/* =========================================================
   Freedive and Beyond — styles
   Order: 1 tokens → 2 base → 3 layout → 4 components → 5 utilities
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
/* Montserrat served from our own domain (no Google Fonts request = faster first paint).
   One variable font file covers 400 and 900; latin subset from Google Fonts v31. Licence: assets/fonts/OFL.txt */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/montserrat-v31-latin.woff2") format("woff2");
}

/* Colours and font taken from the original Wix theme.
   Contrast (WCAG): deep on white 15.4, ocean on white 7.8, slate on white 6.9,
   aqua on deep 6.4, foam on deep 13.0. Aqua is only used on dark backgrounds. */
:root {
  --color-deep: #022933;      /* Wix main colour: text + dark sections */
  --color-ocean: #00587a;     /* buttons, links on light backgrounds */
  --color-teal: #296569;      /* small labels on white */
  --color-aqua: #4ab6c5;      /* accents on dark backgrounds only */
  --color-foam: #d8f1f5;      /* light tinted sections */
  --color-slate: #415f66;     /* secondary text */
  --color-mist: #c0cacc;      /* borders */
  --color-white: #ffffff;
  --color-error: #ffb4a8;     /* form errors, on the dark contact section (≈10:1 contrast) */

  --color-bg: var(--color-white);
  --color-text: var(--color-deep);
  --color-muted: var(--color-slate);
  --color-link: var(--color-ocean);
  --color-focus: var(--color-ocean);

  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: var(--font-body);
  --weight-regular: 400;
  --weight-heavy: 900;        /* Wix headings use Montserrat Black */

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --gutter: var(--space-2);

  --radius: 12px;
  --radius-small: 8px;
  --shadow: 0 1px 2px rgb(2 41 51 / 0.06), 0 8px 24px rgb(2 41 51 / 0.08);
  --max-width: 1100px;
  --header-height: 64px;
  --transition: 200ms ease;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heavy);
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}
h2 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h3 { font-size: 1.375rem; }
h4 { font-size: 1rem; margin-bottom: var(--space-1); }
p { margin: 0 0 var(--space-2); }
strong { font-weight: var(--weight-heavy); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }

/* ---------- 3. Layout ---------- */
/* Sections are full-width (so backgrounds reach the edges); the padding keeps content
   inside --max-width. */
.section {
  padding-block: var(--space-5);
  padding-inline: max(var(--gutter), calc((100% - var(--max-width)) / 2));
}
.section > h2 { margin-bottom: var(--space-4); }
.section--tint { background: var(--color-foam); }
.section--dark {
  background: var(--color-deep);
  color: var(--color-white);
  --color-link: var(--color-aqua);
  --color-focus: var(--color-aqua);
}
/* offset anchor jumps so the sticky header doesn't cover headings */
section[id], article[id], div[id] { scroll-margin-top: calc(var(--header-height) + var(--space-2)); }

/* Mobile: brand on one row, nav links on the next; not sticky (it would cover too much
   of a small screen). Step 3 can swap this for a menu button. */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-2);
  min-height: var(--header-height);
  padding: var(--space-1) max(var(--gutter), calc((100% - var(--max-width)) / 2));
  background: rgb(255 255 255 / 0.96);
  border-bottom: 1px solid var(--color-mist);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.75rem;
}
.site-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: var(--weight-heavy);
  font-size: 0.875rem;
  color: var(--color-deep);
  text-decoration: none;
}
/* very small phones: the hero's "Book on WhatsApp" button sits right below, so the
   header copy is dropped to keep the header to two rows */
@media (max-width: 419px) {
  .site-nav .btn { display: none; }
}
@media (min-width: 768px) {
  .site-header { position: sticky; top: 0; }
  .site-nav { gap: var(--space-1) var(--space-3); }
  .site-nav a:not(.btn) { font-size: 0.9375rem; }
}
.site-nav a:not(.btn):hover { color: var(--color-ocean); text-decoration: underline; }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: min(88vh, 720px);
  padding: var(--space-5) max(var(--gutter), calc((100% - var(--max-width)) / 2));
  color: var(--color-white);
  background: var(--color-deep);
  --color-focus: var(--color-aqua);
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* dark overlay so white text stays readable over the photo */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgb(2 41 51 / 0.88) 0%, rgb(2 41 51 / 0.65) 55%, rgb(2 41 51 / 0.35) 100%);
}
.hero__inner { max-width: 40rem; }
.hero h1 {
  font-size: clamp(2.5rem, 9vw, 4.75rem);
  line-height: 1.05;
  margin-bottom: var(--space-1);
}
.hero__tagline {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  color: var(--color-aqua);
  font-weight: var(--weight-heavy);
  margin-bottom: var(--space-3);
}
.hero__intro { font-size: 1.125rem; }
.hero__next {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-left: 4px solid var(--color-aqua);
  background: rgb(2 41 51 / 0.55);
  margin-bottom: var(--space-3);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.course-grid,
.team-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .course-grid { grid-template-columns: repeat(3, 1fr); }
}

.about {
  display: grid;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-5);
}
.about__img { border-radius: var(--radius); max-height: 520px; width: 100%; object-fit: cover; }
@media (min-width: 900px) {
  .about { grid-template-columns: 3fr 2fr; }
}

/* ---------- 4. Components ---------- */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--color-ocean);
  border-radius: 999px;
  background: var(--color-ocean);
  color: var(--color-white);
  font: inherit;
  font-weight: var(--weight-heavy);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { background: var(--color-deep); border-color: var(--color-deep); }
.btn--small { min-height: 44px; padding: 0.5rem 1.125rem; font-size: 0.9375rem; }
/* on dark backgrounds the main button turns aqua with deep text (contrast 6.4) */
.hero .btn:not(.btn--ghost),
.section--dark .btn:not(.btn--ghost) {
  background: var(--color-aqua);
  border-color: var(--color-aqua);
  color: var(--color-deep);
}
.hero .btn:not(.btn--ghost):hover,
.section--dark .btn:not(.btn--ghost):hover { background: var(--color-white); border-color: var(--color-white); }
.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: var(--color-white); border-color: var(--color-white); color: var(--color-deep); }

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  font-weight: var(--weight-heavy);
  font-size: 1rem;
  white-space: nowrap;
  color: var(--color-deep);
  text-decoration: none;
}
.brand img { width: 40px; height: 40px; }

/* Mobile menu. Without JS the nav just wraps under the logo (see .site-header).
   With JS (html.js, set in <head>): phones get one slim sticky row with a Menu button,
   and the links open as a list below it. From 768 px the nav is always visible. */
.nav-toggle { display: none; }
@media (max-width: 767px) {
  .js .site-header { position: sticky; top: 0; }
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 0.875rem;
    border: 2px solid var(--color-deep);
    border-radius: 999px;
    background: transparent;
    color: var(--color-deep);
    font: inherit;
    font-size: 0.875rem;
    font-weight: var(--weight-heavy);
    cursor: pointer;
  }
  .js .nav-toggle[aria-expanded="true"] { background: var(--color-deep); color: var(--color-white); }
  .js .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: var(--space-2);
  }
  .js .site-nav.is-open { display: flex; }
  .js .site-nav a:not(.btn) {
    font-size: 1.0625rem;
    border-top: 1px solid var(--color-mist);
  }
  .js .site-nav .btn { display: inline-flex; margin-top: var(--space-1); }
  /* logo + name + Menu must fit one row at 360 px */
  .js .site-header { flex-wrap: wrap; gap: 0 var(--space-1); }
  .js .brand { gap: 0.5rem; font-size: 0.9375rem; }
  .js .brand img { width: 36px; height: 36px; }
}

/* Course cards */
.course-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.course-card__img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.course-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-2);
}
@media (min-width: 600px) {
  .course-card__body,
  .team-card__body { padding: var(--space-3); }
}
.course-card__level {
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  font-weight: var(--weight-heavy);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-teal);
}
.course-card h3 { font-size: 1.75rem; margin-bottom: var(--space-1); }
.course-card__headline { font-size: 1.0625rem; }
.course-card__note { color: var(--color-muted); font-style: italic; }
.course-card ul { padding-left: 1.25rem; margin: 0 0 var(--space-2); }
.course-card li { margin-bottom: 0.25rem; }

/* Expandable details (course schedule + FAQ) */
details {
  border-top: 1px solid var(--color-mist);
  margin-bottom: var(--space-2);
}
details:last-of-type { border-bottom: 1px solid var(--color-mist); }
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-1) 0;
  font-weight: var(--weight-heavy);
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-ocean);
  transition: transform var(--transition);
}
details[open] > summary::after { transform: rotate(45deg); }
summary:hover { color: var(--color-ocean); }
details > :not(summary) { margin-top: var(--space-1); }

/* Professional courses */
.pro-courses {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-2);
  background: var(--color-deep);
  color: var(--color-white);
  border-radius: var(--radius);
  --color-link: var(--color-aqua);
  --color-focus: var(--color-aqua);
}
.pro-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 768px) {
  .pro-list { grid-template-columns: repeat(3, 1fr); }
}
.pro-item { padding-top: var(--space-2); border-top: 3px solid var(--color-aqua); }
.pro-item h4 { font-size: 1.125rem; }
.pro-item a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: var(--weight-heavy);
}

.about-molchanovs {
  max-width: 48rem;
  margin-top: var(--space-5);
  color: var(--color-muted);
}
.about-molchanovs h3 { color: var(--color-text); }

/* Team */
.team-card {
  overflow: hidden;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.team-card__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 30%; }
.team-card__body { padding: var(--space-2); }
.team-card h3 { margin-bottom: 0.25rem; }
.team-card__role {
  font-size: 0.875rem;
  font-weight: var(--weight-heavy);
  color: var(--color-teal);
}

/* FAQ */
.faq-list { max-width: 48rem; }
.faq-list details { margin-bottom: 0; }

/* Contact */
.contact-list {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  font-size: 1.125rem;
}
.contact-list a { word-break: break-word; }
.contact-form { max-width: 36rem; }
html:not(.js) .contact-form { display: none; } /* no JS → the <noscript> note shows instead */
.field { margin-bottom: var(--space-2); }
.field label { display: block; margin-bottom: 0.25rem; font-weight: var(--weight-heavy); }
.field-optional { font-weight: var(--weight-regular); opacity: 0.85; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.625rem 0.75rem;
  border: 2px solid var(--color-mist);
  border-radius: var(--radius-small);
  background: var(--color-white);
  color: var(--color-deep);
  font: inherit;
  font-size: 1rem; /* 16px stops iPhones zooming in on focus */
  scroll-margin-top: calc(var(--header-height) + 3rem); /* focused field + its label stay below the sticky header */
}
.field textarea { resize: vertical; }
.field :focus-visible { border-color: var(--color-focus); }
.field [aria-invalid="true"] { border-color: var(--color-error); }
.field-error,
.form-status--error { color: var(--color-error); font-weight: var(--weight-heavy); }
.field-error { margin: 0.25rem 0 0; font-size: 0.9375rem; }
.form-status { margin: var(--space-2) 0 0; }
.form-status:empty { display: none; }
.form-status--success { color: var(--color-aqua); font-weight: var(--weight-heavy); }
.form-privacy { margin-top: var(--space-2); font-size: 0.875rem; opacity: 0.85; }

/* Footer */
.site-footer {
  padding: var(--space-4) max(var(--gutter), calc((100% - var(--max-width)) / 2));
  background: #011a21;
  color: var(--color-mist);
  font-size: 0.875rem;
  --color-link: var(--color-aqua);
  --color-focus: var(--color-aqua);
}
.site-footer p { margin-bottom: var(--space-1); }

/* Course card links (home) */
.course-card__actions { display: grid; gap: var(--space-1); margin-top: auto; }
.course-card__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: var(--weight-heavy);
}

/* ===== Course pages (/molchanovs-waveN-course) ===== */
/* Banner: 2:1 on phones (crops the sides, keeps the centre badge), 4:1 from tablets */
.page-banner {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  background: var(--color-deep);
}
@media (min-width: 700px) {
  .page-banner { aspect-ratio: 4 / 1; }
}
.course-intro { padding-top: var(--space-3); }
.breadcrumb { margin-bottom: var(--space-2); font-size: 0.9375rem; }
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: var(--weight-heavy);
}
.course-intro h1 { font-size: clamp(2rem, 7vw, 3.25rem); margin-bottom: var(--space-2); }
.course-intro__lead { font-size: 1.1875rem; max-width: 46rem; }
.course-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-3) 0;
  padding: 0;
  list-style: none;
}
.course-facts li {
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  background: var(--color-foam);
  font-weight: var(--weight-heavy);
  font-size: 0.9375rem;
}
.prose { max-width: 46rem; }
.prose h2 { margin-top: var(--space-4); }
.prose > :first-child { margin-top: 0; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.375rem; }

/* Three short intro blocks / prerequisites etc. */
.info-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  margin-top: var(--space-4);
}
@media (min-width: 800px) {
  .info-grid { grid-template-columns: repeat(3, 1fr); }
}
.info-block {
  padding: var(--space-3) var(--space-2);
  border-top: 4px solid var(--color-ocean);
  background: var(--color-white);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}
.info-block h2 { font-size: 1.1875rem; } /* h2 for heading order, sized like an h3 */
.info-block ul { padding-left: 1.25rem; margin: 0; }
.info-block > :last-child { margin-bottom: 0; }

/* "What you'll learn" cards */
.learn-grid {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .learn-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .learn-grid { grid-template-columns: repeat(3, 1fr); }
}
.learn-item {
  padding: var(--space-3) var(--space-2);
  background: var(--color-white);
  border: 1px solid var(--color-mist);
  border-radius: var(--radius);
}
.learn-item h3 { font-size: 1.0625rem; color: var(--color-ocean); }
.learn-item p { margin: 0; }
.learn-item ul { margin: var(--space-1) 0 0; padding-left: 1.25rem; }

/* Day-by-day schedule */
.schedule { display: grid; gap: var(--space-4); }
.day { display: grid; gap: var(--space-3); align-items: start; }
@media (min-width: 900px) {
  .day--with-img { grid-template-columns: 3fr 2fr; }
}
.day h3 { margin-bottom: 0.25rem; }
.day__place { color: var(--color-muted); font-weight: var(--weight-heavy); font-size: 0.9375rem; }
.day__img { border-radius: var(--radius); width: 100%; }
.slots { margin: 0; padding: 0; list-style: none; }
.slot {
  display: grid;
  gap: 0 var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-mist);
}
@media (min-width: 600px) {
  .slot { grid-template-columns: 7.5rem 1fr; }
}
.slot__time { font-weight: var(--weight-heavy); color: var(--color-ocean); white-space: nowrap; }
.slot h4 { margin: 0 0 0.25rem; font-size: 1rem; }
.slot ul { margin: 0; padding-left: 1.25rem; }

/* Closing call to action */
.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: var(--space-2); }
.cta-band p { max-width: 36rem; margin-inline: auto; }
.cta-band .hero__actions { justify-content: center; margin-top: var(--space-3); }

/* ---------- 5. Utilities ---------- */
.mt-4 { margin-top: var(--space-4); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: -9999px; z-index: 20; }
.skip-link:focus { left: var(--space-2); top: var(--space-2); background: #fff; padding: var(--space-1); }
