/* =========================================================
   LAYOUT
   Header, Navigation, Main, Section Spacing, Base Grid
   Extracted from styles.css
   ========================================================= */

/* =============================
   HEADER
============================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);

  background: rgba(0, 0, 0, 0.7);
  border-bottom: 2.2px solid var(--accent);
  z-index: 1000;

  display: flex;
  align-items: center;
}

.site-title-logo {
  height: calc(var(--header-height) * 0.8);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* =============================
   NAVIGATION
============================= */

nav {
  max-width: none;
  margin: 0;
  width: 100%;

  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);

  padding: 2.5rem 1rem;
}

.nav-links {
  display: flex;
  margin-left: auto;
  gap: 1rem;
  flex-wrap: nowrap;
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-links button,
.nav-links a {
  position: relative;
  background: transparent;
  border: 2.2px solid var(--accent);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.02rem;
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.24s ease, color 0.24s ease, border-color 0.24s ease, transform 0.16s ease;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.nav-dropdown-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.nav-dropdown-label {
  line-height: 1;
}

.nav-dropdown-caret {
  font-size: 0.76rem;
  line-height: 1;
  transition: transform 0.24s ease;
}

.nav-dropdown.open .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-links button::after,
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.nav-links button:hover,
.nav-links a:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-1px);
}

.nav-links button.active,
.nav-links a.active {
  background: var(--accent);
  color: #000;
}

.nav-links a.is-current-page-link {
  cursor: default;
  pointer-events: none;
}

.nav-links a.is-current-page-link:hover {
  transform: none;
}

.nav-dropdown.is-current > .nav-dropdown-toggle {
  background: var(--accent);
  color: #000;
}

.nav-links button:hover::after,
.nav-links button.active::after,
.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-dropdown.is-current > .nav-dropdown-toggle::after,
.nav-dropdown > .nav-dropdown-toggle.tap-feedback::after {
  transform: scaleX(1);
}

.nav-dropdown.is-current > .nav-dropdown-toggle .nav-dropdown-caret,
.nav-dropdown > .nav-dropdown-toggle.tap-feedback .nav-dropdown-caret {
  background: rgba(0, 0, 0, 0.14);
  color: inherit;
}

@keyframes navDropdownTapFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 214, 126, 0);
  }
  40% {
    box-shadow:
      0 0 0 4px rgba(255, 214, 126, 0.26),
      0 0 18px rgba(255, 214, 126, 0.22);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 214, 126, 0);
  }
}

.nav-dropdown > .nav-dropdown-toggle.tap-feedback {
  animation: navDropdownTapFlash 0.52s ease;
}

.nav-submenu {
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  min-width: 10rem;
  width: min(10.75rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border-radius: 0 14px 14px 14px;
  border: 1px solid rgba(255, 214, 126, 0.28);
  border-top: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.98), rgba(0, 0, 0, 0.94)),
    radial-gradient(circle at 50% 0%, rgba(255, 214, 126, 0.12), transparent 60%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 1300;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  width: calc(100% - 1.9rem);
  height: 0.75rem;
  border-left: 1px solid rgba(255, 214, 126, 0.24);
  border-right: 1px solid rgba(255, 214, 126, 0.24);
  background: linear-gradient(180deg, rgba(255, 214, 126, 0.14), rgba(0, 0, 0, 0));
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scaleY(0.3);
  transform-origin: top;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 1299;
}

.nav-dropdown.open::after {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

.nav-dropdown.open .nav-dropdown-toggle {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 214, 126, 0.92), rgba(240, 184, 67, 0.92)),
    rgba(255, 214, 126, 0.08);
  color: #120900;
  box-shadow: 0 0 0 1px rgba(255, 214, 126, 0.18) inset;
}

.nav-submenu a {
  width: 100%;
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0.72rem;
}

.nav-dropdown.open .nav-submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav-dropdown.open .nav-submenu {
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 214, 126, 0.08) inset;
}

.nav-links a.nav-accessibility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  min-width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(255, 208, 120, 0.95);
  background: linear-gradient(180deg, rgba(255, 220, 160, 0.2), rgba(255, 175, 65, 0.12));
  box-shadow: 0 0 0 1px rgba(255, 200, 120, 0.18) inset, 0 0 16px rgba(255, 166, 64, 0.18);
}

.nav-links a.nav-accessibility::after {
  display: none;
}

.nav-links a.nav-accessibility span[aria-hidden="true"] {
  font-size: 1.35rem;
  line-height: 1;
}

.nav-links a.nav-accessibility:hover,
.nav-links a.nav-accessibility.active {
  color: #140a00;
  border-color: rgba(255, 218, 142, 1);
  background: linear-gradient(180deg, rgba(255, 229, 166, 0.96), rgba(255, 189, 76, 0.92));
  box-shadow: 0 0 0 1px rgba(255, 225, 155, 0.5) inset, 0 0 20px rgba(255, 183, 79, 0.35);
}

.nav-links a:focus-visible,
.nav-links button:focus-visible,
.menu-toggle:focus-visible {
  outline: 3px solid #ffe082;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -44px;
  left: 0.75rem;
  z-index: 3000;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  border: 2px solid #ffe082;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus-visible {
  top: 0.75rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =============================
   MOBILE MENU TOGGLE
============================= */

.menu-toggle {
  display: none; /* hidden by default (desktop) */
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 6px;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  font-weight: 600;
  border: 2.2px solid var(--accent);
}

/* Text before icon */
.menu-toggle::before {
  content: "Menu ";
}

/* =============================
   ADAPTIVE NAV COLLAPSE
============================= */


@media (min-width: 901px) {
  header nav:not(.nav-force-mobile) .nav-links {
    margin-left: auto;
    align-items: stretch;
    gap: clamp(0.6rem, 1.1vw, 0.95rem);
  }

  header nav:not(.nav-force-mobile) .nav-links > a:not(.nav-accessibility),
  header nav:not(.nav-force-mobile) .nav-links > button,
  header nav:not(.nav-force-mobile) .nav-links > .nav-dropdown > .nav-dropdown-toggle {
    width: 9rem;
    min-height: 2.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem 0.75rem;
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-dropdown {
    width: 9rem;
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-dropdown .nav-dropdown-toggle {
    width: 100%;
  }

  header nav:not(.nav-force-mobile) .nav-links > .nav-dropdown {
    width: auto;
  }

  header nav:not(.nav-force-mobile) .nav-links > a:not(.nav-accessibility) {
    width: auto;
    min-width: 8.7rem;
    min-height: 2.82rem;
    padding: 0.56rem 1.08rem 0.56rem 1.14rem;
    border-radius: 13px;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 1px rgba(255, 214, 126, 0.08) inset;
  }

  header nav:not(.nav-force-mobile) .nav-links > .nav-dropdown > .nav-dropdown-toggle {
    width: auto;
    min-height: 2.82rem;
    padding: 0.56rem 1.08rem 0.56rem 1.14rem;
    border-radius: 13px;
    gap: 0.62rem;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 1px rgba(255, 214, 126, 0.08) inset;
  }

  header nav:not(.nav-force-mobile) .nav-links > .nav-dropdown.nav-dropdown--characters > .nav-dropdown-toggle {
    min-width: 10rem;
  }

  header nav:not(.nav-force-mobile) .nav-links > .nav-dropdown.nav-dropdown--stories > .nav-dropdown-toggle {
    min-width: 8.85rem;
  }

  header nav:not(.nav-force-mobile) .nav-links > .nav-dropdown.nav-dropdown--worldbuilding > .nav-dropdown-toggle {
    min-width: 11rem;
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-dropdown .nav-dropdown-label {
    line-height: 1.1;
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-dropdown .nav-dropdown-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.32rem;
    height: 1.32rem;
    border-radius: 999px;
    background: rgba(255, 214, 126, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 214, 126, 0.15);
    font-size: 0.64rem;
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-dropdown::after {
    display: none;
  }

  header nav:not(.nav-force-mobile) .nav-links > .nav-dropdown.is-current > .nav-dropdown-toggle {
    box-shadow:
      0 10px 22px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(255, 214, 126, 0.2) inset;
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-dropdown.open .nav-dropdown-toggle {
    border-bottom-left-radius: 13px;
    border-bottom-right-radius: 13px;
    transform: translateY(-1px);
    box-shadow:
      0 10px 22px rgba(0, 0, 0, 0.24),
      0 0 0 1px rgba(255, 214, 126, 0.18) inset;
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-submenu {
    top: calc(100% + 0.38rem);
    min-width: 13.2rem;
    width: max(13.2rem, calc(100% + 1.35rem));
    gap: 0.38rem;
    padding: 0.62rem;
    border-radius: 16px;
    border-top: 1px solid rgba(255, 214, 126, 0.24);
    background:
      linear-gradient(180deg, rgba(10, 10, 10, 0.98), rgba(3, 3, 3, 0.95)),
      radial-gradient(circle at 50% 0%, rgba(255, 214, 126, 0.1), transparent 62%);
    box-shadow:
      0 18px 36px rgba(0, 0, 0, 0.42),
      0 0 0 1px rgba(255, 214, 126, 0.07) inset;
    transform: translate(-50%, -6px);
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-submenu a {
    justify-content: flex-start;
    text-align: left;
    min-height: 2.42rem;
    padding: 0.62rem 0.86rem;
    border-width: 1.5px;
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.95rem;
    line-height: 1.25;
  }

  header nav:not(.nav-force-mobile) .nav-links .nav-submenu a:hover,
  header nav:not(.nav-force-mobile) .nav-links .nav-submenu a.active {
    background:
      linear-gradient(180deg, rgba(255, 214, 126, 0.2), rgba(255, 214, 126, 0.12)),
      rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 214, 126, 0.38);
    color: #fff3d6;
    transform: translateY(-1px);
  }

  header nav:not(.nav-force-mobile) .nav-links > a.nav-accessibility {
    width: 2.82rem;
    min-width: 2.82rem;
    height: 2.82rem;
    padding: 0;
    border-radius: 13px;
    border-color: rgba(124, 103, 95, 0.92);
    background:
      linear-gradient(180deg, rgba(124, 103, 95, 0.24), rgba(124, 103, 95, 0.1)),
      rgba(255, 255, 255, 0.02);
    box-shadow:
      0 0 0 1px rgba(124, 103, 95, 0.14) inset,
      0 10px 20px rgba(0, 0, 0, 0.2);
  }

  header nav:not(.nav-force-mobile) .nav-links > a.nav-accessibility span[aria-hidden="true"] {
    font-size: 1.28rem;
  }

  header nav:not(.nav-force-mobile) .nav-links > a.nav-accessibility:hover,
  header nav:not(.nav-force-mobile) .nav-links > a.nav-accessibility.active {
    color: #fff7f2;
    border-color: rgba(152, 128, 117, 0.98);
    background:
      linear-gradient(180deg, rgba(143, 120, 110, 0.96), rgba(108, 88, 80, 0.94)),
      rgba(255, 255, 255, 0.04);
    box-shadow:
      0 0 0 1px rgba(175, 151, 140, 0.26) inset,
      0 12px 22px rgba(0, 0, 0, 0.24);
  }
}
header nav.nav-force-mobile {
  position: relative;
  align-items: center;
}

header nav.nav-force-mobile .menu-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0.45rem 0.7rem;
  font-size: 1.15rem;
  border-radius: 8px;
}

header nav.nav-force-mobile .menu-toggle::before {
  content: "";
}

header nav.nav-force-mobile .menu-toggle.open {
  background: var(--accent);
  color: #000;
}

header nav.nav-force-mobile .nav-links {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.5rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  background: rgba(0, 0, 0, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0 0.6rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease,
    transform 0.25s ease,
    padding 0.3s ease;
  z-index: 1200;
}

header nav.nav-force-mobile .nav-links.open {
  max-height: 70vh;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  padding: 0.75rem 0.6rem;
}

header nav.nav-force-mobile .nav-links a,
header nav.nav-force-mobile .nav-links button {
  width: 100%;
  text-align: center;
  padding: 0.72rem 0.85rem;
}

header nav.nav-force-mobile .nav-links .nav-dropdown {
  width: 100%;
  flex-direction: column;
}

header nav.nav-force-mobile .nav-links .nav-dropdown .nav-dropdown-toggle {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding: 0.72rem 0.85rem;
  font-size: 1.02rem;
  border-width: 2.2px;
  border-style: solid;
  background: transparent;
  color: var(--white);
}

header nav.nav-force-mobile .nav-links .nav-dropdown.is-current > .nav-dropdown-toggle,
header nav.nav-force-mobile .nav-links .nav-dropdown .nav-dropdown-toggle.tap-feedback {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

header nav.nav-force-mobile .nav-links .nav-dropdown .nav-dropdown-caret {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 214, 126, 0.14);
  font-size: 0.68rem;
}

header nav.nav-force-mobile .nav-links .nav-dropdown.is-current > .nav-dropdown-toggle .nav-dropdown-caret,
header nav.nav-force-mobile .nav-links .nav-dropdown .nav-dropdown-toggle.tap-feedback .nav-dropdown-caret {
  background: rgba(0, 0, 0, 0.18);
  color: #000;
}

header nav.nav-force-mobile .nav-links .nav-submenu {
  position: static;
  left: auto;
  top: auto;
  min-width: 0;
  width: 100%;
  padding: 0;
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transform: none;
  transition: max-height 0.25s ease, padding-top 0.25s ease;
}

header nav.nav-force-mobile .nav-links .nav-dropdown.open .nav-submenu {
  pointer-events: auto;
  max-height: 16rem;
  padding-top: 0.45rem;
}

header nav.nav-force-mobile .nav-links .nav-submenu a {
  width: 88%;
  margin-inline: auto;
  min-height: 2.16rem;
  padding: 0.46rem 0.7rem;
  font-size: 0.82rem;
  border-width: 1.4px;
  border-color: rgba(158, 158, 158, 0.62);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(241, 241, 241, 0.94);
  box-shadow: none;
}

header nav.nav-force-mobile .nav-links a.nav-accessibility {
  width: 3.1rem;
  min-width: 3.1rem;
  height: 3.1rem;
  align-self: center;
  border-radius: 10px;
}

header nav.nav-force-mobile .nav-links a::after,
header nav.nav-force-mobile .nav-links button::after {
  display: none;
}

/* =============================
   MAIN CONTAINER
============================= */

main {
  flex: 1;
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
  line-height: 1.65;
}

/* =============================
   SECTION SPACING
============================= */

section {
  margin-bottom: clamp(2rem, 6vw, 4rem);
}

/* =============================
   BASE GRID SYSTEM
============================= */

.grid,
.member-grid,
.dropdown-grid {
  display: grid;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

#characters h1,
#characters h2 {
  text-align: center;
}



/* =========================================================
   ⚠ CONFLICT: CHARACTER GRID OVERRIDES
   ---------------------------------------------------------
   #characters .grid is declared multiple times in the
   original stylesheet with different column logic.
   These overrides rely on cascade order.
   Do NOT merge automatically.
   ========================================================= */

#characters .grid {
  display: grid;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

#characters .grid {
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (min-width: 900px) {
  #characters .grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

/* =============================
   CHARACTER TAB WRAP CENTERING
============================= */

#characters .grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  --character-grid-gap: clamp(0.75rem, 2vw, 1.5rem);
  gap: var(--character-grid-gap);
}

#characters .grid .card {
  flex: 0 1 260px;
  max-width: 260px;
  min-width: 0;
}


















