/* ==========================================================================
   Captain's Yard — shared styles
   Palette & type from research/design-language.md
   Light theme is default; dark theme via [data-theme="dark"] on <html>.
   Token discipline: --on-brand (text/icons on navy) stays near-white in BOTH
   themes; --surface (card fills) flips dark. They are separate tokens on
   purpose (see steering doc).
   ========================================================================== */

/* ---- Tokens: light theme (default) ---------------------------------------- */
:root {
  /* Brand identity — constant hue across themes */
  --navy:        #1B2A41;   /* header, footer, primary buttons, headings */
  --navy-deep:   #121D2E;   /* dark-theme ground / footer depth */
  --brass:       #C89B3C;   /* accents, underlines, specials flags, borders */
  --brass-bright:#D4AC55;   /* brass nudged brighter for dark ground */
  --brass-text:  #7A5C15;   /* brass as SMALL TEXT on a light ground — deepened for AA (bright brass on cream is ~2.3:1) */
  --signal:      #C0392B;   /* high-intent CTA only */
  --signal-hover:#a5301f;
  --slate:       #3E5C6B;   /* support surfaces, borders */

  /* Roles that FLIP between themes */
  --bg:          #F4F1E8;   /* page ground (sailcloth) */
  --surface:     #FFFFFF;   /* card / panel fill */
  --surface-alt: #ECE7D8;   /* quiet section band */
  --text:        #22252A;   /* primary body text */
  --text-muted:  #5A6472;   /* captions, meta */
  --border:      #d8d2c2;   /* hairlines on light ground */
  --heading:     #1B2A41;   /* headings on page ground */

  /* Roles that DO NOT flip — always sit on navy */
  --on-brand:        #F4F1E8; /* text/icons on navy backgrounds */
  --on-brand-muted:  #b9c2cc; /* secondary text on navy */
  --on-brand-border: rgba(244,241,232,0.22);

  /* Scale */
  --maxw: 1120px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 10px rgba(18,29,46,0.08);
  --shadow-lg: 0 8px 30px rgba(18,29,46,0.14);
  --gap: 1.25rem;

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Tokens: dark theme --------------------------------------------------- */
[data-theme="dark"] {
  --bg:          #101A28;   /* ground dropped slightly so panels can sit above it */
  --surface:     #223649;   /* lifted well clear of the ground — cards read as panels, not floating text */
  --surface-alt: #18242F;
  --text:        #E7E9EC;
  --text-muted:  #9AA6B2;
  --border:      #3C4F63;   /* lighter hairline so card / input edges are visible on the dark ground */
  --heading:     #E7E9EC;
  --brass:       #D4AC55;  /* brighter brass reads better on dark ground */
  --brass-text:  #D4AC55;  /* on dark, small brass text is already fine — use the bright brass */
  --shadow:      0 2px 10px rgba(0,0,0,0.45);
  --shadow-lg:   0 10px 34px rgba(0,0,0,0.55);
  /* --on-brand* deliberately unchanged: still near-white on navy */
}

/* ---- Reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--slate); }
/* Recolour only bare inline text links in dark mode. Scoping to :not([class])
   keeps this off component anchors (.btn, .icon-btn, .card__link, .brand …) —
   otherwise its [data-theme] specificity beats their own colour rules and every
   CTA button renders brass-on-red / brass-on-green (unreadable). */
[data-theme="dark"] a:not([class]) { color: var(--brass); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--heading);
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 6vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); text-transform: uppercase; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--alt { background: var(--surface-alt); }
.section__intro { max-width: 62ch; margin-bottom: 2rem; }
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: .85rem;
  font-weight: 600;
  color: var(--brass-text);
  margin: 0 0 .4rem;
}

.text-muted { color: var(--text-muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy); color: var(--on-brand); padding: .75rem 1rem;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 600; font-size: 1rem;
  padding: .7rem 1.25rem; border-radius: var(--radius-sm);
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--navy); color: var(--on-brand); }
.btn--primary:hover { background: #24374f; }
.btn--signal { background: var(--signal); color: #fff; }
.btn--signal:hover { background: var(--signal-hover); }
.btn--wa { background: #25D366; color: #06331b; }
.btn--wa:hover { background: #1eb257; }
.btn--ghost { background: transparent; color: var(--on-brand); border-color: var(--on-brand-border); }
.btn--ghost:hover { background: rgba(244,241,232,0.12); }
.btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
[data-theme="dark"] .btn--outline { color: var(--brass); border-color: var(--brass); }
.btn--outline:hover { background: var(--navy); color: var(--on-brand); }
[data-theme="dark"] .btn--outline:hover { background: var(--brass); color: var(--navy-deep); }
.btn__icon { width: 1.1em; height: 1.1em; flex: none; }

/* ---- Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy); color: var(--on-brand);
  border-bottom: 3px solid var(--brass);
}
.header__inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.25rem; max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--on-brand); }
.brand__mark {
  width: 40px; height: 40px; border: 2px solid var(--brass); border-radius: 50%;
  display: grid; place-items: center; flex: none;
  font-family: var(--font-display); font-weight: 700; color: var(--brass);
  font-size: 1.05rem;
}
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--on-brand);
}
.brand__sub {
  font-size: .62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--on-brand-muted); margin-top: 2px;
}
/* On a phone the descriptor wraps to 4 cramped lines next to the action
   buttons — drop it and let the wordmark (wrapping to 2 lines is fine) carry
   the header. Keep the wordmark from forcing horizontal overflow. */
@media (max-width: 480px) {
  .brand__sub { display: none; }
  .brand__name { font-size: 1.02rem; }
  .header__inner { gap: .5rem; padding-left: .9rem; padding-right: .9rem; }
  .header__actions { gap: .35rem; }
}

.header__spacer { flex: 1; }

/* header contact quick-actions (persistent call + whatsapp) */
.header__actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--on-brand-border); background: transparent;
  color: var(--on-brand); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: rgba(244,241,232,0.12); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn--call { background: var(--signal); border-color: var(--signal); color: #fff; }
.icon-btn--call:hover { background: var(--signal-hover); }
.icon-btn--wa { background: #25D366; border-color: #25D366; color: #06331b; }
.icon-btn--wa:hover { background: #1eb257; }

/* nav */
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--on-brand-border); background: transparent;
  color: var(--on-brand); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a {
  color: var(--on-brand); text-decoration: none;
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 500; font-size: 1rem;
  white-space: nowrap;          /* keep "Food & Specials" / "Bottle Store & Water" on one line */
}
.main-nav a[aria-current="page"] { color: var(--brass); }
.main-nav a:hover { color: var(--brass); }

/* Off-canvas nav up to 1024px — the 6 uppercase labels (now nowrap) need ~1120px
   to sit inline without forcing horizontal page scroll, so hand over to the
   hamburger below that. */
@media (max-width: 1024px) {
  .main-nav {
    position: fixed; inset: 0 0 0 auto; width: min(80vw, 320px);
    background: var(--navy-deep); padding: 5rem 1.5rem 2rem;
    transform: translateX(100%); transition: transform .25s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,0.4); border-left: 3px solid var(--brass);
  }
  .main-nav[data-open="true"] { transform: translateX(0); }
  .main-nav ul { display: flex; flex-direction: column; gap: 1.25rem; }
  .main-nav a { font-size: 1.2rem; }
  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 90;
  }
  .nav-backdrop[data-open="true"] { opacity: 1; visibility: visible; }
}
@media (min-width: 1025px) {
  .nav-toggle, .nav-backdrop { display: none; }
  .main-nav ul { display: flex; gap: 1.4rem; align-items: center; }
}

/* theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--on-brand-border); background: transparent;
  color: var(--on-brand); cursor: pointer;
}
.theme-toggle:hover { background: rgba(244,241,232,0.12); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ---- Hero ----------------------------------------------------------------- */
.hero { position: relative; color: var(--on-brand); background: var(--navy-deep); }
.hero__media { position: absolute; inset: 0; overflow: hidden; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,29,46,0.55), rgba(18,29,46,0.85));
}
.hero__inner { position: relative; padding: clamp(3rem, 9vw, 6rem) 0; max-width: 46rem; }
.hero h1 { color: var(--on-brand); margin-bottom: .5rem; }
.hero__lead { font-size: 1.2rem; color: var(--on-brand); max-width: 44ch; }
.hero__rating {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1rem;
  font-family: var(--font-display); letter-spacing: 0.04em; color: var(--on-brand);
}
.hero__rating .stars { color: var(--brass); letter-spacing: 1px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* page banner (interior pages, no photo) */
.page-banner { background: var(--navy); color: var(--on-brand); border-bottom: 3px solid var(--brass); }
.page-banner__inner { padding: clamp(2rem, 6vw, 3.5rem) 0; }
.page-banner h1 { color: var(--on-brand); }
.page-banner p { color: var(--on-brand-muted); max-width: 60ch; margin: 0; }
.breadcrumb { font-size: .85rem; color: var(--on-brand-muted); margin-bottom: .75rem; }
.breadcrumb a { color: var(--on-brand-muted); }
.breadcrumb a:hover { color: var(--brass); }

/* ---- Cards / grids -------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
/* Cap at 3 columns on wide screens so the 6-card "everything we do" grid
   lands as a balanced 3 + 3 rather than 4 + 2 with two empty cells. */
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}
.card__body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.card__body h3 { margin-bottom: .35rem; }
.card__icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(200,155,60,0.14); color: var(--brass); margin-bottom: .9rem;
}
.card__icon svg { width: 24px; height: 24px; }
.card__link {
  margin-top: auto; padding-top: .8rem; font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
  color: var(--navy); text-decoration: none; font-size: .92rem;
}
[data-theme="dark"] .card__link { color: var(--brass); }
.card__link:hover { text-decoration: underline; }
.card__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---- Daily specials ------------------------------------------------------- */
.specials {
  background: var(--navy); color: var(--on-brand);
  border-radius: var(--radius); padding: 2rem; position: relative;
  border: 2px solid var(--brass);
}
.specials__flag {
  display: inline-block; background: var(--brass); color: var(--navy-deep);
  font-family: var(--font-display); text-transform: uppercase; font-weight: 700;
  letter-spacing: 0.06em; padding: .3rem .9rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
.specials h2 { color: var(--on-brand); }
.specials__note {
  border: 1px dashed var(--on-brand-border); border-radius: var(--radius-sm);
  padding: 1rem 1.25rem; color: var(--on-brand-muted); background: rgba(0,0,0,0.15);
}
.needs-content {
  display: inline-block; font-family: var(--font-display); font-size: .72rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-text);
  border: 1px solid var(--brass-text); border-radius: 4px; padding: .1rem .4rem;
  margin-right: .4rem; vertical-align: middle;
}
/* On the navy Daily-Specials panel the chip sits on dark — keep it bright brass there */
.specials .needs-content { color: var(--brass); border-color: var(--brass); }

/* ---- Feature split (image + text) ---------------------------------------- */
.split { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 800px) { .split { grid-template-columns: 1fr 1fr; } .split--rev .split__media { order: 2; } }
.split__media img { border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.list-check { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.list-check li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; }
.list-check li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: .7rem; height: .7rem;
  background: var(--brass); border-radius: 2px; transform: rotate(45deg);
}

/* ---- Reviews strip -------------------------------------------------------- */
.rating-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .75rem 1.25rem; text-align: center;
}
.rating-strip .score { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; color: var(--brass); line-height: 1; }
.rating-strip .stars { color: var(--brass); font-size: 1.4rem; letter-spacing: 2px; }
.quote {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--brass); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.quote blockquote { margin: 0 0 .75rem; font-size: 1.05rem; }
.quote cite { font-style: normal; color: var(--text-muted); font-size: .9rem; }

/* ---- Info / hours / map --------------------------------------------------- */
.info-grid { display: grid; gap: 2rem; }
@media (min-width: 800px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); }
.hours-table th { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.03em; }
.hours-table td { text-align: right; font-variant-numeric: tabular-nums; }
.map-embed {
  position: relative; width: 100%; aspect-ratio: 4/3; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--slate); box-shadow: var(--shadow);
}
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.nap { font-style: normal; line-height: 1.7; }
.nap strong { font-family: var(--font-display); letter-spacing: 0.02em; }
.contact-line { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.contact-line svg { width: 20px; height: 20px; color: var(--brass); flex: none; }

/* ---- Forms ---------------------------------------------------------------- */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow);
}
.form-note {
  background: rgba(62,92,107,0.12); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: 1.25rem;
  font-size: .92rem; color: var(--text-muted);
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .7rem .8rem; font-family: var(--font-body); font-size: 1rem;
  color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(200,155,60,0.25);
}
.field textarea { min-height: 120px; resize: vertical; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 620px) { .field-row { grid-template-columns: 1fr 1fr; } }
.form-status { margin-top: 1rem; font-size: .92rem; color: var(--text-muted); min-height: 1.2em; }

/* ---- Gallery -------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
.gallery img { border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; box-shadow: var(--shadow); }

/* ---- CTA band ------------------------------------------------------------- */
.cta-band { background: var(--navy); color: var(--on-brand); text-align: center; }
.cta-band h2 { color: var(--on-brand); }
.cta-band p { color: var(--on-brand-muted); max-width: 52ch; margin: 0 auto 1.5rem; }
.cta-band__buttons { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { background: var(--navy-deep); color: var(--on-brand); border-top: 3px solid var(--brass); }
.footer__grid { display: grid; gap: 2rem; padding: 3rem 0 2rem; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h3 { color: var(--on-brand); font-size: 1.05rem; text-transform: uppercase; }
.footer a { color: var(--on-brand-muted); text-decoration: none; }
.footer a:hover { color: var(--brass); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .5rem; }
.footer .nap { color: var(--on-brand-muted); }
.footer .nap strong { color: var(--on-brand); }
.footer__rating { display: inline-flex; align-items: center; gap: .5rem; margin-top: .5rem; color: var(--on-brand); }
.footer__rating .stars { color: var(--brass); }
.footer__socials { display: flex; gap: .75rem; margin-top: .75rem; }
.footer__socials a {
  width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center;
  border: 1px solid var(--on-brand-border);
}
.footer__socials a:hover { background: rgba(244,241,232,0.1); }
.footer__socials svg { width: 20px; height: 20px; }
.footer__bottom {
  border-top: 1px solid var(--on-brand-border); padding: 1.25rem 0;
  font-size: .85rem; color: var(--on-brand-muted);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

.disclaimer {
  background: var(--surface-alt); border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--text-muted); text-align: center;
}
.disclaimer .container { padding-top: 1rem; padding-bottom: 1rem; }

/* utilities */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
