/*
 * Guides-page styles.
 *
 * Common tweaks:
 * - Change .guide-layout width to make the guide panel wider or narrower.
 * - Change .guide-menu width to resize the left navigation.
 * - Text colors come from accent/success/danger in site.css.
 */

/* ---------- Overall page and heading ---------- */

.guides-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem;
}

.guide-header {
  margin: 0.5rem 0 1.5rem;
  text-align: center;
}

.guide-header p {
  margin: 0;
  font-size: 0.9rem;
}

.guide-header h1 {
  margin: 0.25rem 0;
  color: var(--accent);
  font-size: clamp(2rem, 7vw, 2.5rem);
}

/* ---------- Guide panel and left navigation ---------- */

.guide-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  width: min(70rem, 100%);
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.45);
}

.guide-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--background);
}

/* Shared reset for clickable controls. */
.guide-menu button,
.menu-toggle,
.text-button,
.modal-button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.guide-menu button {
  padding: 0.75rem;
  border-radius: 0.4rem;
  background: transparent;
  text-align: left;
}

.guide-menu button:hover {
  background: var(--accent-soft);
  color: #000000;
}

.guide-menu button[aria-selected="true"] {
  background: var(--accent);
  color: #000000;
}

.guide-menu .back-link {
  margin-top: 0.5rem;
  padding: 0.75rem;
  text-decoration: none;
}

/* ---------- Guide text area ---------- */

.guide-content {
  min-height: 35rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--panel);
  text-align: center;
  line-height: 1.55;
}

.guide-section[hidden] {
  display: none;
}

.guide-section h2 {
  margin-top: 0;
  color: var(--accent);
}

.guide-section h3 {
  margin-top: 2rem;
  color: var(--accent);
}

/* Short Plex-yellow separator between topics. */
.guide-section hr {
  width: 3rem;
  height: 2px;
  margin: 1.5rem auto;
  border: 0;
  background: #e5a00d;
  color: #e5a00d;
}

.extra-life {
  color: #1d9ed6;
}

/* Buttons that visually behave like normal text links. */
.text-button {
  padding: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---------- Mobile navigation ---------- */

.menu-toggle {
  display: none;
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 30;
  width: 3rem;
  height: 3rem;
  border-radius: 0.4rem;
  background: var(--panel);
  color: var(--accent);
  font-size: 1.5rem;
}

/* ---------- Visual-guide popup ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.88);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  position: relative;
  width: min(62rem, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--panel);
  text-align: center;
}

.modal-title {
  margin: 0 3rem 1rem;
  color: var(--accent);
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  width: 2.75rem;
  height: 2.75rem;
  background: transparent;
  color: var(--accent);
  font-size: 2rem;
}

.carousel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 20rem;
  overflow: hidden;
  touch-action: none;
}

.carousel img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 0.5rem;
  transform-origin: center;
  user-select: none;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 3rem;
  height: 4rem;
  transform: translateY(-50%);
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent);
  font-size: 2rem;
}

.carousel-arrow.previous {
  left: 0.5rem;
}

.carousel-arrow.next {
  right: 0.5rem;
}

/* ---------- Small-screen layout ---------- */

@media (max-width: 768px) {
  .guides-page {
    padding-top: 4rem;
  }

  .menu-toggle {
    display: block;
  }

  .guide-layout {
    display: block;
  }

  .guide-menu {
    position: fixed;
    inset: 3.75rem auto 0 0;
    z-index: 20;
    width: 17rem;
    border: 1px solid rgba(229, 160, 13, 0.35);
    border-left: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 0.5rem 0 1rem rgba(0, 0, 0, 0.4);
  }

  .guide-menu.is-open {
    transform: translateX(0);
  }

  .guide-content {
    min-height: 0;
  }
}
