/* ==========================================================================
   JC Dance Academy — site styles
   Plain CSS, no framework, no build step. Same approach as MPB-Events.
   Colours are lifted from the vector logo; see build/brand/PALETTE.md.
   ========================================================================== */

:root {
  /* Brand — exact values from the logo artwork */
  --jc-magenta: #EC008C;
  --jc-cyan:    #00AEEF;
  --jc-yellow:  #FFF200;
  --jc-green:   #6EBD44;
  --jc-orange:  #E77724;
  --jc-purple:  #712A84;
  --jc-ink:     #231F20;

  /* Derived — darkened for text use where the pure brand colour fails AA */
  --jc-magenta-text: #C4007A;
  --jc-cyan-text:    #0079A6;

  /* Neutrals */
  --paper:      #FFFFFF;
  --paper-alt:  #FAF8F7;
  --rule:       #E6E1DF;
  --muted:      #6B6462;

  /* Type */
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;

  /* Rhythm */
  --gap: 1.5rem;
  --measure: 68ch;
  --wrap: 1140px;
  --radius: 10px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--jc-ink);
  background: var(--paper);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: var(--jc-ink);
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.15em; max-width: var(--measure); }

a { color: var(--jc-magenta-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--jc-ink); }

img { max-width: 100%; height: auto; display: block; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* Visible focus for keyboard users — the WP theme had none. */
:focus-visible { outline: 3px solid var(--jc-cyan); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--jc-ink); color: #fff; padding: 0.7rem 1.1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(1.4) blur(8px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap); padding: 0.7rem 0;
}
.logo img { width: 200px; }

.nav-toggle {
  display: none; font: inherit; background: none; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 6px; padding: 0.45rem 0.8rem;
}

.nav ul { display: flex; gap: 1.35rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a {
  color: var(--jc-ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 0.3rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--jc-magenta); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; }
  .nav[data-open="true"] { display: block; }
  .site-header .wrap { flex-wrap: wrap; }
  .nav ul { flex-direction: column; gap: 0; padding-bottom: 0.75rem; }
  .nav li { border-top: 1px solid var(--rule); }
  .nav a { display: block; padding: 0.75rem 0; }
}

/* ---------- Hero ---------- */

.hero { position: relative; background: var(--jc-ink); color: #fff; }
.hero img { width: 100%; max-height: 62vh; object-fit: cover; opacity: 0.55; }
.hero-copy {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding-block: 2rem;
  /* Scrim weighted to the left, where the copy sits, so the photograph still
     reads on the right rather than being flattened by a full-width wash. */
  background: linear-gradient(90deg, rgba(35,31,32,0.72) 0%, rgba(35,31,32,0.45) 45%, rgba(35,31,32,0.08) 100%);
}
.hero-copy .wrap { width: min(100% - 2.5rem, var(--wrap)); }
.hero h1 { color: #fff; max-width: 20ch; text-shadow: 0 2px 18px rgba(0,0,0,0.55); }
.hero h1 em { font-style: italic; font-weight: 400; }
.hero p { color: #fff; max-width: 46ch; font-size: 1.15rem; text-shadow: 0 1px 12px rgba(0,0,0,0.6); }

@media (max-width: 700px) {
  .hero img { max-height: 44vh; }
  .hero-copy { position: static; background: var(--jc-ink); }
  .hero p { font-size: 1rem; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block; font-weight: 700; text-decoration: none;
  padding: 0.75rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--jc-magenta); color: #fff; }
.btn-primary:hover { background: var(--jc-magenta-text); color: #fff; }
.btn-ghost { border-color: currentColor; color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--jc-ink); }
.btn-row { display: flex; gap: 0.85rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-alt { background: var(--paper-alt); }
.section-head { margin-bottom: 2rem; }
.section-head p { color: var(--muted); }

.prose { max-width: var(--measure); }

/* ---------- Timetable ---------- */

.tt-controls {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule); padding-bottom: 1rem;
}
.tt-day {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.5rem 1.05rem; color: var(--jc-ink);
}
.tt-day[aria-pressed="true"] { background: var(--jc-ink); border-color: var(--jc-ink); color: #fff; }
.tt-day:hover { border-color: var(--jc-ink); }

.tt-day-block + .tt-day-block { margin-top: 2.25rem; }
.tt-day-block h3 {
  font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); border-bottom: 2px solid var(--rule);
  padding-bottom: 0.5rem; margin-bottom: 0;
}

.tt-list { list-style: none; margin: 0; padding: 0; }
.tt-row {
  display: grid;
  /* Wide enough for the longest range the data produces ("11.40am–12.10pm")
     without wrapping into the class name. */
  grid-template-columns: minmax(11.5rem, max-content) 1fr auto;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.tt-time { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.tt-name { font-weight: 600; }
.tt-name a { color: inherit; text-decoration: none; }
.tt-name a:hover { color: var(--jc-magenta-text); text-decoration: underline; }
.tt-meta { color: var(--muted); font-size: 0.92rem; }
.tt-where { color: var(--muted); font-size: 0.92rem; white-space: nowrap; }

@media (max-width: 620px) {
  .tt-row { grid-template-columns: 1fr; gap: 0.15rem; padding: 0.9rem 0; }
  .tt-where { white-space: normal; }
}

.tt-note { color: var(--muted); font-size: 0.92rem; margin-top: 1.5rem; }
.tt-empty { color: var(--muted); padding: 1.5rem 0; }

/* ---------- Cards ---------- */

.cards { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; background: var(--paper);
  display: flex; flex-direction: column;
}
.card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.card-body { padding: 1.15rem 1.25rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin-bottom: 0.35rem; }
.card p { font-size: 0.96rem; color: var(--muted); flex: 1; }
.card .card-link { font-weight: 700; text-decoration: none; }
.card .card-link::after { content: " →"; }

.card-accent { border-top: 4px solid var(--rule); }
.accent-early  { border-top-color: var(--jc-green); }
.accent-kids   { border-top-color: var(--jc-orange); }
.accent-adult  { border-top-color: var(--jc-cyan); }

/* ---------- Awards strip ---------- */

.awards { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.awards img { width: 130px; flex: none; }
.awards .prose { flex: 1 1 320px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--jc-ink); color: #fff; padding-block: 3rem 2rem; margin-top: 3rem; }
.site-footer a { color: #fff; }
.site-footer .cols {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.site-footer h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; font-size: 0.95rem; }
.site-footer .logo-foot { width: 190px; margin-bottom: 1rem; }
.site-footer p { color: #D6D0CE; font-size: 0.95rem; }
.colophon {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #3D3839;
  font-size: 0.85rem; color: #A9A2A0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Teacher profiles ---------- */

.teacher { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 2.25rem; align-items: start; }
.teacher > img { border-radius: var(--radius); width: 100%; }
.teacher h2 { margin-bottom: 0.15rem; }
.teacher .post-noms { font-size: 0.62em; font-weight: 400; color: var(--muted); white-space: nowrap; }
.teacher .role {
  color: var(--jc-magenta-text); font-weight: 700;
  font-size: 0.95rem; margin-bottom: 1.2rem;
}
.teacher details { margin-top: 0.5rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.teacher summary { cursor: pointer; font-weight: 700; }
.teacher details ul { margin: 0.9rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.95rem; }
.teacher details li { margin-bottom: 0.25rem; }

@media (max-width: 720px) {
  .teacher { grid-template-columns: 1fr; gap: 1.5rem; }
  .teacher > img { max-width: 280px; }
}

/* ---------- Internal notes ----------
   Working notes for Mike and Jenny. Hidden by default and revealed only on
   the preview host (or a local file:// copy), so an unresolved note can never
   reach the public site — which means no note is ever a launch blocker.
   Same self-retiring principle as the noindex header and preview banner. */

.internal-note { display: none; }
[data-preview="true"] .internal-note { display: block; }

.internal-note {
  background: #FFF8E1;
  border: 1px solid #F0C36D;
  border-left: 5px solid var(--jc-orange);
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  max-width: var(--measure);
}

/* ---------- Offline preview banner ---------- */

.preview-banner {
  background: var(--jc-purple); color: #fff;
  padding: 0.6rem 1rem; text-align: center; font-size: 0.9rem;
}
.preview-banner strong { font-weight: 700; }

/* Teacher portraits arrive at assorted aspect ratios (some were transparent
   PNGs, trimmed to their content). Normalise so the column reads evenly. */
.teacher > img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; }

/* ---------- Galleries ---------- */

.gallery {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.gallery img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius); background: var(--rule);
}

/* ---------- Lede ---------- */

.lede { font-size: 1.2rem; color: var(--muted); }

/* ---------- Competition results ---------- */

.result-block { margin-bottom: 2rem; }
.result-block h3 {
  font-size: 1.05rem; padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--jc-magenta); display: inline-block;
}
.result-cat {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; color: var(--muted); margin: 0.9rem 0 0.35rem;
}
.result-block ul { margin: 0; padding-left: 1.2rem; }
.result-block li { margin-bottom: 0.2rem; }

/* ---------- Annual show video links ---------- */

.show-card {
  display: flex; flex-direction: column; justify-content: center;
  gap: 0.2rem; text-decoration: none;
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.4rem 1.25rem; background: var(--paper);
  color: var(--jc-ink); font-weight: 600;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.show-card:hover { border-color: var(--jc-magenta); transform: translateY(-2px); color: var(--jc-ink); }
.show-year {
  font-family: var(--font-head); font-size: 2rem; font-weight: 700;
  line-height: 1; color: var(--jc-magenta-text);
}
.show-card::after { content: "Watch on YouTube →"; font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }

/* ---------- FAQ ---------- */

.faq { margin: 2rem 0; max-width: var(--measure); }
.faq details {
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0 1.15rem; margin-bottom: 0.7rem; background: var(--paper);
}
.faq summary {
  cursor: pointer; font-weight: 700; font-family: var(--font-head);
  font-size: 1.08rem; padding: 1rem 0; list-style-position: outside;
}
.faq details[open] summary { border-bottom: 1px solid var(--rule); }
.faq details p { margin: 1rem 0; }
.faq details p:last-child { margin-bottom: 1.15rem; }

/* ---------- Spec lists (studio hire) ---------- */

.spec { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.95rem; color: var(--muted); }
.spec li { padding: 0.3rem 0 0.3rem 1.35rem; position: relative; }
.spec li::before {
  content: ""; position: absolute; left: 0; top: 0.85em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--jc-cyan);
}

/* ---------- Tables ----------
   Wrapped so a wide table scrolls inside its own box rather than pushing
   the whole page sideways on a phone. */

.table-wrap { overflow-x: auto; margin: 1.5rem 0; max-width: var(--measure); }
table { border-collapse: collapse; width: 100%; font-size: 0.96rem; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--rule); }
th { font-family: var(--font-head); background: var(--paper-alt); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }

/* "Coming soon" stand-in for content not yet supplied. Reads as intentional
   rather than broken, and needs no explanation to a visitor. */
.coming-soon {
  font-family: var(--font-head);
  font-size: 1.15rem; font-weight: 700;
  color: var(--muted);
  border: 1px dashed var(--rule); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; display: inline-block;
}

/* ---------- Class page hero ---------- */

.class-hero { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 2.5rem; align-items: start; }
.class-hero > img { border-radius: var(--radius); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.class-hero h1 { margin-top: -0.15em; }

@media (max-width: 800px) {
  .class-hero { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- Forms ---------- */

.jc-form { max-width: 46rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; font-size: 0.95rem; }
.field .req { color: var(--jc-magenta-text); }
.field .opt { font-weight: 400; color: var(--muted); font-size: 0.85em; }

.jc-form input[type="text"],
.jc-form input[type="email"],
.jc-form input[type="tel"],
.jc-form textarea {
  width: 100%; font: inherit; color: var(--jc-ink);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--paper);
}
.jc-form textarea { resize: vertical; min-height: 7rem; }
.jc-form input:focus, .jc-form textarea:focus { border-color: var(--jc-cyan); }

/* Honeypot — off-screen rather than display:none, which some bots detect. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cf-turnstile { margin: 0.5rem 0 1.25rem; }

.form-status { margin: 0 0 1rem; padding: 0; font-size: 0.97rem; }
.form-status:empty { display: none; }
.form-status-working { color: var(--muted); }
.form-status-ok {
  color: #1B5E20; background: #EDF7ED; border: 1px solid #A5D6A7;
  border-radius: 8px; padding: 0.85rem 1rem;
}
.form-status-error {
  color: #8E1B1B; background: #FDECEA; border: 1px solid #F5A9A2;
  border-radius: 8px; padding: 0.85rem 1rem;
}

.jc-form button[type="submit"][disabled] { opacity: 0.6; cursor: progress; }
.form-fallback { font-size: 0.9rem; color: var(--muted); margin-top: 1rem; }

/* ---------- Members area ---------- */

.syllabus-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.syllabus-list li { border-top: 1px solid var(--rule); }
.syllabus-list li:first-child { border-top: none; }
.syllabus-list a { display: block; padding: 0.6rem 0; text-decoration: none; font-weight: 600; }
.syllabus-list a:hover { color: var(--jc-magenta-text); text-decoration: underline; }

.crumb { font-size: 0.92rem; margin-bottom: 0.75rem; }
.video-list { margin: 1.5rem 0; }
