/* ==========================================================================
   Tar Heel Tennis Camps — Base theme
   Built on tokens.css. WCAG 2.2 AA-minded. Mobile-first.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--leading-heading);
  color: var(--color-navy);
  margin: 0 0 var(--space-4);
  font-weight: 700;
  letter-spacing: .01em;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: 600; }

p { margin: 0 0 var(--space-4); }

a {
  color: var(--color-link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.text-muted { color: var(--color-slate-400); }
.text-secondary { color: var(--color-slate-700); }
.small { font-size: var(--text-small); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section { padding-block: var(--space-16); }
.section--surface { background: var(--color-surface); }
.section--navy { background: var(--color-navy); color: var(--color-white); }
.section--navy h1, .section--navy h2, .section--navy h3 { color: var(--color-white); }

.stack > * + * { margin-top: var(--space-4); }

.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ---------- Skip link (a11y) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-navy);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  z-index: 100;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-body);
  line-height: 1;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible {
  outline: 3px solid var(--color-carolina-blue);
  outline-offset: 2px;
}

.btn--primary { background: var(--color-navy); color: var(--color-white); }
.btn--primary:hover { background: #0d1c34; }

.btn--secondary { background: var(--color-carolina-blue); color: var(--color-navy); }
.btn--secondary:hover { background: #3b8ac2; }

.btn--outline { background: transparent; color: var(--color-navy); border-color: var(--color-navy); }
.btn--outline:hover { background: var(--color-navy); color: var(--color-white); }

.btn--ghost { background: transparent; color: var(--color-navy); }
.btn--ghost:hover { background: var(--color-surface); }

.btn--lg { padding: 16px 32px; font-size: 1.125rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-navy);
  color: var(--color-white);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.nav__brand:hover { text-decoration: none; }
.nav__brand .ball {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-carolina-blue);
  box-shadow: inset 0 0 0 2px var(--color-navy);
  display: inline-block;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin: 0; padding: 0;
}
.nav__links a {
  color: var(--color-white);
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
  text-decoration: none;
  border-bottom-color: var(--color-carolina-blue);
}
.nav__toggle {
  display: none;
  background: none; border: 0; color: #fff;
  font-size: 1.5rem; cursor: pointer; padding: var(--space-2);
}

@media (max-width: 820px) {
  .nav__toggle { display: block; }
  .nav__links {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 64px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--color-navy);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .nav__links.is-open { display: flex; }
  .nav__links li { width: 100%; }
  .nav__links a { display: block; width: 100%; padding: var(--space-3) 0; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(rgba(19,41,75,.84) 0%, rgba(19,41,75,.70) 45%, rgba(19,41,75,.58) 100%),
    url("/images/chewning-dual-match.jpeg") center 60% / cover no-repeat,
    var(--color-navy);
  color: var(--color-white);
  padding-block: var(--space-16);
  text-align: center;
}
.hero h1 { color: var(--color-white); font-size: var(--text-display); }
.hero p { font-size: 1.125rem; max-width: 56ch; margin-inline: auto; color: #e6edf5; }
.hero__actions {
  display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap;
  margin-top: var(--space-8);
}
.hero__eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  font-size: var(--text-small);
  color: var(--color-carolina-blue);
  margin-bottom: var(--space-3);
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}
.card__meta { color: var(--color-slate-400); font-size: var(--text-small); }
.card__price { font-family: var(--font-heading); font-size: 1.5rem; color: var(--color-navy); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: var(--text-small);
  font-weight: 600;
  padding: 2px 12px;
  border-radius: var(--radius-full);
  line-height: 1.5;
}
.badge--success { background: #e3f3ea; color: var(--color-success); }
.badge--warning { background: #fbefdd; color: var(--color-warning); }
.badge--error   { background: #f8e4e1; color: var(--color-error); }
.badge--info    { background: #e4f0f9; color: var(--color-link); }
.badge--slate   { background: var(--color-surface); color: var(--color-slate-700); }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--space-4); }
.field label {
  display: block;
  font-weight: 600;
  font-size: var(--text-small);
  color: var(--color-navy);
  margin-bottom: var(--space-2);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  color: var(--color-ink);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-carolina-blue);
  box-shadow: 0 0 0 3px rgba(75,156,211,.25);
}
.field .error { color: var(--color-error); font-size: var(--text-small); margin-top: var(--space-2); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-navy);
  color: #cdd7e4;
  padding-block: var(--space-12);
}
.site-footer a { color: var(--color-white); }
.site-footer h4 { color: var(--color-white); font-family: var(--font-heading); margin-bottom: var(--space-3); }
.footer__grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.footer__bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: var(--text-small);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3);
}

/* ---------- Lead / intro text ---------- */
.lead {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--color-slate-700);
  max-width: 70ch;
}
.section__head { max-width: 64ch; margin-inline: auto; }

/* ---------- Eyebrow (section kicker) ---------- */
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  font-size: var(--text-small);
  color: var(--color-link);
  margin-bottom: var(--space-2);
}

/* ---------- Split (text + media) ---------- */
.split {
  display: grid;
  gap: var(--space-12);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--reverse > :first-child { order: 2; }
}

/* ---------- Media placeholder (until real photos arrive) ---------- */
/* Real photo in a content slot (the filled counterpart to .media-placeholder). */
.media {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(45deg, #e8eef5, #e8eef5 12px, #eef3f8 12px, #eef3f8 24px);
  border: 1px dashed var(--color-slate-400);
  color: var(--color-slate-700);
  font-weight: 600;
  font-size: var(--text-small);
  padding: var(--space-4);
}

/* ---------- Feature list ---------- */
.features {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
/* Symmetrical layout: 1 col (mobile) -> 2 (tablet) -> 3 (desktop) */
.features--3 { grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .features--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 920px) {
  .features--3 { grid-template-columns: repeat(3, 1fr); }
}
.feature {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.feature__icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: #e4f0f9;
  color: var(--color-navy);
  font-size: 1.25rem;
}
.feature h3 { margin: 0 0 var(--space-1); font-size: var(--text-h3); }
.feature p { margin: 0; color: var(--color-slate-700); font-size: var(--text-small); }

/* ---------- Coaches ---------- */
.coach { display: flex; gap: var(--space-4); align-items: flex-start; }
.coach__avatar {
  flex: 0 0 auto;
  width: 72px; height: 72px; border-radius: var(--radius-full);
  background: var(--color-navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 1.25rem;
  object-fit: cover;            /* when rendered as <img> */
  object-position: top center;
}
.coach h3 { margin: 0; }
.coach .role { color: var(--color-link); font-weight: 600; font-size: var(--text-small); }
.coach ul { margin: var(--space-2) 0 0; padding-left: 1.1em; color: var(--color-slate-700); font-size: var(--text-small); }

/* ---------- Urgency callout ---------- */
.callout {
  display: flex; gap: var(--space-3); align-items: center;
  background: #fbefdd; border: 1px solid #f0dcc0;
  color: #8a5500;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 600;
}

/* ---------- Schedule table ---------- */
.schedule {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.schedule caption {
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-navy);
  padding: var(--space-3) 0;
}
.schedule th, .schedule td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-small);
}
.schedule tr:last-child td { border-bottom: 0; }
.schedule th {
  width: 38%;
  color: var(--color-navy);
  font-weight: 600;
  background: var(--color-surface);
  white-space: nowrap;
}

/* ---------- Price card ---------- */
.price-card {
  text-align: center;
}
.price-card .amount {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-navy);
  line-height: 1;
  margin: var(--space-2) 0;
}
.price-card .per { color: var(--color-slate-400); font-size: var(--text-small); }
.price-card ul {
  list-style: none; padding: 0; margin: var(--space-4) 0 0;
  text-align: left; color: var(--color-slate-700); font-size: var(--text-small);
}
.price-card li { padding: var(--space-2) 0; border-top: 1px solid var(--color-border); }

/* ---------- Director profile ---------- */
.profile {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 720px) {
  .profile { grid-template-columns: 240px 1fr; }
  .profile--reverse { grid-template-columns: 1fr 240px; }
  .profile--reverse .profile__photo { order: 2; }
}
.profile__photo {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--color-surface);
}
.profile .role {
  color: var(--color-link);
  font-weight: 600;
}
.profile .accolades {
  margin: var(--space-4) 0 0;
  padding-left: 1.1em;
  color: var(--color-slate-700);
}
.profile .accolades li { margin-bottom: var(--space-2); }

/* ---------- FAQ accordion (native details/summary) ---------- */
.faq-list { max-width: 820px; margin-inline: auto; }
.faq-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}
.faq-item > summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-carolina-blue);
  flex: 0 0 auto;
}
.faq-item[open] > summary::after { content: "\2013"; }
.faq-item > summary:focus-visible {
  outline: 3px solid var(--color-carolina-blue);
  outline-offset: -3px;
  border-radius: var(--radius-md);
}
.faq-body { padding: 0 var(--space-6) var(--space-5); color: var(--color-slate-700); }
.faq-body p:first-child { margin-top: 0; }
.faq-body ul { margin: 0; padding-left: 1.2em; }
.faq-body li { margin-bottom: var(--space-2); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  gap: var(--space-12);
  grid-template-columns: 1fr;
}
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-map {
  width: 100%; height: 320px; border: 0;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.alert--success {
  background: #e3f3ea; border: 1px solid #bfe3cd; color: var(--color-success);
  padding: var(--space-4) var(--space-6); border-radius: var(--radius-md);
  margin-bottom: var(--space-6); font-weight: 600;
}

/* ---------- Auth ---------- */
.auth { max-width: 460px; margin-inline: auto; }
.auth__alt { text-align: center; margin-top: var(--space-6); font-size: var(--text-small); }
.auth .field:last-of-type { margin-bottom: var(--space-6); }
.checkbox {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-small); color: var(--color-slate-700);
}
.checkbox input { width: auto; min-height: 0; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.alert--error {
  background: #f8e4e1; border: 1px solid #eecac4; color: var(--color-error);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  margin-bottom: var(--space-4); font-size: var(--text-small);
}

/* ---------- Selectable choice (radio cards) ---------- */
.choice {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--color-carolina-blue);
  box-shadow: 0 0 0 2px rgba(75,156,211,.25);
}
.choice input { width: auto; min-height: 0; flex: 0 0 auto; }
.choice__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--space-2); }
.choice__title { font-family: var(--font-heading); font-weight: 600; color: var(--color-navy); }
.choice__meta { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.choice__price { font-family: var(--font-heading); font-size: 1.25rem; color: var(--color-navy); }

/* ---------- Stat bar (home "at a glance") ---------- */
.statbar {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(2, 1fr);
  text-align: center;
}
@media (min-width: 760px) { .statbar { grid-template-columns: repeat(4, 1fr); } }
/* Flows to whatever the stat count is — used where it comes from config. */
.statbar--auto { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
@media (min-width: 760px) { .statbar--auto { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.stat { display: flex; flex-direction: column; gap: var(--space-1); }
.stat__num {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  line-height: 1;
  color: var(--color-navy);
}
.stat__label { font-size: var(--text-small); color: var(--color-slate-700); }
.card__price-unit { font-size: 1rem; color: var(--color-slate-400); }

/* ---------- Day columns on /format ---------- */
.sched-day__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-navy);
}
.sched-day__title span {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  color: var(--color-slate-700);
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Roster table (coach dashboard) ---------- */
.roster-scroll { overflow-x: auto; }
.roster {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-small);
}
.roster th, .roster td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.roster thead th {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-weight: 600;
  white-space: nowrap;
}
.roster tbody tr:last-child td { border-bottom: 0; }
.roster__lineup {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 30px; padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: var(--font-heading);
  color: var(--color-navy);
}
.roster__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Checklist (what's included) ---------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding: var(--space-2) 0 var(--space-2) 1.8em;
  border-top: 1px solid var(--color-border);
  color: var(--color-slate-700);
}
.checklist li:first-child { border-top: 0; }
.checklist li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--color-success);
  font-weight: 700;
}

/* ---------- Steps (an ordered sequence, e.g. the format rounds) ---------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li {
  position: relative;
  counter-increment: step;
  padding: var(--space-3) 0 var(--space-3) 2.6em;
  border-top: 1px solid var(--color-border);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: var(--space-3);
  width: 1.9em; height: 1.9em;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: #e4f0f9;
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-small);
}
.steps li:first-child::before { top: 0; }
.steps h3 { margin: 0 0 var(--space-1); font-size: var(--text-h3); }
.steps p { margin: 0; color: var(--color-slate-700); font-size: var(--text-small); }

/* ---------- Modal (native <dialog>) ---------- */
.modal {
  width: min(540px, calc(100vw - var(--space-8)));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--color-white);
  color: var(--color-ink);
}
.modal::backdrop { background: rgba(19, 41, 75, .55); }
.modal__head {
  display: flex; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-6) var(--space-6) 0;
}
.modal__head h2 { margin: 0; font-size: var(--text-h3); flex: 1 1 auto; }
.modal__body { padding: var(--space-4) var(--space-6); color: var(--color-slate-700); }
.modal__body > :first-child { margin-top: 0; }
.modal__body > :last-child { margin-bottom: 0; }
.modal__detail {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.modal__detail dt {
  font-size: var(--text-small); color: var(--color-slate-400);
  text-transform: uppercase; letter-spacing: .04em;
}
.modal__detail dd {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading); color: var(--color-navy);
}
.modal__detail dd:last-child { margin-bottom: 0; }
.modal__policy {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-carolina-blue);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: var(--text-small);
}
.modal__foot {
  display: flex; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-4) var(--space-6) var(--space-6);
}
.btn--danger { background: var(--color-error); color: var(--color-white); border-color: var(--color-error); }
.btn--danger:hover { background: #a5301f; border-color: #a5301f; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
