/* Mystic Model Yacht Club. Design system, Direction A "Burgee".
   Hand written CSS, no framework, no runtime CDN. Fonts are vendored in assets/fonts.
   Colours are tokens so light and dark stay in sync.

   Contrast notes, checked against WCAG AA (4.5:1 body text, 3:1 large text and UI edges):
   the mockup's bright signal red (#e8332a) only reaches 4.25:1 on white, so it is kept for
   large display type and decorative bars, and a slightly deeper red carries anything that is
   small text or a filled button. Both reds read as the same signal red on screen. */

@import url("./fonts/fonts.css");

/* ---------- tokens ---------- */
:root{
  --navy:#0b3a6e;
  --navy-deep:#072a51;
  --bg:#f4f6f9;
  --ink:#0f1c2e;
  --muted:#5a6a80;         /* 5.1:1 on --bg */
  --card:#ffffff;
  --line:#d9e0ea;

  --red-bright:#e8332a;    /* display type and decorative bars only */
  --red:#cf2e24;           /* filled buttons and small red text, 5.2:1 on white */
  --on-red:#ffffff;        /* 5.2:1 on --red */
  --red-text:#cf2e24;      /* small red text on a light surface */

  --on-navy:#ffffff;
  --on-navy-soft:#d6e2f2;  /* 8.9:1 on --navy-deep */
  --focus:#e8332a;
  --radius:6px;
  --display:"Archivo Narrow",Archivo,"Arial Narrow",system-ui,sans-serif;
  --sans:Archivo,system-ui,-apple-system,"Segoe UI",sans-serif;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#06162b; --ink:#eef3f9; --muted:#9db0c8; --card:#0b2444; --line:#1c3a62;
    --red-text:#ff8078;    /* 6.3:1 on --card, the deep red is too dark on a navy field */
    --focus:#ff8078;
  }
}
:root[data-theme="dark"]{
  --bg:#06162b; --ink:#eef3f9; --muted:#9db0c8; --card:#0b2444; --line:#1c3a62;
  --red-text:#ff8078;
  --focus:#ff8078;
}

/* ---------- base ---------- */
*{box-sizing:border-box;margin:0}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto} *{animation:none !important;transition:none !important}}
body{
  font-family:var(--sans);
  background:var(--bg);
  color:var(--ink);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;display:block}
a{color:inherit}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px;border-radius:3px}
.skip{position:absolute;left:-9999px;top:0;background:var(--card);color:var(--ink);padding:12px 18px;z-index:60;border-radius:0 0 6px 0}
.skip:focus{left:0}
.wrap{max-width:1120px;margin:0 auto;padding:0 20px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---------- display type ---------- */
h1,h2,h3,.facts b,.when{font-family:var(--display);text-transform:uppercase}
h1{font-weight:700;font-size:clamp(40px,9vw,112px);line-height:.92;letter-spacing:-.01em;max-width:14ch}
h1 span{color:var(--red-bright)}
h2{font-weight:700;font-size:clamp(30px,5vw,56px);line-height:.95;margin-bottom:8px}
h3{font-family:var(--sans);text-transform:none;font-weight:700;font-size:20px;line-height:1.25}
.sub{color:var(--muted);margin-bottom:28px;max-width:62ch}
.lede{color:var(--muted);font-size:18px;margin-top:18px;max-width:56ch}
.kicker{display:inline-flex;align-items:center;gap:10px;font-size:12px;font-weight:700;letter-spacing:.18em;text-transform:uppercase;margin-bottom:18px}
.kicker:before{content:"";width:28px;height:3px;background:var(--red-bright);flex:none}

/* ---------- header ---------- */
header.site{background:var(--navy);color:var(--on-navy)}
header.site nav{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:64px;flex-wrap:wrap}
header.site .brand{display:flex;align-items:center;gap:12px;font-weight:900;letter-spacing:.02em;text-transform:uppercase;font-size:14px;text-decoration:none;color:var(--on-navy)}
header.site .brand img{height:30px;width:auto}
header.site ul{display:flex;gap:26px;list-style:none;font-size:14px;font-weight:500;margin:0;padding:0;align-items:center}
header.site ul a{text-decoration:none;color:#e4ecf6}
header.site ul a:hover{color:#fff;text-decoration:underline}
header.site ul a[aria-current="page"]{color:#fff;border-bottom:3px solid var(--red-bright);padding-bottom:3px}
header.site .join{background:var(--red);color:var(--on-red);padding:9px 16px;border-radius:4px;font-weight:700;text-decoration:none;font-size:14px}
header.site .join:hover{filter:brightness(1.1)}
.navtools{display:flex;align-items:center;gap:10px}
.themebtn{background:transparent;border:1px solid rgba(255,255,255,.45);color:#e4ecf6;border-radius:4px;padding:8px 12px;font:inherit;font-size:13px;font-weight:500;cursor:pointer}
.themebtn:hover{border-color:#fff;color:#fff}
.menubtn{display:none;background:transparent;border:1px solid rgba(255,255,255,.45);color:#e4ecf6;border-radius:4px;padding:8px 12px;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
@media(max-width:860px){
  header.site nav{padding:12px 0}
  .menubtn{display:block}
  header.site ul{display:none;order:3;width:100%;flex-direction:column;align-items:flex-start;gap:0;padding-bottom:8px}
  header.site ul.open{display:flex}
  header.site ul li{width:100%;border-top:1px solid rgba(255,255,255,.2)}
  header.site ul a{display:block;padding:13px 0;font-size:16px}
  header.site ul a[aria-current="page"]{border-bottom:0;color:#fff;text-decoration:underline;text-decoration-color:var(--red-bright);text-decoration-thickness:3px;text-underline-offset:4px}
}

/* ---------- hero ---------- */
.hero{position:relative;background:var(--navy-deep);color:var(--on-navy);overflow:hidden;min-height:82vh;display:grid;align-items:end}
/* Duotone treatment: the photo is desaturated to luminosity and laid over the navy field,
   so every hero photo lands in the same navy and red world no matter how it was shot. */
.hero img.photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:saturate(.75) contrast(1.05);opacity:.55;mix-blend-mode:luminosity}
.hero:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(7,42,81,.2) 0%,rgba(7,42,81,.88) 70%,#072a51 100%)}
.hero .wrap{position:relative;z-index:1;padding-top:96px;padding-bottom:60px}
.hero p{max-width:52ch;font-size:18px;margin-top:20px;color:var(--on-navy-soft)}
.hero.short{min-height:0}
.hero.short .wrap{padding-top:64px;padding-bottom:48px}
.hero.short h1{font-size:clamp(34px,6.5vw,72px)}
@media(max-width:760px){.hero{min-height:0}.hero .wrap{padding-top:56px;padding-bottom:44px}}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:14px 22px;border-radius:4px;font-family:var(--sans);font-weight:700;text-decoration:none;font-size:15px;line-height:1;border:2px solid transparent;cursor:pointer;background:var(--navy);color:var(--on-navy)}
.btn:hover{filter:brightness(1.12)}
.btn.red{background:var(--red);color:var(--on-red)}
.btn.ghost{background:transparent;border-color:rgba(255,255,255,.6);color:#fff}
.btn.ghost:hover{border-color:#fff;filter:none}
.btn.line{background:transparent;border-color:var(--line);color:var(--ink)}
.btn.line:hover{border-color:var(--ink);filter:none}
.btn[disabled],.btn[aria-disabled="true"]{opacity:.55;cursor:not-allowed;filter:none}
.cta,.btnrow{display:flex;gap:12px;flex-wrap:wrap;margin-top:30px}

/* ---------- red ticker strip ---------- */
.strip{background:var(--red);color:var(--on-red);font-weight:700;font-size:13px;letter-spacing:.08em;text-transform:uppercase}
.strip .wrap{display:flex;gap:40px;padding:12px 20px;overflow-x:auto;white-space:nowrap}
.strip a{color:var(--on-red)}

/* ---------- facts band ---------- */
.facts{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;background:var(--line);margin:64px 0}
.facts>div{background:var(--card);padding:32px 28px}
.facts b{display:block;font-size:clamp(28px,3.4vw,40px);line-height:1;color:var(--navy);font-weight:700}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .facts b{color:#fff}}
:root[data-theme="dark"] .facts b{color:#fff}
.facts small{display:block;margin-top:10px;color:var(--muted);font-size:14px;line-height:1.45}
@media(max-width:760px){.facts{grid-template-columns:1fr;margin:44px 0}}

/* ---------- news cards ---------- */
.news{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px}
.news.featured{grid-template-columns:1.4fr 1fr 1fr}
@media(max-width:900px){.news.featured{grid-template-columns:1fr}}
.post{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column}
.post>img,.post .thumb{width:100%;aspect-ratio:16/10;object-fit:cover;background:var(--line)}
.post .body{padding:20px}
.post time{font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--red-text)}
.post h3{margin:8px 0}
.post p{color:var(--muted);font-size:15px;white-space:pre-wrap}
.post .fb{margin-top:auto;padding:14px 20px;border-top:1px solid var(--line);font-size:13px;font-weight:700;text-decoration:none;display:flex;justify-content:space-between;gap:10px;color:var(--ink)}
.post .fb:hover{background:var(--bg)}

/* ---------- source of truth callout ---------- */
.truth{margin:64px 0;padding:22px 26px;border-left:6px solid var(--red);background:var(--card);border-radius:0 var(--radius) var(--radius) 0;font-size:15px;color:var(--ink)}
.truth b{text-transform:uppercase;letter-spacing:.08em;font-size:12px;display:block;margin-bottom:4px;color:var(--red-text)}
.truth a{color:var(--ink);font-weight:700}

/* ---------- events ---------- */
.events{list-style:none;padding:0;margin:28px 0 0}
.events li{display:grid;grid-template-columns:130px 1fr;gap:24px;padding:22px 0;border-bottom:1px solid var(--line);align-items:start}
.events .when{font-weight:700;color:var(--red-text);font-size:22px;line-height:1.05}
.events .when small{display:block;color:var(--muted);font-family:var(--sans);text-transform:uppercase;font-size:12px;font-weight:500;letter-spacing:.1em;margin-top:6px}
.events p{color:var(--muted);font-size:15px;margin-top:4px}
@media(max-width:620px){.events li{grid-template-columns:1fr;gap:6px}}
/* compact version used in the home page sidebar */
.events.compact li{grid-template-columns:86px 1fr;gap:16px;padding:14px 0}
.events.compact .when{font-size:17px}
.events.compact h3{font-size:16px}

/* ---------- gallery ---------- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:18px;margin-top:28px}
.grid figure{margin:0}
.grid img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:var(--radius);background:var(--line)}
.grid figcaption{font-size:13px;color:var(--muted);margin-top:8px}

/* ---------- cards and boats ---------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:28px}
.boats{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:20px;margin-top:28px}
.boats .card h3{font-family:var(--display);text-transform:uppercase;font-size:26px;line-height:1}
.boats .card>p{color:var(--muted);margin-top:10px;font-size:15px}
.boats dl{margin-top:16px;font-size:14px}
.boats dt{color:var(--muted);font-size:11px;letter-spacing:.12em;text-transform:uppercase;margin-top:14px;font-weight:700}
.boats dd{margin:2px 0 0}

/* ---------- prose ---------- */
.prose p{margin-top:16px;max-width:68ch;color:var(--ink)}
.prose ul,.prose ol{margin:16px 0 0 22px;max-width:68ch}
.prose li{margin-top:10px}
.prose h2{margin-top:48px}
.prose h3{margin-top:28px}
.section{padding:64px 0}
.section.tight{padding:44px 0}

/* ---------- subscribe panel ---------- */
.subscribe{background:var(--navy);color:var(--on-navy);border-radius:8px;padding:48px 40px;display:grid;grid-template-columns:1fr 1fr;gap:40px;margin:64px 0}
.subscribe h2{color:#fff}
.subscribe h2.small{font-size:28px}
.subscribe p{color:var(--on-navy-soft);margin-top:10px;font-size:15px}
.subscribe .qr{width:120px;height:120px;background:#fff;border-radius:6px;padding:8px;flex:none}
.subscribe .qr img{width:100%;height:100%;object-fit:contain}
.subscribe .row{display:flex;gap:20px;align-items:center;margin-top:18px;flex-wrap:wrap}
.subscribe form{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}
.subscribe input{flex:1;min-width:200px;padding:12px 14px;border-radius:4px;border:1px solid transparent;font:inherit;background:#fff;color:var(--ink)}
.subscribe .msg{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.5);color:#fff}
@media(max-width:760px){.subscribe{grid-template-columns:1fr;padding:32px 24px;margin:44px 0}}

/* ---------- forms ---------- */
form.stack{display:grid;gap:16px;margin-top:20px;max-width:580px}
form.inline{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}
form.inline input{flex:1;min-width:200px}
label{font-size:14px;font-weight:700;display:block;margin-bottom:6px}
label .hint{display:block;font-weight:400;color:var(--muted);font-size:13px;margin-top:3px}
input[type=text],input[type=email],input[type=url],input[type=date],input[type=time],input[type=number],textarea,select{
  width:100%;padding:12px 14px;border-radius:4px;border:1px solid var(--line);
  font:inherit;background:var(--card);color:var(--ink)
}
textarea{min-height:160px;resize:vertical;line-height:1.55}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}
button{font:inherit;cursor:pointer}
.msg{margin-top:16px;padding:14px 16px;border-radius:4px;border:1px solid var(--line);background:var(--card);font-size:15px}
.msg.ok{border-left:6px solid var(--navy)}
.msg.bad{border-left:6px solid var(--red)}
.msg[hidden]{display:none}

/* ---------- empty states ---------- */
.empty{border:1px dashed var(--line);border-radius:var(--radius);padding:28px;color:var(--muted);text-align:center;grid-column:1 / -1}
.empty a{color:var(--red-text);font-weight:700}

/* ---------- footer ---------- */
footer.site{background:var(--navy-deep);color:#c3d3e6;padding:40px 0;font-size:13px;margin-top:64px}
footer.site .wrap{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
footer.site a{color:#fff;text-decoration:underline}
footer.site span{max-width:46ch}

/* QA round 1: replaced inline styles so the CSP stays strict */
.card-sub{color:var(--muted);margin-top:10px;font-size:15px}
.sub-gap{margin-top:22px}
