/*
 * Enter any custom CSS here.
 * This file will not be overwritten by theme updates.
 *
 * ── Semantic class hooks (sa-*) ────────────────────────────────────────────
 * Every section, snippet and key element carries a stable `sa-` class you can
 * target with plain CSS — no Tailwind rebuild needed. These classes ship with
 * NO styles of their own; they exist purely as selectors for you to hook onto.
 *
 * Page scope   body.sa-tpl-<template>      e.g. .sa-tpl-product, .sa-tpl-shop
 *              body.sa-no-product-images / .sa-no-category-images when the
 *              matching theme setting is off
 * Chrome       .sa-header .sa-navbar .sa-footer
 *              .sa-navbar-link .sa-navbar-logo .sa-navbar-cart .sa-footer-link
 * Sections     .sa-<component>             e.g. .sa-hero, .sa-features, .sa-faq
 *   variant    .sa-<component>--<variant>  e.g. .sa-hero--split-media
 *   inner      .sa-<component>-title / -subtitle / -eyebrow / -media /
 *              -items / -item / -actions / -link / -price / -badge / -icon
 * Primitives   .sa-btn (+ .sa-btn--<variant>), .sa-section-header
 *              (.sa-section-title / -eyebrow / -subtitle),
 *              .sa-product-card (+ .sa-product-card--<style>,
 *              .sa-product-card-title / -price / -stock / -status / -badges),
 *              .sa-product-form + .sa-add-to-cart, .sa-product-gallery,
 *              .sa-cart-panel + .sa-cart-item, .sa-searchbar, .sa-pagination,
 *              .sa-breadcrumbs, .sa-toasts + .sa-toast, .sa-feedback-card
 *
 * Example — bigger hero heading only on the product page:
 *   .sa-tpl-product .sa-hero-title { font-size: 3rem; }
 * ───────────────────────────────────────────────────────────────────────────
*/

/* EliteSync: payment logos sit on small white chips so every logo (navy Visa, dark wordmarks…) stays readable on the dark theme and the mixed logo shapes form one even row. */
.sa-pay-logo {
  box-sizing: content-box;
  padding: 4px 8px;
  border-radius: 6px;
  background-color: #FFFFFF;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06);
}

/* ── EliteSync store cards (elitesync.org directory) ─────────────────────────
   Two faces, one structure (name + subtitle, then a rail with "View guides"):
   - image: postcard, the image fills the card and the text sits on a dark fade at the bottom;
   - plate (no image yet): the game's name set large on the surface, its initial cropped into the
     corner as an outline in the game's own hue (--sc-h, set per card in store-cards.njk).
   One hover moment: the card lifts, the hue warms, the arrow steps toward the store. */
/* Cards sit right under the landing hero: half the usual section top spacing. */
.sa-store-cards { padding-top: min(calc(var(--section-py) / 2), 7vw); }
/* Centered wrapping row: 1 card per row on phones, 2 from 640px, the chosen count from 1024px. */
.sa-store-cards-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--grid-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sa-store-cards-item { width: 100%; }
@media (min-width: 640px) {
  .sa-store-cards-item { width: calc((100% - var(--grid-gap)) / 2); }
}
@media (min-width: 1024px) {
  .sa-store-cards-items[data-columns='3'] .sa-store-cards-item { width: calc((100% - 2 * var(--grid-gap)) / 3); }
  .sa-store-cards-items[data-columns='4'] .sa-store-cards-item { width: calc((100% - 3 * var(--grid-gap)) / 4); }
}
.sa-store-card {
  --sc-ink: hsl(var(--sc-h, 262) 90% 74%);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.25rem;
  height: 100%;
  padding: 1.375rem;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-card);
  border: 1px solid var(--cl-border);
  text-decoration: none;
  transform: translateY(0);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.18);
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 450ms cubic-bezier(0.16, 1, 0.3, 1), border-color var(--dur) ease-out;
}
/* 28% lightness keeps every hue in the rotation at 5:1 or better on white (teal and green fail at 36%). */
[data-scheme='light'] .sa-store-card { --sc-ink: hsl(var(--sc-h, 262) 75% 28%); }
.sa-store-card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--sc-h, 262) 80% 66% / 0.6);
  box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.5), 0 6px 16px -6px hsl(var(--sc-h, 262) 80% 60% / 0.35);
}
.sa-store-card:focus-visible {
  outline: 2px solid rgb(var(--cl-accent));
  outline-offset: 3px;
}
.sa-store-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.sa-store-card-name {
  font-family: var(--ff-heading);
  font-weight: var(--fw-heading);
  font-size: calc(1.5rem * var(--heading-scale));
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.sa-store-card-subtitle {
  font-size: 0.9375rem;
  line-height: 1.45;
}
.sa-store-card-rail {
  display: flex;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--sc-rule);
  font-size: 0.8125rem;
  line-height: 1.3;
}
.sa-store-card-cta {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
}
.sa-store-card-arrow {
  width: 1rem;
  height: 1rem;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sa-store-card:hover .sa-store-card-arrow { transform: translate(3px, -3px); }

/* Plate: no image yet. Surface-coloured in both schemes; the game's hue lives in the cropped initial,
   a low wash from that corner, and the "View guides" label. */
.sa-store-card--plate {
  --sc-rule: var(--cl-border);
  aspect-ratio: 4 / 3;
  justify-content: space-between;
  background-color: rgb(var(--cl-surface));
  background-image: radial-gradient(120% 90% at 100% 100%, hsl(var(--sc-h, 262) 85% 60% / 0.16), transparent 62%);
  color: rgb(var(--cl-t-primary));
}
.sa-store-card--plate .sa-store-card-subtitle { color: rgb(var(--cl-t-muted)); }
.sa-store-card--plate .sa-store-card-cta { color: var(--sc-ink); }
/* The initial sits in the open band between the name and the rail, cropped by the card's right edge. */
.sa-store-card-initial {
  position: absolute;
  right: -0.08em;
  bottom: 3.5rem;
  z-index: -1;
  font-family: var(--ff-heading);
  font-weight: 800;
  font-size: clamp(6.5rem, 9vw, 8.5rem);
  line-height: 0.78;
  color: transparent;
  -webkit-text-stroke: 1.5px hsl(var(--sc-h, 262) 85% 66% / 0.42);
  pointer-events: none;
  user-select: none;
  transition: -webkit-text-stroke-color 450ms ease-out, transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sa-store-card--plate:hover .sa-store-card-initial {
  -webkit-text-stroke-color: hsl(var(--sc-h, 262) 90% 70% / 0.75);
  transform: translate(-4px, -4px);
}

/* Image: postcard. White type on a dark fade in both schemes. */
.sa-store-card--image {
  --sc-rule: rgb(255 255 255 / 0.18);
  background-color: #0E1020;
  color: #FFFFFF;
}
.sa-store-card--image .sa-store-card-subtitle { color: rgb(255 255 255 / 0.78); }
.sa-store-card--image .sa-store-card-cta { color: #FFFFFF; }
.sa-store-card-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sa-store-card--image:hover .sa-store-card-image { transform: scale(1.05); }
.sa-store-card--image::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgb(5 6 13 / 0.94) 0%, rgb(5 6 13 / 0.6) 36%, rgb(5 6 13 / 0) 66%);
}
@media (prefers-reduced-motion: reduce) {
  .sa-store-card, .sa-store-card-image, .sa-store-card-arrow, .sa-store-card-initial { transition: none; }
  .sa-store-card:hover, .sa-store-card:hover .sa-store-card-image, .sa-store-card:hover .sa-store-card-arrow, .sa-store-card:hover .sa-store-card-initial { transform: none; }
}

/* ── Landing hero: the four promises read as one line on desktop, a 2x2 grid on phones ─────── */
.sa-hero-trust { gap: 0.5rem 1.25rem; font-size: 0.8125rem; }
@media (min-width: 1024px) {
  .sa-hero-trust { flex-wrap: nowrap; width: max-content; max-width: calc(100vw - 2rem); }
  .sa-hero-trust > span { white-space: nowrap; }
}
@media (max-width: 639px) {
  .sa-hero-trust {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 22rem;
    text-align: left;
  }
  .sa-hero-trust > span { align-items: flex-start; }
  .sa-hero-trust svg { flex-shrink: 0; margin-top: 0.15em; }
}

/* ── Secure checkout panel: promise left, accepted methods right ─────────────────────────────── */
.sa-tpl-shop .sa-trust-badges--card { padding-block: min(calc(var(--section-py) / 2), 7vw); }
.sa-trust-badges-panel {
  display: grid;
  gap: 1.5rem;
  text-align: center;
}
.sa-trust-badges-copy { align-items: center; }
.sa-trust-badges-panel .sa-trust-badges-subtitle { max-width: 34rem; text-wrap: pretty; }
@media (min-width: 1024px) {
  .sa-trust-badges-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 3rem;
    text-align: left;
  }
  .sa-trust-badges-copy { align-items: flex-start; }
  .sa-trust-badges-panel .sa-trust-badges-items { justify-content: flex-end; }
}

/* ── Browser surfaces in the brand's colours ─────────────────────────────────────────────────── */
::selection { background-color: rgba(var(--cl-accent-fill), 0.85); color: #FFFFFF; }
html {
  accent-color: rgb(var(--cl-accent));
  caret-color: rgb(var(--cl-accent));
  scrollbar-color: rgba(var(--cl-t-muted), 0.45) rgb(var(--cl-background));
}
a { text-underline-offset: 0.18em; }

/* ── Skip link: hidden until keyboard focus, then a pill over the header ───────────────────── */
.sa-skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-badge, 9999px);
  background-color: rgb(var(--cl-accent-fill));
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transform: translateY(-200%);
}
.sa-skip-link:focus-visible { transform: none; outline: 2px solid #FFFFFF; outline-offset: 2px; }
.sa-main:focus { outline: none; }

/* ── Mobile menu: the bottom row holds only the currency/language pickers; with neither it goes. ── */
.sa-navbar-mobile-extra:not(:has(*)) { display: none; }

/* ── Cookie banner: the platform paints its solid button with the text violet (white on it is 4.3:1);
   use the fill violet like every other accent fill (5.2:1). !important beats the platform's injected rule. */
.sa-cc-solid { background-color: rgb(var(--cl-accent-fill)) !important; border-color: rgb(var(--cl-accent-fill)) !important; color: #FFFFFF !important; }
.sa-cc-solid:hover { background-color: color-mix(in srgb, rgb(var(--cl-accent-fill)), #000 12%) !important; }

/* ── EliteSync colour roles ──────────────────────────────────────────────────
   One violet cannot pass WCAG AA both as text on the near-black canvas and as a fill under white
   text, so the brand violet is split by role (same hue, two lightnesses):
     text / focus / glow   dark #8A70FF (4.77:1 or better on every dark surface: canvas, cards, raised
                           panels, active rows; #7C5CFF from settings failed on cards at 4.34:1)
                           light #6D4AFF (4.82:1 on #F6F7FB)
     fill under white text #6D4AFF in both schemes (white 5.15:1); hover 12% deeper
   Applies to the announcement bar, buttons, badges and every other accent fill. */
:root { --cl-accent-fill: 109, 74, 255; }
html[data-scheme='dark'] { --cl-accent: 138, 112, 255; }
html[data-scheme='light'] { --cl-accent: 109, 74, 255; }
.bg-accent-500 { background-color: rgba(var(--cl-accent-fill), var(--tw-bg-opacity, 1)); }
.hover\:bg-accent-600:hover { background-color: color-mix(in srgb, rgb(var(--cl-accent-fill)), #000 12%); }
/* ── Product page: what the buyer gets, beside the buy button ─────────────────────────────── */
.sa-delivery-note svg { margin-top: 0.15em; }

/* Product page editions: disclosure toggle, chevron, recommended badge */
.sa-editions-toggle { align-self: flex-start; text-underline-offset: 4px; text-decoration-color: rgba(var(--cl-t-primary), 0.3); }
.sa-editions-compare { min-height: 44px; }
.sa-editions-toggle { min-height: 44px; }
.sa-editions-toggle:hover { text-decoration-color: rgba(var(--cl-t-primary), 1); }
.sa-editions-toggle svg.is-open { transform: rotate(90deg); }
.sa-edition-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
@media (prefers-reduced-motion: reduce) { .sa-editions-toggle svg { transition: none; } }

/* Home: the catalog follows the hero at half the section interval (DESIGN.md: cards sit closer to the hero) */
section#hero + section#products { padding-top: min(44px, 7vw); }

/* Reading measure (typeset): prose stays within ~70 characters; light-on-dark copy gets a little more leading */
.editor p, .editor li { max-width: 56ch; } /* Inter: 1ch is wider than an average letter, 56ch ~ 70 characters */
.editor { line-height: 1.7; }
.editor li + li { margin-top: 0.5rem; }
/* Rhythm: paragraphs breathe; in edition tabs the name stays tight to its text and editions separate from each other */
.editor p + p { margin-top: 0.75rem; }
.editor p:has(> strong:first-child) + p { margin-top: 0.125rem; }
.editor p + p:has(> strong:first-child) { margin-top: 1.25rem; }
.sa-text-block-body { max-width: 65ch; }
.sa-faq-answer { max-width: 52ch; box-sizing: content-box; line-height: 1.65; }

/* Product cards: long game names wrap to two lines instead of being cut */
.sa-product-card-title { white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: balance; }

/* Product tabs (Description + edition bands): underlined row on desktop; below 1024px every tab stays visible as a
   wrapping button, so no band is hidden behind a sideways scroll */
@media (max-width: 1023px) {
  .sa-product-tabs { gap: 0.5rem; border-bottom: 0; }
  .sa-product-tabs > button { min-height: 44px; margin-bottom: 0; border-width: 1px; border-radius: var(--radius-button); }
  .sa-product-tabs > button.border-transparent { border-color: var(--cl-border); }
  .sa-product-tabs > button.border-accent-500 { background-color: rgba(var(--cl-accent), 0.08); }
}

/* Announcement bar (static): on narrow screens the message wraps onto balanced lines instead of running off-screen */
.sa-announcement .wrap > .sa-announcement-item { display: inline-block; max-width: 100%; white-space: normal; text-wrap: balance; line-height: 1.4; }

/* Icon controls in the navbar get the 44px touch target DESIGN.md asks for (Search and Cart ship at 36px) */
.sa-navbar [aria-label="Search"], .sa-navbar [aria-label="Open cart"] { min-width: 44px; min-height: 44px; justify-content: center; }
.sa-navbar-logo { min-height: 44px; }

/* Navbar below 380px (320-375px phones): keep all four 44px controls; tighten the shell and hide the wordmark
   visually (the logo stays, and the name stays available to screen readers as the link's text) */
@media (max-width: 379px) {
  .sa-navbar--floating-pill > div { padding-left: 8px; padding-right: 8px; }
  .sa-navbar--floating-pill .rounded-full > div { padding-left: 12px; padding-right: 6px; gap: 6px; }
  .sa-navbar-logo span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Keyboard focus (DESIGN.md): 2px accent outline, offset 3px; white on the violet announcement bar */
a:focus-visible, button:focus-visible, summary:focus-visible, [role="button"]:focus-visible { outline: 2px solid rgb(var(--cl-accent)); outline-offset: 3px; }
.sa-announcement a:focus-visible { outline-color: #FFFFFF; outline-offset: 1px; }

/* Light scheme: the theme's success green is too pale for small text on white (about 2.3:1) */
html[data-scheme='light'] .text-success { color: #15803D; }

/* Cart (drawer and page): full 16:9 cover as thumbnail, names on two lines, 44px targets */
.sa-cart-thumb { width: 5rem; aspect-ratio: 16 / 9; }
.sa-page-cart .sa-cart-thumb { width: 6rem; }
@media (min-width: 640px) { .sa-page-cart .sa-cart-thumb { width: 8rem; } }
.sa-cart-title, .sa-page-cart-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sa-cart-panel .sa-cart-title { -webkit-line-clamp: 3; }
/* Short viewports (phone in landscape): keep room for the items; the final-sale line and Checkout stay */
@media (max-height: 500px) { .sa-cart-panel .sa-cart-assurance { display: none; } }
.sa-cart-panel button[aria-label] { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.sa-cart-panel .input-stepper { height: 44px; align-items: center; }
.sa-cart-action { display: inline-flex; align-items: center; min-height: 44px; }
.sa-cart-assurance svg { width: 0.875rem; height: 0.875rem; margin-top: 0.1em; }

/* Compare editions lands on the tabs below the sticky navbar */
.sa-product-tabs { scroll-margin-top: 7rem; }
[x-data*="activeTab"] { scroll-margin-top: 7rem; }
@media (max-width: 1023px) { [x-data*="activeTab"] { scroll-margin-top: 9rem; } }

/* Catalog genres on phones and tablets: visible above the grid, not behind the Filter panel (same shape as the product tabs) */
.sa-genre-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; font-size: 0.875rem; font-weight: 500; border: 1px solid var(--cl-border); border-radius: var(--radius-button); color: rgb(var(--cl-t-muted)); transition: color var(--duration-theme, 200ms), border-color var(--duration-theme, 200ms); }
.sa-genre-chip:hover { color: rgb(var(--cl-t-primary)); }
.sa-genre-chip.is-active { color: rgb(var(--cl-t-primary)); border-color: rgb(var(--cl-accent)); background-color: rgba(var(--cl-accent), 0.08); }

/* Card price: "From" reads as a label, the amount carries the accent */
.sa-price-from { color: rgb(var(--cl-t-muted)); font-weight: 400; }

/* Grid cards in a row share one height; the price row sits on the bottom edge whatever the title length */
.sa-product-card--padded-detail { display: flex; flex-direction: column; height: 100%; }
.sa-product-card--padded-detail > div:last-child { display: flex; flex: 1; flex-direction: column; }
.sa-product-card--padded-detail > div:last-child > div:last-child { margin-top: auto; padding-top: 0.75rem; }

/* Cookie banner message: same reading measure as the rest of the site */
span[data-sa-mode] { display: inline-block; max-width: 56ch; }

/* Legal pages: the support ticket link must read as a link */
a[href="/customer/tickets"], .sa-page-legal a[href^="mailto:"], a[href="mailto:synclimb@gmail.com"] { text-decoration: underline; text-underline-offset: 2px; }