/* components.css: header, buttons, forms, cards, gallery, footer */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 8, 18, 0.92);
  border-bottom: 1px solid var(--hairline);
}
.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: var(--header-height);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  margin-right: auto;
  flex-shrink: 0;
}
/* Sized to the header Wishlist button (min-height: 44px): same height keeps
   the bar visually level. Height drives the size, width follows the ratio. */
.site-header__brand img { width: auto; height: 44px; }

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav__list a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.7rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  border-radius: var(--radius);
}
.site-nav__list a:not(.button):hover { color: var(--text); }

/* Mobile menu: native <details> disclosure, works without JavaScript.
   The Steam call to action stays outside it and is always visible. */
.site-nav__menu { display: none; }
.site-nav__menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.9rem 2px; /* bottom-only: same 1px optical lift as .button */
  font-family: var(--font-button);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  cursor: pointer;
}
.site-nav__menu summary::-webkit-details-marker { display: none; }
/* Disclosure affordance: Chromium drops the native marker once summary is
   inline-flex, so the open/closed state needs an explicit chevron. */
.site-nav__menu summary::after,
.more-links summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 0.55rem;
  border-left: 0.3em solid transparent;
  border-right: 0.3em solid transparent;
  border-top: 0.35em solid currentColor;
  transition: transform var(--transition);
}
.site-nav__menu[open] summary::after,
.more-links[open] summary::after { transform: rotate(180deg); }
.site-nav__menu[open] summary { border-color: var(--gold); }
.site-nav__menu .site-nav__list {
  position: absolute;
  right: var(--gutter);
  top: 100%; /* the sticky header is the containing block: tracks its real height */
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 12rem;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5);
}

/* ---------- Buttons ---------- */
/* Quantico's line box leaves more air above all-caps text than below, so a
   centred label reads slightly low. Shift it up 1px (one less on top, one
   more on the bottom); min-height still governs the box, so height and the
   44px touch target are unchanged. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: calc(0.55rem - 1px) 1.4rem calc(0.55rem + 1px);
  font-family: var(--font-button);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition);
}
.button--primary {
  background: var(--gold);
  color: var(--bg);
}
.button--primary:hover { background: var(--text-highlight); color: var(--bg); }
.button--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--hairline);
}
.button--secondary:hover { border-color: var(--teal); color: var(--teal); }
.button--small { padding: calc(0.4rem - 1px) 1rem calc(0.4rem + 1px); }

/* Press and disabled states. Without them a submit in flight looks identical
   to an idle control, so the pending state must be visible, not only spoken
   by the status region. */
.button:active { transform: translateY(1px); }
.button[disabled],
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}
.button--primary[disabled]:hover { background: var(--gold); }
@media (prefers-reduced-motion: reduce) {
  .button:active { transform: none; }
}

/* Header Steam CTA: dominant through its gold fill, but sized to sit
   inside the nav rhythm instead of towering over it. Must never wrap or
   shrink away at small widths; it stays fully visible per spec §7. */
.site-header .button {
  flex-shrink: 0;
  white-space: nowrap;
  padding: calc(0.3rem - 1px) 0.85rem calc(0.3rem + 1px);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
/* Quantico renders the space after "Wishlist" about 4px wider than the one
   after "on" (font metrics, not a second space in the markup). Pull the tail
   back so both word gaps read as one space. Inert under 400px, where the
   tail is clipped out of the layout. */
.site-header .cta-tail { margin-left: -0.32em; }

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--section-gap) 0 0; }

/* Full-width band. Used for the newsletter: a change of surface separates the
   two forms at the foot of the page, which otherwise read as one long column
   of fields, and lets the copy and the form share a row instead of stacking. */
.band {
  margin-top: var(--section-gap);
  padding: clamp(3rem, 7vw, 4.75rem) 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-raised);
}
.band__inner {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}
.band__inner > div > p:last-child { margin-bottom: 0; }
.band form > *:last-child { margin-bottom: 0; }
@media (max-width: 880px) {
  .band__inner { grid-template-columns: 1fr; }
}

/* ---------- Feature blocks ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3rem;
  margin-top: 3rem;
}
.feature-grid--stacked {
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 0;
}
.feature h3 { color: var(--text); }
/* One accent for the whole set: purple is the systems/game family (visual
   system §6.3), which is what this section is about. Alternating the rule
   colour per item made the palette look decorative rather than semantic. */
.feature h3::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 2px;
  margin-bottom: 0.9rem;
  background: var(--purple);
}
.feature p { color: var(--text-secondary); margin-bottom: 0; }

/* ---------- Highlight strip ---------- */
.highlight-strip {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(120deg, rgba(140, 92, 255, 0.10), rgba(217, 173, 96, 0.06) 60%, transparent);
  padding: 3rem 0;
}
.highlight-strip h2 { color: var(--text-highlight); }
.highlight-strip p { color: var(--text-secondary); font-size: var(--step-1); margin-bottom: 0; }

/* ---------- Media gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}
.gallery figure {
  margin: 0;
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery img { width: 100%; height: auto; }
.gallery figcaption {
  padding: 0.75rem 1rem;
  font-size: var(--step--1);
  color: var(--text-secondary);
  text-align: right;
}

/* ---------- Community channel list ----------
   A ruled register rather than a grid of boxes: the channel count changes
   over time and a card grid leaves a hole whenever
   the count is not a multiple of the column count. Rules also keep the
   section reading as an index of destinations, not as a dashboard. */
.channels {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--hairline);
}
.channels li { border-bottom: 1px solid var(--hairline); }
/* Name and description share one row, so every rule runs the full width and
   the register never ends ragged, whatever the channel count becomes. */
.channels a {
  display: grid;
  grid-template-columns: minmax(11rem, 4fr) 7fr;
  align-items: baseline;
  gap: 0.15rem clamp(1rem, 3vw, 2.5rem);
  min-height: 44px;
  padding: 1rem 0.25rem;
  text-decoration: none;
  transition: background var(--transition);
}
@media (max-width: 560px) {
  .channels a { grid-template-columns: 1fr; }
}
.channels a:hover { background: rgba(104, 216, 218, 0.06); }
.channels__name {
  color: var(--text);
  font-family: var(--font-heading);
  font-size: var(--step-1);
  transition: color var(--transition);
}
.channels a:hover .channels__name { color: var(--teal); }
.channels__name .ext-glyph {
  display: inline-block;
  margin-left: 0.35em;
  color: var(--teal);
  transition: transform var(--transition);
}
.channels a:hover .ext-glyph { transform: translate(2px, -2px); }
.channels__desc { color: var(--text-secondary); font-size: var(--step--1); }

.more-links { margin-top: 2rem; }
.more-links summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-button);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}
.more-links ul { list-style: none; margin: 0.75rem 0 0; padding: 0; columns: 2; }
.more-links li { margin-bottom: 0.5rem; break-inside: avoid; }
.more-links a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Forms ---------- */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.5rem 0 1.25rem;
}
@media (max-width: 400px) {
  /* Stack form actions as full-width blocks: clean edges, larger targets.
     Slightly tighter type keeps each label on one line at 320px. */
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .button { font-size: 0.8rem; padding: 0.55rem 1rem; letter-spacing: 0.08em; }
}
.form-field { margin-bottom: 1.4rem; max-width: 34rem; }
.form-field label {
  display: block;
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}
.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
}
.form-field textarea { min-height: 9rem; resize: vertical; }
/* Fields default to the raised surface; inside a band that surface is the
   background, so the input would vanish. Drop back to the page ground. */
.band .form-field input,
.band .form-field textarea { background: var(--bg); }
.form-field input:focus-visible,
.form-field textarea:focus-visible { outline-color: var(--teal); }
.form-field .optional { text-transform: none; letter-spacing: 0; }

.form-note { color: var(--text-secondary); font-size: var(--step--1); max-width: var(--measure-small); }

.form-status {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  max-width: 34rem;
}
.form-status[hidden] { display: none; }
.form-status--success { border-left: 3px solid var(--teal); }
.form-status--error {
  border-left: 3px solid var(--danger-bright);
  color: var(--danger-text);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--hairline);
  padding: 3rem 0 3.5rem;
  color: var(--text-secondary);
  font-size: var(--step--1);
}
.site-footer__credit { color: var(--text); font-size: var(--step-0); max-width: 68ch; }
.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-footer__fine { margin-bottom: 0; }
.site-footer__fine .release-line {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
}

/* ---------- Responsive ---------- */
/* The header collapses to the menu earlier than the content grids do: logo,
   five inline links and the Steam CTA need roughly 760px, so at 768 the CTA
   was cut off by the viewport edge. The CTA must never be clipped (spec §7). */
@media (max-width: 860px) {
  .site-nav__inline { display: none; }
  .site-nav__menu { display: block; position: static; }
  .site-header__inner { gap: 0.75rem; }
  .site-nav__menu summary { padding: 0 0.6rem 2px; font-size: 0.8rem; }
  .site-header .button { font-size: 0.72rem; padding: calc(0.3rem - 1px) 0.6rem calc(0.3rem + 1px); letter-spacing: 0.05em; }
}
@media (max-width: 720px) {
  .feature-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .more-links ul { columns: 1; }
}
/* Tightest phones: the Steam CTA stays on one line without overflowing.
   Gaps and paddings tighten below 400px; the logo is already only 44px tall,
   matching the CTA, so it needs no step-down. Verified at 320px. */
@media (max-width: 400px) {
  /* Logo, menu and CTA no longer fit one line with the full label. Only the
     visible words shorten: the accessible name stays "Wishlist on Steam
     (external link)", so the link is never reduced to an ambiguous target. */
  .site-header .cta-tail {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
  }
  .site-header__inner { gap: 0.5rem; padding: 0 0.75rem; }
  .site-nav__menu summary { padding: 0 0.45rem 2px; font-size: 0.75rem; }
  .site-nav__menu summary::after { margin-left: 0.4rem; }
  .site-header .button { font-size: 0.7rem; padding: calc(0.3rem - 1px) 0.5rem calc(0.3rem + 1px); letter-spacing: 0.04em; }
  .site-nav__menu .site-nav__list { right: 0.75rem; }
}
