/*
 * Content Reveal — module stylesheet
 *
 * Panels render hidden in place; the module JS wraps them all in one
 * ".ea-content-reveal-stage" (the visible panel area). The stage is the
 * height-animation container: JS drives its inline height between 0 /
 * the panels' natural heights / auto, with the transition defined here.
 * A leaving panel is lifted onto an absolute overlay (.is-leaving) so the
 * incoming one defines the flow height while both crossfade.
 *
 * Look (operator's pick): the v9 card family — white card, 1px border,
 * no shadow (dropped: it could only pop in after the height animation,
 * whose overflow clip hides it — the operator called that unnatural),
 * 5px radius, Poppins headings / Lato body, green links.
 *
 * HOW TO RESTYLE
 * --------------
 * Same contract as pricing-selector: PALETTE tokens (base colours, fonts,
 * radii, durations) and ELEMENTS tokens (one per element); the rules below
 * only consume tokens. Tokens sit on the stage AND the panel — panels are
 * children of the stage after the JS wrap, but the error paragraph and
 * pre-init panels are not.
 *
 * Salient hardening: unlike the lightbox (reparented to <body>), these
 * panels stay inside Salient's rows, so the theme's `.row .col h3`-style
 * selectors (0,2,1) reach in and the plugin stylesheet prints first.
 * The typography rules therefore lead with `div.` (0,2,2) to win on
 * specificity, not on order.
 */

/* 1. PALETTE ----------------------------------------------------------- */

.ea-content-reveal-stage,
.ea-content-reveal {
    --ea-crv-font-heading: 'Poppins', sans-serif;
    --ea-crv-font-body: 'Lato', sans-serif;

    --ea-crv-green: #00634c;
    --ea-crv-green-dark: #004f38;
    --ea-crv-white: #ffffff;
    --ea-crv-grey-line: #e3e3e3;
    --ea-crv-text: #2b2b2b;
    --ea-crv-text-muted: #6b6b6b;

    --ea-crv-radius: 5px;

    --ea-crv-duration-height: 300ms; /* keep in sync with HEIGHT_MS in the JS */
    --ea-crv-duration-fade: 250ms;   /* keep in sync with FADE_MS in the JS */

    /* Clearance above the panel when the page scrolls to it (Salient's
       sticky header) */
    --ea-crv-scroll-margin: 110px;
}

/* 2. ELEMENTS ---------------------------------------------------------- */

.ea-content-reveal-stage,
.ea-content-reveal {
    --ea-crv-card-bg: var(--ea-crv-white);
    --ea-crv-card-border: rgba(0, 0, 0, 0.05);
    --ea-crv-card-shadow: none;
    --ea-crv-card-pad: 32px 36px;

    --ea-crv-content-color: var(--ea-crv-text);
    --ea-crv-heading-color: var(--ea-crv-text);
    --ea-crv-link-color: var(--ea-crv-green);
}

/* 3. STAGE -------------------------------------------------------------- */

.ea-content-reveal-stage {
    position: relative;
    scroll-margin-top: var(--ea-crv-scroll-margin);
}

/* Only while JS animates the height: clip the content and transition.
   (Also why the card has no shadow: it would be clipped during the
   animation and pop in only at rest — rejected as unnatural.) */
.ea-content-reveal-stage.is-animating {
    overflow: hidden;
    transition: height var(--ea-crv-duration-height) ease;
}

/* 4. PANEL (card) ------------------------------------------------------- */

.ea-content-reveal {
    box-sizing: border-box;
    background: var(--ea-crv-card-bg);
    border: 1px solid var(--ea-crv-card-border);
    border-radius: var(--ea-crv-radius);
    box-shadow: var(--ea-crv-card-shadow);
    padding: var(--ea-crv-card-pad);
}

.ea-content-reveal[hidden] {
    display: none !important;
}

/* Crossfade states driven by the JS */
.ea-content-reveal.is-entering {
    opacity: 0;
    transform: translateY(10px);
}

.ea-content-reveal.is-fading {
    transition: opacity var(--ea-crv-duration-fade) ease, transform var(--ea-crv-duration-fade) ease;
}

.ea-content-reveal.is-leaving {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.ea-content-reveal.is-hiding {
    opacity: 0;
}

/* 5. CONTENT ------------------------------------------------------------ */

div.ea-content-reveal .ea-content-reveal__content {
    font-family: var(--ea-crv-font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ea-crv-content-color);
}

div.ea-content-reveal .ea-content-reveal__content h1,
div.ea-content-reveal .ea-content-reveal__content h2,
div.ea-content-reveal .ea-content-reveal__content h3,
div.ea-content-reveal .ea-content-reveal__content h4,
div.ea-content-reveal .ea-content-reveal__content h5,
div.ea-content-reveal .ea-content-reveal__content h6 {
    margin: 0 0 0.6em;
    font-family: var(--ea-crv-font-heading);
    color: var(--ea-crv-heading-color);
    line-height: 1.3;
}

div.ea-content-reveal .ea-content-reveal__content p,
div.ea-content-reveal .ea-content-reveal__content ul,
div.ea-content-reveal .ea-content-reveal__content ol {
    margin: 0 0 1em;
}

div.ea-content-reveal .ea-content-reveal__content > :last-child {
    margin-bottom: 0;
}

div.ea-content-reveal .ea-content-reveal__content a {
    color: var(--ea-crv-link-color);
    text-decoration: underline;
}

div.ea-content-reveal .ea-content-reveal__content img {
    max-width: 100%;
    height: auto;
}

/* 6. MOBILE ------------------------------------------------------------- */

@media (max-width: 690px) {
    .ea-content-reveal-stage,
    .ea-content-reveal {
        --ea-crv-card-pad: 24px 20px;
    }
}

/* 7. REDUCED MOTION ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .ea-content-reveal-stage.is-animating,
    .ea-content-reveal.is-fading {
        transition: none;
    }
}
