/* ==========================================================================
   Flow Yoga Studio booking page
   Colors, fonts and spacing are set once here. Change them here to restyle the page.
   Text colors were checked against WCAG AA contrast (4.5:1 or better).
   ========================================================================== */

:root {
  /* Colors */
  --cream: #F7F2E8;          /* page background */
  --cream-deep: #EFE7D8;     /* subtle panels */
  --card: #FFFDF8;           /* cards and form */
  --line: #E2DACB;           /* borders */
  --sage: #8A9A7B;           /* decoration only (borders, icons). Too light for text. */
  --sage-soft: #DCE3D3;      /* badges and highlights */
  --sage-deep: #4F5D45;      /* buttons, links */
  --sage-darker: #3F4B37;    /* button hover, text on sage-soft */
  --ink: #2F3A2B;            /* main text */
  --muted: #5E6657;          /* secondary text */
  --full-bg: #EFEBE3;        /* full class badge */
  --full-ink: #6E6A60;
  --error: #9B3B2E;
  --error-bg: #FBEDE9;

  /* Typography */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Shape and spacing */
  --radius: 14px;
  --radius-sm: 8px;
  --space: 1rem;
  --shadow: 0 1px 2px rgba(47, 58, 43, 0.04), 0 6px 20px rgba(47, 58, 43, 0.06);
  --max-width: 68rem;

  color-scheme: light;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

main { flex: 1; outline: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 6vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 4vw, 1.85rem); }
h3 { font-size: 1.4rem; }
h1:focus, h2:focus { outline: none; }

p { margin: 0 0 1em; }

a { color: var(--sage-deep); text-underline-offset: 0.15em; }
a:hover { color: var(--sage-darker); }

:focus-visible {
  outline: 3px solid var(--sage-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
}

.visually-hidden {
  position: absolute !important;
  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: var(--space);
  top: -100px;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--sage-deep);
  color: var(--card);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space); color: var(--card); }

/* ---------- Header and footer ---------- */

.site-header {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand__mark {
  width: 2.25rem; height: 2.25rem;
  fill: none;
  stroke: var(--sage-deep);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.brand__place {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 2.5rem;
  background: var(--cream-deep);
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer__inner { display: grid; gap: 0.75rem; }
.site-footer__name { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); margin: 0; }
.site-footer address { font-style: normal; }
.site-footer a { display: inline-block; padding: 0.2rem 0; }
.site-footer__note { margin: 0; }

/* ---------- Shared bits ---------- */

.status, .notice {
  margin: 2.5rem 0;
  color: var(--muted);
}
.notice {
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.intro { padding: 2.5rem 0 1rem; max-width: 40rem; }
.intro p { color: var(--muted); font-size: 1.05rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--sage-deep);
  color: var(--card);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.button:hover { background: var(--sage-darker); color: var(--card); }
.button[disabled] { opacity: 0.7; cursor: progress; }
.button--block { width: 100%; }
.button--quiet {
  background: transparent;
  color: var(--sage-deep);
  box-shadow: inset 0 0 0 1.5px var(--sage-deep);
}
.button--quiet:hover { background: var(--sage-soft); color: var(--sage-darker); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  margin-top: 1.25rem;
  font-weight: 500;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-darker);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge--low { background: var(--sage-deep); color: var(--card); }
.badge--full { background: var(--full-bg); color: var(--full-ink); }

/* ---------- Class list ---------- */

/* ---------- Filters ---------- */

.filters-box {
  max-width: 46rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filters-box summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.filters-box summary::-webkit-details-marker { display: none; }
.filters-box summary::before {
  /* Funnel icon */
  content: "";
  width: 1.1rem; height: 1.1rem;
  background: var(--sage-deep);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18l-7 8.5V19l-4 2v-7.5z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18l-7 8.5V19l-4 2v-7.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.filters-box summary::after {
  content: "";
  margin-left: auto;
  width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-0.15rem);
  transition: transform 0.2s ease;
}
.filters-box[open] summary::after { transform: rotate(-135deg) translateY(-0.1rem); }
.filters-box__active { font-weight: 500; color: var(--muted); }

.filters {
  display: grid;
  gap: 1rem;
  padding: 0.25rem 1.25rem 1rem;
}
.filters__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.filters__group legend {
  margin-bottom: 0.45rem;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip > span {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.chip:hover > span { border-color: var(--sage); }
.chip input:checked + span { background: var(--sage-deep); border-color: var(--sage-deep); color: var(--card); }
.chip input:focus-visible + span { outline: 3px solid var(--sage-deep); outline-offset: 2px; }

.filters__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  font-weight: 500;
  cursor: pointer;
}
.switch input { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--sage-deep); }

.link-button {
  min-height: 2.75rem;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--sage-deep);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.link-button[hidden] { display: none; }

.filters__count {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.notice--empty { max-width: 46rem; text-align: center; }
.notice--empty p { margin-bottom: 0.75rem; }

/* ---------- Day groups ---------- */

.day { margin-top: 2rem; }
.day__title {
  /* Stays at the top while scrolling through that day's classes. */
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0;
  padding: 0.6rem 0 0.5rem;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.day__relative {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.class-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.class-card {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.25rem 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.class-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(47, 58, 43, 0.1); }
.class-card:focus-within { outline: 3px solid var(--sage-deep); outline-offset: 3px; }
.class-card.is-full { border-left-color: var(--line); background: #FBF8F2; }

.class-card__time {
  grid-row: span 3;
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
}
.class-card__duration { font-size: 0.85rem; font-weight: 400; color: var(--muted); }

.class-card__title { margin: 0; font-size: 1.45rem; }
/* The whole card is clickable through the title link. */
.class-card__title a { color: var(--ink); text-decoration: none; }
.class-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.class-card__title a:focus-visible { outline: none; }

.class-card__meta { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Spots left: text first, with a small bar showing how much space is left. */
.class-card__spots {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.spots-text { font-weight: 600; color: var(--sage-darker); white-space: nowrap; }
.spots-meter {
  flex: 1;
  max-width: 9rem;
  height: 6px;
  border-radius: 999px;
  background: var(--sage-soft);
  overflow: hidden;
}
.spots-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--sage-deep); }
.class-card__price { margin-left: auto; font-weight: 600; }

.class-card.is-low { border-left-color: var(--sage-deep); }
.class-card.is-low .spots-text::before {
  content: "";
  display: inline-block;
  width: 0.5rem; height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--sage-deep);
  vertical-align: 0.1em;
}
.class-card.is-full .spots-text { color: var(--full-ink); font-weight: 500; }
.class-card.is-full .spots-meter { display: none; }
.class-card.is-full .class-card__title a { color: var(--muted); }

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

.class-page { padding-top: 1rem; }
.class-page__header { margin: 1rem 0 1.5rem; }
.class-page__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 0 0 1.75rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.details dt {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.details dd { margin: 0.1rem 0 0; font-weight: 500; }

.class-page__body h2 { font-size: 1.4rem; margin-top: 1.5rem; }

.panel {
  padding: 1.5rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 1rem;
}
.panel__lead { color: var(--muted); }
.panel--full { background: var(--cream-deep); box-shadow: none; }
.panel--full .button { margin: 0.25rem 0.5rem 0.25rem 0; }

/* Mobile shortcut to the form. Hidden on wide screens and once the form is visible. */
.jump-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 1.5rem calc(var(--space) * -1) 0;
  padding: 0.75rem var(--space) calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(247, 242, 232, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.jump-bar[hidden] { display: none; }

/* ---------- Form ---------- */

.field { margin-bottom: 1.15rem; }
.field label,
.field .label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
}
.field .optional { font-weight: 400; color: var(--muted); }
.hint { display: block; margin: -0.1rem 0 0.4rem; font-size: 0.9rem; color: var(--muted); }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #B9B2A3;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px stops iOS from zooming in on focus */
}
textarea { min-height: 6rem; resize: vertical; }
input:focus-visible,
textarea:focus-visible { outline: 3px solid var(--sage-deep); outline-offset: 1px; border-color: var(--sage-deep); }
[aria-invalid="true"] { border-color: var(--error); }

.checkbox {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.6rem;
  align-items: start;
  font-weight: 400;
}
.checkbox input {
  width: 1.35rem; height: 1.35rem;
  margin: 0.15rem 0 0;
  accent-color: var(--sage-deep);
}
.field .checkbox { font-weight: 400; }

.field-error {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  color: var(--error);
  font-size: 0.92rem;
  font-weight: 500;
}
.field-error:empty { display: none; }
.field-error::before { content: "!"; font-weight: 700; }

.form-alert {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--error);
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  color: var(--ink);
}
.form-alert:empty { display: none; }
.form-alert:focus { outline: 3px solid var(--error); outline-offset: 2px; }
.form-alert p { margin: 0 0 0.35rem; font-weight: 600; }
.form-alert ul { margin: 0; padding-left: 1.2rem; }
.form-alert a { color: var(--error); }

.form-small { margin: 0.85rem 0 0; font-size: 0.88rem; color: var(--muted); }

/* Spam trap. Hidden from people and screen readers, bots tend to fill it in. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Confirmation ---------- */

.confirmation { max-width: 36rem; margin: 2.5rem auto 0; text-align: center; }
.confirmation__icon {
  width: 4rem; height: 4rem;
  margin: 0 auto 1rem;
  padding: 0.9rem;
  border-radius: 50%;
  background: var(--sage-soft);
  stroke: var(--sage-deep);
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.confirmation .details { text-align: left; margin-top: 1.5rem; }
.confirmation .details .span-2 { grid-column: 1 / -1; }
.reference { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.04em; }
.next-steps {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--cream-deep);
  border-radius: var(--radius);
  text-align: left;
}
.next-steps h2 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.next-steps p { margin: 0; }

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
  .container { padding: 0 1.5rem; }
  .day { max-width: 46rem; } /* one calm column; most days have only one or two classes */
  .details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer__inner { grid-template-columns: 1fr 1fr 1fr; align-items: start; }
}

@media (min-width: 60rem) {
  .class-page__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }
  .class-page__layout .panel { position: sticky; top: 1.5rem; }
  .jump-bar { display: none; }
}

/* ---------- Preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .class-card:hover { transform: none; }
}

@media (forced-colors: active) {
  .class-card, .panel, .details, .badge { border: 1px solid CanvasText; }
}
