/* ==========================================================================
   Madera Martial Arts — shared base
   Reset + token NAMES (values set per version in vN/css/main.css) + shared
   primitives (contact block, buttons, FAQ, a11y). No framework.
   ========================================================================== */

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { min-height: 100dvh; line-height: 1.6; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
ul[role="list"] { list-style: none; padding: 0; }

/* ---- token contract (values per version) ---- */
:root {
  --color-bg:; --color-surface:; --color-text:; --color-text-muted:;
  --color-accent:; --color-accent-dark:; --color-border:;
  --font-display:; --font-body:;
  --text-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  --text-sm: clamp(0.875rem, 1.8vw, 1rem);
  --text-base: clamp(1rem, 1.2vw, 1.125rem);
  --text-lg: clamp(1.125rem, 2.2vw, 1.3rem);
  --text-xl: clamp(1.35rem, 3vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 4vw, 2.5rem);
  --text-3xl: clamp(2.25rem, 5.5vw, 3.5rem);
  --text-hero: clamp(2.75rem, 9vw, 6rem);
  --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-12: 3rem; --space-16: 4rem; --space-24: 6rem;
  --nav-h: 64px; --maxw: 1200px;
  --section-pad: clamp(3.5rem, 9vw, 7rem);
  --radius: 3px;
}

/* ---- layout helpers ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: var(--section-pad); }
section[id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }
.eyebrow { font-family: var(--font-body); font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; font-size: var(--text-xs); color: var(--color-accent); }

/* ---- a11y ---- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--color-accent);
  color: #fff; padding: .6rem 1rem; z-index: 1000; }
.skip-link:focus { left: 0; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-base);
  padding: .85rem 1.6rem; border-radius: var(--radius); text-decoration: none;
  white-space: nowrap; min-height: 48px; border: 2px solid transparent;
  cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); }
.btn-ghost { background: transparent; color: var(--color-text);
  border-color: var(--color-border); }
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ---- shared contact block (CONTACT-BLOCK styles) ---- */
.contact-cta { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
.contact-channels { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6);
  align-items: center; font-family: var(--font-body); font-size: var(--text-sm); }
.contact-channels a { text-decoration: none; font-weight: 600;
  border-bottom: 2px solid var(--color-accent); padding-bottom: 2px; }
.contact-channels a:hover { color: var(--color-accent); }
.contact-note { color: var(--color-text-muted); font-size: var(--text-sm); }

/* floating text button (mobile) */
.text-float { position: fixed; right: 1rem; bottom: 1rem; z-index: 100;
  box-shadow: 0 4px 14px rgba(0,0,0,.28); }
@media (min-width: 900px) { .text-float { display: none; } }

/* ---- FAQ (native details) ---- */
.faq details { border-bottom: 1px solid var(--color-border); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 0;
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-lg);
  display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--color-accent); font-size: 1.5em; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { color: var(--color-accent); }
.faq details p { padding: 0 0 1.2rem; color: var(--color-text-muted); max-width: 60ch; }

/* ---- review cards (editorial, NOT rounded SaaS cards) ---- */
.reviews-grid { display: grid; gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.review { border: 1px solid var(--color-border); border-top: 3px solid var(--color-accent);
  padding: var(--space-6); background: var(--color-surface); }
.review .stars { color: var(--color-accent); letter-spacing: 2px; }
.review blockquote { margin: var(--space-3) 0; font-size: var(--text-base); }
.review cite { font-style: normal; font-weight: 600; font-size: var(--text-sm); }
.review .via { color: var(--color-text-muted); font-size: var(--text-xs); }

/* ---- scroll reveal (CSS-only, guarded) ---- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    [data-reveal] { animation: reveal-up linear both; animation-timeline: view();
      animation-range: entry 0% entry 28%; }
    @keyframes reveal-up { from { opacity: 0; transform: translateY(22px); }
      to { opacity: 1; transform: translateY(0); } }
  }
}

/* ---- lightbox (anchor-baseline + tiny-JS upgrade; degrades to opening the image) ---- */
a.lb { display: block; cursor: zoom-in; }
.lb-overlay { position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: clamp(1rem, 4vw, 3rem);
  background: rgba(8, 8, 10, 0.92); }
.lb-overlay[data-open="true"] { display: flex; }
.lb-overlay img { max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
.lb-close { position: absolute; top: 1rem; right: 1rem; width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4); color: #fff; border: 2px solid rgba(255,255,255,.5);
  border-radius: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lb-close:hover { border-color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .lb-overlay[data-open="true"] img { animation: lb-in .18s ease both; }
  @keyframes lb-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
}

/* ---- images / CLS ---- */
.media { overflow: hidden; background: var(--color-surface); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; text-align: center; padding: 2rem;
  background: #2a2a2a; color: #ddd; font-family: var(--font-body); font-size: var(--text-sm);
  aspect-ratio: 16/9; }
