/* ============================================================
   LIFE STAGE PAGE – Template Styles
   All bg/text/border colors use utility classes from color.css.txt
   Layout, typography, sizing, and structural rules only.
   ============================================================ */

/* base.css kills every transition/animation site-wide under
   prefers-reduced-motion, via `* { transition: none !important; }`. AOS's
   reveal effect is driven entirely by CSS transitions (no @keyframes), so
   that rule silently disables it too — the .aos-animate class still gets
   added correctly, but opacity/transform jump to their final values with
   no easing, which reads as "nothing is animating."
   Since `transition` is a shorthand, that rule also zeroes transition-
   duration/-delay, not just transition-property — restoring only
   transition-property here would still leave duration pinned to 0s (an
   instant, invisible "transition"). Using the full shorthand with a fixed
   duration re-enables a real, visible fade for AOS elements specifically,
   without touching reduced-motion behavior anywhere else on the site.
   Per-element data-aos-duration/-delay values are not replicated here
   (uniform timing instead of the full staggered sequence), which is an
   acceptable, arguably preferable simplification for reduced-motion. */
@media (prefers-reduced-motion: reduce) {
    [data-aos] {
        transition: opacity .3s ease, transform .3s ease !important;
    }

    /* Same problem hits the chip hover color-swap (not AOS-driven, but
       still killed by the same blanket rule) — restore its own
       already-declared transition value so hover stays eased instead of
       snapping instantly. */
    .lp-stage-tab {
        transition: background-color .2s ease, color .2s ease, box-shadow .2s ease !important;
    }
}

/* ---- Hero ---- */
.lp-hero {
    padding: 2rem 0 0;
    position: relative;
    overflow: visible;
}

/* font-quincy; ~25% larger than previous clamp(2.4rem,5vw,4.5rem) */
.lp-hero-headline {
    font-family: 'quincy-cf', 'QuincyCF', serif; /* font-quincy */
    font-size: clamp(3rem, 6.25vw, 5.625rem);
    line-height: .9;
    letter-spacing: -0.02em;
    color: var(--gray800);
}

/* ---- Life Stage Nav Chips ---- */
.lp-lifestage-nav {
    display: inline-flex;
    gap: 3rem;              /* wider gap between chips */
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.lp-stage-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* center text within chip */
    min-width: 135px;        /* minimum chip width */
    padding: 0.45em 1.1em;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;   /* no underline by default */
    border: none;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.01em;

    /* Rest state: 10%-opacity tint of the chip's own color (set inline
       per-chip in PHP via --chip-tint), always light enough for gray800. */
    background-color: var(--chip-tint);
    color: var(--gray800);
}

/* No underline ever on rest state */
.lp-stage-tab,
.lp-stage-tab:visited {
    text-decoration: none;
}

/* Underline only on hover (as specified) */
.lp-stage-tab:hover {
    text-decoration: underline;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Hover previews the active look: full-strength color, with text forced
   to whichever of white/gray800 contrasts with that specific color
   (--chip-text, computed per-chip in PHP from its luminance). Declared
   separately from .active (rather than combined) so hover keeps its own
   underline+lighter shadow instead of inheriting .active's no-underline. */
.lp-stage-tab:hover {
    background-color: var(--chip-full);
    color: var(--chip-text);
    text-decoration: none;
}

.lp-stage-tab.active {
    background-color: var(--chip-full);
    color: var(--chip-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    text-decoration: none;
}

/* ---- Hero Avatar ---- */
.lp-hero-avatar-wrap {
    position: relative;
    display: inline-block;
    margin: 1.5rem auto 0;
}

.lp-hero-avatar {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    /* Width + style only; color comes from border-{lifestage_color_val} utility class in PHP */
    border-width: 4px;
    border-style: solid;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    display: block;
    margin: 0 auto;
}

@media (max-width: 840px) {
    .lp-hero-avatar {
        width: 150px;
        height: 150px;
    }
}

/* ---- Scroll Thread / Descending Orange Line ---- */
.lp-scroll-line-container {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 0;
    position: relative;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

.lp-scroll-line {
    width: 2px;
    height: 0;
    border-radius: 2px;
    transform-origin: top center;
    /* No transition — JS controls height directly via rAF */
}

/* ---- Products Section ---- */
.lp-products-section {
    position: relative;
    z-index: 2;
    background: var(--white);
}

/* Establishes the containing block for .lp-scroll-line-terminus below, so
   it's constrained to this grid-xxl column's width (per comp) rather than
   the full viewport. */
.lp-products-section > .columns > .column > .container.grid-xxl {
    position: relative;
}

/* Horizontal terminus. Starts at width: 0 (no line visible at all until
   the vertical thread reaches it) and is filled in via JS as the user
   scrolls further — see initScrollLine() in lifestage.js. Centered and
   growing via left: 50% + translateX(-50%) so increasing the width
   spreads it outward to both sides evenly, rather than growing
   left-to-right. */
.lp-scroll-line-terminus {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    /* No transition — JS controls width directly via rAF, same as the
       vertical thread's height. */
}

/* font-quincy */
.lp-section-headline {
    font-family: 'quincy-cf', 'QuincyCF', serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--gray800);
    margin-bottom: 0.5rem;
}

.lp-section-sub {
    font-size: 0.95rem;
    max-width: 560px;
    margin: 0 auto;
}

/* ---- Product Category Cards ---- */
.lp-product-cards {
    margin-top: 2rem;
    margin-bottom: 0;
}

.lp-product-card {
    border-radius: 18px;     /* fully rounded outer corners */
    overflow: hidden;
    cursor: pointer;
    box-shadow: none;        /* box-shadow removed entirely */
    transition: transform 0.2s ease;
    background: var(--white);
    position: relative;
}

.lp-product-card.active {
    box-shadow: none;        /* never any box-shadow */
    transform: translateY(-3px);
}

.lp-product-card-header {
    padding: 0.85rem 1.25rem;
    text-align: center;
    /* Header sits at top; upper corners match outer card radius */
    border-radius: 18px 18px 0 0;
}

.lp-product-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.01em;
}

/* 6px border, square aspect, rounded bottom corners only (flush against
   the header, whose own bottom corners are square). No gap between
   header and image — instead, background and border share the same
   color (bg-/border-{color} utility classes in PHP), so the flush seam
   between the header's square bottom and the image wrap's square top
   is invisible: same color meeting same color. */
.lp-product-card-img-wrap {
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
    border-width: 6px;
    border-style: solid;
    border-radius: 0 0 15px 15px;
    /* Background and border color are set via bg-{color}/border-{color} utility classes in PHP */
}

.lp-product-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
    /* Image itself also gets slightly rounded bottom corners */
    border-radius: 10px;
}

.lp-product-card-desc {
    padding: 1rem 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.lp-product-card-desc p,
.lp-product-card-desc a {
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.lp-product-card:hover .lp-product-card-desc p,
.lp-product-card:hover .lp-product-card-desc a,
.lp-product-card.active .lp-product-card-desc p,
.lp-product-card.active .lp-product-card-desc a {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 840px) {
    .lp-product-card-desc p,
    .lp-product-card-desc a {
        opacity: 1;
        pointer-events: auto;
    }
    .lp-product-card-desc {
        min-height: auto;
    }
}

/* ---- Carousel Panel ---- */
.life-stages-target-parent {
    overflow: hidden;
}

.life-stage-product-target {
    /* Hidden/shown by existing carousel JS */
}

.lp-carousel-panel {
    padding-bottom: 3rem;
}

/* ---- Vertical Connector Lines ---- */
.lp-vert-connector {
    display: flex;
    justify-content: center;
    height: 70px;
    align-items: stretch;
}

.lp-vert-connector-line {
    width: 2px;
    height: 100%;
    border-radius: 2px;
}

/* ---- Recommended Section ---- */
/* font-quincy */
.lp-recommend-headline {
    font-family: 'quincy-cf', 'QuincyCF', serif;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    color: var(--gray800);
    margin: 0.5rem 0 0;
}

.lp-recommended-cards {
    margin-top: 1rem;
}

.lp-recommended-card {
    border-radius: 12px;
    padding: 2rem 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
    cursor: default;
    position: relative;

    /* Rest state: 10%-opacity tint of this category's color (--rec-tint,
       set on the panel ancestor in PHP), always light enough for gray800. */
    background-color: var(--rec-tint);
    color: var(--gray800);
}

/* On hover, a card shows the full-strength color with text forced to
   whichever of white/gray800 contrasts with that specific color
   (--rec-text, computed in PHP from the category's own product_color).
   .lp-rec-name/.lp-rec-desc/the badge all inherit this via color:
   inherit below, so nothing needs a separate light/dark class of its
   own. There is no persistent "active" card state — every card rests
   at the tint and only shows full color while actually hovered. */
.lp-recommended-card:hover {
    background-color: var(--rec-full);
    color: var(--rec-text);
}

.lp-rec-number-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid currentColor;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.85;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}

.lp-rec-name,
.lp-rec-desc {
    color: inherit;
}

.lp-rec-name {
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
    /* font-size controlled by .text-large utility */
}

.lp-rec-desc {
    font-size: 0.85rem;
    line-height: 1.55;
    /* margin removed — mb-3 class added in PHP markup */
    flex: 1;
}

.lp-rec-btn {
    margin-top: auto;
    font-size: 0.8rem;
    align-self: center;
}

/* Every card's button is btn-gray800-outline at rest (correct against
   the tint background). On hover the card temporarily shows the full
   color — if that color needs white text, the button has to switch to
   reading as white-outline even though its resting class is
   gray800-outline. */
.lp-recommended-card:hover .btn-gray800-outline {
    border-color: var(--rec-text);
    color: var(--rec-text);
}

/* Per spec: the button's own hover/focus/active is always a plain white
   fill + gray800 text, regardless of which outline variant is showing
   at rest. !important because hovering the button necessarily also
   triggers the ancestor-hover rule above (the button is inside the
   card), and that rule has higher selector specificity — without it,
   the ancestor rule would win and the button would never show its own
   hover fill. */
.lp-rec-btn:hover,
.lp-rec-btn:focus,
.lp-rec-btn:active {
    background: var(--white) !important;
    border-color: var(--white) !important;
    color: var(--gray800) !important;
}

/* ---- Other Links Section ---- */
/* font-quincy on the section header */
.lp-other-headline {
    font-family: 'quincy-cf', 'QuincyCF', serif;
    font-weight: 400;
    margin: 0;
    /* font-size controlled by .text-large utility */
}

.lp-other-cards {
    margin-top: 0.5rem;
    /* Left-align cards so an incomplete last row aligns left, not center/stretch */
    justify-content: flex-start;
}

.lp-other-card {
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--gray50);
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease, border-color 0.25s ease;
    cursor: default;
    position: relative;
}

.lp-other-card:hover {
    box-shadow: none;
    transform: translateY(-2px);
    border-color: transparent;
}

.lp-other-card.hover-active .lp-other-name,
.lp-other-card.hover-active .lp-other-desc {
    color: var(--white);
}

.lp-other-name {
    font-weight: 700;
    margin: 0;
    transition: color 0.25s ease;
    /* font-size controlled by .text-large utility */
}

.lp-other-desc {
    font-size: 0.84rem;
    line-height: 1.55;
    /* margin:0 removed — mb-3 class added in PHP markup */
    flex: 1;
    transition: color 0.25s ease;
}

.lp-other-btn {
    align-self: center;
    margin-top: auto;
    font-size: 0.8rem;
    transition: color 0.25s ease, box-shadow 0.25s ease;
}

/* btn-white base style — white bg, gray800 text, sweeps to transparent on hover */
.btn.btn-white {
    background: var(--white);
    color: var(--gray800);
    box-shadow: inset -450px 0 0 0 var(--white);
    border: 1px solid var(--gray50);
}

.btn.btn-white:hover,
.btn.btn-white:focus,
.btn.btn-white:active {
    background: var(--white);
    color: var(--gray500);
    box-shadow: inset 0 0 0 0 var(--white);
    border-color: var(--gray100);
}

/* On hover-active cards, btn-white inverts to white outline */
.lp-other-card.hover-active .lp-other-btn {
    box-shadow: inset 0 0 0 1px var(--white);
    color: var(--white);
    background: transparent;
    border-color: var(--white);
}

.lp-other-card.hover-active .lp-other-btn:hover {
    box-shadow: inset -450px 0 0 0 var(--white);
    color: var(--gray800);
    background: transparent;
}

/* ---- Responsive ---- */
@media (max-width: 840px) {
    .lp-recommended-card {
        padding: 1.5rem 1.25rem;
    }
    .lp-lifestage-nav {
        gap: 0.75rem;
    }
    .lp-stage-tab {
        min-width: 0;
    }
}