/* === Course Pages — Premium/WOW Add-ons (works with styles.css) === */
:root{ --course-ring: rgba(166,99,204,.35); }

/* Progress bar (reuses .progress container from styles.css if present) */
.progress{position:fixed; top:0; left:0; right:0; height:3px; z-index:80}
.progress__bar{position:absolute; inset:0 0 auto 0; height:3px;
  background:linear-gradient(90deg, var(--primary), var(--primary-2), var(--gold));
  transform-origin:left center; transform:scaleX(0);}

/* Breadcrumbs */
.crumbs{font-size:.92rem;margin:.2rem 0 0}
.crumbs a{color:var(--muted);text-decoration:none}
.crumbs a:hover{text-decoration:underline}

/* Hero */
.course-hero{background:linear-gradient(135deg,#fff 0%, #f8f5ff 100%);
  padding:clamp(2.2rem,5vw,3.4rem) 0 2.2rem; border-bottom:1px solid rgba(111,45,189,.12); position:relative;}
.course-hero__grid{display:grid;grid-template-columns:1.15fr .85fr;gap:min(6vw,44px);align-items:center}
@media (max-width:900px){ .course-hero__grid{ grid-template-columns:1fr } }
.course-hero h1{margin:.2rem 0 .6rem; letter-spacing:-.02em;}
.meta{list-style:none; padding:0; margin:.6rem 0 0; display:flex; gap:.7rem; flex-wrap:wrap; color:#4a3c66}

/* Framed hero image with gradient glow */
.course-hero__media{ position:relative; display:grid; place-items:center; }
.course-hero__media img{
  border-radius:18px; box-shadow:var(--sh2);
  filter: contrast(1.02) saturate(1.08) brightness(.98);
  animation: floatHero 7s ease-in-out infinite alternate;
}
.hero-frame{ position:absolute; inset:-10px; border-radius:22px; z-index:-1; pointer-events:none;
  background: conic-gradient(from 180deg, var(--primary), var(--primary-2), var(--gold), var(--primary));
  filter: blur(20px); opacity:.35;}
@keyframes floatHero{ from{transform:translateY(0)} to{transform:translateY(-10px)} }

/* Layout */
.course-wrap{ display:grid; grid-template-columns:1fr .88fr; gap:min(6vw,44px); margin: clamp(1.4rem,4vw,2rem) auto; }
@media (max-width:1100px){ .course-wrap{ grid-template-columns:1fr; } }

/* Sticky aside */
.course-aside{ position:sticky; top:88px; align-self:start; display:grid; gap:.9rem; }
.enrol-card{ background:var(--surface); border:1px solid rgba(111,45,189,.14);
  border-radius:16px; padding:1rem; box-shadow:var(--sh1);}
.enrol-card h3{ margin:.2rem 0 .6rem; }
.enrol-meta{ list-style:none; padding:0; margin:.2rem 0 .8rem; color:#4a3c66; display:grid; gap:.25rem; }
.guarantee{ margin-top:.6rem; font-size:.9rem; color:#4a3c66;
  background:#faf7ff; border:1px dashed rgba(111,45,189,.25); border-radius:12px; padding:.6rem .7rem;}

/* Facts / Checklist */
.facts{ background:var(--surface); border:1px solid rgba(111,45,189,.14); border-radius:16px; padding:1rem; box-shadow:var(--sh1); }
.facts h4{ margin:.1rem 0 .5rem; }
.checklist{ list-style:none; padding:0; margin:0; display:grid; gap:.35rem; }
.checklist li{ padding-left:1.6rem; position:relative; }
.checklist li::before{ content:"✓"; position:absolute; left:.4rem; top:0; color:var(--primary); font-weight:900; }

/* Main sections */
.course-main{ display:grid; gap:1rem; }
.section-block.card{ background:var(--surface); border:1px solid rgba(111,45,189,.12); border-radius:16px; padding:1rem; box-shadow:var(--sh1); }

/* Outcomes as pills */
.pill-grid{ display:flex; flex-wrap:wrap; gap:.5rem; }
.pill{ display:inline-flex; align-items:center; gap:.4rem;
  border:1px solid rgba(111,45,189,.22); color:#4a1e87; background:#fbf8ff;
  border-radius:999px; padding:.4rem .7rem; font-weight:700; }

/* Modules */
.module{ border:1px solid rgba(111,45,189,.14); border-radius:14px; padding:.8rem 1rem; background:var(--surface); }
.module + .module{ margin-top:.6rem; }
.module h4{ margin:.1rem 0 .35rem; }

/* Pricing highlight */
.highlight{ background:linear-gradient(90deg,var(--primary),var(--primary-2)); color:#fff; border-radius:16px; padding:1rem; box-shadow:var(--sh2); }
.price{ font-size:1.55rem; font-weight:800; }

/* FAQ */
.faq details{ border:1px solid rgba(111,45,189,.14); border-radius:12px; padding:.8rem 1rem; background:var(--surface); }
.faq details + details{ margin-top:.6rem; }
.faq summary{ font-weight:800; color:#2a2342; cursor:pointer; }

/* Backlink */
.backlink{ display:inline-flex; align-items:center; gap:.4rem; text-decoration:none; color:var(--primary); font-weight:800; }

/* Reveal support */
[data-animate].course-media{ opacity:0; transform: translateY(28px) scale(.98); transition: all .9s cubic-bezier(.19,1,.22,1); }
[data-animate].course-media.visible{ opacity:1; transform: translateY(0) scale(1); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .hero-frame{ display:none }
  .course-hero__media img{ animation:none }
}
/* === Mobile adjustments for course pages === */
@media (max-width: 700px) {
  /* HERO GRID stacks vertically with smaller gaps */
  .course-hero__grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: center;
  }

  .course-hero h1 {
  font-size: 2.6rem;        /* ✅ makes the course title larger */
  line-height: 1.15;        /* ✅ keeps it compact vertically */
  margin-bottom: 0.6rem;    /* ✅ reduces the gap below the title */
}

.course-hero p,
.course-hero .lead {
  font-size: 1.05rem;       /* keep readable but subtle */
  margin-top: 0.3rem;       /* tighter top gap below the title */
  color: #444;              /* ensure visible against background */
}


  .course-hero__media img {
    width: 100%;
    height: auto;
    max-height: 45vh;
    object-fit: cover;
    border-radius: 1rem;
  }

  /* Breadcrumbs smaller and centered */
  .crumbs {
    font-size: 0.85rem;
    margin-bottom: .5rem;
    text-align: center;
  }

  /* Meta list vertically stacked */
  .meta {
    flex-direction: column;
    align-items: center;
    gap: .4rem;
  }

  /* Inner sections spacing */
  section {
    padding: 1.5rem 1rem;
  }

  /* Course cards and content */
  .course-section {
    text-align: center;
  }
}
/* Hide the 'Book / Enquire' highlight card on every course page */
.course-main .section-block.highlight {
  display: none !important;
}
/* --- Mobile-first sanity --- */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
img, video { max-width: 100%; height: auto; display: block; }
iframe { max-width: 100%; }
body { overflow-x: hidden; }

/* Container spacing */
.container { padding-left: 1rem; padding-right: 1rem; }

/* Buttons & inputs full-width on small screens */
button, .btn, input[type="text"], input[type="email"], input[type="tel"],
select, textarea { width: 100%; }

/* Typography scale */
h1 { font-size: clamp(1.4rem, 4.5vw, 2.2rem); line-height: 1.2; }
h2 { font-size: clamp(1.2rem, 4vw, 1.8rem); }
.lead { font-size: clamp(1rem, 3.6vw, 1.125rem); }

/* Hero grid stacks */
.course-hero__grid,
.hero__grid,
.grid-2,
.grid { display: grid; gap: 1.25rem; }

/* Default: single column */
.course-hero__grid,
.hero__grid,
.grid-2 { grid-template-columns: 1fr; }

/* Images in hero */
.course-hero__media img,
.hero__media img { width: 100%; height: auto; border-radius: 12px; }

/* The framed accent shouldn’t overflow */
.hero-frame { inset: auto; max-width: 100%; }

/* Sidebar “book/enquire” card becomes a short bar */
.aside-card, .course-aside, .enquire-card {
  position: static; /* remove sticky on mobile */
  width: 100%;
  max-width: 680px;
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
}

/* Course cards: 1 column on phones, 2 on tablets */
.courses-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .courses-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .courses-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Keep meta lists and badges from wrapping awkwardly */
.meta { display: flex; flex-wrap: wrap; gap: .5rem .75rem; }
.meta > li { margin: 0; }

/* Navigation: wrap and increase tap targets */
.nav, .site-nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.nav a, .site-nav a { padding: .5rem .75rem; }

/* Forms: spacing & readable labels */
.form-row { display: grid; gap: .75rem; }
label { font-size: 0.95rem; line-height: 1.3; }

/* Prevent huge vertical gaps on small screens */
section { padding: 2.5rem 0; }
@media (min-width: 900px) { section { padding: 4rem 0; } }

/* Fix common horizontal scroll offenders */
.row, .container, .course, .course-hero { max-width: 100vw; }
.course-hero__grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1rem;       /* reduce huge white gap */
}

/* Image sizing */
.course-hero__media img {
  width: 100%;
  max-width: 680px;
  border-radius: 16px;
  margin-inline: auto;    /* centre image */
  height: auto;
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

/* Meta line spacing */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: .5rem 0 1.25rem;   /* pull it closer to heading */
  color: #555;
  font-weight: 500;
}

/* Make the text hierarchy feel balanced */
.course-hero__grid h1 {
  margin-bottom: .25rem;
  line-height: 1.25;
}

.lead {
  margin-top: .5rem;
  opacity: .9;
  font-size: 1.05rem;
}

/* On small screens, tighten vertical rhythm */
@media (max-width: 600px) {
  .course-hero__grid { gap: 1rem; }
  .meta { justify-content: center; text-align: center; }
  .course-hero__media img { border-radius: 12px; }
}

/* === Course Pages — works with styles.css / do not globally override site === */
:root{ --course-ring: rgba(166,99,204,.35); }

/* Breadcrumbs */
.crumbs{font-size:.92rem;margin:.2rem 0 0}
.crumbs a{color:var(--muted);text-decoration:none}
.crumbs a:hover{text-decoration:underline}

/* Hero */
.course-hero{
  background:linear-gradient(135deg,#fff 0%, #f8f5ff 100%);
  padding:clamp(2.2rem,5vw,3.4rem) 0 2.2rem;
  border-bottom:1px solid rgba(111,45,189,.12);
  position:relative;
}
.course-hero__grid{ display:grid; grid-template-columns:1.15fr .85fr; gap:min(6vw,44px); align-items:center; }
@media (max-width:900px){ .course-hero__grid{ grid-template-columns:1fr; text-align:center; gap:1.1rem; } }

.course-hero h1{ margin:.2rem 0 .6rem; letter-spacing:-.02em; }
.meta{ list-style:none; padding:0; margin:.6rem 0 0; display:flex; gap:.7rem; flex-wrap:wrap; color:#4a3c66; }

/* Hero media */
.course-hero__media{ position:relative; display:grid; place-items:center; }
.course-hero__media img{
  width:100%; height:auto; max-width:680px;
  border-radius:18px; box-shadow:var(--sh2);
  filter: contrast(1.02) saturate(1.08) brightness(.98);
}
.hero-frame{
  position:absolute; inset:-10px; border-radius:22px; z-index:-1; pointer-events:none;
  background: conic-gradient(from 180deg, var(--primary), var(--primary-2), var(--gold), var(--primary));
  filter: blur(20px); opacity:.35;
}

/* Layout */
.course-wrap{ display:grid; grid-template-columns:1fr .88fr; gap:min(6vw,44px); margin: clamp(1.4rem,4vw,2rem) auto; }
@media (max-width:1100px){ .course-wrap{ grid-template-columns:1fr; } }

/* Sticky aside */
.course-aside{ position:sticky; top:88px; align-self:start; display:grid; gap:.9rem; }
.enrol-card{ background:var(--surface); border:1px solid rgba(111,45,189,.14);
  border-radius:16px; padding:1rem; box-shadow:var(--sh1);}
.enrol-card h3{ margin:.2rem 0 .6rem; }
.enrol-meta{ list-style:none; padding:0; margin:.2rem 0 .8rem; color:#4a3c66; display:grid; gap:.25rem; }
.guarantee{ margin-top:.6rem; font-size:.9rem; color:#4a3c66;
  background:#faf7ff; border:1px dashed rgba(111,45,189,.25); border-radius:12px; padding:.6rem .7rem;}

/* Facts / Checklist */
.facts{ background:var(--surface); border:1px solid rgba(111,45,189,.14); border-radius:16px; padding:1rem; box-shadow:var(--sh1); }
.facts h4{ margin:.1rem 0 .5rem; }
.checklist{ list-style:none; padding:0; margin:0; display:grid; gap:.35rem; }
.checklist li{ padding-left:1.6rem; position:relative; }
.checklist li::before{ content:"✓"; position:absolute; left:.4rem; top:0; color:var(--primary); font-weight:900; }

/* Main sections */
.course-main{ display:grid; gap:1rem; }
.section-block.card{ background:var(--surface); border:1px solid rgba(111,45,189,.12); border-radius:16px; padding:1rem; box-shadow:var(--sh1); }

/* Outcomes as pills */
.pill-grid{ display:flex; flex-wrap:wrap; gap:.5rem; }
.pill{ display:inline-flex; align-items:center; gap:.4rem;
  border:1px solid rgba(111,45,189,.22); color:#4a1e87; background:#fbf8ff;
  border-radius:999px; padding:.4rem .7rem; font-weight:700; }

/* Modules */
.module{ border:1px solid rgba(111,45,189,.14); border-radius:14px; padding:.8rem 1rem; background:var(--surface); }
.module + .module{ margin-top:.6rem; }
.module h4{ margin:.1rem 0 .35rem; }

/* Pricing highlight — optional card */
.highlight{ background:linear-gradient(90deg,var(--primary),var(--primary-2)); color:#fff; border-radius:16px; padding:1rem; box-shadow:var(--sh2); }
.price{ font-size:1.55rem; font-weight:800; }

/* FAQ */
.faq details{ border:1px solid rgba(111,45,189,.14); border-radius:12px; padding:.8rem 1rem; background:var(--surface); }
.faq details + details{ margin-top:.6rem; }
.faq summary{ font-weight:800; color:#2a2342; cursor:pointer; }

/* Backlink */
.backlink{ display:inline-flex; align-items:center; gap:.4rem; text-decoration:none; color:var(--primary); font-weight:800; }

/* Reveal support */
[data-animate].course-media{ opacity:0; transform: translateY(28px) scale(.98); transition: all .9s cubic-bezier(.19,1,.22,1); }
[data-animate].course-media.visible{ opacity:1; transform: translateY(0) scale(1); }

/* ========== Mobile-only adjustments (NO global overrides) ========== */
@media (max-width: 700px) {
  .course-hero h1{ font-size: 1.6rem; line-height:1.3; margin-bottom:.4rem; }
  .course-hero .lead{ font-size:1rem; line-height:1.5; margin-bottom:1rem; }

  .crumbs{ font-size:.85rem; text-align:center; margin-bottom:.5rem; }
  .meta{ flex-direction:column; align-items:center; gap:.4rem; }

  /* Forms/buttons only go full-width on small screens */
  .course-main button,
  .course-main .btn,
  .course-main input,
  .course-main select,
  .course-main textarea{ width:100%; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .hero-frame{ display:none }
}


/* === PATCH: Desktop layout restore & mobile scoping (auto-added) === */
@media (min-width: 1024px){
  /* Two-column hero/course hero */
  .hero__grid,
  .course-hero__grid,
  .hero .container.grid,
  .course-hero .container.grid {
    display: grid !important;
    grid-template-columns: 1.1fr 0.9fr !important;
    align-items: center !important;
    gap: min(6vw, 48px) !important;
    text-align: left !important;
  }
  /* CTAs inline */
  .cta-stack,
  .hero__cta { display: flex !important; gap: 12px !important; flex-wrap: wrap !important; }
  .cta-stack .btn,
  .hero__cta .btn,
  .btn { width: auto !important; display: inline-flex !important; }
  /* Nav row in one line */
  .header__row, header .container { display:flex !important; align-items:center !important; justify-content:space-between !important; gap:2rem !important; flex-wrap:nowrap !important; }
  .site-nav, nav.site-nav { display:flex !important; align-items:center !important; gap:1.25rem !important; flex-wrap:nowrap !important; }
  /* Hero image sane */
  .hero__media img, .course-hero__media img, .hero figure img { max-width: 680px !important; width: 100% !important; height: auto !important; border-radius: 20px !important; margin: 0 !important; box-shadow: 0 12px 34px rgba(0,0,0,.08); }
  /* Containers constrained */
  .container { max-width: 1120px !important; margin-inline: auto !important; padding-inline: 24px !important; }
}
@media (max-width: 900px){
  /* Buttons full-width only on small screens */
  .cta-stack .btn, .hero__cta .btn, .btn, button, input, select, textarea { width: 100% !important; }
  .hero__grid, .course-hero__grid, .hero .container.grid, .course-hero .container.grid { grid-template-columns: 1fr !important; text-align:center !important; gap: 16px !important; }
  .meta { flex-direction: column !important; align-items: center !important; gap: 6px !important; }
}
/* Prevent horizontal scroll */
img, video { max-width: 100%; height: auto; }
body { overflow-x: hidden; }
/* === Course & CPD hero typography overrides (apply to all) === */
.course-hero h1{
  font-size: clamp(2.6rem, 3.6vw + 1rem, 3.4rem) !important; /* bigger title */
  line-height: 1.12 !important;                               /* tighter lines */
  margin: 0 0 0.45rem !important;                              /* smaller gap below */
}
.course-hero h1 .grad-text{ line-height: inherit !important; } /* avoid extra gap from span */

/* The intro paragraph under the title */
.course-hero .lead,
.course-hero p.lead{
  margin: 0.2rem 0 0.6rem !important;                          /* tight under title */
  font-size: 1.08rem !important;
  color: rgba(30,27,45,.92) !important;                        /* stop washed-out text */
  opacity: 1 !important;                                       /* kill any old dimming */
}

/* Breadcrumb + meta spacing */
.course-hero .crumbs{ margin-bottom: .5rem !important; }
.course-hero .meta{ margin-top: .6rem !important; }
/* ==== MOBILE OVERLAP PATCH (append at end of courses.css) ==== */

/* 1) Keep the floating hero + glow inside the hero section */
.course-hero { overflow: clip; }           /* or overflow:hidden if older browser */
.course-hero .hero-frame { z-index: 0; }
.course-hero__media { position: relative; z-index: 1; }

/* 2) Stop the hero image animation on small screens (prevents bleed) */
@media (max-width: 700px){
  .course-hero__media img { animation: none !important; }
}

/* 3) Ensure side column isn’t sticky on mobile (sticky can overlap) */
@media (max-width: 900px){
  .course-aside { position: static !important; top: auto !important; }
}

/* 4) Give each content card its own paint layer and clipping box */
.section-block.card,
.facts,
.enrol-card,
.module,
.highlight {
  position: relative;
  z-index: 0;                 /* new stacking context base */
  overflow: hidden;           /* clip inner shadows/glows */
  contain: layout paint;      /* isolate layout/paint so it can't overlap siblings */
  backface-visibility: hidden;
  transform: translateZ(0);   /* nudge GPU to avoid flicker */
}

/* 5) Make vertical rhythm explicit so nothing visually “sits on” the next block */
.course-main { display: grid; gap: 1rem; }
.course-main > * + * { margin-top: 0 !important; } /* rely on gap only */

/* 6) Safety net: cards and images may not exceed the viewport width */
img, video { max-width: 100%; height: auto; display: block; }
.course-wrap, .course-hero, .container { max-width: 100vw; overflow-x: hidden; }
