/* ===== THEME & RESET ===== */
:root {
  --color-text: #000000;
  --color-muted: #333333;
  --color-surface: #efe9df;
  --color-surface-2: #e8e1d6;
  --color-border: #222222;
  --radius-card: 28px;
  --radius-sm: 8px;
  --container-max: 1200px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.06);
  --nav-height: 60px;
  --touch-target: 44px;
}

/* ===== PDF MODAL ===== */
.pdf-modal[hidden] { display: none !important; }
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}
.pdf-modal__dialog {
  position: relative;
  width: min(100vw - 2rem, 900px);
  height: min(90vh, 1000px);
  margin: 5vh auto 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== BOOKING MODAL ===== */
.booking-modal[hidden] { display: none !important; }
.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  overflow: hidden; /* prevent body scroll bleed */
  overscroll-behavior: contain; /* prevent scroll chaining to body */
}
.booking-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}
.booking-modal__dialog {
  position: relative;
  width: clamp(320px, 92vw, 720px);
  margin: 6vh auto 0;
  background: #fff;
  border: none; /* remove outer black border */
  border-radius: 16px;
  box-shadow: none; /* no shadow to avoid perceived border */
  outline: none; /* ensure no focus outline */
  /* Use dynamic viewport to adapt to mobile URL/keyboard changes */
  max-height: min(90dvh, 1000px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* keep scroll within dialog */
}
.booking-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none; /* remove button border */
  border-radius: 8px;
  background: #eee; /* subtle background without border */
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.booking-modal__content {
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 3vw, 2rem) 1.5rem;
}
.booking-modal__header {
  text-align: center;
  margin-bottom: 1rem;
}
.booking-modal__illustration {
  width: 160px; /* ~2.5x larger */
  height: 160px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 0.75rem;
  background: url("/media/booking-form-image.png") top center/contain no-repeat; /* ensure full image fits */
  border: none; /* ensure no border around the image */
  border-radius: 12px;
}
/* Booking PAGE: real IMG displayed at intrinsic size, responsive down */
.booking-illustration {
  display: block;
  width: 678px; /* 0.75x of 904px */
  height: auto;
  max-width: 100%;
  margin: 0 auto 1rem;
  border: 0;
}
/* Desktop: make booking illustration ~33% smaller */
@media (min-width: 1025px) {
  .booking-illustration {
    width: 452px; /* ~0.67 × 678px */
  }
}
.booking-modal__lead {
  color: var(--color-muted);
  margin-top: 0.5rem;
}
.booking-modal__sublead {
  color: var(--color-muted);
  margin: 0.5rem 0 1rem;
}

.booking-form {
  display: grid;
  gap: 0.9rem;
}
.form-field {
  display: grid;
  gap: 0.35rem;
}
.form-field label {
  font-weight: 600;
}
.form-field input {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: #000; /* Ensure entered text is visible */
  -webkit-text-fill-color: #000; /* iOS Safari */
  caret-color: #000;
  font-size: 1rem;
}
.form-field textarea {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: #000;
  -webkit-text-fill-color: #000;
  caret-color: #000;
  font-size: 1rem;
  min-height: 120px;
  resize: vertical;
}
.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #666;
  opacity: 1; /* Ensure consistent placeholder contrast */
}
/* Override iOS autofill styles to keep black text on white background */
.form-field input:-webkit-autofill,
.form-field textarea:-webkit-autofill {
  -webkit-text-fill-color: #000 !important;
  caret-color: #000;
  transition: background-color 9999s ease-out 0s; /* prevent yellow bg flash */
  box-shadow: 0 0 0px 1000px #fff inset;
}
.form-field input:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}
.form-field input[aria-invalid="true"] {
  border-color: #a40000;
  box-shadow: 0 0 0 1px rgba(164,0,0,0.15) inset;
}
.field-hint {
  font-size: 0.9rem;
  color: var(--color-muted);
}
.field-error {
  font-size: 0.9rem;
  color: #a40000;
}
.form-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}
.booking-modal__privacy {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
}
.booking-success {
  text-align: center;
  padding: 1rem 0;
}

/* Ensure hidden elements are fully removed from layout */
.booking-form[hidden] { display: none !important; }
.booking-modal__header[hidden] { display: none !important; }

/* Sending state */
.booking-sending[hidden] { display: none !important; }
.booking-sending {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.75rem;
  padding: 1rem 0;
  text-align: center;
}

/* Separate screen layout for sending/success */
.booking-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  min-height: 280px;
}
.booking-screen[hidden] { display: none !important; }

/* Back to form button inside booking screens */
.booking-screen .booking-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  background: transparent;
  border: none;
  color: #374151;
  font: inherit;
  padding: 6px 0;
  cursor: pointer;
}
.booking-screen .booking-back:hover { color: #111827; }
.booking-screen .booking-back:focus { outline: none; }
.booking-screen .booking-back:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; }
.booking-screen .booking-back svg { flex: 0 0 auto; }

.booking-error[hidden] { display: none !important; }

/* Success visuals */
.success-icon { 
  margin-bottom: 0.5rem; 
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
}
.booking-success h3 { font-size: 1.4rem; margin: 0.25rem 0 0.25rem; }
.booking-success p { font-size: 1rem; color: var(--color-text, #222); max-width: 28rem; }

/* Error visuals */
.error-icon {
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
}
.booking-error h3 { font-size: 1.4rem; margin: 0.25rem 0 0.25rem; color: #9B1C1C; }
.booking-error p { font-size: 1rem; color: var(--color-text, #222); max-width: 28rem; }
.booking-error .btn { margin-top: 0.25rem; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ddd;
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Form alert (errors/info) */
.form-alert[hidden] { display: none !important; }
.form-alert {
  margin-bottom: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #faf7f7;
  color: #7a0000;
}
.form-alert.is-error {
  border-color: #e1b6b6;
  background: #fff1f1;
  color: #7a0000;
}
.form-alert.is-success {
  border-color: #b6e1c3;
  background: #f1fff5;
  color: #0a5d2a;
}

/* ===== BOOKING PAGE (standalone) ===== */
.booking-page-body { background: #fff; }
.booking-page__topbar {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #eee;
  z-index: 100;
  padding: 0.75rem 2rem;
}
.booking-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  line-height: 1;
}
.booking-back-link svg { display: block; }
.booking-back-link:hover { background: #f7f7f7; border-color: #d5d5d5; }
.booking-back-link:active { background: #f0f0f0; transform: translateY(0.5px); }
.booking-back-link:focus { outline: none; box-shadow: 0 0 0 3px rgba(0,0,0,0.08); }
.booking-page {
  max-width: clamp(200px, 600px, 100vw); /* allow header image to display at its native width (904px) */
  margin: 0 auto;
  padding: 0.75rem 1.5rem 1.5rem;
}

@media (max-width: 768px) {
  /* Booking page tweaks for mobile */
  .booking-page__topbar { padding: 0.75rem 1rem; }
  .booking-page { 
    max-width: 300px; 
    padding: 0.75rem; 
  }
  .booking-back-link { padding: 0.625rem 0.9rem; border-radius: 999px; font-size: 1rem; }
  .booking-modal__illustration { width: 120px; height: 120px; aspect-ratio: 1 / 1; }
  .booking-modal__content { padding: 1rem 1rem 1.25rem; }
  .form-actions .btn { width: 100%; }
}

/* Very small phones and landscape phones: reduce top margin, allow taller dialog */
@media (max-height: 640px) {
  .booking-modal__dialog {
    margin-top: 2vh;
    max-height: 96dvh;
  }
}
.pdf-modal__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pdf-modal__frame {
  width: 100%;
  height: 100%;
  border: 0;
}
.pdf-modal__fallback {
  padding: 1rem;
}

/* Utility: visually hidden (for a11y headings) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 1px, 1px);
  white-space: nowrap; border: 0;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Offset anchor scrolling by navbar height; updated dynamically via JS */
  scroll-padding-top: var(--scroll-padding, 96px);
}

body {
  font-family: 'Lora', serif;
  background-color: #ffffff;
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
  /* Improve text rendering on mobile */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  /* Respect iOS safe areas */
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, var(--nav-bg-opacity, 1));
  transition: background-color 200ms ease, box-shadow 200ms ease, backdrop-filter 200ms ease;
  z-index: 999;
  /* Ensure navbar is always visible on mobile */
  min-height: var(--nav-height);
  /* Avoid notch overlap */
  padding-top: max(0px, env(safe-area-inset-top));
}

/* Ensure nav-toggle is hidden on desktop by default */
.nav-toggle {
  display: none !important;
}

/* Ensure nav-links are visible on desktop by default */
.nav-links {
  display: flex !important;
}

.navbar.navbar--blur {
  /* Always keep a subtle shadow; heavy blur guarded below */
  box-shadow: var(--shadow-sm);
}

/* Guard heavy blur for capable browsers and users without reduced transparency */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  @media (prefers-reduced-transparency: no-preference) {
    .navbar.navbar--blur {
      -webkit-backdrop-filter: saturate(180%) blur(8px);
      backdrop-filter: saturate(180%) blur(8px);
    }
  }
}

/* space between navbar and first card */
.navbar + .card {
  margin-top: 2rem;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.6rem;
  text-decoration: none;
  color: var(--color-text);
  font-family: 'Lora', serif;
  /* Ensure logo is readable on mobile */
  min-width: 0;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: underline;
  color: var(--color-text);
  padding: 0.25rem 0.25rem;
  transition: color 0.2s ease;
  /* Ensure touch targets are large enough */
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
}

@media (hover: hover) {
  .nav-links a:hover {
    color: #444;
  }
}

.nav-toggle {
  display: none; /* Hidden by default */
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  /* Ensure toggle button is large enough for touch */
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  align-items: center;
  justify-content: center;
  color: #000000 !important;
  -webkit-text-fill-color: #000000;
  appearance: none;
  -webkit-appearance: none;
}

.nav-toggle:hover,
.nav-toggle:active,
.nav-toggle:focus {
  color: #000000 !important;
  -webkit-text-fill-color: #000000;
}

/* Ensure SVG icon uses the current text color */
.nav-toggle svg {
  display: block;
  color: inherit;
}

/* ===== BUTTONS ===== */
.btn, .btn-outline {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
  /* Ensure buttons are large enough for touch */
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-weight: 600;
}

@media (hover: hover) {
  .btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
  }
}

.btn-outline {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

@media (hover: hover) {
  .btn-outline:hover {
    background: #f4f4f4;
    transform: scale(1.05);
  }
}

/* Avoid overflow on full-width buttons: don't scale on hover */
.btn-wide:hover,
.btn-hero:hover {
  transform: none;
}

/* ===== LAYOUT ===== */
section {
  padding: 2rem 1rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Ensure anchor-targeted sections leave room for sticky navbar */
section[id] {
  scroll-margin-top: var(--scroll-padding, 96px);
}

/* Increase vertical rhythm between sections */
section + section {
  margin-top: 4rem;
}

.hero, .about {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.5rem;
}

/* Card container styling to match design */
.card {
  background: #e8e1d6;
  border: none;
  border-radius: var(--radius-card);
  padding: 2rem;
  margin-bottom: 6rem;
}

.card-photo {
  display: inline-block;
  width: fit-content;
}

.hero-text, .about-text {
  flex: 1 1 400px;
}

.hero-image, .about-image {
  flex: 1 1 150px;
}

/* Make the hero photo bigger on desktop while staying responsive */
.hero-image {
  flex: 1 1 280px; /* 50% of previous base width */
  max-width: 340px; /* 50% of previous max */
  align-self: stretch; /* match the full height of the hero card */
  display: flex;
  justify-content: flex-end; /* hug the right edge */
  align-items: flex-end; /* sit flush to the bottom of the card */
  margin-top: 0;
  margin-left: auto; /* push image column to the far right */
}

/* Hide hero image on mobile */
@media (max-width: 768px) {
  .hero-image {
    display: none;
  }
}

/* Reduce space between text and image just for hero */
.hero {
  gap: 0.25rem;
  align-items: stretch; /* allow image column to reach card bottom */
}

/* Bring image closer to the right edge inside the hero card */
.hero.card {
  padding-top: 0; /* allow image to touch top rounded corner */
  padding-bottom: 0;
  padding-right: 0; /* let image approach the rounded edge */
  overflow: hidden; /* clip image to card radius */
}

/* Vertically center and limit line length of the hero text */
.hero-text {
  align-self: center;
  max-width: 640px;
  padding-top: 1.25rem; /* compensate for the hero card's missing top padding */
}

/* Subtitle as bold name, closer to title */
.display-subtitle {
  font-weight: 700;
  margin: 0.75rem 0 0.5rem;
}

/* Small meta lines like age/roles, closer spacing and darker color */
.kicker {
  color: #222;
  margin: 0.15rem 0;
  font-size: 1rem;
}

/* About layout refinements */
.about .display-title {
  margin-bottom: 1.5rem;
}

/* Hero text paragraph rhythm and width */
.hero-text p {
  margin: 0.5rem 0;
  max-width: 60ch;
  color: #333;
}

.about p + p {
  margin-top: 1rem;
}

.about-cta {
  display: inline-block;
  margin-top: 2rem;
}

/* About section typography to match hero look */
.display-title {
  font-size: clamp(2.25rem, 4.6vw + 1rem, 3.8rem);
  line-height: 1.06;
  font-weight: 700; /* available weight for Lora */
  letter-spacing: -0.01em;
  font-family: 'Lora', serif;
  margin-bottom: 1rem;
}

.display-subtitle {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  font-family: 'Lora', serif;
  margin: 1rem 0;
}

.kicker {
  color: #222;
  margin: 0.15rem 0;
  font-size: 1rem;
}

.btn-hero {
  padding: 1rem 1.5rem;
  font-size: 1rem;
  background: transparent;
  border: 2px solid var(--color-border);
}

/* Extra space between text and button on the first (hero) card */
.hero .btn-hero {
  margin-top: 2rem;
  border: 2px solid #333; /* outlined like reference */
  border-radius: 10px;
  width: 360px; /* fixed visual width on desktop */
  max-width: 100%;
}

.image-placeholder {
  width: 100%;
  min-height: 520px;
  background: repeating-linear-gradient(45deg, #ddd 0, #ddd 10px, #eee 10px, #eee 20px);
  border: 1px dashed #888;
  border-radius: 12px;
}

.image-placeholder.tall {
  min-height: 640px;
}

.hero-media,
.education-media {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

/* Visually crop transparent margins around the hero subject */
.hero-media {
  /* No cropping; show full image */
  -webkit-clip-path: none;
  clip-path: none;
}

/* Keep border only for education image */
.education-media {
  border-radius: 12px;
  /* no border per design */
  border: none;
}

/* Visually crop transparent margins around education image subject */
.education-media {
  -webkit-clip-path: none;
  clip-path: none;
}

/* Media frame and responsive video to replace photo in About section */
.media-frame {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: none; /* remove border around poster/video */
  /* Ensure transparent poster blends with card color */
  background: #e8e1d6;
}

.responsive-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5; /* portrait-like placeholder similar to previous photo */
  object-fit: cover;
}

/* Fill transparent areas of the poster and video with the card color */
.about .responsive-video {
  background: #e8e1d6;
}

/* Improve keyboard accessibility for media */
.responsive-video:focus-visible {
  outline: 3px solid var(--color-accent, #3b82f6);
  outline-offset: 2px;
}

/* When video is playing, let container control aspect and fit video to it.
   Aspect ratio is set inline on .media-frame from JS to match intrinsic media. */
.media-frame.playing .responsive-video {
  aspect-ratio: auto; /* override initial placeholder ratio */
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo {
  text-align: center;
}

.how-section {
  padding: 3.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto 2rem auto;
}

.how-section .display-title {
  margin-bottom: 1.75rem;
  text-align: center;
}

.how-section p + p {
  margin-top: 1rem;
}

.how-subtitle {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.how-list {
  margin-left: 1.25rem;
  padding-left: 1.25rem;
}

.how-list li {
  margin: 0.5rem 0;
  line-height: 1.7;
}

/* What I Work With section */
.what-section {
  padding: 3.5rem 2rem;
  max-width: var(--container-max);
  margin: 0 auto 3rem auto;
}

.what-section .display-title {
  text-align: center;
  margin-bottom: 2.25rem;
}

.what-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  justify-content: center;
}

.what-text p + p {
  margin-top: 1rem;
}

/* Allow the text column to shrink without forcing overflow */
.what-text { min-width: 0; }

.what-cta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-self: center;
}

/* Avoid micro layout jank in dense CTA area */
.what-cta .btn:hover,
.what-cta .btn-outline:hover {
  transform: none;
}

.btn-wide {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  padding: 1rem 1.25rem;
  text-align: center;
  width: 100%;
}

/* Make certain wide buttons dynamic-width on desktop (keep full-width on mobile) */
@media (min-width: 769px) {
  .btn-auto {
    width: auto;
    display: inline-flex;
  }
}

@media (max-width: 900px) {
  .what-grid {
    grid-template-columns: 1fr;
  }
  .what-cta {
    max-width: 360px;
  }
  .education-grid,
  .booking-grid {
    grid-template-columns: 1fr;
  }
  /* Center the photo card when stacked */
  .education-photo-card {
    margin: 0 auto;
  }
  /* Make education image smaller on small tablets/large phones */
  .education-photo-card .education-media {
    width: clamp(96px, 12vw, 120px);
    max-width: none;
  }
}

/* Education section */
.education-section {
  padding: 3.5rem 2rem;
  max-width: var(--container-max);
  margin: 0 auto 3rem auto;
}

.education-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* photo background takes half of the card */
  gap: 2.5rem;
  align-items: stretch; /* stretch columns to equal height */
}

/* Background card behind the education photo */
.education-photo-card {
  background: var(--color-surface);
  border-radius: 20px;
  padding: 0.75rem 0.75rem 0 0.75rem; /* keep sides/top, remove bottom so image touches the box */
  overflow: hidden;
  display: grid;
  justify-items: center; /* center image horizontally */
  align-items: center;   /* center image vertically */
  width: 100%; /* make the background box fill its half (column) */
  margin-left: 0;
  align-self: center; /* prevent stretching to full row height */
  justify-self: center; /* center image */
}

@media (max-width: 900px) {
  .education-photo-card {
    width: max-content;
  }
}

 /* Centered photo within half-card background */
 .education-photo-card .education-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;  /* safety: never distort */
 }
 @media (min-width: 901px) {
  .education-photo-card .education-media {
    width: calc(64% - 1.5rem); /* image + 0.75rem L/R padding = 64% of the column */
  }
 }

/* Align education text similarly to hero text on desktop */
.education-text {
  align-self: center;
}

.education-text .edu-subtitle {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  font-family: 'Lora', serif;
  margin: 2rem 0 0.75rem 0;
}

/* XL screens: match the hero's larger photo column */
@media (min-width: 1200px) {
  .education-grid {
    grid-template-columns: 1fr 1fr; /* keep half/half at XL too */
  }
}

.edu-list {
  margin-left: 1.25rem;
  padding-left: 1.25rem;
}

.edu-list li {
  margin: 0.5rem 0;
}

/* Booking / Contact CTA */
.booking-section {
  padding: 3.5rem 2rem 6rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Defer rendering of below-the-fold sections with tuned intrinsic sizes */
.about,
.how-section,
.what-section,
.education-section,
.booking-section,
.site-footer {
  content-visibility: auto;
}

.about { contain-intrinsic-size: 720px; }
.how-section { contain-intrinsic-size: 820px; }
.what-section { contain-intrinsic-size: 900px; }
.education-section { contain-intrinsic-size: 900px; }
.booking-section { contain-intrinsic-size: 720px; }
.site-footer { contain-intrinsic-size: 420px; }

.booking-grid {
  display: flex;
  justify-content: center;
}

.booking-text .display-title {
  margin-bottom: 1rem;
}

.social-icons {
  display: flex;
  gap: 1rem;
  margin: 1rem 0 2rem 0;
}

.social-icons a {
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--color-text);
}

.booking-btn {
  margin-top: 1rem;
}

.icon-placeholder {
  width: 36px;
  height: 36px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  font-weight: 700;
}

/* Social icon buttons (SVG-based, inherit currentColor) */
.social-icon {
  width: 36px;
  height: 36px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-text);
}

.social-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.boxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 6rem;
}

.box {
  background: #efe9df;
  border: none;
  border-radius: 28px;
  padding: 2rem;
  text-align: center;
  flex: 1;
  min-width: 150px;
}

/* Footer */
.site-footer {
  padding: 3rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3rem;
}

.footer-title {
  font-family: 'Lora', serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li + li {
  margin-top: 0.5rem;
}

.footer-links a {
  color: var(--color-text);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== ANIMATIONS ===== */
.animate-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease-out;
}

.animate-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== MOBILE-FIRST RESPONSIVE DESIGN ===== */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
  .nav-container {
    padding: 0.9rem 1.5rem;
  }
  
  .hero, .about {
    gap: 2rem;
  }
  
  .what-grid {
    gap: clamp(1.5rem, 5vw, 4rem);
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  }
  
  .education-grid {
    gap: 2rem;
  }
}

/* Tablets */
@media (max-width: 900px) {
  .nav-container {
    padding: 0.9rem 1.25rem;
  }
  
  section {
    padding: 1.75rem 1.25rem;
  }
  
  .card {
    padding: 1.75rem;
    margin-bottom: 4rem;
  }
  
  .hero, .about {
    gap: 1.75rem;
  }
  /* Slightly larger hero image on tablets too */
  .hero-image {
    flex-basis: 240px; /* 50% */
    max-width: 280px; /* 50% */
  }
  
  .what-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .what-cta {
    max-width: 360px;
    margin: 0 auto;
  }
  
  .education-grid,
  .booking-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  /* Improve mobile performance */
  * {
    -webkit-tap-highlight-color: transparent;
  }
  /* Remove black focus box/ring from mobile nav items */
  .nav-links a:focus,
  .nav-links a:focus-visible,
  .nav-links a:focus-within,
  .nav-links a:active {
    outline: none !important;
    box-shadow: none !important;
  }
  
  /* Better mobile scrolling */
  html {
    -webkit-overflow-scrolling: touch;
  }
  /* Navigation improvements */
  .nav-container {
    padding: 0.75rem 1rem;
  }
  
  .nav-logo {
    font-size: 1.4rem;
  }
  
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    width: 100%;
    border-top: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none !important;
    padding: 1rem 0 max(1rem, env(safe-area-inset-bottom));
  }
  
  .nav-links.show {
    display: flex !important;
  }
  
  .nav-links a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1.1rem;
    justify-content: center;
  }
  
  .nav-links a:last-child {
    border-bottom: none;
  }
  
  .nav-toggle {
    display: flex !important;
  }
  
  /* Layout improvements */
  .hero, .about {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  /* Constrain hero image on mobile for good balance */
  .hero-image {
    width: 120px; /* smaller on mobile */
    max-width: 120px; /* cap as well */
    margin-inline: auto;
  }

  /* Make education image smaller on mobile (override with higher specificity) */
  .education-photo-card .education-media {
    width: 100%; /* fill the constrained card width */
    max-width: 100%;
    height: auto;
    margin-inline: auto;
  }

  /* Reduce card padding and avoid transform so layout height matches visuals */
  .education-photo-card {
    transform: none; /* ensure no layout/visual mismatch */
    padding: 0.25rem; /* match smaller image */
    width: 160px;       /* doubled size on mobile */
    max-width: 160px;   /* constrain overall card width on mobile */
    margin-inline: auto; /* keep centered */
  }

  /* Reduce bottom spacing after Education section on mobile */
  .education-section {
    padding-bottom: 1rem; /* less internal space at bottom */
    margin: 0 auto 1.5rem; /* less external bottom margin */
    content-visibility: visible; /* avoid reserving extra height on mobile */
    contain-intrinsic-size: auto; /* match actual content height */
  }

  /* Also decrease the gap before the next section just after Education */
  .education-section + section {
    margin-top: 1.5rem;
  }

  /* Ensure the hero img fits the smaller container */
  .hero-image .hero-media {
    width: 100%;
    height: auto;
  }

/* Extra-large screens: let photo grow a bit more and tighten right padding */
@media (min-width: 1200px) {
  .hero-image {
    flex-basis: 380px; /* 50% */
    max-width: 440px; /* 50% */
    margin-right: 0; /* reset container margins; shift inner image instead */
    margin-left: 0; /* reset container margins */
  }
  .hero-image .hero-media { width: calc(100% + 12rem); transform: translateX(-12rem); will-change: transform; display:block; }
  .hero.card {
    padding-right: 0; /* keep flush on wide screens too */
  }
  /* No cropping on wide screens */
}
  
  /* Desktop: add more space between hero text and image */
  @media (min-width: 1025px) {
    .hero {
      gap: 0; /* no extra space between text and image */
      justify-content: flex-start; /* no distributed space */
    }
    /* Increase specificity so later generic .hero, .about gap rules don't override */
    .hero.card { gap: 0; }
    .hero-image {
      margin-left: 0; /* reset container margins */
      margin-right: 0; /* reset container margins */
    }
    .hero-image .hero-media { width: calc(100% + 10rem); transform: translateX(-10rem); will-change: transform; display:block; }
  }
  
  section {
    padding: 1.5rem 1rem;
  }
  
  section + section {
    margin-top: 3rem;
  }
  
  .card {
    padding: 1.5rem;
    margin-bottom: 3rem;
    border-radius: 20px;
  }
  
  .navbar + .card {
    margin-top: 1.5rem;
  }
  
  /* Typography improvements */
  .display-title {
    font-size: clamp(1.75rem, 5vw + 1rem, 2.5rem);
    line-height: 1.2;
  }
  
  .display-subtitle {
    font-size: 1.5rem;
  }
  
  .kicker {
    font-size: 1.1rem;
  }
  
  /* Button improvements */
  .btn, .btn-outline, .btn-hero, .btn-wide {
    width: 100%;
    max-width: 320px;
    margin: 0.75rem auto;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    /* Better touch feedback */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    /* Prevent text selection on double tap */
    -webkit-user-select: none;
    user-select: none;
  }
  
  .btn-hero {
    margin-top: 2rem;
  }
  
  /* Image improvements */
  .image-placeholder {
    min-height: 300px;
    border-radius: 16px;
  }
  
  .image-placeholder.tall {
    min-height: 400px;
  }
  
  /* Section-specific improvements */
  .how-section,
  .what-section,
  .education-section,
  .booking-section {
    padding: 2rem 1rem;
  }
  
  /* Education mobile spacing overrides (after generic mobile rules) */
  .education-grid {
    gap: 1rem; /* tighter internal spacing within the section */
  }
  .education-section {
    padding-bottom: 0.75rem; /* reduce internal bottom padding */
    margin: 0 auto 1rem;     /* reduce external bottom margin */
  }
  .education-section + section {
    margin-top: 0.75rem; /* tighter gap before the next section */
  }
  /* Reduce top padding of Booking when it follows Education */
  .education-section + .booking-section {
    padding-top: 0.75rem;
  }
  
  .how-section .display-title {
    margin-bottom: 1.5rem;
  }
  
  .what-section .display-title {
    margin-bottom: 1.75rem;
  }
  
  .education-text .edu-subtitle {
    font-size: 1.75rem;
    margin: 1.5rem 0 0.75rem 0;
  }
  
  .social-icons {
    justify-content: center;
    margin: 1.5rem 0 2rem 0;
  }
  
  .icon-placeholder,
  .social-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  
  /* Footer improvements */
  .site-footer {
    padding: 2rem 1rem 3rem;
  }
  
  .footer-title {
    font-size: 1.5rem;
    text-align: center;
  }
  
  .footer-links {
    text-align: center;
  }
  
  .footer-links a {
    padding: 0.5rem 0;
    display: block;
  }
  
  /* Hide the brand/social block in footer on mobile to avoid
     duplicating contact info that's shown just above */
  .site-footer .footer-grid .footer-col:first-child {
    display: none;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  /* Ensure minimum touch targets */
  .nav-toggle,
  .nav-links a,
  .btn,
  .btn-outline,
  .btn-hero,
  .btn-wide,
  .icon-placeholder,
  .social-icon {
    min-height: 44px;
    min-width: 44px;
  }
  .nav-container {
    padding: 0.75rem 0.75rem;
  }
  
  .nav-logo {
    font-size: 1.3rem;
  }
  
  section {
    padding: 1.25rem 0.75rem;
  }
  
  .card {
    padding: 1.25rem;
    margin-bottom: 2.5rem;
    border-radius: 16px;
  }
  
  .hero, .about {
    gap: 1.5rem;
  }
  
  .display-title {
    font-size: clamp(1.5rem, 6vw + 1rem, 2.25rem);
  }
  
  .display-subtitle {
    font-size: 1.4rem;
  }
  
  .kicker {
    font-size: 1.1rem;
  }
  
  .btn, .btn-outline, .btn-hero, .btn-wide {
    max-width: 280px;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
  
  .image-placeholder {
    min-height: 250px;
    border-radius: 12px;
  }
  
  .image-placeholder.tall {
    min-height: 350px;
  }
  
  .how-section,
  .what-section,
  .education-section,
  .booking-section {
    padding: 1.75rem 0.75rem;
  }
  
  .social-icons {
    gap: 0.75rem;
  }
  
  .icon-placeholder,
  .social-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
  /* Reduce padding in landscape to save space */
  .nav-container {
    padding: 0.5rem 1rem;
  }
  
  .nav-links {
    max-height: 70vh;
    overflow-y: auto;
  }
  
  .hero, .about {
    flex-direction: row;
    text-align: left;
    gap: 1.5rem;
  }
  
  .hero-text, .about-text {
    flex: 1 1 50%;
  }
  
  .hero-image, .about-image {
    flex: 1 1 40%;
  }
  
  /* Adjust section padding for landscape */
  section {
    padding: 1.25rem 1rem;
  }
  
  .card {
    padding: 1.25rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .image-placeholder {
    border-width: 0.5px;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-fade {
    transition: none;
    opacity: 1;
    transform: none;
  }
  
  .btn:hover,
  .btn-outline:hover {
    transform: none;
  }
}

/* Dark mode support (if user prefers) */
@media (prefers-color-scheme: dark) {
  /* Keep your current light theme but add dark mode variables for future use */
  :root {
    --color-text-dark: #ffffff;
    --color-surface-dark: #1a1a1a;
    --color-surface-2-dark: #2a2a2a;
  }
}

/* Active nav link */
.nav-links a.active {
  text-decoration: underline;
  font-weight: 700;
  position: relative;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background-color: var(--color-border);
  border-radius: 1px;
}

/* Mobile-specific active state */
@media (max-width: 768px) {
  .nav-links a.active {
    background-color: transparent;
    border-left: none;
    padding-left: 1.5rem;
    font-weight: inherit;
    color: inherit;
  }
  
  .nav-links a.active::after {
    display: none;
  }
  
  /* Add a subtle indicator for the current section */
  .nav-links a.active::before {
    display: none;
    content: none;
  }
}

/* Focus styles for accessibility */
/* Prefer focus-visible outlines for better mobile UX */
.btn:focus-visible,
.btn-outline:focus-visible,
.btn-hero:focus-visible,
.btn-wide:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}
.btn:focus:not(:focus-visible),
.btn-outline:focus:not(:focus-visible),
.btn-hero:focus:not(:focus-visible),
.btn-wide:focus:not(:focus-visible),
.nav-toggle:focus:not(:focus-visible) {
  outline: none;
}

/* Remove focus outline box for navbar links on desktop only */
@media (min-width: 769px) {
  .nav-links a:focus,
  .nav-links a:focus-visible {
    outline: none;
    outline-offset: 0;
  }
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  /* Ensure it's completely hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: none;
  /* Completely remove from layout */
  pointer-events: none;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.skip-link:focus {
  top: 6px;
  opacity: 1;
  visibility: visible;
  /* Restore interaction when focused */
  pointer-events: auto;
  clip: auto;
  clip-path: none;
}

/* Print styles */
@media print {
  .navbar,
  .nav-toggle,
  .btn,
  .btn-outline,
  .btn-hero,
  .btn-wide {
    display: none !important;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    margin-bottom: 2rem;
  }

/* ===== Safe-area and modal tweaks ===== */
/* Respect safe areas inside dialogs and top bars */
.booking-modal__dialog {
  margin-top: max(6vh, env(safe-area-inset-top));
}
.pdf-modal__dialog {
  margin-top: max(5vh, env(safe-area-inset-top));
}
.booking-page__topbar {
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-left: max(2rem, env(safe-area-inset-left));
  padding-right: max(2rem, env(safe-area-inset-right));
}

/* Connection-aware reduced effects */
html.reduced-effects .animate-fade {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
html.reduced-effects .navbar.navbar--blur {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
@media (hover: hover) {
  html.reduced-effects .btn:hover,
  html.reduced-effects .btn-outline:hover {
    transform: none !important;
  }
}
  
  .image-placeholder {
    border: 1px solid #ccc;
    background: #f9f9f9;
  }
}
