/* frame.css - the shared frame of boulx.ch: tokens, type, header, buttons,
   club path, footer and form basics. The BoulX server pages load this very
   file at runtime (BOULX-PLN-93), so its selectors are a contract:
   specs/features/frame.md. Renaming or removing one is announced first.
   Colours from the app (boulx, app/lib/theme/app_theme.dart), see
   .claude/skills/boulx-brand. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F7F9F8;
  --surface: #FFFFFF;
  --surface-2: #EEF3F0;
  --border: #E7ECE9;
  --text: #12181A;
  --muted: #5E6B63;
  --mint: #1FAE79;
  --mint-text: #17925F;
  --mint-soft: #E3F7EE;
  --terracotta: #D9672F;
  --terracotta-text: #B8531F;
  --boule: #12181A;
  --focus: #17925F;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-width: 1120px;
  --gutter: clamp(16px, 5vw, 48px);
  --r-pill: 20px;
  --r-card: 16px;
  --r-tile: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1210;
    --surface: #161D1A;
    --surface-2: #121916;
    --border: rgba(255, 255, 255, 0.08);
    --text: #F5F7F5;
    --muted: #9BA8A2;
    --mint: #3FE0A5;
    --mint-text: #3FE0A5;
    --mint-soft: rgba(63, 224, 165, 0.12);
    --terracotta: #E67B45;
    --terracotta-text: #E67B45;
    --boule: #F5F7F5;
    --focus: #3FE0A5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1210;
  --surface: #161D1A;
  --surface-2: #121916;
  --border: rgba(255, 255, 255, 0.08);
  --text: #F5F7F5;
  --muted: #9BA8A2;
  --mint: #3FE0A5;
  --mint-text: #3FE0A5;
  --mint-soft: rgba(63, 224, 165, 0.12);
  --terracotta: #E67B45;
  --terracotta-text: #E67B45;
  --boule: #F5F7F5;
  --focus: #3FE0A5;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
p, dl, dd, ol, ul, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* --- Header ------------------------------------------------------- */
.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px 28px;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.logo-mark { width: 32px; height: 32px; color: var(--muted); flex: none; }
.logo-mark .boule { fill: var(--mint); }
.logo-mark .cochonnet { fill: var(--terracotta); }
.wordmark { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.wordmark b { font-weight: 800; color: var(--mint-text); }
.main-nav { display: flex; gap: 22px; font-weight: 500; font-size: 16px; }
.main-nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current] { border-bottom-color: var(--mint); }
.languages { display: flex; gap: 2px; font-size: 13.5px; font-weight: 600; }
.languages a, .languages span { display: inline-block; padding: 4px 7px; border-radius: 6px; text-decoration: none; }
.languages a[aria-current] { background: var(--mint-soft); color: var(--mint-text); }
.lang-pending { color: var(--muted); opacity: 0.55; cursor: default; }
/* Light/dark switch (REV-3), next to the languages; run by /assets/js/theme.js */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle:hover { background: var(--mint-soft); }
.theme-toggle svg { width: 18px; height: 18px; display: none; }
.theme-toggle[data-mode="auto"] .i-auto, .theme-toggle[data-mode="light"] .i-light, .theme-toggle[data-mode="dark"] .i-dark { display: block; }
.theme-toggle[hidden] { display: none; }

/* --- Buttons ----------------------------------------------------- */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex; align-items: center; min-height: 48px;
  padding: 12px 22px; border-radius: var(--r-pill);
  background: var(--mint); color: #0D1210;
  font-weight: 650; font-size: 16px; line-height: 1.2; text-decoration: none;
  border: 2px solid var(--mint);
}
.button:hover { background: var(--mint-text); border-color: var(--mint-text); color: #fff; }
.button-quiet { background: transparent; color: var(--text); border-color: var(--border); }
.button-quiet:hover { background: var(--surface); color: var(--text); border-color: var(--text); }
.button-dark { background: #12181A; border-color: #12181A; color: #F5F7F5; }
.button-dark:hover { background: #000; border-color: #000; color: #fff; }

/* --- Club path: the throw as step indicator -------------------- */
.club-path { position: relative; margin: 28px 0 8px; }
.club-path-trail { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 40px; color: var(--mint); }
.club-path ol { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.club-path li { display: flex; }
.club-path li:nth-child(1) { padding-top: 22px; }
.club-path li:nth-child(2) { padding-top: 2px; }
.club-path li:nth-child(3) { padding-top: 0; }
.club-path li:nth-child(4) { padding-top: 10px; justify-content: flex-end; text-align: right; }
.club-path a { display: grid; gap: 2px; text-decoration: none; padding: 4px 6px; border-radius: 8px; }
.club-path .goal a { justify-items: end; }
.club-path .dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--mint); margin-bottom: 6px;
}
.club-path .goal .dot { width: 14px; height: 14px; background: var(--terracotta); border-color: var(--terracotta); }
.club-path .done .dot { background: var(--mint); }
.club-path .current .dot { width: 30px; height: 30px; margin-top: -5px; background: var(--boule); border-color: var(--boule); }
.club-path .num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.club-path .name { font-weight: 650; font-size: 15.5px; line-height: 1.25; }
.club-path a:hover .name { text-decoration: underline; }

/* --- Footer -------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); }
.footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 32px var(--gutter) 44px;
  display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between;
  font-size: 14.5px; color: var(--muted);
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .logo-mark { width: 24px; height: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* --- Content and forms (for pages without their own layout) ------- */
.frame-content { max-width: 880px; margin: 0 auto; padding: 16px var(--gutter) 96px; }
.frame-content > h1 { margin-top: 44px; font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; letter-spacing: -0.035em; }
.frame-content > p { margin-top: 14px; max-width: 65ch; }
.frame-content > .club-path:first-child { margin-top: 8px; }
.frame-content > .club-path + h1 { margin-top: 28px; }

.field { display: grid; gap: 6px; margin-top: 22px; max-width: 34rem; }
label { font-weight: 650; font-size: 15.5px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--muted); border-radius: var(--r-tile);
  padding: 11px 14px; min-height: 48px; width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[type="checkbox"], input[type="radio"] { width: 20px; min-height: 0; height: 20px; padding: 0; accent-color: var(--mint-text); }
[aria-invalid="true"] { border-color: var(--terracotta); }
.field-hint { font-size: 14.5px; color: var(--muted); }
.field-error { display: none; font-size: 14.5px; font-weight: 600; color: var(--terracotta-text); }
[aria-invalid="true"] ~ .field-error, .field-error[data-visible] { display: block; }
.form-error {
  margin-top: 24px; padding: 12px 16px; border-radius: var(--r-tile);
  border-left: 4px solid var(--terracotta); background: var(--surface);
  color: var(--text); font-weight: 600;
}
button.button { cursor: pointer; font-family: inherit; }

/* --- Narrow ------------------------------------------------------ */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .main-nav { order: 3; width: 100%; }
  .club-path ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .club-path .num { display: none; }
  .club-path .name { font-size: 13px; }
}
