/* Cape Ann Symphony — 75th Anniversary
   Design system */

:root {
  /* Light — Cream & Ink */
  --bg: #F6F1E7;          /* warm cream */
  --bg-elev: #FBF7EE;     /* paper */
  --bg-sunken: #EEE6D4;   /* deeper cream */
  --ink: #15181C;         /* near-black, cool */
  --ink-2: #2C3138;       /* body */
  --ink-3: #5A6069;       /* secondary */
  --ink-4: #8B8F97;       /* tertiary / labels */
  --rule: #D9D0BB;        /* horizontal rules */
  --rule-2: #C8BEA7;
  --accent: #426777;      /* CAS brand deep teal */
  --accent-2: #2F5062;    /* hover */
  --accent-ink: #FBF7EE;  /* text on accent */
  --accent-light: #64abb9;/* CAS secondary light teal */
  --navy: #426777;        /* deep harbor teal (brand) */
  --gold: #B58A2E;        /* muted gold for 75 seal */
  --success: #2E6F4B;
  --focus: #1F5FD2;
  color-scheme: light;
}

.dark {
  --bg: #0E141B;          /* harbor night */
  --bg-elev: #121A23;
  --bg-sunken: #0A0F14;
  --ink: #F3EADA;         /* warm bone */
  --ink-2: #E5DBC8;
  --ink-3: #9FA8B3;
  --ink-4: #6E7782;
  --rule: #25303B;
  --rule-2: #334050;
  --accent: #64abb9;      /* brighter teal in dark */
  --accent-2: #88C3CE;
  --accent-ink: #0E141B;
  --accent-light: #64abb9;
  --navy: #88C3CE;
  --gold: #D9B05A;
  --success: #6DBF8C;
  --focus: #7FA7FF;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Enable common + discretionary ligatures sitewide so Playfair
     display headlines render "fi"/"fl"/"ff"/"ffi" as single glyphs
     instead of letting consecutive letters collide (e.g. "seventy-
     five" on /support/planned). Both properties are inherited, so
     setting them on body cascades to every descendant — Playfair,
     Inter, and Source Serif all carry the same liga tables.
     home.css already sets these per-rule; this base rule makes the
     behaviour the site default rather than opt-in. */
  font-feature-settings: "liga" 1, "dlig" 1;
  font-variant-ligatures: normal;
}

/* type scale multiplier applied via JS for accessibility */
html[data-scale="L"] { font-size: 20px; }
html[data-scale="XL"] { font-size: 22px; }

.sans { font-family: "Inter", "Helvetica Neue", Arial, sans-serif; }
.display { font-family: "Playfair Display", "Times New Roman", serif; font-weight: 500; letter-spacing: -0.01em; }
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; }

h1, h2, h3, h4 { color: var(--ink); font-family: "Playfair Display", serif; font-weight: 500; letter-spacing: -0.01em; line-height: 1.08; }
h1 { font-size: clamp(44px, 6vw, 88px); }
h2 { font-size: clamp(32px, 3.6vw, 52px); }
h3 { font-size: clamp(22px, 2vw, 28px); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* primitives */
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 32px; }

.eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.label {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.rule { height: 1px; background: var(--rule); border: 0; }
.rule-thick { height: 2px; background: var(--ink); border: 0; }

/* buttons — large, clearly-labeled, no icon-only */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.005em;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 2px;
  transition: background 120ms, color 120ms, transform 120ms;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:active { transform: translateY(1px); }

.btn-ink {
  background: var(--ink);
  color: var(--bg);
}
.btn-ink:hover { background: var(--ink-2); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--rule-2);
}
.btn-ghost:hover { border-color: var(--ink-2); color: var(--ink); }

.btn-lg { min-height: 60px; font-size: 18px; padding: 0 34px; }
.btn-sm { min-height: 40px; font-size: 14px; padding: 0 16px; }

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

/* chip / badge */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--ink-2);
  border: 1px solid var(--rule);
}
.chip-accent { background: color-mix(in oklab, var(--accent) 12%, var(--bg)); border-color: color-mix(in oklab, var(--accent) 30%, var(--bg)); color: var(--accent-2); }
.dark .chip-accent { color: var(--accent); }

/* card */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

/* link underline */
.ulink { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ulink:hover { color: var(--accent); }

/* inputs */
.input, .select, .textarea {
  width: 100%;
  font-family: "Inter", sans-serif;
  font-size: 17px;
  padding: 14px 16px;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1.5px solid var(--rule-2);
  border-radius: 2px;
  min-height: 52px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--ink);
}

/* anniversary seal */
.seal-75 {
  display: inline-flex; align-items: center; justify-content: center;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: "Playfair Display", serif;
  position: relative;
}
.seal-75 .num { font-size: 52px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.seal-75 .curved {
  position: absolute; inset: 0;
  font-family: "Inter", sans-serif;
  font-size: 10px; letter-spacing: 0.2em; font-weight: 600; text-transform: uppercase;
}

/* scrollbars — subtle */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* helpers */
.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.stack-32 > * + * { margin-top: 32px; }
.stack-48 > * + * { margin-top: 48px; }

.row { display: flex; align-items: center; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }

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

/* subtle placeholder image styling */
.placeholder-img {
  background: repeating-linear-gradient(
    135deg,
    var(--bg-sunken) 0 12px,
    var(--bg-elev) 12px 24px
  );
  color: var(--ink-4);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; letter-spacing: 0.12em;
  border: 1px solid var(--rule);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Nav defaults */
.nav-links { display: flex; }
.nav-cart-short { display: none; }
.nav-item:hover { background: var(--bg-elev); }
.nav-item:focus-visible { background: var(--bg-elev); outline: 2px solid var(--accent); outline-offset: 0; }
.nav-dropdown { animation: dropdownIn 140ms ease-out; }
@keyframes dropdownIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 1024px) {
  .nav-links { display: none !important; }
  .nav-burger { display: flex !important; }
  .nav-utility { display: none; }
  .nav-label { display: none; }
  .nav-cart-short { display: inline; }
  .nav-main { padding: 12px 18px !important; gap: 10px !important; }
}

/* Tablet + smaller — ease up max-widths, smaller hero type */
@media (max-width: 1024px) {
  .container, .container-narrow { padding: 0 24px; }
  h1 { font-size: clamp(40px, 7vw, 64px); }

  /* flatten any 2-col / 3-col grids set via inline styles (excluding nav dropdowns) */
  div[style*="grid-template-columns"]:not(.nav-dropdown):not(.nav-dropdown *) {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Keep ticket-option trios and certain small card trios 2-up if possible */
  div[style*="1fr 1fr 1fr"]:not(.nav-dropdown):not(.nav-dropdown *) {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 720px) {
  html, body { font-size: 17px; }
  html[data-scale="L"] { font-size: 18px; }
  html[data-scale="XL"] { font-size: 20px; }

  .container, .container-narrow { padding: 0 18px; }

  /* all inline column grids collapse to single column on phones */
  div[style*="grid-template-columns"]:not(.nav-dropdown):not(.nav-dropdown *),
  article[style*="grid-template-columns"],
  section[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Buttons — full width in constrained rows, and wrap */
  div[style*="display: flex"][style*="gap"] {
    flex-wrap: wrap;
  }
  .btn { min-height: 56px; font-size: 16px; padding: 0 20px; }
  .btn-lg { min-height: 60px; padding: 0 22px; font-size: 17px; }
  .btn-sm { min-height: 40px; font-size: 14px; padding: 0 14px; }

  /* Heading scales */
  h1 { font-size: clamp(36px, 10vw, 52px); }
  h2 { font-size: clamp(28px, 7vw, 40px); }
  h3 { font-size: clamp(20px, 5vw, 28px); }

  /* Reduce large padding used on hero/section blocks */
  [style*="padding: '96px"] { padding: 56px 18px !important; }
  [style*="padding: '88px"] { padding: 56px 18px !important; }
  [style*="padding: '72px"] { padding: 48px 18px !important; }
  [style*="padding: 48px"] { padding: 24px !important; }

  /* Hero aspect ratios — allow to breathe */
  div[style*="aspectRatio"], div[style*="aspect-ratio"] {
    aspect-ratio: 4 / 5 !important;
  }

  /* Make fixed-size tweak panel fit */
  div[style*="position: fixed"][style*="width: 280"] { width: calc(100vw - 24px) !important; max-width: 320px; }

  /* Seals + logos that were absolutely positioned — bring inline */
  div[style*="position: absolute"][style*="bottom: -30"] {
    position: static !important;
    margin-top: 20px;
    display: inline-block;
  }
  div[style*="position: absolute"][style*="top: 20"][style*="left: 20"] {
    position: static !important;
    margin-top: 12px;
    display: inline-block;
  }
}

/* extra narrow */
@media (max-width: 480px) {
  .container, .container-narrow { padding: 0 14px; }
  h1 { font-size: clamp(32px, 9vw, 44px); letter-spacing: -0.01em; }

  .btn { width: 100%; }
  .btn-sm { width: auto; }

  /* Tables-ish rows flatten */
  [style*="grid-template-columns"]:not(.nav-dropdown):not(.nav-dropdown *) { grid-template-columns: 1fr !important; }
}

/* ── Password show/hide toggle (site-wide) ────────────────────
   Driven by 2026/js/password-toggle.js — wraps every
   <input type="password"> in a .pw-toggle-wrap and drops an
   eye-icon button on the right inside the input. */
.pw-toggle-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.pw-toggle-wrap > input {
  width: 100%;
  padding-right: 44px;
}
.pw-toggle-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 6px;
  cursor: pointer;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: color 120ms;
}
.pw-toggle-btn:hover  { color: var(--ink); }
.pw-toggle-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
