/* ==========================================================================
   Visionary Education — Public base: reset, typography, layout primitives,
   buttons, badges, generic components shared by every page.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--ve-font-text);
  font-size: var(--ve-text-md);
  line-height: var(--ve-leading-normal);
  color: var(--ve-text);
  background: var(--ve-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"], .ve-list-reset { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4 { font-family: var(--ve-font-display); line-height: var(--ve-leading-tight); color: var(--ve-text-strong); font-weight: 700; letter-spacing: -0.015em; overflow-wrap: anywhere; }
p { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--ve-focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--ve-purple-100); color: var(--ve-ink-900); }

.ve-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ve-skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 999;
  background: var(--ve-primary); color: #fff; padding: .6rem 1rem; border-radius: var(--ve-radius-md);
  transition: top var(--ve-dur-fast) var(--ve-ease);
}
.ve-skip-link:focus { top: 1rem; }

/* ---- Layout primitives --------------------------------------------------- */
.ve-container { width: min(100% - (var(--ve-gutter) * 2), var(--ve-container)); margin-inline: auto; }
.ve-container--wide { width: min(100% - (var(--ve-gutter) * 2), var(--ve-container-wide)); }
.ve-section { padding-block: var(--ve-section-y); position: relative; }
.ve-section--tight { padding-block: var(--ve-section-y-tight); }
.ve-section--alt { background: var(--ve-surface-alt); }
.ve-section--brand { background: var(--ve-surface-brand); }
.ve-section--dark { background: var(--ve-surface-dark); color: var(--ve-text-inverse); }
.ve-section--dark h1, .ve-section--dark h2, .ve-section--dark h3 { color: var(--ve-text-inverse); }

/* Section heading block: eyebrow + title + lede */
.ve-heading { display: grid; gap: .5rem; max-width: 46rem; }
.ve-heading--center { text-align: center; margin-inline: auto; justify-items: center; }
.ve-heading__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--ve-text-xs); font-weight: 700; letter-spacing: var(--ve-tracking-caps);
  text-transform: uppercase; color: var(--ve-primary);
}
.ve-heading__eyebrow::before { content: ""; width: 1.25rem; height: 2px; background: var(--ve-accent); border-radius: 2px; }
.ve-heading--center .ve-heading__eyebrow::after { content: ""; width: 1.25rem; height: 2px; background: var(--ve-accent); border-radius: 2px; }
.ve-heading__title { font-size: var(--ve-text-3xl); }
.ve-heading__title--lg { font-size: var(--ve-text-4xl); }
.ve-heading__lede { color: var(--ve-text-muted); font-size: var(--ve-text-md); line-height: var(--ve-leading-relaxed); max-width: 40rem; }
.ve-section--dark .ve-heading__eyebrow { color: var(--ve-gold-400); }
.ve-section--dark .ve-heading__lede { color: var(--ve-text-inverse-muted); }
.ve-section__head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.ve-section__head--center { justify-content: center; margin-bottom: 2.25rem; }
.ve-section__foot { display: flex; justify-content: center; margin-top: 2rem; }

/* ---- Buttons ------------------------------------------------------------- */
.ve-btn {
  --btn-bg: var(--ve-primary); --btn-fg: #fff; --btn-border: var(--ve-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--ve-control-height); padding: .7rem 1.35rem;
  font-weight: 600; font-size: var(--ve-text-sm); line-height: 1.1; letter-spacing: .01em;
  color: var(--btn-fg); background: var(--btn-bg); border: 1.5px solid var(--btn-border);
  border-radius: var(--ve-radius-md); white-space: nowrap; position: relative; overflow: hidden;
  transition: transform var(--ve-dur-fast) var(--ve-ease), box-shadow var(--ve-dur-base) var(--ve-ease), background var(--ve-dur-fast) var(--ve-ease), color var(--ve-dur-fast) var(--ve-ease), border-color var(--ve-dur-fast) var(--ve-ease);
}
.ve-btn:hover { transform: translateY(-2px); box-shadow: var(--ve-shadow-brand); }
.ve-btn:active { transform: translateY(0); box-shadow: none; }
.ve-btn--primary { --btn-bg: var(--ve-primary); --btn-border: var(--ve-primary); }
.ve-btn--primary:hover { --btn-bg: var(--ve-purple-600); --btn-border: var(--ve-purple-600); }
.ve-btn--dark { --btn-bg: var(--ve-primary-dark); --btn-border: var(--ve-primary-dark); }
.ve-btn--outline { --btn-bg: transparent; --btn-fg: var(--ve-primary); --btn-border: var(--ve-primary); }
.ve-btn--outline:hover { --btn-bg: var(--ve-purple-050); box-shadow: var(--ve-shadow-sm); }
.ve-btn--outline-light { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgb(255 255 255 / .55); }
.ve-btn--outline-light:hover { --btn-bg: rgb(255 255 255 / .1); --btn-border: #fff; box-shadow: none; }
.ve-btn--gold { --btn-bg: var(--ve-accent); --btn-fg: var(--ve-ink-900); --btn-border: var(--ve-accent); }
.ve-btn--gold:hover { --btn-bg: var(--ve-gold-400); --btn-border: var(--ve-gold-400); box-shadow: 0 12px 28px rgb(229 177 46 / .35); }
.ve-btn--ghost { --btn-bg: transparent; --btn-fg: var(--ve-primary); --btn-border: transparent; padding-inline: .5rem; }
.ve-btn--ghost:hover { box-shadow: none; transform: none; --btn-bg: var(--ve-purple-050); }
.ve-btn--sm { min-height: 2.25rem; padding: .45rem .95rem; font-size: var(--ve-text-xs); }
.ve-btn--lg { min-height: 3.1rem; padding: .9rem 1.75rem; font-size: var(--ve-text-md); }
.ve-btn--block { width: 100%; }
.ve-btn__icon { width: 1rem; height: 1rem; flex: none; }
.ve-btn svg { width: 1rem; height: 1rem; }
/* subtle sheen on primary buttons */
.ve-btn--primary::after, .ve-btn--gold::after, .ve-btn--dark::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / .18) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform var(--ve-dur-slow) var(--ve-ease);
}
.ve-btn--primary:hover::after, .ve-btn--gold:hover::after, .ve-btn--dark:hover::after { transform: translateX(120%); }

/* Text link with arrow */
.ve-link {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: var(--ve-text-sm);
  /* No layout property changes on hover anywhere on this site: growing a gap
     or a padding re-flows the text and a link that fitted on one line breaks
     onto two under the pointer. The arrow moves with a transform instead. */
  color: var(--ve-primary); transition: color var(--ve-dur-fast) var(--ve-ease);
}
.ve-link svg { width: .95rem; height: .95rem; transition: transform var(--ve-dur-fast) var(--ve-ease); }
.ve-link:hover svg { transform: translateX(3px); }
.ve-link--light { color: #fff; }

/* ---- Cards ---------------------------------------------------------------- */
.ve-card {
  background: var(--ve-surface); border: 1px solid var(--ve-border-subtle); border-radius: var(--ve-radius-lg);
  box-shadow: var(--ve-shadow-xs); overflow: hidden;
  transition: transform var(--ve-dur-base) var(--ve-ease), box-shadow var(--ve-dur-base) var(--ve-ease), border-color var(--ve-dur-base) var(--ve-ease);
}
.ve-card:hover { transform: translateY(-4px); box-shadow: var(--ve-shadow-md); border-color: var(--ve-border); }
.ve-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--ve-ink-100); }
.ve-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--ve-dur-slow) var(--ve-ease); }
.ve-card:hover .ve-card__media img { transform: scale(1.05); }
.ve-card__body { padding: 1.1rem 1.15rem 1.2rem; display: grid; gap: .55rem; }
.ve-card__title { font-size: var(--ve-text-lg); font-weight: 700; }
.ve-card__meta { color: var(--ve-text-muted); font-size: var(--ve-text-xs); display: flex; flex-wrap: wrap; gap: .3rem .55rem; align-items: center; }
.ve-card__meta span + span::before { content: "•"; margin-right: .55rem; color: var(--ve-ink-300); }
.ve-card__text { color: var(--ve-text-muted); font-size: var(--ve-text-sm); line-height: var(--ve-leading-relaxed); }
.ve-card__actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .25rem; }

/* Badges / chips */
.ve-badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: var(--ve-radius-pill);
  font-size: var(--ve-text-2xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--ve-purple-100); color: var(--ve-purple-700);
}
.ve-badge--gold { background: var(--ve-gold-100); color: var(--ve-gold-600); }
.ve-badge--mint { background: var(--ve-pastel-mint); color: var(--ve-teal-500); }
.ve-badge--sky { background: var(--ve-pastel-sky); color: var(--ve-blue-500); }
.ve-badge--light { background: rgb(255 255 255 / .12); color: #fff; }

/* Icon disc */
.ve-icon {
  display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: var(--ve-primary); color: #fff; flex: none;
}
.ve-icon svg { width: 1.45rem; height: 1.45rem; }
.ve-icon--soft { background: var(--ve-purple-050); color: var(--ve-primary); }
.ve-icon--outline { background: transparent; border: 1.5px solid var(--ve-border); color: var(--ve-primary); }
.ve-icon--gold { background: var(--ve-gold-100); color: var(--ve-gold-600); }
.ve-icon--teal { background: var(--ve-teal-500); }
.ve-icon--blue { background: var(--ve-blue-500); }
.ve-icon--sm { width: 2.5rem; height: 2.5rem; }
.ve-icon--sm svg { width: 1.15rem; height: 1.15rem; }
.ve-icon--lg { width: 4rem; height: 4rem; }
.ve-icon--lg svg { width: 1.75rem; height: 1.75rem; }

/* Rating stars */
.ve-stars { display: inline-flex; gap: 2px; color: var(--ve-gold-500); }
.ve-stars svg { width: .85rem; height: .85rem; fill: currentColor; }
.ve-stars svg.is-empty { color: var(--ve-ink-300); fill: none; }

/* Prose */
.ve-prose { font-size: var(--ve-text-md); line-height: var(--ve-leading-relaxed); color: var(--ve-text); }
.ve-prose > * + * { margin-top: 1em; }
.ve-prose h2 { font-size: var(--ve-text-2xl); margin-top: 1.8em; }
.ve-prose h3 { font-size: var(--ve-text-xl); margin-top: 1.5em; }
.ve-prose ul, .ve-prose ol { padding-left: 1.4em; }
.ve-prose li + li { margin-top: .35em; }
.ve-prose a { color: var(--ve-primary); text-decoration: underline; text-underline-offset: 3px; }
.ve-prose img { border-radius: var(--ve-radius-lg); }
.ve-prose blockquote { border-left: 3px solid var(--ve-accent); padding-left: 1.1rem; color: var(--ve-text-muted); font-style: italic; }

/* Forms (public) */
.ve-field { display: grid; gap: .4rem; }
.ve-field__label { font-size: var(--ve-text-sm); font-weight: 600; color: var(--ve-text-strong); }
.ve-field__label .req { color: var(--ve-error); margin-left: .15rem; }
.ve-input, .ve-select, .ve-textarea {
  width: 100%; min-height: var(--ve-control-height); padding: .65rem .9rem;
  border: 1.5px solid var(--ve-border); border-radius: var(--ve-radius-md); background: #fff;
  font-size: var(--ve-text-sm); color: var(--ve-text-strong);
  transition: border-color var(--ve-dur-fast) var(--ve-ease), box-shadow var(--ve-dur-fast) var(--ve-ease);
}
.ve-textarea { min-height: 7.5rem; resize: vertical; }
.ve-input:focus, .ve-select:focus, .ve-textarea:focus { outline: none; border-color: var(--ve-primary); box-shadow: 0 0 0 4px var(--ve-purple-100); }
.ve-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6884' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.4rem; }
.ve-field__error { color: var(--ve-error); font-size: var(--ve-text-xs); font-weight: 600; }
.ve-field__hint { color: var(--ve-text-muted); font-size: var(--ve-text-xs); }
.ve-checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--ve-text-sm); color: var(--ve-text-muted); }
.ve-checkbox input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--ve-primary); flex: none; }
/* Public forms: fields flow in rows and GROW into whatever space is left, so
   a field that ends up alone on its row fills the width instead of leaving a
   dead half. `.span-2` still forces its own full row (textareas, consent). */
.ve-form-grid { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.ve-form-grid > * { flex: 1 1 15rem; min-width: 0; }
.ve-form-grid > .span-2, .ve-form-grid > .ve-field--wide { flex-basis: 100%; }
@media (max-width: 40rem) { .ve-form-grid > * { flex-basis: 100%; } }

/* Alerts */
.ve-alert { padding: .9rem 1.1rem; border-radius: var(--ve-radius-md); font-size: var(--ve-text-sm); border: 1px solid; }
.ve-alert--success { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.ve-alert--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Grid helpers */
.ve-grid { display: grid; gap: 1.5rem; }
.ve-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ve-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ve-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 64rem) { .ve-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ve-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .ve-grid--2, .ve-grid--3, .ve-grid--4 { grid-template-columns: 1fr; } }

/* Breadcrumbs */
.ve-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; padding: 0; list-style: none; font-size: var(--ve-text-xs); font-weight: 600; color: rgb(255 255 255 / .72); }
.ve-crumbs li { display: inline-flex; align-items: center; gap: .5rem; }
.ve-crumbs li + li::before { content: ""; width: 5px; height: 5px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: .55; }
.ve-crumbs [aria-current] { color: #fff; }
.ve-crumbs a:hover { color: #fff; }

/* Page banner (inner pages) */
/* Inner-page hero. The h1 needs its colour stated: the global heading rule
   sets a dark ink colour, which inheritance from .ve-banner cannot beat. */
.ve-banner { position: relative; isolation: isolate; color: #fff; padding-block: clamp(3.5rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem); overflow: hidden; background: var(--ve-primary-dark); }
.ve-banner::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; z-index: -1; background-image: radial-gradient(rgb(255 255 255 / .09) 1px, transparent 1.2px); background-size: 22px 22px; mask-image: linear-gradient(to top, #000, transparent); -webkit-mask-image: linear-gradient(to top, #000, transparent); pointer-events: none; }
.ve-banner__title, .ve-banner h1, .ve-banner h2 { color: #fff; }
.ve-banner__bg { position: absolute; inset: 0; z-index: -2; }
/* Two things sat on top of the banner photograph: the image at .32 opacity AND
   a near-solid .93 brand gradient over it. Together they left the picture all
   but invisible — an admin could change the banner and see almost no
   difference. The photograph now carries the band and the gradient is a tint
   over it, with a separate scrim behind the words so the white title keeps its
   contrast wherever the picture happens to be bright. */
.ve-banner__bg img { width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.ve-banner::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to right, rgb(14 10 46 / .72) 0%, rgb(14 10 46 / .38) 55%, rgb(14 10 46 / .15) 100%),
    linear-gradient(105deg, var(--ve-indigo-950) 0%, var(--ve-indigo-800) 45%, var(--ve-purple-600) 100%);
  background-blend-mode: normal, normal;
  opacity: .72;
}
.ve-banner__title { font-size: var(--ve-text-4xl); margin-top: .9rem; letter-spacing: -.02em; text-shadow: 0 2px 24px rgb(14 10 46 / .35); }
.ve-banner__lede { margin-top: .75rem; max-width: 42rem; color: var(--ve-text-inverse-muted); font-size: var(--ve-text-lg); }
/* Layout of the banner's contents. Global, not per page: one partial draws
   every inner-page banner, so a page that did not happen to load pages.css
   must not lose the eyebrow colour or the button row. */
.ve-banner__grid { display: grid; gap: 1.5rem; align-items: end; }
.ve-banner__title { max-width: 22ch; overflow-wrap: anywhere; }
.ve-banner__eyebrow { color: var(--ve-gold-400); margin-top: 1rem; }
.ve-banner__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.ve-banner--compact { padding-block: clamp(2.25rem, 5vw, 3.5rem); }
.ve-crumbs a { color: inherit; }

/* Empty state */
.ve-empty { text-align: center; padding: 3rem 1.5rem; border: 1.5px dashed var(--ve-border); border-radius: var(--ve-radius-lg); color: var(--ve-text-muted); display: grid; gap: .6rem; justify-items: center; }
.ve-empty__title { font-weight: 700; color: var(--ve-text-strong); font-size: var(--ve-text-lg); }

/* Pagination */
.ve-pagination { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.ve-pagination a, .ve-pagination span { display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding-inline: .6rem; border-radius: var(--ve-radius-md); border: 1px solid var(--ve-border); font-size: var(--ve-text-sm); font-weight: 600; }
.ve-pagination a:hover { border-color: var(--ve-primary); color: var(--ve-primary); }
.ve-pagination .is-active { background: var(--ve-primary); color: #fff; border-color: var(--ve-primary); }
.ve-pagination .is-disabled { opacity: .45; }

/* ---- Small-screen safety --------------------------------------------------- */
@media (max-width: 30rem) {
  .ve-btn { white-space: normal; text-align: center; }
  .ve-cta__actions .ve-btn, .ve-drawer__cta .ve-btn { width: 100%; }
}

/* ---- Mobile buttons: full width, stacked, even spacing ------------------- */
@media (max-width: 40rem) {
  .ve-hero__actions, .ve-cta__actions, .ve-about__actions, .ve-section__foot, .ve-panel__foot, .ve-drawer__cta, .ve-banner__actions, .ve-form__actions {
    display: flex; flex-direction: column; align-items: stretch; gap: .75rem; width: 100%;
  }
  .ve-hero__actions .ve-btn, .ve-cta__actions .ve-btn, .ve-about__actions .ve-btn, .ve-section__foot .ve-btn, .ve-panel__foot .ve-btn, .ve-drawer__cta .ve-btn, .ve-banner__actions .ve-btn, .ve-form__actions .ve-btn, .ve-card__actions .ve-btn {
    width: 100%; white-space: normal; text-align: center;
  }
  .ve-card__actions { flex-direction: column; align-items: stretch; gap: .6rem; }
}

/* ==========================================================================
   Section rhythm (site-wide). A heading always has air under it and blocks
   never touch: set once here so every page — homepage bands, CMS pages,
   listings, detail pages — breathes the same way.
   ========================================================================== */
.ve-section > .ve-container > .ve-heading,
.ve-section > .ve-container > .ve-section__head { margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.ve-section > .ve-container > .ve-heading + *,
.ve-section > .ve-container > .ve-heading--center + * { margin-top: 0; }
.ve-heading + .ve-prose,
.ve-heading + .ve-grid,
.ve-heading + .ve-auto,
.ve-heading + .ve-carousel,
.ve-heading + .ve-fill { margin-top: clamp(1.5rem, 2.5vw, 2.25rem); }
.ve-heading { row-gap: .6rem; }
.ve-heading__lede { margin-top: .25rem; }
/* Two blocks of the same background in a row would otherwise read as one. */
.ve-section + .ve-section { padding-top: var(--ve-section-y); }

/* ---- Telling one section from the next -----------------------------------
   Bands alternate plain / soft grey automatically (see App\Services\HomeContent
   ::separate), so switching one off never leaves two identical ones touching.
   This is the safety net for the cases alternation cannot solve: a band the
   client has pinned to a colour that happens to repeat, and a band that only
   appears on one kind of device, which can vanish under its neighbours' feet.
   A hairline, not a rule you notice — the point is that the seam exists. */
.ve-section--divided { position: relative; }

.ve-section--divided::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  /* Fades out at both edges, so it reads as a deliberate seam rather than a
     table border ruled across the page. */
  background: linear-gradient(90deg,
    transparent,
    var(--ve-border, #ddd8ee) 18%,
    var(--ve-border, #ddd8ee) 82%,
    transparent);
  pointer-events: none;
}

/* On a dark or brand band the seam has to be light to be seen at all. */
.ve-section--divided.ve-section--dark::before,
.ve-section--divided.ve-section--brand::before {
  background: linear-gradient(90deg,
    transparent,
    rgb(255 255 255 / .22) 18%,
    rgb(255 255 255 / .22) 82%,
    transparent);
}
