/* The Charleston Society — design tokens + shared styles
   Palette source of truth. Page layout stays inline in each page;
   colors reference these tokens. Light mode only (brand decision). */

:root {
  /* Brand blues */
  --navy: #16306f;        /* headings, dark sections, button hover */
  --royal: #23479e;       /* links, primary buttons, accents */
  --blue-pale: #eef2fb;   /* striped section backgrounds, numeral chips */

  /* Accents */
  --gold: #f2c744;
  --gold-light: #f6d569;
  --pink: #ec9dbf;        /* dots, tenet borders (decorative — non-text) */
  --pink-dusty: #9d5d7b;  /* kickers, logo subtitle (AA 4.6:1 on white/cream) */
  --pink-deep: #95627b;   /* kickers on cream-gold (AA 4.5:1) */
  --green: #6fae8b;

  /* Text */
  --ink: #22335c;         /* body */
  --ink-2: #35466e;       /* hero subtitle */
  --ink-3: #3d4f76;       /* section body */
  --ink-4: #4a5a80;       /* card body */
  --muted: #5f76a7;       /* card kickers, footer (AA 4.5:1 on white) */
  --muted-2: #65759f;     /* back-home, footnotes (AA 4.6:1 on white) */

  /* Surfaces */
  --cream: #faf6ee;       /* home nav */
  --cream-gold: #fdf6e2;  /* formats sections */
  --chip-pink: #f8dbe6;
  --chip-blue: #dfe8fb;
  --chip-green: #d9ecdf;

  /* On-navy (contact + CTA sections) */
  --on-navy: #f4f6fc;
  --on-navy-body: #c4d0ec;
  --on-navy-label: #a9bae0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: #ffffff; font-family: 'Jost', sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--royal); text-decoration: none; }
a:hover { color: var(--navy); }
::selection { background: var(--chip-pink); color: var(--navy); }
input, textarea, button, select { font-family: inherit; }
@keyframes floatIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* Skip link (visually hidden until focused) */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 8px; font-size: 14px; transition: top 0.15s ease; }
.skip-link:focus { top: 0; color: #fff; }

/* Buttons */
.btn-primary { background: var(--royal); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy); }

/* Site header — navy bar, gold accents (variant G, approved 2026-08-25) */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(22,48,111,0.97); backdrop-filter: blur(10px); }
.site-header nav { max-width: 1200px; margin: 0 auto; padding: 14px clamp(16px, 4vw, 32px); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.logo { display: flex; flex-direction: column; line-height: 1; }
.logo-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 27px; letter-spacing: 0.5px; color: #ffffff; }
.logo-sub { font-family: 'Jost', sans-serif; font-weight: 400; font-size: 10px; letter-spacing: 3.5px; text-transform: uppercase; margin-top: 5px; color: var(--gold); }
.logo:hover .logo-title { color: #ffffff; }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 34px); flex-wrap: wrap; justify-content: flex-end; font-size: 16px; letter-spacing: 0.4px; }
/* Padding gives comfortable tap targets (WCAG 2.5.8) */
.nav-link { display: inline-block; padding: 10px 2px; color: #f4f6fc; }
.nav-link:hover { color: var(--gold); }
.nav-link[aria-current="page"] { color: var(--gold); font-weight: 600; }
.nav-cta { padding: 12px 28px; border-radius: 999px; font-weight: 600; font-size: 16px; letter-spacing: 0.5px; }

/* Mobile menu (progressive enhancement: without JS the links simply wrap as before) */
.nav-toggle { display: none; }
.no-scroll { overflow: hidden; }
@keyframes menuIn { to { opacity: 1; transform: translateY(0); } }
@media (max-width: 860px) {
  .logo-title { font-size: 22px; }
  .logo-sub { font-size: 9px; letter-spacing: 3px; }
  /* backdrop-filter would trap the fixed overlay inside the header (containing block) */
  .js .site-header { backdrop-filter: none; background: var(--navy); }
  .js .site-header nav { flex-wrap: nowrap; }
  .js .logo, .js .nav-toggle { position: relative; z-index: 42; }
  .js .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 44px; height: 44px; background: none; border: none; cursor: pointer; padding: 0; }
  .nav-toggle span { display: block; height: 2px; width: 24px; background: #ffffff; border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .js .nav-links { position: fixed; inset: 0; background: var(--navy); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 90px 24px 56px; z-index: 40; }
  .js .nav-links.open { display: flex; }
  .js .nav-links .nav-link { font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 500; letter-spacing: 0.5px; padding: 12px 10px; opacity: 0; transform: translateY(16px); }
  .js .nav-links .nav-link[aria-current="page"] { color: var(--gold); }
  .js .nav-links .nav-link[aria-current="page"]::after { content: ""; display: block; width: 38px; height: 2px; background: var(--gold); margin: 6px auto 0; border-radius: 2px; }
  .js .nav-links .nav-cta { margin-top: 22px; font-size: 17px; padding: 15px 40px; opacity: 0; transform: translateY(16px); }
  .js .nav-links.open .nav-link, .js .nav-links.open .nav-cta { animation: menuIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
  .js .nav-links.open .nav-link:nth-child(1) { animation-delay: 0.06s; }
  .js .nav-links.open .nav-link:nth-child(2) { animation-delay: 0.12s; }
  .js .nav-links.open .nav-link:nth-child(3) { animation-delay: 0.18s; }
  .js .nav-links.open .nav-link:nth-child(4) { animation-delay: 0.24s; }
  .js .nav-links.open .nav-cta { animation-delay: 0.32s; }
}

/* Full-bleed homepage hero. 112% zoom pushes the watercolor's paper-white
   edges off-screen on wide viewports; cover takes over on phones where the
   sides are cropped anyway. */
.hero-bleed { position: relative; min-height: clamp(440px, 58vw, 640px); background-image: url('assets/charleston-harbor2-bg.jpg'); background-size: 112% auto; background-position: center 30%; }
@media (max-width: 430px) { .hero-bleed { background-size: cover; background-position: center; } }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.86) 34%, rgba(255,255,255,0.4) 62%, rgba(255,255,255,0.05) 100%); }
.hero-ctas { display: flex; gap: 14px 22px; margin-top: 36px; align-items: center; flex-wrap: wrap; }
@media (max-width: 400px) { .hero-ctas { flex-direction: column; align-items: flex-start; gap: 18px; } }
.hero-badge { position: absolute; bottom: 28px; right: 30px; background: var(--gold); color: var(--navy); font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 21px; padding: 12px 26px; border-radius: 999px; box-shadow: 0 14px 30px -14px rgba(0,0,0,0.35); transform: rotate(-3deg); }
@media (max-width: 640px) { .hero-badge { display: none; } }
@media (max-width: 640px) { .hero-scrim { background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.82) 55%, rgba(255,255,255,0.35) 100%); } }

/* Cards (homepage programs) */
.program-card { display: block; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid rgba(35,71,158,0.12); box-shadow: 0 20px 44px -30px rgba(22,48,111,0.4); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.program-card:hover { transform: translateY(-5px); box-shadow: 0 34px 60px -30px rgba(22,48,111,0.5); }

/* Contact section links */
.link-gold { color: var(--on-navy); border-bottom: 1px solid rgba(242,199,68,0.5); padding-bottom: 1px; }
.link-gold:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* Footer */
.site-footer { background: #ffffff; padding: 44px 32px; border-top: 1px solid rgba(35,71,158,0.12); }
.site-footer > div { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px 28px; flex-wrap: wrap; }
.footer-wordmark { font-family: 'Cormorant Garamond', serif; font-size: 20px; color: var(--navy); }
.footer-links { display: flex; align-items: center; gap: 14px; }
.footer-icon { display: inline-flex; padding: 8px; color: var(--navy); }
.footer-icon:hover { color: var(--royal); }
.footer-mail { font-size: 14px; letter-spacing: 0.3px; }
.footer-note { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
