/* ==========================================================================
   Dr Lambrechts: Paediatrician site
   Kid-friendly, warm, parent-reassuring theme
   ========================================================================== */

:root {
  /* Vintage storybook palette: cream paper, duck-egg blue, balloon red, soft bunny brown */
  --color-bg: #fdf8ec;
  --color-bg-alt: #e9f3f4;
  --color-primary: #5a9aa8;
  --color-primary-dark: #35707d;
  --color-accent: #d9584a;       /* balloon red: small motif accents only */
  --color-accent-dark: #bf4437;
  --color-cta: #f3a68f;          /* soft peach coral for buttons */
  --color-cta-dark: #ec957c;
  --color-cta-text: #3f322d;
  --color-yellow: #f6dd8e;
  --color-bunny: #b9917a;
  --color-text: #3a3532;
  --color-text-soft: #6b625c;
  --color-white: #fffdf8;
  --color-border: #e6dccb;

  --font-heading: 'Baloo 2', 'Quicksand', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;

  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-soft: 0 10px 30px rgba(53, 112, 125, 0.10);
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary-dark);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-primary-dark);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

address { font-style: normal; }

.site-header nav { display: contents; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.85em 1.8em;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* transparent border keeps primary and outline buttons the same height side by side */
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--color-cta);
  color: var(--color-cta-text);
  box-shadow: 0 8px 22px rgba(243, 166, 143, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--color-cta-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 248, 236, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.nav-brand .brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-brand .brand-badge img {
  width: 34px;
  height: 34px;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary-dark);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: var(--color-bg-alt);
  color: var(--color-primary-dark);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.nav-toggle svg path {
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: 12px 12px;
}

.nav-toggle[aria-expanded="true"] .l1 { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .l2 { opacity: 0; }
.nav-toggle[aria-expanded="true"] .l3 { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
    transition: max-height 0.25s ease;
  }

  .nav-links.open {
    max-height: 400px;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 14px 24px;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links li:last-child {
    padding: 14px 24px 18px;
  }

  .nav-links li:last-child a {
    display: inline-block;
    width: auto;
    border-bottom: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 64px 0;
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  overflow: hidden;
}

/* Storybook motifs: a hopping bunny low in the corner and a red balloon drifting above.
   A nod to the practice's bunny-painted rooms; drawings are original. */
.hero::after {
  content: "";
  position: absolute;
  right: 3%;
  bottom: -10px;
  width: 260px;
  height: 234px;
  background: url("/assets/img/bunny-silhouette.svg") no-repeat center / contain;
  opacity: 0.14;
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  right: 9%;
  top: 28px;
  width: 44px;
  height: 88px;
  background: url("/assets/img/balloon.svg") no-repeat center / contain;
  opacity: 0.9;
  pointer-events: none;
  animation: balloon-drift 6s ease-in-out infinite;
}

@keyframes balloon-drift {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

@media (max-width: 860px) {
  .hero::before { display: none; }
  /* stacked layout: the photo card fills the bottom, so the bunny peeks in top right instead */
  .hero::after {
    width: 170px;
    height: 153px;
    opacity: 0.1;
    top: 12px;
    right: -28px;
    bottom: auto;
  }
}

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

.hero-image .bunny-placeholder {
  width: 160px;
  height: auto;
  margin: 0 auto 12px;
}

/* Real photo in the hero card: square, no dashed frame, sits inside the rounded border */
.hero-image.has-photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 420px;
  justify-self: center;
  padding: 0;
  overflow: hidden;
  border: 6px solid var(--color-white);
  background: var(--color-bg-alt);
  font-style: normal;
}

.hero-image.has-photo picture,
.team-avatar picture {
  display: contents;
}

.hero-image.has-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 6px);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero {
    padding: 48px 0 32px;
  }

  /* stacked hero ends with the photo card; pull the next section up to it */
  .hero + .section {
    padding-top: 36px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }
}

.hero-eyebrow {
  display: inline-block;
  background: var(--color-yellow);
  color: var(--color-text);
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero-image {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-soft);
  font-style: italic;
  border: 2px dashed var(--color-border);
  text-align: center;
  padding: 24px;
}

/* ---------- Sections ---------- */

.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

/* Outlined icons: duck-egg stroke, one small accent (red, blush or butter) */
.icon,
.age-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--color-bg-alt);
  color: var(--color-primary-dark);
  flex-shrink: 0;
}

.icon {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
}

.age-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.icon svg,
.age-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon svg { width: 30px; height: 30px; }
.age-icon svg { width: 24px; height: 24px; }

.icon .ac, .age-icon .ac { fill: var(--color-accent); }
.icon .acl, .age-icon .acl { fill: var(--color-accent); fill-opacity: 0.4; }
.icon .pk, .age-icon .pk { fill: #f2c6c2; }
.icon .yl, .age-icon .yl { fill: var(--color-yellow); }
.icon .ac-stroke, .age-icon .ac-stroke { stroke: var(--color-accent); }
.icon .pk-stroke, .age-icon .pk-stroke { stroke: #fff; stroke-opacity: 0.8; }

/* ---------- Team ---------- */

#team {
  scroll-margin-top: 80px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  gap: 24px;
  justify-content: center;
}

.team-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 28px;
  text-align: center;
}

.team-avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  border: 4px solid var(--color-yellow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card h3 {
  margin-bottom: 2px;
}

.team-role {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin-bottom: 12px;
}

/* ---------- Blog list ---------- */

.post-list {
  display: grid;
  gap: 24px;
}

.post-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--color-border);
}

.post-card .post-date {
  color: var(--color-text-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-grid figure {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
}

.gallery-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* ---------- Content lists ---------- */

.card ul,
.prose ul {
  padding-left: 1.2em;
  margin: 0 0 1em;
}

.card li,
.prose li {
  margin-bottom: 0.35em;
}

.prose {
  max-width: 760px;
  margin: 0 auto;
}

.prose p {
  font-size: 1.05rem;
}

.age-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.age-card .age-range {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-soft);
  margin-bottom: 12px;
}

.note {
  background: var(--color-white);
  border-left: 5px solid var(--color-yellow);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 24px 0;
}

/* ---------- FAQ ---------- */

.faq details {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 24px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--color-accent);
  flex-shrink: 0;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq .faq-body {
  padding: 0 24px 20px;
}

/* ---------- Placeholder helper ---------- */

.placeholder-block {
  background: var(--color-white);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  color: var(--color-text-soft);
  font-style: italic;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding: 48px 0 24px;
}

.site-footer a {
  color: var(--color-white);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 20px;
  font-size: 0.85rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
}

/* ==========================================================================
   Motion and depth. Everything here is decorative; content is fully
   readable with JS off or with prefers-reduced-motion set.
   ========================================================================== */

/* ---------- Soft watercolour blobs behind sections ---------- */

.section-alt {
  background:
    radial-gradient(600px 320px at 8% 0%, rgba(243, 166, 143, 0.16), transparent 70%),
    radial-gradient(520px 300px at 95% 100%, rgba(246, 221, 142, 0.28), transparent 70%),
    var(--color-bg-alt);
}

.hero {
  background:
    radial-gradient(700px 360px at 12% 20%, rgba(246, 221, 142, 0.22), transparent 70%),
    radial-gradient(520px 320px at 88% 90%, rgba(243, 166, 143, 0.14), transparent 70%),
    linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.site-footer {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(90, 154, 168, 0.35), transparent 70%),
    var(--color-primary-dark);
}

/* ---------- Header ---------- */

.site-header {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 6px 24px rgba(53, 112, 125, 0.10);
  background: rgba(253, 248, 236, 0.97);
}

.nav-brand .brand-badge {
  transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.3s ease;
}

.nav-brand:hover .brand-badge {
  transform: rotate(-10deg) scale(1.08);
  box-shadow: 0 6px 16px rgba(246, 221, 142, 0.6);
}

/* Sliding underline on nav links (desktop) */
@media (min-width: 761px) {
  .nav-links a:not(.btn) {
    position: relative;
    padding-bottom: 2px;
  }

  .nav-links a:not(.btn)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
  }

  .nav-links a:not(.btn):hover::after,
  .nav-links a:not(.btn).active::after {
    transform: scaleX(1);
  }
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
  pointer-events: none;
}

.btn:hover::after {
  left: 120%;
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn-primary:hover {
  box-shadow: 0 12px 28px rgba(243, 166, 143, 0.5);
}

/* ---------- Cards ---------- */

.card,
.team-card,
.post-card,
.faq details {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card {
  background: linear-gradient(160deg, var(--color-white) 0%, var(--color-white) 65%, #fbf3e3 100%);
}

.card:hover,
.team-card:hover,
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(53, 112, 125, 0.14);
  border-color: rgba(90, 154, 168, 0.45);
}

.icon,
.age-icon {
  transition: background-color 0.3s ease, transform 0.3s cubic-bezier(.34, 1.56, .64, 1), color 0.3s ease;
}

.card:hover .icon,
.age-card:hover .age-icon {
  background: var(--color-yellow);
  transform: rotate(-6deg) scale(1.08);
}

.post-card:hover h3 {
  color: var(--color-primary);
}

.team-avatar {
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.team-card:hover .team-avatar {
  transform: scale(1.05);
  border-color: var(--color-cta);
}

/* ---------- In-text links ---------- */

main p a:not(.btn),
main li a:not(.btn) {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.2s ease;
}

main p a:not(.btn):hover,
main li a:not(.btn):hover {
  background-size: 100% 2px;
  color: var(--color-primary);
}

/* ---------- FAQ ---------- */

.faq summary::after {
  transition: transform 0.3s ease, color 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.faq details:hover {
  border-color: rgba(90, 154, 168, 0.45);
}

.faq details[open] .faq-body {
  animation: faq-in 0.35s ease both;
}

@keyframes faq-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Scroll reveal (only when JS is present) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.22, .61, .36, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Keep hover transforms working after reveal */
.js .reveal.in.card:hover,
.js .reveal.in.team-card:hover,
.js .reveal.in.post-card:hover {
  transform: translateY(-5px);
}

/* ---------- Hero entrance and idle motion ---------- */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-9px) rotate(0.4deg); }
}

@keyframes hop {
  0%, 70%, 100% { transform: translateY(0); }
  80% { transform: translateY(-14px); }
  90% { transform: translateY(-4px); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero .hero-eyebrow,
  .hero h1,
  .hero > .container > div:first-child > p,
  .hero .hero-actions {
    animation: fade-up 0.7s cubic-bezier(.22, .61, .36, 1) both;
  }

  .hero h1 { animation-delay: 0.08s; }
  .hero > .container > div:first-child > p { animation-delay: 0.18s; }
  .hero .hero-actions { animation-delay: 0.28s; }

  .hero-image {
    animation: fade-up 0.8s 0.25s cubic-bezier(.22, .61, .36, 1) both, float 7s 1.1s ease-in-out infinite;
  }

  .hero-image .bunny-placeholder {
    animation: wiggle 5s 2s ease-in-out infinite;
    transform-origin: 50% 90%;
  }

  .hero::after {
    animation: hop 6s 3s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
