/* =========================================================
   Clinica Joelle — Front page only
   Loaded only on is_front_page(). Nothing here should be
   referenced by header.php, footer.php, or any inner page.
   ========================================================= */

/* ---- Hero ---- */
/* Creates the two columns */
.hero-text-split {
  display: grid;
  grid-template-columns: 1fr 1.5fr; /* Heading takes 1 part, content takes 1.5 parts */
  gap: 40px;
  align-items: start; /* Aligns both columns to the top */
  width: 100%;
}

/* Stacks the buttons vertically like in the image */
.hero-actions-stacked {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start; /* Keeps buttons aligned to the left */
  margin-top: 24px;
}

/* Ensures buttons have consistent width if desired */
.hero-actions-stacked .btn {
  text-align: center;
  min-width: 240px;
}

.hero {
  min-height: clamp(450px, 100vh, 830px);
  display: grid;
  grid-template-columns: 50% 50%;
  position: relative;
  background: var(--bg);
  overflow: hidden;
}
/* Column, not a centred single item: the headline is a flex sibling pulled up
   over the photo with a negative margin, so the overlap is a fixed number of
   lines at every viewport height rather than a percentage that only lands
   right on one screen size. */
.hero-left {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(72px, 13vh, 190px);
}
/* Warm sand. The portrait was shot on a white studio background, so it can
   only dissolve into a light panel — on the dark version its own backdrop
   read as a grey rectangle. Painted in CSS: no request, and no JPEG banding
   across a large smooth gradient. */
.hero-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(65% 50% at 70% 80%, rgba(176, 141, 79, .20) 0%, rgba(176, 141, 79, 0) 72%),
    linear-gradient(165deg, #f3eee6 0%, #e9e1d5 55%, #ddd2c2 100%);
}
.hero-image {
  position: relative;
  /* Above .hero-content (z-index 2). Both are children of .hero and neither
     parent makes a stacking context, so with equal z-index the later element
     in the DOM wins — which would draw the decorative rule across the photo
     instead of letting it disappear behind her. */
  z-index: 3;
  width: 60%;
  /* joelle.jpg is 490x700, so this cap renders it below native — sharp, no
     upscaling. `top` rather than `center` because the frame is shorter than
     the photo and the crop should come off the bottom, not off her head. */
  max-width: 460px;
  aspect-ratio: 1 / 1.15;
  background: url("../images/joelle.jpg") center top / cover;
  /* Feathered into the espresso instead of sitting on it as a hard rectangle.
     The solid core is centred at 40% height so her face stays at full opacity
     and only the edges dissolve. No box-shadow — a cast shadow needs an edge
     to cast from, and there isn't one any more. */
  -webkit-mask-image: radial-gradient(78% 72% at 50% 42%, #000 58%, transparent 100%);
  mask-image: radial-gradient(78% 72% at 50% 42%, #000 58%, transparent 100%);
}
.hero-overlap-text {
  position: relative;
  z-index: 4;   /* still above the photo, which is now 3 */
  /* Full panel width so the text starts at the panel's edge, not the photo's,
     then pulled back up over the photo's lower edge. */
  align-self: stretch;
  margin: -1.15em 0 0;
  padding: 0 8%;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  text-align: left;
  font-size: clamp(2rem, 3vw, 4rem);
  line-height: 1;
  white-space: nowrap;
  /* No text-shadow: it existed to lift white type off a dark photo, and the
     type is dark on a light panel now. */
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg);
}
.split-heading h2 {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 0;
}
.split-heading h2::after {
  content: "";
  position: absolute;
  top: 20%;
  left: -115%;
  width: 980%;
  height: clamp(28px, 4.5vw, 50px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C200,75 350,35 600,50 C800,60 950,30 1100,40' fill='none' stroke='%232e2a26' stroke-width='1.5' opacity='0.5'/%3E%3C/svg%3E") no-repeat center;
  background-size: 100% 100%;
  transform: translateY(-50%) rotate(-4deg);
  z-index: -1;
  pointer-events: none;
}
.hero .lead { max-width: 460px; font-size: 1.1rem; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }

/* ---- Intro ---- */
.intro { background: #fff; padding-bottom: 40px; }
.intro-large {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.25;
  color: var(--ink);
  font-weight: 400;
  max-width: 1000px;
  text-align: left;
  margin: 0;
}

/* ---- Service Cards ---- */
.services {
  background: #ffffff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.service-card, .article-card { background: transparent; border: 0; padding: 0; }

.card-bar { height: 8px; width: 100%; }
.bar-green { background: #c2d7bf; height:15px }
.bar-brown { background: #512326; height:15px }
.bar-beige { background: #e7c8ae; height:15px }

.service-card .card-image, .article-card .card-image {
  width: 100%;
  margin-top: 15px;
  aspect-ratio: 5 / 4;
  height: auto;
  object-fit: cover;
  margin-bottom: 18px;
}
.service-card h3 { font-size: 1.8rem; margin-bottom: 12px; }
.service-card p { font-size: 0.95rem; color: var(--muted); margin-bottom: 24px; min-height: 50px; }

.btn-card {
  padding: 12px 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: inline-block;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.bg-green { background: #c2d7bf; color: var(--ink); border-color: #c2d7bf; }
.bg-green:hover { background: #aebdb0; border-color: #aebdb0; }
.bg-brown { background: #512326; color: #fff; border-color: #512326; }
.bg-brown:hover { background: #3e1b1d; border-color: #3e1b1d; }
.bg-beige { background: #e7c8ae; color: var(--ink); border-color: #e7c8ae; }
.bg-beige:hover { background: #d4b59b; border-color: #d4b59b; }

/* ---- Band & Final CTA (Two Image Layouts) ---- */
.cta-final { background: #fff; height:750px; }

.cta-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 60px;
  align-items: center;
}
.split-text { max-width: 480px; }
.split-text h2 { margin-bottom: .4em; }

.image-pair {
  display: flex;
  gap: 24px;
}

/* Final CTA layout details */
.cta-images {
  align-items: center;
}
.cta-images .img-left-wrap {
  width: 42%;
  position: relative;
}
.cta-images .img-left {
  width: 100%;
  aspect-ratio: 3 / 4; /* Document is portrait */
  object-fit: cover;
}
.cta-images .img-right {
  width: 58%;
  aspect-ratio: 1 / 1; /* Glass drop is square */
  object-fit: cover;
}
.cta-clip {
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
}

/* ---- Results Dark Section (Black Gallery) ---- */
.results-dark {
  background: #000;
  color: #fff;
  padding: 100px 0;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 60px;
}
.results-text { max-width: 700px; text-align: left; }
.results-dark h2 {
  color: #fff;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: 0.3em;
  font-weight: 400;
}
.muted-light { color: #e0e0e0; font-size: 1.05rem; margin: 0; }
.btn.light-border {
  border: 1px solid #fff;
  color: #fff;
  background: transparent;
}
.btn.light-border:hover { background: #fff; color: #000; }

.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding-top: 20px;
  padding-bottom: 40px;
}
.polaroid {
  background: #fff;
  padding: 12px 12px 48px 12px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.polaroid img {
  width: 100%;
  /* Source files are 4:5 before/after composites - never crop them, both
     halves and the labels have to stay visible. */
  aspect-ratio: 4/5;
  object-fit: contain;
  background: #fff;
  display: block;
}

/* Binder clip styling - shaded steel clip, not a flat silhouette. */
.clip {
  position: absolute;
  width: 34px;
  height: 51px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 72'%3E %3Cdefs%3E %3ClinearGradient id='cw' x1='0' y1='0' x2='1' y2='0'%3E %3Cstop offset='0' stop-color='%235f646a'/%3E%3Cstop offset='.28' stop-color='%23f2f4f6'/%3E %3Cstop offset='.5' stop-color='%23b6bbc1'/%3E%3Cstop offset='.78' stop-color='%23dfe3e7'/%3E %3Cstop offset='1' stop-color='%23565b61'/%3E%3C/linearGradient%3E %3ClinearGradient id='cb' x1='0' y1='0' x2='1' y2='0'%3E %3Cstop offset='0' stop-color='%230a0a0c'/%3E%3Cstop offset='.13' stop-color='%233d4046'/%3E %3Cstop offset='.3' stop-color='%23141517'/%3E%3Cstop offset='.58' stop-color='%230d0e10'/%3E %3Cstop offset='.8' stop-color='%232e3136'/%3E%3Cstop offset='1' stop-color='%23090909'/%3E%3C/linearGradient%3E %3ClinearGradient id='cl' x1='0' y1='0' x2='0' y2='1'%3E %3Cstop offset='0' stop-color='%236a6e74'/%3E%3Cstop offset='1' stop-color='%232b2d31'/%3E%3C/linearGradient%3E %3C/defs%3E %3Cg stroke='url(%23cw)' fill='none' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.8'%3E %3Cpath d='M16 34 L11.5 13 Q11 8.5 15.5 8.5 L21.5 8.5 Q25 8.5 24 12'/%3E %3Cpath d='M32 34 L36.5 13 Q37 8.5 32.5 8.5 L26.5 8.5 Q23 8.5 24 12'/%3E %3C/g%3E %3Cpath d='M6 30 h36 a2.5 2.5 0 0 1 2.5 2.5 v26 a6 6 0 0 1 -6 6 h-29 a6 6 0 0 1 -6 -6 v-26 a2.5 2.5 0 0 1 2.5 -2.5 z' fill='url(%23cb)'/%3E %3Cpath d='M6 30 h36 a2.5 2.5 0 0 1 2.5 2.5 v2.5 h-41 v-2.5 a2.5 2.5 0 0 1 2.5 -2.5 z' fill='url(%23cl)'/%3E %3Crect x='9.5' y='36' width='4.5' height='26' rx='2' fill='%23fff' opacity='.14'/%3E %3Crect x='37' y='36' width='2.5' height='26' rx='1.2' fill='%23fff' opacity='.07'/%3E %3C/svg%3E") no-repeat center;
  background-size: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45));
  z-index: 3;
}
.p-1 .clip { top: -20px; left: 50%; transform: translateX(-50%); }
.p-2 .clip { bottom: -20px; left: 25%; transform: rotate(180deg); }
.p-3 .clip { bottom: -20px; right: 25%; transform: rotate(180deg); }
.p-4 .clip { top: -20px; left: 50%; transform: translateX(-50%); }

.p-1 { transform: rotate(-2deg); }
.p-2 { transform: rotate(1.5deg) translateY(15px); }
.p-3 { transform: rotate(-1.5deg) translateY(5px); }
.p-4 { transform: rotate(2.5deg) translateY(10px); }

/* ---- Before/After Slider ---- */
.ba-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-top: 64px;
}
.ba-slider {
  position: relative;
  /* Matches the 1000x500 source files, so neither side is cropped. */
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  user-select: none;
}
.ba-slider-image {
  position: absolute;
  inset: 0;
}
.ba-slider-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ba-before img { filter: grayscale(65%) brightness(.82) contrast(.92); }
.ba-after {
  clip-path: inset(0 0 0 var(--pos));
}
.ba-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: #fff;
  transform: translateX(-50%);
  pointer-events: none;
}
.ba-slider-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
.ba-slider-handle::before {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  color: var(--ink);
  font-size: 1rem;
}
.ba-slider-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}
.ba-label {
  position: absolute;
  top: 16px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  pointer-events: none;
}
.ba-label-before { left: 16px; }
.ba-label-after { right: 16px; }
.ba-caption { margin-top: 20px; font-size: .8rem; }

/* ---- Values ---- */
/* No fixed height — it was 560px, which left ~180px of empty ground below
   the four columns. The section's own padding sizes it now. */
.values { background: #f4f1e9; }
.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  position: relative;
  padding-top: 78px;
}
.values-grid::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 36' preserveAspectRatio='none'%3E%3Cpath d='M-50,14 C20,12 60,10 125,10 C220,10 280,26 375,26 C470,26 530,8 625,8 C710,8 780,20 875,20 C930,20 980,16 1050,16' fill='none' stroke='%2377736d' stroke-width='1.5' opacity='0.7'/%3E%3C/svg%3E") no-repeat center;
  background-size: 100% 100%;
}
.value::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c2d7bf;
  transform: translateX(-50%);
}
.value:nth-child(1)::before { top: -71px; }
.value:nth-child(2)::before { top: -55px; }
.value:nth-child(3)::before { top: -73px; }
.value:nth-child(4)::before { top: -61px; }
.value { position: relative; border-top: 0; padding-top: 0; }
.value-label {
  display: block;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.value h4 { display: none; }
.value p { color: var(--ink); font-family: var(--font-display); font-size: 1.8rem; line-height: 1.18; }

/* ---- Doctor ---- */
.doctor.section { padding: clamp(56px, 8vw, 96px) 0; }
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
/* The portrait panel that filled the left half was removed, so this is a
   single centred text block now rather than a bleeding 50/50 split. */
.doctor .container.split {
  grid-template-columns: 1fr;
}
.doctor .split-text {
  max-width: 620px;
  margin-inline: auto;
}

/* ---- Articles ---- */
.articles {
  background: #fff;
}

.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 44px;
  gap: 24px;
}

.articles-title-wrap {
  max-width: 800px;
}

.articles-title-wrap h2 {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  margin-bottom: 0.3em;
  font-weight: 400;
}

.articles-title-wrap p {
  font-weight: bolder;
}

.card-grid.four {
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.article-card {
  background: #f0dfcf; /* Soft beige background */
  padding: 16px;
}

.article-card .card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1; /* Forces perfectly square images */
  margin: 0 0 16px;
  object-fit: cover;
}

.article-card h3 {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 1000;
  letter-spacing: .12em;
  line-height: 1.45;
  text-transform: uppercase;
  color: #9d5a49;
  margin: 0;
}

/* ---- Statement (the old testimonial slot) ---- */
.testimonial {
  background: #512326;
  color: #f5ecd9;
  padding-block: clamp(64px, 9vw, 120px);
}
.testimonial-inner { display: flex; justify-content: center; }
.testimonial-statement {
  max-width: 820px;
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  line-height: 1.35;
  text-align: center;
}

/* =========================================================
   RESPONSIVE — front page only
   ========================================================= */

/* Very wide viewports — a 4K monitor, or any screen at 50-75% browser zoom.
   Everything here is sized in vw, with no fixed-pixel terms. That matters:
   mixing vw with px means the px part doesn't scale when you zoom, so the
   composition creeps as you step through zoom levels — bigger at 75%, plainly
   oversized at 65%. In pure vw the hero looks identical at every zoom.
   Breakpoint is 1900px because 24vw there equals ~456px, which is where the
   photo already sits — so nothing jumps as you cross it. */
@media (min-width: 1900px) {
  /* Panels stay 50/50; it's their contents that need to scale. */
  .hero-image { max-width: 24vw; }      /* right edge lands at 37vw */
  .hero-text-split { max-width: 44vw; } /* centred, so its left edge is 53vw */

  /* From the heading's left edge (53vw) back to the photo's right edge (37vw)
     is 16vw, and on to the window edge is another 47vw. A couple of vw of
     overshoot each way covers the -4deg rotation; .hero clips the remainder,
     and the photo's higher z-index hides the left overshoot behind her. */
  .split-heading h2::after {
    left: -18vw;
    width: 68vw;
  }
}

@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  /* Ensure header stacks properly on smaller screens */
  .articles-header {
    flex-direction: column;
    gap: 20px;
  }

  /* Hero */
  .hero { grid-template-columns: 1fr; grid-template-rows: auto auto; min-height: auto; }
  .hero-left { height: 50vh; min-height: 400px; }
  .hero-image { width: 85%; }
  .hero-overlap-text { margin-top: -0.9em; padding: 0 5%; font-size: 2.8rem; white-space: normal; }
  .hero-content { grid-column: 1; padding: 60px 24px 80px; }
  .hero-text-split { grid-template-columns: 1fr; gap: 20px; }
  .split-heading h2::after { top: 55%; }

  /* Grids */
  .card-grid, .card-grid.four,
  .values-grid, .split, .cta-layout, .ba-gallery { grid-template-columns: 1fr; gap: 40px; }

  /* Values: horizontal wave becomes a vertical wave running down the left edge */
  .values-grid { padding-top: 0; padding-left: 44px; }
  .values-grid::before {
    top: 0;
    left: 6px;
    right: auto;
    bottom: 0;
    width: 34px;
    height: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 1000' preserveAspectRatio='none'%3E%3Cpath d='M17,-50 C10,20 26,60 12,125 C4,190 30,290 26,375 C22,460 4,540 8,625 C12,710 30,790 20,875 C14,940 20,980 17,1050' fill='none' stroke='%2377736d' stroke-width='1.5' opacity='0.7'/%3E%3C/svg%3E");
  }
  .value::before { left: -21px; }
  .value:nth-child(1)::before,
  .value:nth-child(2)::before,
  .value:nth-child(3)::before,
  .value:nth-child(4)::before {
    top: 8px;
  }

  .results-header { flex-direction: column; gap: 24px; }
  .polaroid-grid { grid-template-columns: repeat(2, 1fr); }

}

@media (max-width: 600px) {
  .polaroid-grid { grid-template-columns: 1fr; justify-items: center; }
  .polaroid { max-width: 320px; }
  .image-pair { flex-direction: column; }
  .cta-images .img-left-wrap, .cta-images .img-right { width: 100%; aspect-ratio: auto; }
}

@media (max-width: 560px) {
}
