/**
 * Learningbelt Academy — modern design layer.
 *
 * Loaded after style.css. Every colour here resolves to a --wsms-* token so a
 * preset change in the plugin's Branding & Themes screen restyles all of it.
 * Fallback values are supplied on every var() so the layer still looks right
 * with the plugin absent.
 *
 * No !important and no compound selectors deeper than one class: builder CSS
 * must be able to win without a fight.
 */

/* ---------------------------------------------------------------
   1. Fluid type and spacing scale
   Sizes interpolate with the viewport instead of stepping at
   breakpoints, so headings stay proportionate on every screen.
   --------------------------------------------------------------- */
:root {
  --wsms-step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --wsms-step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --wsms-step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --wsms-step-3: clamp(2rem, 1.6rem + 2vw, 3rem);
  --wsms-step-4: clamp(2.5rem, 1.8rem + 3.5vw, 4.5rem);

  --wsms-space-s: clamp(0.75rem, 0.6rem + 0.75vw, 1.25rem);
  --wsms-space-m: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  --wsms-space-l: clamp(3rem, 2rem + 5vw, 6rem);

  --wsms-measure: 65ch;
}

/* ---------------------------------------------------------------
   2. Motion — opt-in reveal on scroll
   The .is-revealed class is added by theme.js. The default state is
   *visible*, so if JavaScript never runs the content is still there;
   theme.js hides elements itself before observing them.
   --------------------------------------------------------------- */
.wsms-reveal {
  opacity: 1;
  transform: none;
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wsms-reveal.is-pending {
  opacity: 0;
  transform: translateY(1.5rem);
}

.wsms-reveal.is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .wsms-reveal,
  .wsms-reveal.is-pending,
  .wsms-reveal.is-revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------
   3. Hero
   --------------------------------------------------------------- */
.wsms-hero {
  padding-block: var(--wsms-space-l);
  text-align: center;
  position: relative;
  isolation: isolate;
}

.wsms-hero::before {
  /* A soft brand wash rather than an image, so it costs no request and
     recolours with the palette. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 50% 0%, var(--wsms-primary-soft, rgba(99, 102, 241, 0.18)), transparent 70%);
  border-radius: var(--wsms-radius-lg, 1.5rem);
}

.wsms-hero__title {
  font-size: var(--wsms-step-4);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-block-end: var(--wsms-space-s);
  text-wrap: balance;
}

.wsms-hero__lead {
  font-size: var(--wsms-step-1);
  color: var(--wsms-text-muted, #64748b);
  max-width: var(--wsms-measure);
  margin-inline: auto;
  text-wrap: pretty;
}

.wsms-hero__actions {
  justify-content: center;
  margin-block-start: var(--wsms-space-m);
}

/* ---------------------------------------------------------------
   4. Cards and grids
   Auto-fit means the grid decides its own column count from the
   available width — no breakpoint list to maintain.
   --------------------------------------------------------------- */
.wsms-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: var(--wsms-space-m);
  margin-block: var(--wsms-space-m);
}

.wsms-feature-card {
  background: var(--wsms-card, #ffffff);
  border: 1px solid var(--wsms-border, rgba(100, 116, 139, 0.2));
  border-radius: var(--wsms-radius-lg, 1.25rem);
  padding: var(--wsms-space-m);
  box-shadow: var(--wsms-shadow, 0 1px 2px rgba(15, 23, 42, 0.06));
  transition: transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}

.wsms-feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--wsms-primary, #6366f1);
  box-shadow: 0 12px 32px -12px var(--wsms-primary-soft, rgba(99, 102, 241, 0.45));
}

@media (prefers-reduced-motion: reduce) {
  .wsms-feature-card:hover {
    transform: none;
  }
}

.wsms-feature-card h3 {
  font-size: var(--wsms-step-1);
  margin-block-end: 0.5rem;
}

/* ---------------------------------------------------------------
   5. Statistics band
   --------------------------------------------------------------- */
.wsms-stats-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: var(--wsms-space-s);
  padding: var(--wsms-space-m);
  background: var(--wsms-surface, rgba(100, 116, 139, 0.06));
  border-radius: var(--wsms-radius-lg, 1.25rem);
  margin-block: var(--wsms-space-m);
}

.wsms-stat {
  text-align: center;
}

.wsms-stat__value {
  font-size: var(--wsms-step-3);
  font-weight: 700;
  line-height: 1.1;
  color: var(--wsms-primary, #6366f1);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.wsms-stat__label {
  font-size: 0.875rem;
  color: var(--wsms-text-muted, #64748b);
  margin: 0.35rem 0 0;
}

/* ---------------------------------------------------------------
   6. Call-to-action sections
   --------------------------------------------------------------- */
.wsms-cta {
  padding: var(--wsms-space-l) var(--wsms-space-m);
  border-radius: var(--wsms-radius-lg, 1.5rem);
  background: var(--wsms-surface, rgba(100, 116, 139, 0.06));
  border: 1px solid var(--wsms-border, rgba(100, 116, 139, 0.2));
  text-align: center;
  margin-block: var(--wsms-space-m);
}

.wsms-cta h2 {
  font-size: var(--wsms-step-2);
  margin-block-end: 0.5rem;
  text-wrap: balance;
}

.wsms-cta p {
  color: var(--wsms-text-muted, #64748b);
  max-width: var(--wsms-measure);
  margin-inline: auto;
}

.wsms-cta--inverse {
  background: linear-gradient(135deg, var(--wsms-primary, #6366f1), var(--wsms-primary-hover, #4f46e5));
  border-color: transparent;
  color: var(--wsms-on-primary, #ffffff);
}

.wsms-cta--inverse h2,
.wsms-cta--inverse p {
  color: var(--wsms-on-primary, #ffffff);
}

.wsms-cta--inverse .wp-element-button {
  background: var(--wsms-on-primary, #ffffff);
  color: var(--wsms-primary, #6366f1);
}

/* ---------------------------------------------------------------
   7. Sticky glass header
   Applied via the .wsms-sticky-header body class so a site that does
   not want it simply drops the class.
   --------------------------------------------------------------- */
.wsms-sticky-header .site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(150%) blur(12px);
  background: color-mix(in srgb, var(--wsms-bg, #ffffff) 82%, transparent);
  border-bottom: 1px solid var(--wsms-border, rgba(100, 116, 139, 0.2));
  transition: box-shadow 200ms ease;
}

.wsms-sticky-header .site-header.is-stuck {
  box-shadow: 0 8px 24px -18px rgba(15, 23, 42, 0.6);
}

/* Elementor and Divi Builder both manage their own sticky headers; when a
   builder owns the page chrome the theme steps aside rather than stacking
   two sticky bars. */
.elementor-editor-active .wsms-sticky-header .site-header,
.wsms-divi-built .site-header {
  position: static;
  backdrop-filter: none;
}

/* ---------------------------------------------------------------
   8. Content rhythm and readability
   --------------------------------------------------------------- */
.entry-content > * + * {
  margin-block-start: var(--wsms-space-s);
}

.entry-content > h2,
.entry-content > h3 {
  margin-block-start: var(--wsms-space-m);
  text-wrap: balance;
}

.entry-content p {
  max-width: var(--wsms-measure);
  text-wrap: pretty;
}

.entry-content :is(img, figure, iframe, video) {
  border-radius: var(--wsms-radius, 0.75rem);
}

/* Long tables must scroll inside their own box rather than pushing the page
   sideways on a phone. */
.entry-content .wp-block-table {
  overflow-x: auto;
}

/* ---------------------------------------------------------------
   9. Focus visibility
   Keyboard users get a clear ring in the brand colour; mouse users do
   not, because :focus-visible excludes pointer focus.
   --------------------------------------------------------------- */
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--wsms-primary, #6366f1);
  outline-offset: 2px;
  border-radius: var(--wsms-radius-sm, 0.375rem);
}

/* ---------------------------------------------------------------
   10. Utility helpers available to any pattern or builder module
   --------------------------------------------------------------- */
.wsms-section {
  padding-block: var(--wsms-space-l);
}

.wsms-center {
  text-align: center;
}

.wsms-muted {
  color: var(--wsms-text-muted, #64748b);
}

.wsms-glass {
  background: color-mix(in srgb, var(--wsms-card, #ffffff) 70%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--wsms-border, rgba(100, 116, 139, 0.2));
  border-radius: var(--wsms-radius-lg, 1.25rem);
}

/* ===============================================================
   9. Homepage
   ---------------------------------------------------------------
   The theme had no front-page template, so none of the design above
   was visible on a fresh install: it lived in block patterns that
   somebody had to find and insert by hand. These rules dress
   front-page.php.

   Everything resolves to a --wsms-* token, so all five presets in
   the plugin's Branding & Themes screen restyle it. Nothing here
   assumes a light or a dark palette.
   =============================================================== */

/* A small tracked label above a heading. The cheapest piece of typographic
   furniture there is for making a plain section look composed. */
.wsms-overline {
  display: block;
  margin: 0 0 var(--wsms-space-s);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wsms-text-muted, rgba(120, 120, 120, 0.8));
}

.wsms-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--wsms-space-m);
  flex-wrap: wrap;
  padding-top: var(--wsms-space-s);
  border-top: 1px solid var(--wsms-border, rgba(120, 120, 120, 0.2));
  margin-bottom: var(--wsms-space-m);
}

.wsms-section-head h2 { margin: 0; font-size: var(--wsms-step-3); }
.wsms-section-head > p { max-width: 32ch; margin: 0; font-size: 0.9375rem; }

/* ------------------------------------------------------------- hero */

.wsms-home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: clamp(560px, 74vh, 800px);
  overflow: hidden;
  background: var(--wsms-bg, #0b1220);
}

.wsms-home-hero__image,
.wsms-home-hero__shade { position: absolute; inset: 0; width: 100%; height: 100%; }

.wsms-home-hero__image { object-fit: cover; z-index: -2; }

/*
 * Two gradients, not one flat tint.
 *
 * The headline sits on the left and the picture's subject is centre-right, so
 * only the left needs darkening. A flat scrim over the whole frame kills the
 * photograph to solve a problem that exists in one corner.
 *
 * These are fixed dark values rather than tokens, deliberately: the text on
 * top is always white because it sits over a photograph, and a light preset
 * must not turn the scrim pale and leave that text unreadable.
 */
.wsms-home-hero__shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 14, 20, 0.84) 0%, rgba(8, 14, 20, 0.55) 44%, rgba(8, 14, 20, 0.08) 80%),
    linear-gradient(0deg, rgba(8, 14, 20, 0.5), transparent 46%);
}

.wsms-home-hero__content {
  padding-top: clamp(5rem, 12vw, 9rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
  color: #fff;
}

.wsms-home-hero .wsms-overline { color: rgba(255, 255, 255, 0.78); }

.wsms-home-hero h1 {
  max-width: 17ch;
  margin: 0 0 var(--wsms-space-s);
  color: #fff;
  font-size: var(--wsms-step-4);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.wsms-home-hero__lead {
  max-width: 46ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: var(--wsms-step-1);
  line-height: 1.55;
}

.wsms-home-hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--wsms-space-m);
  margin-top: var(--wsms-space-m);
}

/* A text link that behaves like a button: label, hairline, stepping arrow. */
.wsms-link-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 180ms ease;
}

.wsms-link-cta::after { content: "\2192"; transition: transform 220ms ease; }
.wsms-link-cta:hover { color: #fff; border-bottom-color: #fff; }
.wsms-link-cta:hover::after { transform: translateX(3px); }

/* ------------------------------------------------------------ stats */

.wsms-home-stats {
  padding-block: var(--wsms-space-m);
  background: var(--wsms-surface, rgba(120, 120, 120, 0.06));
  border-bottom: 1px solid var(--wsms-border, rgba(120, 120, 120, 0.2));
}

.wsms-home-stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--wsms-space-m);
}

/* ------------------------------------------------------------ intro */

.wsms-home-intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.wsms-home-intro h2 {
  margin: 0 0 var(--wsms-space-s);
  font-size: var(--wsms-step-3);
  line-height: 1.12;
  text-wrap: balance;
}

.wsms-home-intro p { max-width: 48ch; margin: 0; }

.wsms-home-intro__figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--wsms-radius-lg, 1.25rem);
  box-shadow: var(--wsms-shadow, 0 10px 30px -12px rgba(0, 0, 0, 0.25));
}

.wsms-home-intro__figure img { width: 100%; height: auto; display: block; }

/* ------------------------------------------------------------ tiles */

.wsms-home-life { background: var(--wsms-surface, rgba(120, 120, 120, 0.05)); }

.wsms-home-life__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--wsms-space-s);
}

.wsms-tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 19rem;
  margin: 0;
  padding: var(--wsms-space-s);
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--wsms-radius-lg, 1.25rem);
}

.wsms-tile img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* A gradient scrim, not a flat tint: the label sits over the bottom third, so
   only the bottom third needs darkening and the picture keeps its colour. */
.wsms-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(8, 14, 20, 0.72), rgba(8, 14, 20, 0.04) 58%);
}

.wsms-tile:hover img { transform: scale(1.05); }

.wsms-tile figcaption {
  position: relative;
  color: #fff;
  font-size: var(--wsms-step-1);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------------- news */

.wsms-home-news__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--wsms-space-s);
}

.wsms-news-card { display: flex; flex-direction: column; gap: 0.35rem; }
.wsms-news-card h3 { margin: 0; font-size: var(--wsms-step-1); line-height: 1.25; }
.wsms-news-card h3 a { color: inherit; text-decoration: none; }
.wsms-news-card h3 a:hover { text-decoration: underline; }
.wsms-news-card p { margin: 0; }

.wsms-news-card__date {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wsms-text-muted, rgba(120, 120, 120, 0.8));
}

/* -------------------------------------------------------------- CTA */

.wsms-home-cta {
  padding-block: var(--wsms-space-l);
  background: var(--wsms-surface, rgba(120, 120, 120, 0.06));
  border-top: 1px solid var(--wsms-border, rgba(120, 120, 120, 0.2));
}

.wsms-home-cta__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--wsms-space-m);
  flex-wrap: wrap;
}

.wsms-home-cta h2 { margin: 0 0 var(--wsms-space-s); font-size: var(--wsms-step-3); }
.wsms-home-cta p { margin: 0; max-width: 46ch; }

/* ----------------------------------------------------------- header */

/* The fallback list, used until the school assigns a Primary Menu. */
.wsms-nav__fallback {
  display: flex;
  align-items: center;
  gap: var(--wsms-space-s);
  list-style: none;
  margin: 0;
  padding: 0;
}

.wsms-nav__fallback a { text-decoration: none; }

@media (max-width: 860px) {
  .wsms-home-intro__grid { grid-template-columns: minmax(0, 1fr); }
  .wsms-home-intro__figure { order: -1; }
  .wsms-home-cta__inner { display: block; }
  .wsms-home-cta__inner .wsms-btn { margin-top: var(--wsms-space-s); }
}

/* --- corrections found by looking at the rendered homepage ------------- */

/*
 * The value and the label ran together as "10Students enrolled".
 *
 * The block patterns emit these as <p>, which is a block element, so nobody
 * had noticed. front-page.php emits <span> because a number and its caption
 * are one phrase, not two paragraphs. Making the rule explicit fixes the
 * homepage and cannot break the patterns.
 */
.wsms-stat { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.wsms-stat__value { display: block; }
.wsms-stat__label { display: block; margin: 0; }

/*
 * No wrapper padding above a full-bleed hero or below a full-bleed closing
 * band.
 *
 * `.wsms-main` adds up to 4rem of its own, which on the homepage produced a
 * dark empty strip between the sticky header and the hero, and a second one
 * between the admissions band and the footer. Both read as a rendering fault
 * rather than as space.
 *
 * :has() rather than a body class, so a template gets this right simply by
 * starting or ending with a full-width section.
 */
.wsms-main:has(> .wsms-home-hero:first-child) { padding-block-start: 0; }
.wsms-main:has(> :is(.wsms-home-cta, .wsms-home-life, .wsms-home-news):last-child) { padding-block-end: 0; }

/* The homepage sections carry their own rhythm; the container must not add a
   second one on top of it. */
.wsms-home-stats,
.wsms-home-hero { margin-block: 0; }
