/* ============================================================
   Laudium Secondary — design tokens & base styles
   Loaded on every page. Page-specific CSS builds on top of this.
   ============================================================ */

:root {
  /* Brand colors (from the site's existing Astra palette) */
  --color-navy: #2c3091;
  --color-navy-dark: #1b1e5c;
  --color-navy-deep: #243673;
  --color-red: #ec1e22;
  --color-red-dark: #c5181b;
  --color-yellow: #ffd400;
  --color-ink: #26262c;
  --color-muted: #63636e;
  --color-surface: #f6f7fd;
  --color-surface-alt: #eceefa;
  --color-white: #ffffff;
  --color-border: #e1e3f0;

  --gradient-navy: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-deep) 100%);
  --gradient-red: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-dark) 100%);

  /* Type */
  --font-heading: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --fs-sm: clamp(0.83rem, 0.79rem + 0.18vw, 0.95rem);
  --fs-base: clamp(1rem, 0.95rem + 0.22vw, 1.125rem);
  --fs-md: clamp(1.15rem, 1.06rem + 0.4vw, 1.375rem);
  --fs-lg: clamp(1.3rem, 1.18rem + 0.55vw, 1.65rem);
  --fs-xl: clamp(1.65rem, 1.4rem + 1.15vw, 2.5rem);
  --fs-2xl: clamp(2.1rem, 1.65rem + 2.05vw, 3.5rem);
  --fs-hero: clamp(2.4rem, 1.8rem + 2.7vw, 4.25rem);
  --fs-stat: clamp(2.5rem, 1.9rem + 2.75vw, 4.25rem);

  /* Fluid spacing */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: clamp(1rem, 0.93rem + 0.3vw, 1.25rem);
  --space-md: clamp(1.5rem, 1.28rem + 0.95vw, 2.25rem);
  --space-lg: clamp(2.25rem, 1.75rem + 2.2vw, 4rem);
  --space-xl: clamp(3.5rem, 2.7rem + 3.5vw, 6rem);
  --space-2xl: clamp(4.5rem, 3.3rem + 5.2vw, 8rem);

  --container-width: 1280px;
  --container-pad: clamp(1.25rem, 4vw + 0.5rem, 3rem);

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-full: 999px;

  --shadow-sm: 0 2px 10px rgba(38, 38, 44, 0.07);
  --shadow-md: 0 16px 40px -12px rgba(38, 38, 44, 0.18);
  --shadow-lg: 0 30px 70px -20px rgba(28, 31, 92, 0.3);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s var(--ease);
  --header-h: 78px;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--color-ink);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  font-weight: 600;
  color: var(--color-navy-dark);
}

p {
  max-width: 68ch;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-red);
  outline-offset: 3px;
}

::selection {
  background: var(--color-navy);
  color: var(--color-white);
}

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

.skip-link {
  position: fixed;
  top: -60px;
  left: var(--space-sm);
  z-index: 200;
  background: var(--color-navy);
  color: var(--color-white);
  padding: 0.75em 1.25em;
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}

.skip-link:focus {
  top: var(--space-sm);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Layout helpers */
.container {
  width: min(100% - (var(--container-pad) * 2), var(--container-width));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-xl);
}

.section-head {
  max-width: 62ch;
  margin-bottom: var(--space-lg);
}

.section-head--center {
  max-width: 62ch;
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: var(--space-xs);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-red);
}

.section-head h2 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.01em;
}

.section-head p {
  margin-top: var(--space-sm);
  font-size: var(--fs-md);
  color: var(--color-muted);
}

.lede {
  font-size: var(--fs-md);
  color: var(--color-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 1.9em;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-base);
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  transition: transform var(--transition);
}

.btn-primary {
  background: var(--color-red);
  color: var(--color-white);
  box-shadow: 0 10px 24px -8px rgba(236, 30, 34, 0.55);
}

.btn-primary:hover {
  background: var(--color-red-dark);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -8px rgba(236, 30, 34, 0.55);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-navy);
  border: 1.5px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-navy);
  transform: translateY(-2px);
}

.btn:hover svg {
  transform: translateX(3px);
}

/* Icons */
.icon {
  width: 1.4em;
  height: 1.4em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Reusable card surface */
.surface {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ---- Page hero (About / Activities / Contact) ---- */
.page-hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient-navy);
  color: var(--color-white);
  padding-block: calc(var(--space-2xl) - var(--space-sm)) var(--space-2xl);
}

.page-hero::before,
.page-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.page-hero::before {
  width: clamp(220px, 30vw, 480px);
  aspect-ratio: 1;
  right: clamp(-140px, -6vw, -40px);
  top: -18%;
  background: radial-gradient(circle at 30% 30%, rgba(236, 30, 34, 0.55), transparent 70%);
}

.page-hero::after {
  width: clamp(180px, 22vw, 360px);
  aspect-ratio: 1;
  left: clamp(-120px, -8vw, -30px);
  bottom: -25%;
  background: radial-gradient(circle at 60% 40%, rgba(255, 212, 0, 0.35), transparent 70%);
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero .eyebrow {
  color: var(--color-yellow);
}

.page-hero .eyebrow::before {
  background: var(--color-yellow);
}

.page-hero h1 {
  font-size: var(--fs-hero);
  color: var(--color-white);
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.page-hero .lede {
  color: rgba(255, 255, 255, 0.82);
  margin-top: var(--space-sm);
  max-width: 56ch;
  font-size: var(--fs-md);
}

.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-lg);
}

.page-hero-meta > div {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.page-hero-meta .icon {
  color: var(--color-yellow);
  margin-top: 0.2rem;
}

.page-hero-meta strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.page-hero-meta span {
  display: block;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.75);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: var(--space-md);
}

.breadcrumb a:hover {
  color: var(--color-white);
}

/* ---- Floating-label form (shared by Contact + Admissions) ---- */
.contact-form {
  margin-top: var(--space-md);
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 1fr 1fr;
}

.contact-form .field.field-full {
  grid-column: 1 / -1;
}

@media (max-width: 599.98px) {
  .contact-form {
    grid-template-columns: 1fr;
  }
}

.field {
  position: relative;
}

.field input,
.field textarea {
  width: 100%;
  padding: 1.4rem 1rem 0.55rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--color-ink);
  transition: border-color var(--transition), background-color var(--transition);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field label {
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  color: var(--color-muted);
  pointer-events: none;
  transition: all var(--transition);
  font-size: 1rem;
  line-height: 1;
}

.field .required {
  color: var(--color-red);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-navy);
  background: var(--color-white);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-navy);
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-color: var(--color-red);
}

.field-hint {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--color-red);
  min-height: 1.1em;
}

.contact-form .form-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  margin-top: var(--space-xs);
  min-width: 0;
}

.form-footer .btn {
  min-width: 180px;
}

.form-footer .btn[disabled] {
  opacity: 0.7;
  cursor: progress;
  transform: none !important;
}

.form-status {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5em;
  font-size: var(--fs-sm);
  font-weight: 500;
  min-height: 1.4em;
}

.form-status-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.form-status a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-status .icon {
  width: 1.15em;
  height: 1.15em;
}

.form-status[data-state="success"] {
  color: #1f9d55;
}

.form-status[data-state="error"] {
  color: var(--color-red);
}

.form-status[data-state=""] .icon,
.form-status:empty {
  display: none;
}

/* ---- Hero-overlap strip (a card row floating over the bottom of a page-hero) ---- */
.hero-overlap {
  margin-top: calc(var(--space-2xl) * -1 + var(--space-md));
  position: relative;
  z-index: 2;
}

/* ---- Stats strip (About + Home) ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 700px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--color-white);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.stat-number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.15em;
  font-family: var(--font-heading);
  font-size: var(--fs-stat);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1;
}

.stat-number .suffix {
  font-size: 0.5em;
  color: var(--color-red);
}

.stat-label {
  margin-top: var(--space-xs);
  font-size: var(--fs-sm);
  color: var(--color-muted);
  font-weight: 500;
}

/* ---- Pillar cards (Admissions + Academics) ---- */
.pillar-grid {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.pillar-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: var(--space-md);
  background: var(--color-white);
  transition: transform var(--transition), box-shadow var(--transition);
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-navy);
}

.pillar-card:nth-child(2) .pillar-icon {
  background: #fff2e0;
  color: var(--color-red);
}

.pillar-card:nth-child(3) .pillar-icon {
  background: #eefaf1;
  color: #1f9d55;
}

.pillar-card h3 {
  font-size: 1rem;
  line-height: 1.35;
}

.pillar-card p {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.pillar-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-navy);
}

.pillar-card .card-link .icon {
  width: 0.9em;
  height: 0.9em;
  transition: transform var(--transition);
}

.pillar-card:hover .card-link .icon {
  transform: translateX(3px);
}

/* ---- Subject cards (Home highlights + full Academics grid) ---- */
.subject-grid {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.subject-card {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.subject-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-navy);
}

.subject-grid .subject-card:nth-child(4n + 2) .subject-icon {
  background: #fff2e0;
  color: var(--color-red);
}

.subject-grid .subject-card:nth-child(4n + 3) .subject-icon {
  background: #eefaf1;
  color: #1f9d55;
}

.subject-grid .subject-card:nth-child(4n) .subject-icon {
  background: #eef1fd;
  color: var(--color-navy-deep);
}

.subject-card h3 {
  font-size: 1.05rem;
}

.subject-card p {
  color: var(--color-muted);
  font-size: var(--fs-sm);
}

/* ---- Inline newsletter form ---- */
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-md);
}

.newsletter-form .field {
  flex: 1 1 260px;
}

.newsletter-form .field input {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-full);
}

.newsletter-form .field label {
  left: 1.25rem;
  top: 1rem;
}

.newsletter-form .field input:focus + label,
.newsletter-form .field input:not(:placeholder-shown) + label {
  top: -0.6rem;
  left: 1rem;
  padding-inline: 0.35rem;
  background: var(--color-white);
  border-radius: var(--radius-full);
}

.newsletter-form .btn {
  flex: 0 0 auto;
}

.newsletter-form .form-status {
  flex-basis: 100%;
}
