/* ============================================================
   ATLAS ACADEMY — styles.css
   ------------------------------------------------------------
   TABLE OF CONTENTS
   01. Design tokens  (EDIT HERE to change the whole theme)
   02. Base & reset
   03. Shared components (container, buttons, section heads)
   04. Header & navigation (desktop + mobile menu)
   05. Hero
   06. About
   07. Image slider
   08. Ticker strip
   09. "What we are good at" grid
   10. Courses architecture (dark panel, tabs, accordions)
   11. Contact section & form
   12. Footer
   13. Toast, reveal animations, scroll hint
   14. Responsive breakpoints
   15. Reduced-motion accessibility
   ============================================================ */


/* ============================================================
   01. DESIGN TOKENS
   ------------------------------------------------------------
   ★ HOW TO RE-THEME: change --color-primary and --color-secondary
   below and the entire page (buttons, accents, dark sections,
   footer) updates automatically.

   Examples:
     Deep blue theme : primary #16324f  secondary #d08b3c
     Burgundy theme  : primary #4a1f26  secondary #c98a3d
   ============================================================ */
:root {
  /* --- Brand colors --- */
  --color-primary:       #008080;   /* deep forest green (brand) */
  --color-primary-dark:  #008080;   /* footer / deeper surfaces  */
  --color-secondary:     #6B1D5F;   /* warm ochre accent         */
  --color-secondary-soft:#6B1D5F;   /* accent used on dark/image backgrounds */

  /* --- Neutrals --- */
  --color-ink:        #20241f;      /* near-black headings       */
  --color-body:       #4c5247;      /* default paragraph text    */
  --color-paper:      #f7f3e9;      /* main warm background      */
  --color-paper-deep: #efe8d8;      /* alternate section background */
  --color-white:      #fffdf8;      /* card surfaces             */
  --color-cream:      #f4efe2;      /* text on dark backgrounds  */
  --color-line:       #e0d8c4;      /* hairline borders          */
  --color-danger:     #b0402c;      /* form validation errors    */

  /* --- Typography --- */
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body:    'Manrope', 'Helvetica Neue', Arial, sans-serif;

  /* --- Shape, depth & motion --- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-soft: 0 10px 30px rgba(28, 36, 28, .08);
  --shadow-lift: 0 18px 44px rgba(28, 36, 28, .16);
  --ease: cubic-bezier(.22, 1, .36, 1);   /* signature easing */

  /* --- Layout --- */
  --header-h: 76px;                        /* fixed navbar height   */
  --container: 1180px;                     /* max content width     */
  --gutter: clamp(1.25rem, 5vw, 2.5rem);   /* side padding          */

  /* --- Contextual text colors (overridden on dark sections) --- */
  --text-main:  var(--color-ink);
  --text-muted: var(--color-body);
  --line:       var(--color-line);
  --accent:     var(--color-secondary);
}


/* ============================================================
   02. BASE & RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Smooth in-page scrolling.
   scroll-padding-top offsets anchors so they never hide
   behind the fixed navbar. Set behavior to "auto" to disable. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-body);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

/* RTL Support via HTML dir attribute */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[dir="rtl"] .slider-dots {
  right: auto;
  left: clamp(1.5rem, 4vw, 3rem);
}

html[dir="rtl"] .slider-count {
  right: auto;
  left: 1.5rem;
}

html[dir="rtl"] .feature-num {
  right: auto;
  left: 1.7rem;
}

html[dir="rtl"] .btn svg {
  transform: scaleX(-1);
}

html[dir="rtl"] .btn:hover svg {
  transform: translateX(-4px) scaleX(-1);
}

html[dir="rtl"] .eyebrow::before {
  display: none;
}

p { color: var(--text-muted); }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.12;
  color: var(--text-main);
  text-wrap: balance;
}
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
button {
  font: inherit; color: inherit; background: none;
  border: 0; cursor: pointer;
}
em { font-style: italic; }

::selection { background: var(--color-secondary); color: #fff; }
:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 3px; }

/* Lock body scroll while the mobile menu is open */
body.nav-locked { overflow: hidden; }

/* Accessible "skip to content" link — visible on keyboard focus */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 300;
  background: var(--color-primary); color: #fff;
  padding: .7rem 1.2rem; border-radius: var(--radius-sm);
  transition: top .3s ease;
}
.skip-link:focus { top: 1rem; }


/* ============================================================
   03. SHARED COMPONENTS
   ============================================================ */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4.5rem, 9vw, 7.5rem); }

/* Dark-section scope: overrides the contextual text variables so
   every component inside (cards, accordions, headings) adapts. */
.section-dark {
  --text-main:  var(--color-cream);
  --text-muted: #a8b3a2;
  --line:       rgba(244, 239, 226, .16);
  --accent:     var(--color-secondary-soft);
  background: var(--color-primary);
  color: var(--color-cream);
}

/* --- Section headings (eyebrow + title + subtitle) --- */
.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head.center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: flex; align-items: center; gap: .9rem;
  margin-bottom: 1.1rem;
  font-size: .78rem; font-weight: 800;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: ""; width: 34px; height: 1px; background: var(--accent);
}
.section-eyebrow-center { justify-content: center; }

.section-title { font-size: clamp(2rem, 4.2vw, 3.1rem); }
.section-title em { color: var(--accent); }
.section-sub { margin-top: 1.1rem; max-width: 560px; font-size: 1.02rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.7rem;
  border: 1.5px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: .95rem;
  transition: background .3s ease, color .3s ease,
              border-color .3s ease, transform .3s var(--ease),
              box-shadow .3s ease;
}
.btn svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary { background: var(--color-primary); color: var(--color-cream); }
.btn-primary:hover { background: var(--color-secondary); color: #fff; }

/* Ochre variant used on the dark Courses panel */
.section-dark .btn-primary { background: var(--color-secondary); color: #fff; }
.section-dark .btn-primary:hover { background: var(--color-cream); color: var(--color-primary); }

.btn-ghost { border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: var(--color-primary); color: var(--color-cream); border-color: var(--color-primary); }

/* --- Language Toggle Button Style --- */
#lang-toggle {
  background: transparent;
  border: 1.5px solid var(--nav-color);
  color: var(--nav-color);
  padding: .5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#lang-toggle:hover {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #fff;
}


/* ============================================================
   04. HEADER & NAVIGATION
   The header is transparent over the hero (light text) and
   gains a solid blurred background once .is-scrolled is added
   by script.js (scroll position > 24px).
   ============================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  --nav-color: var(--color-cream);       /* light text over hero */
  color: var(--nav-color);
  transition: background .35s ease, color .35s ease, box-shadow .35s ease;
}
.site-header.is-scrolled,
.site-header.is-open {
  --nav-color: var(--color-ink);
  background: rgba(247, 243, 233, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-line);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; height: 100%;
}

/* --- Logo (works with the text version or an <img class="logo-img">) --- */
.logo { display: inline-flex; align-items: center; gap: .7rem; color: var(--nav-color); }
.logo-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--color-secondary); color: #fff;
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600;
}
.logo-text { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 600; line-height: 1; }
.logo-text span {
  display: block; margin-top: .22rem;
  font-family: var(--font-body); font-size: .6rem; font-weight: 800;
  letter-spacing: .32em; text-transform: uppercase; opacity: .65;
}
/* Used when you drop in a real logo file */
.logo-img { height: 40px; width: auto; }

/* --- Desktop nav links --- */
.main-nav { display: flex; align-items: center; gap: 2.2rem; }
.main-nav ul { display: flex; align-items: center; gap: 2.2rem; }

.nav-link {
  position: relative; padding: .4rem 0;
  font-weight: 700; font-size: .92rem; letter-spacing: .02em;
  color: var(--nav-color);
}
/* Animated underline: sweeps in from the left on hover / active section */
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--color-secondary);
  transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease);
}
html[dir="rtl"] .nav-link::after {
  left: auto; right: 0;
  transform-origin: left;
}
html[dir="rtl"] .nav-link:hover::after,
html[dir="rtl"] .nav-link.is-active::after {
  transform-origin: right;
}
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav-cta { padding: .65rem 1.3rem; font-size: .85rem; }

/* --- Hamburger (hidden on desktop) --- */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 44px; height: 44px;
}
.nav-toggle .bar {
  display: block; width: 24px; height: 2px; border-radius: 2px;
  background: var(--nav-color);
  transition: transform .3s var(--ease), opacity .3s ease;
}
.site-header.is-open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .bar:nth-child(2) { opacity: 0; }
.site-header.is-open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================================
   05. HERO
   Background image sits behind the transparent header;
   .hero-overlay is the dark scrim that guarantees text
   readability — ★ raise/lower the alpha value to taste.
   ============================================================ */
.hero {
  position: relative;
  display: flex; align-items: center;
  min-height: max(600px, 94vh);
  padding-top: var(--header-h);
  overflow: hidden; isolation: isolate;
  --accent: var(--color-secondary-soft);
  color: var(--color-cream);
}
.hero-bg   { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  /* ★ EDIT: overlay darkness — increase alpha for a darker hero */
  background: rgba(15, 22, 16, .58);
}

.hero-content { max-width: 780px; padding-block: 3rem 6rem; }
.hero h1 {
  margin-bottom: 1.4rem;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  color: #fff;
}
.hero h1 em { color: var(--color-secondary-soft); }
.hero-sub {
  max-width: 540px; margin-bottom: 2.4rem;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: rgba(244, 239, 226, .82);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero .btn-ghost { border-color: rgba(244, 239, 226, .5); }
.hero .btn-ghost:hover {
  background: var(--color-cream); color: var(--color-primary);
  border-color: var(--color-cream);
}

/* Animated scroll indicator at the hero's base */
.scroll-hint {
  position: absolute; left: 50%; bottom: 1.8rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  font-size: .68rem; font-weight: 800; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(244, 239, 226, .6);
}
.scroll-hint .line {
  position: relative; width: 1px; height: 44px; overflow: hidden;
  background: rgba(244, 239, 226, .25);
}
.scroll-hint .line::after {
  content: ""; position: absolute; left: 0; top: -40%;
  width: 100%; height: 40%; background: var(--color-secondary-soft);
  animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip { to { top: 110%; } }


/* ============================================================
   06. ABOUT
   ============================================================ */
.about-statement {
  max-width: 880px; margin-inline: auto; text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.1vw, 2.35rem);
  line-height: 1.42; color: var(--text-main);
}
.about-statement em { color: var(--color-secondary); }
.about-more {
  max-width: 620px; margin: 1.8rem auto 0; text-align: center;
}

/* Quick stats row — plain figures, no card clutter */
.stats {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(2rem, 6vw, 4.5rem);
  margin-top: 3.5rem;
}
.stat { text-align: center; }
.stat b {
  display: block; margin-bottom: .3rem;
  font-family: var(--font-heading); font-weight: 500;
  font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1;
  color: var(--color-primary);
}
.stat span {
  font-size: .72rem; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-muted);
}


/* ============================================================
   07. IMAGE SLIDER
   Crossfade slides + a slow "Ken Burns" settle on each image.
   The active dot carries a progress fill driven by script.js —
   its speed matches CONFIG.sliderInterval automatically.
   ============================================================ */
.showcase { background: var(--color-paper-deep); }

.slider {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9; max-height: 640px;
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lift);
  user-select: none;
}

.slider-viewport, .slide { position: absolute; inset: 0; }
.slide {
  opacity: 0; pointer-events: none;
  transition: opacity 1s ease;
}
.slide.is-active { opacity: 1; pointer-events: auto; }

.slide img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.1);
}
.slide.is-active img { animation: kenburns 7s var(--ease) forwards; }
@keyframes kenburns { from { transform: scale(1.1); } to { transform: scale(1); } }

/* Caption with a readability scrim (functional, not decorative) */
.slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: clamp(3.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(transparent, rgba(12, 18, 12, .74));
  color: #fff;
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s ease .35s, transform .7s var(--ease) .35s;
}
.slide.is-active figcaption { opacity: 1; transform: none; }
.slide-kicker {
  display: block; margin-bottom: .35rem;
  font-size: .72rem; font-weight: 800;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--color-secondary-soft);
}
.slide figcaption h3 { font-size: clamp(1.3rem, 2.6vw, 2rem); color: #fff; }

/* Prev / Next round buttons — revealed on hover (always visible
   on touch devices via the hover:none media query below) */
.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(20, 28, 20, .45); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0;
  transition: background .25s ease, opacity .3s ease;
}
.slider:hover .slider-btn,
.slider:focus-within .slider-btn,
.slider-btn:focus-visible { opacity: 1; }
.slider-btn:hover { background: var(--color-secondary); }
.slider-btn svg { width: 20px; height: 20px; }
.slider-btn.prev { left: 1.2rem; }
.slider-btn.next { right: 1.2rem; }
html[dir="rtl"] .slider-btn.prev { left: auto; right: 1.2rem; }
html[dir="rtl"] .slider-btn.next { right: auto; left: 1.2rem; }
html[dir="rtl"] .slider-btn.prev svg,
html[dir="rtl"] .slider-btn.next svg { transform: scaleX(-1); }
@media (hover: none) { .slider-btn { opacity: 1; } }

/* Progress dots — thin chapter bars with a filling accent line */
.slider-dots {
  position: absolute; right: clamp(1.5rem, 4vw, 3rem);
  bottom: clamp(1.6rem, 4vw, 3rem);
  display: flex; align-items: center; gap: .5rem;
}
.slider-dot { position: relative; width: 44px; height: 14px; }
.slider-dot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px;
  border-radius: 2px; background: rgba(255, 255, 255, .35);
}
.dot-fill {
  position: absolute; left: 0; right: 0; top: 6px; height: 2px;
  border-radius: 2px; background: var(--color-secondary-soft);
  transform: scaleX(0); transform-origin: left;
}
html[dir="rtl"] .dot-fill {
  transform-origin: right;
}

/* Slide counter pill (top-right) */
.slider-count {
  position: absolute; top: 1.4rem; right: 1.5rem;
  padding: .3rem .85rem; border-radius: 999px;
  background: rgba(20, 28, 20, .4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: var(--font-heading); font-size: .9rem;
  color: rgba(255, 255, 255, .9); letter-spacing: .08em;
}


/* ============================================================
   08. TICKER — infinite CSS marquee (pauses on hover).
   Two identical .ticker-group blocks make the -50% loop seamless.
   ============================================================ */
.ticker {
  padding: 1.1rem 0; overflow: hidden;
  background: var(--color-primary); color: var(--color-cream);
}
.ticker-track {
  display: flex; width: max-content;
  animation: ticker-scroll 32s linear infinite;
}
html[dir="rtl"] .ticker-track {
  animation-name: ticker-scroll-rtl;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-group {
  display: flex; align-items: center; gap: 2.6rem;
  padding-right: 2.6rem;
}
html[dir="rtl"] .ticker-group {
  padding-right: 0;
  padding-left: 2.6rem;
}
.ticker-group span {
  font-family: var(--font-heading); font-style: italic;
  font-size: 1.05rem; white-space: nowrap; opacity: .9;
}
.tick-sep {
  flex: none; width: 7px; height: 7px;
  background: var(--color-secondary-soft);
  transform: rotate(45deg);
}
@keyframes ticker-scroll { to { transform: translateX(-50%); } }
@keyframes ticker-scroll-rtl { to { transform: translateX(50%); } }


/* ============================================================
   09. "WHAT WE ARE GOOD AT" — asymmetric feature grid
   Desktop: a 12-column weave (7/5 → 5/7) instead of uniform
   equal cards. Collapses to 2 columns, then 1, on small screens.
   ============================================================ */
.features-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.4rem;
}
.feature-card {
  position: relative; overflow: hidden;
  padding: 2.2rem;
  background: var(--color-white);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  transition: transform .4s var(--ease), box-shadow .4s ease, border-color .4s ease;
}
.feature-card:nth-child(1) { grid-column: span 7; }
.feature-card:nth-child(2) { grid-column: span 5; }
.feature-card:nth-child(3) { grid-column: span 5; }
.feature-card:nth-child(4) { grid-column: span 7; }

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: transparent;
}

/* Oversized ghost numeral in each card's corner */
.feature-num {
  position: absolute; top: 1.4rem; right: 1.7rem;
  font-family: var(--font-heading); font-weight: 600;
  font-size: 2.5rem; line-height: 1;
  color: var(--color-paper-deep);
  transition: color .4s ease;
}
.feature-card:hover .feature-num { color: var(--color-secondary-soft); }

.feature-icon {
  display: grid; place-items: center;
  width: 52px; height: 52px; margin-bottom: 1.6rem;
  border-radius: 14px;
  background: rgba(201, 123, 45, .12); color: var(--color-secondary);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { margin-bottom: .7rem; font-size: 1.45rem; }
.feature-card p  { font-size: .97rem; }


/* ============================================================
   10. COURSES ARCHITECTURE (dark panel)
   ============================================================ */
.courses { background: var(--color-primary); }

/* --- Directory cards: these double as the tab buttons --- */
.category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
  margin-bottom: clamp(2.2rem, 4.5vw, 3.2rem);
}
.category-card {
  display: flex; flex-direction: column; gap: 2.2rem;
  min-height: 215px; padding: 1.7rem 1.6rem 1.6rem;
  text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  color: var(--text-main);
  transition: background .35s ease, border-color .35s ease, transform .35s var(--ease);
}
html[dir="rtl"] .category-card { text-align: right; }
.category-card:hover { border-color: rgba(244, 239, 226, .45); transform: translateY(-4px); }

/* Active card inverts to cream — its inner colors re-scope here */
.category-card.is-active {
  --text-main: var(--color-primary);
  --text-muted: #67705e;
  --line: rgba(30, 58, 43, .22);
  background: var(--color-cream);
  border-color: var(--color-cream);
}

.cat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.cat-index { font-family: var(--font-heading); color: var(--accent); }
.cat-arrow {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); opacity: .55;
  transition: opacity .3s ease, background .3s ease, color .3s ease, border-color .3s ease;
}
html[dir="rtl"] .cat-arrow svg { transform: scaleX(-1); }
.category-card:hover .cat-arrow { opacity: 1; border-color: currentColor; }
.category-card.is-active .cat-arrow {
  background: var(--color-primary); color: var(--color-cream);
  border-color: var(--color-primary); opacity: 1;
}
.cat-arrow svg { width: 16px; height: 16px; }

.cat-title {
  display: block; margin-bottom: .4rem;
  font-family: var(--font-heading); font-weight: 500;
  font-size: 1.35rem; line-height: 1.2; color: var(--text-main);
}
.cat-desc { display: block; font-size: .9rem; color: var(--text-muted); }
.cat-count {
  margin-top: auto;
  font-size: .7rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
}

/* --- Panel that holds the three dynamic views --- */
.course-panel {
  padding: clamp(1.6rem, 4vw, 3rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: rgba(244, 239, 226, .03);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

/* Views are toggled with [hidden]; the active one animates in */
.course-view { display: none; }
.course-view.is-active { display: block; animation: view-in .55s var(--ease); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.course-view-intro {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem;
  padding-bottom: 2.2rem; margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}
.view-kicker {
  display: block; margin-bottom: .5rem;
  font-size: .72rem; font-weight: 800;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent);
}
.course-view-intro h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.view-meta {
  display: flex; flex-wrap: wrap; gap: 2rem;
  margin-top: 1.6rem;
}
.view-meta li { font-size: .78rem; color: var(--text-muted); }
.view-meta b {
  display: block; margin-bottom: .15rem;
  font-family: var(--font-heading); font-weight: 500;
  font-size: 1.15rem; color: var(--text-main);
}

/* --- Individual course rows (expandable accordions) --- */
.course-item { border-bottom: 1px solid var(--line); }
.course-item:first-child { border-top: 1px solid var(--line); }

.course-item-head {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 1.4rem;
  width: 100%; padding: 1.5rem .4rem; text-align: left;
}
html[dir="rtl"] .course-item-head { text-align: right; }
.course-index {
  min-width: 2ch;
  font-family: var(--font-heading); color: var(--accent);
}
.course-title {
  display: block;
  font-family: var(--font-heading); font-weight: 500; font-size: 1.22rem;
  color: var(--text-main);
  transition: color .25s ease;
}
.course-summary { display: block; margin-top: .25rem; font-size: .9rem; color: var(--text-muted); }
.course-item-head:hover .course-title { color: var(--accent); }

.course-duration {
  padding: .45rem .95rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; white-space: nowrap;
  color: var(--text-muted);
}

/* Plus icon rotates into an "×" when the row is open */
.course-toggle {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line);
  transition: transform .4s var(--ease), background .3s ease,
              color .3s ease, border-color .3s ease;
}
.course-toggle svg { width: 15px; height: 15px; }
.course-item-head:hover .course-toggle,
.course-item.open .course-toggle {
  background: var(--color-secondary); border-color: var(--color-secondary); color: #fff;
}
.course-item.open .course-toggle { transform: rotate(45deg); }

/* Expandable body — max-height is animated by script.js */
.course-item-body {
  max-height: 0; overflow: hidden;
  transition: max-height .5s var(--ease);
}
.course-item-body-inner {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2rem; align-items: start;
  padding: .2rem .4rem 1.9rem;
}
.course-item-body p { font-size: .95rem; }
.course-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.course-tags li {
  padding: .4rem .85rem; border-radius: 999px;
  background: rgba(244, 239, 226, .07);
  border: 1px solid var(--line);
  font-size: .76rem; font-weight: 700; letter-spacing: .06em;
}


/* ============================================================
   11. CONTACT SECTION & FORM
   ============================================================ */
.contact-grid {
  display: grid; grid-template-columns: .85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact-info .section-head { margin-bottom: 2rem; }

.info-list { display: flex; flex-direction: column; gap: 1.4rem; }
.info-list li { display: flex; align-items: flex-start; gap: 1rem; }
.info-icon {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(30, 58, 43, .08); color: var(--color-primary);
}
.info-icon svg { width: 19px; height: 19px; }
.info-list h4 {
  margin-bottom: .15rem;
  font-family: var(--font-body); font-size: .74rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-muted);
}
.info-list p { font-weight: 600; color: var(--text-main); }

.contact-form {
  padding: clamp(1.6rem, 3.5vw, 2.6rem);
  background: var(--color-white);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.form-field { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1.2rem; }
.form-field label {
  font-size: .76rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-main);
}
.label-optional { text-transform: none; letter-spacing: 0; opacity: .6; }
.form-field input,
.form-field textarea {
  width: 100%; padding: .85rem 1rem;
  font: inherit; color: var(--color-ink);
  background: var(--color-paper);
  border: 1.5px solid var(--color-line); border-radius: 10px;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.form-field textarea { min-height: 130px; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(30, 58, 43, .1);
}
/* Validation states (toggled by script.js) */
.form-field.has-error input,
.form-field.has-error textarea { border-color: var(--color-danger); }
.field-error { min-height: 0; font-size: .8rem; font-weight: 600; color: var(--color-danger); }

.form-actions { display: flex; justify-content: flex-end; margin-top: .4rem; }
html[dir="rtl"] .form-actions { justify-content: flex-start; }


/* ============================================================
   12. FOOTER
   ============================================================ */
.site-footer {
  --text-main: var(--color-cream);
  --text-muted: #9daa97;
  --line: rgba(244, 239, 226, .14);
  background: var(--color-primary-dark);
  color: var(--text-muted);
  padding-top: clamp(3rem, 6vw, 4.5rem);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem; padding-bottom: 3rem;
}
.footer-brand .logo { color: var(--color-cream); }
.footer-brand p { max-width: 300px; margin-top: 1.2rem; font-size: .92rem; }

.footer-col h4 {
  margin-bottom: 1.2rem;
  font-family: var(--font-body); font-size: .74rem; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--color-cream);
}
.footer-col ul { display: flex; flex-direction: column; gap: .7rem; }
.footer-col a { font-size: .95rem; transition: color .25s ease; }
.footer-col a:hover { color: var(--color-secondary-soft); }

/* Social placeholders — swap href="#" for your real profiles */
.socials { display: flex; gap: .7rem; margin-top: 1.5rem; }
.socials a {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--color-cream);
  transition: background .3s ease, border-color .3s ease, transform .3s var(--ease);
}
.socials a:hover {
  background: var(--color-secondary); border-color: var(--color-secondary);
  transform: translateY(-3px);
}
.socials svg { width: 17px; height: 17px; }

.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
  font-size: .85rem;
}


/* ============================================================
   13. TOAST, REVEAL ANIMATIONS, MISC
   ============================================================ */
/* Toast notification (form success feedback) */
.toast {
  position: fixed; left: 50%; bottom: 1.6rem; z-index: 200;
  display: flex; align-items: center; gap: .7rem;
  max-width: calc(100vw - 2rem);
  padding: .95rem 1.4rem; border-radius: 999px;
  background: var(--color-primary); color: var(--color-cream);
  box-shadow: var(--shadow-lift);
  transform: translate(-50%, 160%);
  transition: transform .5s var(--ease);
}
.toast.is-visible { transform: translate(-50%, 0); }
.toast svg { flex: none; width: 18px; height: 18px; color: var(--color-secondary-soft); }

/* Scroll-reveal: elements with [data-reveal] fade/slide in once
   when they enter the viewport (driven by script.js). */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s ease, transform .8s var(--ease);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }


/* ============================================================
   14. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ---- ≤ 960px: tablet tweaks ---- */
@media (max-width: 960px) {
  /* Override the asymmetric weave: 2 equal columns.
     nth-child(n) keeps specificity equal so this wins by order. */
  .feature-card:nth-child(n) { grid-column: span 6; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 0; gap: 1.6rem; }
}


/* =========================================================
   14.1. FLOATING WHATSAPP BUTTON  —  bottom-right, always visible
   ========================================================= */
 .whatsapp-float {
  position: fixed;
  right: 24px; bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25d366;       
  color: var(--color-white);
  padding: 14px 20px 14px 16px;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45);
  z-index: 90;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: pulse 2.6s ease-in-out infinite;   
}
html[dir="rtl"] .whatsapp-float {
  right: auto;
  left: 24px;
}
.whatsapp-float:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 36px rgba(37, 211, 102, 0.55);
}
.whatsapp-label { font-size: 0.92rem; font-weight: 700; letter-spacing: 0.02em; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45); }
  50%      { box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45), 0 0 0 14px rgba(37, 211, 102, 0); }
} 


/* ---- ≤ 900px: contact stacks ---- */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid  { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---- ≤ 880px: mobile navigation menu ---- */
@media (max-width: 880px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99;
    flex-direction: column; align-items: stretch;
    padding: .5rem var(--gutter) 2rem;
    background: var(--color-paper);
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow-soft);
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity .3s ease, transform .3s var(--ease), visibility .3s;
  }
  .site-header.is-open .main-nav { opacity: 1; visibility: visible; transform: none; }

  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav li { border-bottom: 1px solid var(--color-line); }
  .nav-link {
    display: block; padding: 1.15rem 0;
    font-family: var(--font-heading); font-size: 1.5rem; font-weight: 500;
  }
  .nav-link::after { display: none; }
  .nav-cta { margin-top: 1.4rem; justify-content: center; }
}

/* ---- ≤ 820px: course intro becomes one column ---- */
@media (max-width: 820px) {
  .course-view-intro { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* ---- ≤ 720px: slider & course rows adapt ---- */
@media (max-width: 720px) {
  .slider { aspect-ratio: 4 / 5; max-height: 560px; }
  .slider-dot { width: 30px; }

  /* Duration pill wraps to its own row under the course title */
  .course-item-head { grid-template-columns: auto 1fr auto; gap: 1rem .9rem; }
  .course-duration  { grid-column: 2; grid-row: 2; justify-self: start; }
  html[dir="rtl"] .course-duration { justify-self: start; }
  .course-toggle    { grid-column: 3; grid-row: 1; }
  .course-item-body-inner { grid-template-columns: 1fr; gap: 1.2rem; }
}

/* ---- ≤ 640px: single-column feature cards ---- */
@media (max-width: 640px) {
  .feature-card:nth-child(n) { grid-column: span 12; }
}

/* ---- ≤ 560px: form fields stack ---- */
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .stats { gap: 1.6rem 2.4rem; }
}


/* ============================================================
   15. REDUCED MOTION — respect users who opt out of animation
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}