/* ==========================================
   Astra Technical College: main stylesheet
   ========================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Brand colours */
  /* Primary brand: burgundy, to match the red in the logo.
     #7b1e2e on white is about 10:1 contrast (WCAG AA needs 4.5:1). */
  --color-primary: #7b1e2e;
  /* Green only where it means something: WhatsApp and "success" */
  --color-success: #1e5631;
  --color-navy: #12264a;
  --color-navy-dark: #0d1c38;
  --color-gold: #c9a227;
  --color-gold-light: #e2c15a;
  --color-white: #ffffff;
  --color-grey-light: #f5f7fa;
  --color-slate: #3b4a63;
  --color-border: #e4e8ef;
  /* Form and button edges: 3.7:1 on white (WCAG asks for 3:1) */
  --color-border-strong: #7b8699;
  --color-placeholder: #f7eff0;

  /* Fonts */
  --font-heading: "Montserrat", sans-serif;
  --font-body: "Inter", sans-serif;

  /* Spacing, corners, shadow */
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 3rem;
  --space-xl: 6rem;
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(18, 38, 74, 0.12);

  /* Layout: content is max 1240px wide, centred, with at least
     1.5rem of space at the sides on small screens */
  --content-width: 1240px;
  --gutter: max(var(--space-m), (100% - var(--content-width)) / 2);
  --space-section: 4rem;
  /* Height of the compact sticky header you see while scrolling.
     A starting guess: main.js replaces it with the real measured height. */
  --header-height: 5.3rem;
}

@media (min-width: 64em) {
  :root {
    --space-section: 6rem;
    --header-height: 6rem;
  }
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

/* height: auto lets an image keep its shape when CSS changes its width.
   The width/height in the HTML still reserve the space while it loads. */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

/* Make the "hidden" attribute always win, even over display: flex */
[hidden] {
  display: none !important;
}

/* Menu links land just below the sticky header, not hidden under it */
html {
  scroll-padding-top: var(--header-height);
}

/* Smooth scrolling, unless the visitor has asked for less motion */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- 3. Base typography ---------- */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-slate);
  background: var(--color-white);
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-navy);
}

h1 {
  font-size: clamp(2.25rem, 4vw + 1rem, 3.375rem);
}

h2 {
  font-size: clamp(1.75rem, 2vw + 1rem, 2.375rem);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

a {
  color: var(--color-primary);
  text-underline-offset: 0.2em;
}

address {
  font-style: normal;
}

:focus-visible {
  outline: 3px solid var(--color-navy);
  outline-offset: 3px;
}

/* Gold on dark backgrounds, where navy would disappear */
.site-header :focus-visible,
.hero :focus-visible,
.admissions :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--color-gold);
}

/* ---------- 4. Reusable components ---------- */
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.badge {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  background: var(--color-gold);
  color: var(--color-navy);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  display: inline-block;
  padding: 1rem 1.75rem;
  border: 2px solid transparent;
  border-radius: var(--radius-s);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-navy);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}

.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: var(--space-m);
  border: 2px dashed #9fbfa9;
  border-radius: var(--radius-m);
  background: var(--color-placeholder);
  color: var(--color-slate);
  font-size: 0.9375rem;
  text-align: center;
}

/* Section headings block (eyebrow + h2 + optional link) */
.section-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.section-header > a {
  font-weight: 700;
}

@media (min-width: 40em) {
  .section-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 0.75rem 1.5rem;
  }

  .section-header > * {
    grid-column: 1;
  }

  .section-header > a {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* Hidden on screen, still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hidden above the page until a keyboard user presses Tab */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--color-gold);
  color: var(--color-navy);
  font-weight: 600;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- 5. Header (mobile first) ---------- */
/* Sticky: scrolls with the page until it reaches the top, then stays
   there, so the menu is always one click away */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-navy);
  border-bottom: 4px solid var(--color-gold);
  color: var(--color-white);
}

.utility-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 0.5rem var(--gutter);
  background: var(--color-primary);
  font-size: 0.75rem;
}

.utility-bar ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

/* Phones: short labels ("Call", "Email") keep the bar on one line.
   The full details are still read out by screen readers. */
.utility-detail {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 40em) {
  .utility-detail {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}

.utility-bar ul,
.site-header nav ul {
  list-style: none;
}

/* Padding is set on .nav-list and .dropdown themselves. A broad
   "nav ul { padding: 0 }" here would override them (specificity). */
.utility-bar ul {
  padding: 0;
}

.utility-bar a,
.site-header nav a {
  color: var(--color-white);
  text-decoration: none;
}

/* Phone: logo on the left, then menu button and Apply Now on the right */
.header-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem var(--gutter);
}

.logo {
  margin-right: auto;
}

/* Transparent, cropped logo (400px wide file, shown at half size
   so it stays sharp on high-resolution screens). An SVG would be best. */
.logo img {
  width: 140px;
  height: auto;
}

.header-main > .btn {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

/* Hamburger button: three lines drawn with CSS */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-white);
  cursor: pointer;
}

.menu-toggle-icon,
.menu-toggle-icon::before,
.menu-toggle-icon::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.menu-toggle-icon {
  position: relative;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-icon::before {
  top: -7px;
}

.menu-toggle-icon::after {
  top: 7px;
}

/* When open, the three lines become an X */
.menu-toggle[aria-expanded="true"] .menu-toggle-icon {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Phone menu: a full-width panel under the header, hidden until opened */
.nav-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 0.5rem var(--gutter) 1.5rem;
  background: var(--color-navy);
  border-bottom: 4px solid var(--color-gold);
  font-weight: 600;
}

.menu-toggle[aria-expanded="true"] + .nav-list {
  display: flex;
}

.nav-list > li {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-list > li > a,
.has-dropdown > button {
  display: block;
  width: 100%;
  padding: 0.875rem 0;
  text-align: left;
}

.has-dropdown > button {
  border: 0;
  background: none;
  color: var(--color-white);
  font-weight: 600;
  cursor: pointer;
}

.has-dropdown > button::after {
  content: "▾" / "";
  display: inline-block;
  margin-left: 0.35rem;
}

.has-dropdown > button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* Phone: sub-menu links shown indented inside the panel */
.dropdown {
  padding: 0 0 0.75rem 1rem;
}

/* Sub-menus are closed until their button is clicked */
.js .has-dropdown > button[aria-expanded="false"] + .dropdown {
  display: none;
}

.site-header .dropdown a {
  display: block;
  padding: 0.4rem 0;
  color: #c5cedc;
  font-weight: 500;
}

/* No-JS fallback: main.js can't run, so the ☰ button would do nothing.
   Hide it and just show the links. (The "js" class is added in <head>.) */
html:not(.js) .menu-toggle {
  display: none;
}

html:not(.js) .header-main {
  flex-wrap: wrap;
}

html:not(.js) .header-main nav {
  order: 1;
  width: 100%;
}

html:not(.js) .nav-list {
  display: flex;
  position: static;
  max-height: none;
  padding: 0;
}

/* Laptop and up: menu in a row, drop-downs float below */
@media (min-width: 64em) {
  .utility-bar {
    padding: 0.625rem var(--gutter);
    font-size: 0.8125rem;
  }

  .header-main {
    justify-content: space-between;
    gap: 2rem;
  }

  .logo {
    margin-right: 0;
  }

  .logo img {
    width: 160px;
  }

  .header-main > .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .menu-toggle {
    display: none;
  }

  .nav-list {
    display: flex;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.75rem;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: none;
    border: 0;
    font-size: 0.9375rem;
  }

  .nav-list > li {
    border-top: 0;
  }

  .nav-list > li > a,
  .has-dropdown > button {
    width: auto;
    padding: 0.5rem 0;
  }

  .has-dropdown {
    position: relative;
  }

  .dropdown {
    position: absolute;
    top: 100%;
    left: -1rem;
    min-width: 16rem;
    padding: 0.5rem 0;
    border-radius: var(--radius-m);
    background: var(--color-white);
    box-shadow: var(--shadow);
  }

  .site-header .dropdown a {
    padding: 0.5rem 1rem;
    color: var(--color-navy);
    font-weight: 600;
  }

  /* White panel: navy outline (3 classes beat the header's 2) */
  .site-header .dropdown a:hover {
    background: var(--color-grey-light);
    color: var(--color-navy);
  }

  .site-header .dropdown :focus-visible {
    outline-color: var(--color-navy);
  }

  /* No-JS fallback: put the menu back in the row and open
     drop-downs on hover or keyboard focus instead of click */
  html:not(.js) .header-main {
    flex-wrap: nowrap;
  }

  html:not(.js) .header-main nav {
    order: 0;
    width: auto;
  }

  html:not(.js) .dropdown {
    display: none;
  }

  html:not(.js) .has-dropdown:hover .dropdown,
  html:not(.js) .has-dropdown:focus-within .dropdown {
    display: block;
  }
}

/* Compact header: main.js adds .is-scrolled once you scroll down,
   so the pinned header takes up less of the screen */
.site-header.is-scrolled .utility-bar {
  padding-block: 0.25rem;
}

.site-header.is-scrolled .logo img {
  width: 100px;
}

@media (min-width: 64em) {
  .site-header.is-scrolled .logo img {
    width: 120px;
  }

  .site-header.is-scrolled .header-main > .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9375rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .logo img,
  .utility-bar {
    transition:
      width 0.2s,
      padding 0.2s;
  }
}

/* ---------- 6. Sections ---------- */
main > section {
  padding: var(--space-section) var(--gutter);
}

/* Hero: two layers. On top, a see-through gradient (the overlay) that
   keeps the white text readable. Underneath, the photo.
   Phones get a smaller file (900px wide, 51 KB) and an even overlay,
   because the text covers the whole photo there. */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.375rem;
  background-color: var(--color-navy);
  background-image:
    linear-gradient(rgba(18, 38, 74, 0.86), rgba(18, 38, 74, 0.78)),
    url("../assets/hero-students-small.webp");
  background-size: cover;
  background-position: 70% center;
  color: var(--color-white);
}

/* Wider screens: the full-size photo (109 KB). The overlay stays dark
   behind the text (side gutter + 40rem, the headline's max width) and
   only fades out after it, so the trainer on the right stays visible
   but the text is always readable, whatever the screen width. */
@media (min-width: 40em) {
  .hero {
    background-image:
      linear-gradient(
        90deg,
        rgba(18, 38, 74, 0.92),
        rgba(18, 38, 74, 0.82) calc(var(--gutter) + 40rem),
        rgba(18, 38, 74, 0.15)
      ),
      url("../assets/hero-students.webp");
    /* Near the top, so no heads get cut off on wide screens */
    background-position: center top;
  }
}

/* Desktop: the hero fills the rest of the first screen below the
   header (8rem tall), so no white strip of the next section peeks in.
   max() keeps it at least 560px tall on very short screens.
   svh = 1% of the screen's height. */
@media (min-width: 64em) {
  .hero {
    min-height: max(560px, 100svh - 8rem);
  }
}

.hero h1 {
  max-width: 40rem;
  color: var(--color-white);
}

.hero p:not(.badge) {
  max-width: 34rem;
  color: #e6efe8;
  font-size: 1.125rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

/* About */
.about {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3.5rem;
}

/* Same flex size the placeholder had; corners and shadow match the
   Director's photo so the two sections feel like one set */
.about > img {
  flex: 1 1 420px;
  min-width: 0;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
}

.about-text {
  flex: 1 1 480px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.125rem;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
  list-style: none;
  padding: 0;
  font-weight: 600;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.checklist li::before {
  content: "✓" / "";
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-navy);
  font-weight: 800;
  line-height: 1.75rem;
  text-align: center;
}

/* Message from the Director */
.director {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3.5rem;
  background: var(--color-grey-light);
}

/* Portrait photo: 4:5 shape, never wider than 420px, so the face
   doesn't become huge on wide screens or when it wraps above the text. */
.director > img,
.director > .image-placeholder {
  flex: 1 1 280px;
  min-width: 0; /* let it shrink below the file's 640px on phones */
  max-width: 420px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
}

.director-text {
  flex: 2 1 480px;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.director blockquote {
  padding-left: 1.5rem;
  border-left: 4px solid var(--color-gold);
  font-size: 1.125rem;
  font-style: italic;
}

/* Space between the paragraphs of the message */
.director blockquote p + p {
  margin-top: 0.875rem;
}

.director figcaption {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  font-size: 0.9375rem;
}

.director figcaption strong {
  color: var(--color-navy);
}

/* Mission & Vision: click to reveal (<details>/<summary>, no JS) */
.mission-vision {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: start;
  gap: 1rem;
  width: 100%;
}

.mission-vision details {
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-s);
  background: var(--color-grey-light);
}

.mission-vision details + details {
  border-left-color: var(--color-gold);
}

.mission-vision summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

/* Hide the browser's default triangle (Safari needs the second rule) */
.mission-vision summary::-webkit-details-marker {
  display: none;
}

/* Our own + / − sign */
.mission-vision summary::after {
  content: "+" / "";
  font-size: 1.25rem;
  line-height: 1;
}

.mission-vision details[open] summary::after {
  content: "−" / "";
}

.mission-vision details p {
  padding: 0 1.25rem 1rem;
  font-size: 0.9375rem;
}

/* Programmes */
.programmes {
  background: var(--color-grey-light);
}

.programmes .section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 0.5rem;
}

.filters button {
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-white);
  color: var(--color-navy);
  font-weight: 600;
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-white);
}

/* max-width stops the cards growing huge on wide screens: the grid
   stays at most ~1100px wide (three cards) and is centred. */
.programme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin-inline: auto;
}

.programme-card,
.news-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-white);
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1.5rem;
}

/* Each card's accent colour, set once per school category.
   Used by the thick line under the photo. */
.programme-card {
  --card-accent: var(--color-primary);
}

.programme-card[data-category="technical-ict"] {
  --card-accent: var(--color-navy);
}

.programme-card[data-category="creative-arts"] {
  --card-accent: var(--color-gold);
}

/* Card photo (and placeholder): same 16:10 shape on every card, so a
   row of cards lines up. object-fit: cover fills the box without
   stretching the photo, trimming the edges if needed. */
.programme-card > img,
.programme-card .image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 0;
  object-fit: cover;
  border: 0;
  border-bottom: 4px solid var(--card-accent);
  border-radius: 0;
}

/* Programme cards are a little more compact than news cards */
.programme-card > img,
.programme-card .image-placeholder {
  aspect-ratio: 16 / 9;
}

.programme-card .card-body {
  gap: 0.75rem;
  padding: 1.25rem;
}

/* Course list: ticks and thin dividers instead of bullets */
.programme-card ul {
  flex: 1;
  width: 100%;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.programme-card li {
  display: flex;
  gap: 0.75rem;
  padding: 0.45rem 0;
}

.programme-card li + li {
  border-top: 1px solid var(--color-border);
}

/* A small burgundy circle with a white tick inside.
   The circle is the box itself (border-radius: 50%); the tick is a tiny
   SVG drawn as a background image, so no extra HTML is needed. */
.programme-card li::before {
  content: "";
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  margin-top: 0.27rem; /* lines the circle up with the first line of text */
  border-radius: 50%;
  background: var(--color-primary)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.3 4.7-4.9' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 100% no-repeat;
}

/* Admissions (dark section) */
.admissions {
  background: var(--color-navy);
  color: #d3dbe8;
}

.admissions h2,
.admissions h3 {
  color: var(--color-white);
}

.admissions .eyebrow {
  color: var(--color-gold-light);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.25rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  border-radius: var(--radius-m);
  background: #1a3260;
  counter-increment: step;
}

.steps li::before {
  content: counter(step, decimal-leading-zero) / "";
  color: var(--color-gold-light);
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

/* News */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.news-card .image-placeholder {
  min-height: 200px;
  border: 0;
  border-radius: 0;
}

.news-card time {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Contact */
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 3rem;
  background: var(--color-grey-light);
}

.contact-info {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.contact-info dl {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

/* "Campus: Hurukai..." on one line, wrapping if it's too long */
.contact-info dl div {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.35rem;
}

.contact-info dt {
  font-weight: 700;
  color: var(--color-navy);
}

.contact-info dt::after {
  content: ":";
}

.contact-info dd a {
  color: inherit;
}

/* Form: 2 columns when there's room, 1 column on narrow screens */
.contact-form {
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.125rem;
  padding: 1.5rem;
  border-radius: var(--radius-m);
  background: var(--color-white);
  box-shadow: var(--shadow);
}

@media (min-width: 40em) {
  .contact-form {
    padding: 2rem;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-field-full,
.contact-form button {
  grid-column: 1 / -1;
}

.contact-form label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.optional {
  font-weight: 400;
  color: var(--color-slate);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-white);
  color: var(--color-navy);
}

.contact-form textarea {
  resize: vertical;
}

/* Form messages */
.field-error {
  color: #b42318;
  font-size: 0.8125rem;
  font-weight: 600;
}

.contact-form [aria-invalid="true"] {
  border-color: #b42318;
}

.form-status {
  grid-column: 1 / -1;
  color: var(--color-success);
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

.form-note {
  grid-column: 1 / -1;
  font-size: 0.875rem;
}

/* ---------- Privacy page: a narrow column is easier to read ---------- */
.legal {
  max-width: 44rem;
  margin-inline: auto;
}

.legal h1 {
  margin-top: 0.5rem;
  color: var(--color-navy);
}

.legal h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
  color: var(--color-navy);
}

.legal p + p,
.legal p + ul,
.legal ul + p {
  margin-top: 0.875rem;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li + li {
  margin-top: 0.375rem;
}

.legal .updated {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

/* ---------- 7. Footer ---------- */
.site-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  padding: 4rem var(--gutter) 6rem;
  background: var(--color-navy-dark);
  color: #c5cedc;
  font-size: 0.875rem;
}

/* Phone: extra bottom space so the floating WhatsApp button
   doesn't cover the copyright line */
@media (min-width: 40em) {
  .site-footer {
    padding-bottom: 2rem;
  }
}

.site-footer h2 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--color-white);
}

.site-footer ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.site-footer a {
  color: #c5cedc;
  text-decoration: none;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.footer-brand img {
  width: 200px;
  height: auto;
}

.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: var(--space-m);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8125rem;
}

.footer-bottom ul {
  flex-direction: row;
  gap: 1.25rem;
}

/* ---------- 8. Floating WhatsApp ---------- */
/* Stays in the bottom-right corner while the page scrolls */
.whatsapp-float {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 100;
  display: inline-block;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-success);
  color: var(--color-white);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Phone: show just "Chat with us"; screen readers still hear the full text */
.whatsapp-extra {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 40em) {
  .whatsapp-extra {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}

/* ---------- 9. Hover effects ----------
   (hover: hover) = only on devices with a mouse, so phones don't
   get "stuck" hover colours after a tap. The cards aren't links,
   so they don't lift: hover should only promise what's clickable. */
@media (hover: hover) {
  .btn-primary:hover {
    background: var(--color-gold-light);
    border-color: var(--color-gold-light);
  }

  .btn-outline:hover {
    background: var(--color-white);
    color: var(--color-navy);
  }

  .filters button:hover {
    border-color: var(--color-navy);
  }

  .site-header nav a:hover,
  .has-dropdown > button:hover {
    color: var(--color-gold-light);
  }

  a:hover {
    text-decoration-thickness: 2px;
  }

  .whatsapp-float:hover {
    background: #17432a;
  }
}

/* Smooth colour changes and a small lift, unless the visitor
   has asked their device for less motion */
@media (prefers-reduced-motion: no-preference) {
  .btn,
  .filters button,
  .whatsapp-float,
  .site-header a {
    transition:
      background-color 0.2s,
      border-color 0.2s,
      color 0.2s,
      transform 0.2s;
  }

  @media (hover: hover) {
    .btn:hover {
      transform: translateY(-2px);
    }
  }
}
