/* =====================================================
   treatments-section.css — Photo-backed bento grid
   Scoped entirely under .treatments-section
   ===================================================== */

/* ── Section wrapper ── */
.treatments-section {
    background-color: #F4F1EA;
    padding: 96px 0 112px;
}

.treatments-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Intro block ── */
.treatments-intro {
    margin-bottom: 56px;
}

.treatments-eyebrow {
    display: block;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #8FA88A;
    margin-bottom: 14px;
}

.treatments-heading {
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    font-size: clamp(34px, 4.5vw, 54px);
    font-weight: 700;
    color: #1A1D1A;
    line-height: 1.15;
    max-width: 660px;
    margin-bottom: 0;
}

.treatments-heading em {
    font-style: italic;
    font-weight: 700;
}

/* Sage hairline rule beneath heading */
.treatments-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: #8FA88A;
    margin-top: 12px;
}

.treatments-lede {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 17px;
    color: #4A4E48;
    line-height: 1.65;
    max-width: 600px;
    margin: 24px 0 0;
}

/* ──────────────────────────────────────────────────────
   BENTO GRID — desktop ≥1064px
   12 columns, 3 rows, 16px gap
   ────────────────────────────────────────────────────── */
.treatments-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: 290px 290px auto;
    gap: 16px;
}

/* Grid placement */
.treatments-grid .treatment-card:nth-child(1) { grid-column: 1 / 8;  grid-row: 1 / 3; }
.treatments-grid .treatment-card:nth-child(2) { grid-column: 8 / 13; grid-row: 1;     }
.treatments-grid .treatment-card:nth-child(3) { grid-column: 8 / 13; grid-row: 2;     }
.treatments-grid .treatment-card:nth-child(4) { grid-column: 1 / 7;  grid-row: 3;     }
.treatments-grid .treatment-card:nth-child(5) { grid-column: 7 / 13; grid-row: 3;     }

/* ──────────────────────────────────────────────────────
   CARD BASE
   Flex column, content justified to bottom
   ────────────────────────────────────────────────────── */
.treatment-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 280px;
    will-change: transform;
    transition: box-shadow 500ms ease;
    cursor: pointer;
}

.treatments-grid .treatment-card:nth-child(1) {
    min-height: 580px;
    padding: 36px;
}

.treatments-grid .treatment-card:nth-child(4),
.treatments-grid .treatment-card:nth-child(5) {
    min-height: 260px;
}

/* ──────────────────────────────────────────────────────
   BACKGROUND IMAGE LAYER (.card-bg)
   Scales independently of card tilt; overflow: hidden clips it
   ────────────────────────────────────────────────────── */
.card-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    transform-origin: center center;
    transition: transform 600ms ease;
}

/* Image subtly zooms on card hover (CSS-driven, independent of JS tilt) */
.treatment-card:hover .card-bg {
    transform: scale(1.06);
}

/* ──────────────────────────────────────────────────────
   GRADIENT OVERLAY (::before pseudo-element)
   Runs bottom-dark → top-transparent for text legibility
   Opacity nudges up on hover to deepen contrast
   ────────────────────────────────────────────────────── */
.treatment-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to top,
        rgba(26, 29, 26, 0.85) 0%,
        rgba(26, 29, 26, 0.65) 35%,
        rgba(26, 29, 26, 0.3) 70%,
        rgba(26, 29, 26, 0.1) 100%
    );
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
}

.treatment-card:hover::before,
.treatment-card.is-active::before {
    opacity: 1;
}

/* ──────────────────────────────────────────────────────
   OVERSIZED DISPLAY NUMERALS
   Decorative, aria-hidden; position varies per card
   ────────────────────────────────────────────────────── */
.treatment-num-display {
    position: absolute;
    z-index: 2;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    font-weight: 400;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    user-select: none;
    transition: transform 400ms ease;
}

/* Card 01 — large (130px), bottom-right */
.treatments-grid .treatment-card:nth-child(1) .treatment-num-display {
    font-size: 130px;
    bottom: 22px;
    right: 22px;
}

/* Card 02 — bottom-right */
.treatments-grid .treatment-card:nth-child(2) .treatment-num-display {
    font-size: 80px;
    bottom: 14px;
    right: 14px;
}

/* Card 03 — top-left */
.treatments-grid .treatment-card:nth-child(3) .treatment-num-display {
    font-size: 80px;
    top: 14px;
    left: 14px;
}

/* Card 04 — top-left */
.treatments-grid .treatment-card:nth-child(4) .treatment-num-display {
    font-size: 80px;
    top: 14px;
    left: 14px;
}

/* Card 05 — top-left */
.treatments-grid .treatment-card:nth-child(5) .treatment-num-display {
    font-size: 80px;
    top: 14px;
    left: 14px;
}

/* ──────────────────────────────────────────────────────
   CARD CONTENT WRAPPER
   Sits above all layers; always at the card bottom
   ────────────────────────────────────────────────────── */
.treatment-card-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.treatment-card:hover .treatment-card-content,
.treatment-card.is-active .treatment-card-content {
    opacity: 1;
    transform: translateY(0);
}

/* ──────────────────────────────────────────────────────
   PER-CARD BACKGROUND IMAGES + FALLBACK COLORS
   Fallbacks visible before real images are added
   ────────────────────────────────────────────────────── */
.treatments-grid .treatment-card:nth-child(1) .card-bg {
    background-color: #1A1D1A;
    background-image: url('images/skin-therapies.png');
}

.treatments-grid .treatment-card:nth-child(2) .card-bg {
    background-color: #4A5760;
    background-image: url('images/injectable-refinement.png');
}

.treatments-grid .treatment-card:nth-child(3) .card-bg {
    background-color: #6B4F3A;
    background-image: url('images/energy-laser.png');
}

.treatments-grid .treatment-card:nth-child(4) .card-bg {
    background-color: #8FA88A;
    background-image: url('images/body-contouring.png');
}

.treatments-grid .treatment-card:nth-child(5) .card-bg {
    background-color: #3D4632;
    background-image: url('images/regenerative.png');
}

/* ──────────────────────────────────────────────────────
   TYPOGRAPHY — all ivory over dark overlay
   ────────────────────────────────────────────────────── */
.treatment-name {
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    margin: 0 0 10px;
    line-height: 1.2;
}

.treatments-grid .treatment-card:nth-child(1) .treatment-name {
    font-size: 32px;
}

.treatment-desc {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    line-height: 1.55;
    margin: 0 0 14px;
}

.treatments-grid .treatment-card:nth-child(1) .treatment-desc {
    font-size: 15.5px;
}

.treatment-price {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #D1DACB;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.4px;
    display: block;
    margin: 0 0 12px;
}

/* ──────────────────────────────────────────────────────
   CTA — ghost pill button, ivory on dark
   ────────────────────────────────────────────────────── */
.treatment-cta {
    background: transparent;
    border: 1.5px solid rgba(244, 241, 234, 0.35);
    padding: 9px 20px;
    border-radius: 99px;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: rgba(244, 241, 234, 0.9);
    cursor: pointer;
    align-self: flex-start;
    transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
}

.treatment-cta:hover,
.treatment-cta:focus {
    color: #A8B5A0;
    border-color: #A8B5A0;
    background-color: rgba(168, 181, 160, 0.12);
}

.treatment-cta:focus-visible {
    outline: 2px solid rgba(244, 241, 234, 0.8);
    outline-offset: 3px;
}

/* Arrow element — slides right on hover */
.cta-arrow {
    display: inline-block;
    transition: transform 200ms ease;
}

.treatment-cta:hover .cta-arrow,
.treatment-cta:focus .cta-arrow {
    transform: translateX(4px);
}

/* ── Scroll reveal animation ── */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ──────────────────────────────────────────────────────
   TABLET — 768px–1063px
   6-col grid: Card 01 full-width hero; 02–05 two-up
   ────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1063px) {
    .treatments-section  { padding: 72px 0 88px; }
    .treatments-inner    { padding: 0 28px; }

    .treatments-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: auto auto auto;
        gap: 14px;
    }

    .treatments-grid .treatment-card:nth-child(1) { grid-column: 1 / 7; grid-row: 1; min-height: 360px; }
    .treatments-grid .treatment-card:nth-child(2) { grid-column: 1 / 4; grid-row: 2; min-height: 240px; }
    .treatments-grid .treatment-card:nth-child(3) { grid-column: 4 / 7; grid-row: 2; min-height: 240px; }
    .treatments-grid .treatment-card:nth-child(4) { grid-column: 1 / 4; grid-row: 3; min-height: 220px; }
    .treatments-grid .treatment-card:nth-child(5) { grid-column: 4 / 7; grid-row: 3; min-height: 220px; }

    .treatments-grid .treatment-card:nth-child(1) .treatment-name        { font-size: 28px; }
    .treatments-grid .treatment-card:nth-child(1) .treatment-num-display  { font-size: 100px; }
}

/* ──────────────────────────────────────────────────────
   MOBILE — ≤767px
   Single column; Card 01 taller, others equal
   ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .treatments-section  { padding: 56px 0 72px; }
    .treatments-inner    { padding: 0 16px; }
    .treatments-intro    { margin-bottom: 40px; }

    .treatments-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        gap: 12px;
    }

    /* Reset all explicit placements */
    .treatments-grid .treatment-card:nth-child(1),
    .treatments-grid .treatment-card:nth-child(2),
    .treatments-grid .treatment-card:nth-child(3),
    .treatments-grid .treatment-card:nth-child(4),
    .treatments-grid .treatment-card:nth-child(5) {
        grid-column: auto;
        grid-row: auto;
    }

    .treatments-grid .treatment-card:nth-child(1) {
        min-height: 380px;
        padding: 28px;
    }

    .treatments-grid .treatment-card:nth-child(2),
    .treatments-grid .treatment-card:nth-child(3),
    .treatments-grid .treatment-card:nth-child(4),
    .treatments-grid .treatment-card:nth-child(5) {
        min-height: 260px;
    }

    .treatments-grid .treatment-card:nth-child(1) .treatment-name       { font-size: 26px; }
    .treatments-grid .treatment-card:nth-child(1) .treatment-num-display { font-size: 90px; }

    .treatments-lede { font-size: 15px; }
}

@media (max-width: 480px) {
    .treatments-section { padding: 40px 0 56px; }
    .treatments-inner   { padding: 0 14px; }
}

/* ── Reduced motion — disable all animation and interaction effects ── */
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
        will-change: auto;
    }

    .treatment-card {
        will-change: auto;
        transition: none;
    }

    .card-bg {
        transition: none;
    }

    .treatment-card:hover .card-bg {
        transform: none;
    }

    .treatment-card::before,
    .treatment-card:hover::before {
        opacity: 1;
        transition: none;
    }

    .treatment-num-display {
        transition: none;
    }

    .treatment-cta {
        transition: none;
    }

    .cta-arrow {
        transition: none;
    }

    .treatment-cta:hover .cta-arrow,
    .treatment-cta:focus .cta-arrow {
        transform: none;
    }
}
