/* Epilog: compact sections and numbered steps. */
.epilog-procedure-page .epilog-procedure-section,
body.epilog-electrolysis-template .epilog-procedure-section {
    padding-block: clamp(2rem, 3.2vw, 2.75rem);
}

body.epilog-electrolysis-template .epilog-procedure-hero {
    padding-block: clamp(2.5rem, 4vw, 3.5rem);
}

body.epilog-electrolysis-template .epilog-results--procedure {
    padding-block: clamp(2rem, 3.2vw, 2.75rem);
}

body.epilog-electrolysis-template :is(.epilog-detailed-steps, .epilog-feature-grid,
    .epilog-zone-grid, .epilog-safety-grid, .epilog-results__grid, .epilog-faq) {
    margin-top: 1.75rem;
}

#epilog-procedure-results {
    scroll-margin-top: 1.5rem;
}

/* Electrolysis 2.8.4: a clear follicle illustration replaces the abstract diagram. */
body.epilog-electrolysis-template .epilog-procedure-visual--illustration {
    min-height: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #fff8fb;
}

body.epilog-electrolysis-template .epilog-procedure-visual__image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Home 2.8.4: match the compact vertical rhythm of procedure and contacts pages. */
.epilog-home-page :is(.epilog-about, .epilog-process, .epilog-reviews) {
    padding-block: clamp(2rem, 3.2vw, 2.75rem);
}

.epilog-home-page .epilog-cta {
    padding-block: clamp(1.5rem, 2.6vw, 2rem);
}

.epilog-home-page :is(.epilog-process__grid, .epilog-reviews__grid) {
    margin-top: 1.75rem;
}

/* Contacts 2.8.2: compact sections with clear spacing inside each block. */
.epilog-contacts-page .epilog-procedure-section {
    padding-block: clamp(2rem, 3.2vw, 2.75rem);
}

.epilog-contacts-page .epilog-contacts-hero {
    padding-block: clamp(2.5rem, 4vw, 3.5rem) clamp(2rem, 3.2vw, 2.75rem);
}

.epilog-contacts-page :is(.epilog-contact-grid, .epilog-contact-steps, .epilog-faq) {
    margin-top: 1.75rem;
}

.epilog-contacts-page .epilog-contact-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.epilog-contacts-page .epilog-contact-card > p {
    margin-bottom: 0;
}

/* Equal-height cards place all four captions on the same baseline. */
.epilog-contacts-page .epilog-contact-card__action {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 1rem;
    font-size: .875rem;
    line-height: 1.5;
}

.epilog-contacts-page .epilog-route-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(.875rem, 1.4vw, 1.25rem);
}

.epilog-contacts-page .epilog-route-box > :is(.epilog-kicker, .epilog-section-title, .epilog-route-box__text) {
    margin: 0;
}

.epilog-contacts-page .epilog-route-box__actions {
    align-self: stretch;
    margin-top: .5rem;
}

.epilog-contacts-page :is(.epilog-find-copy, .epilog-contact-notice) .epilog-procedure-heading {
    margin-bottom: 1rem;
}

.epilog-contacts-page .epilog-find-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 1536 / 1024;
    object-fit: contain;
}

@media (min-width: 64em) {
    .epilog-contacts-page .epilog-contact-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }

    .epilog-contacts-page .epilog-contact-card {
        padding: 1.75rem clamp(.875rem, 1.4vw, 1.25rem);
    }
}

/* Place the existing number in normal flow, followed by the step text. */
.epilog-detailed-steps--numbered .epilog-detailed-step {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
    min-height: 0;
    padding: 1.25rem 1.5rem;
}

.epilog-detailed-steps--numbered .epilog-detailed-step__number {
    position: static;
    width: 3rem;
    height: 3rem;
    transform: none;
}

/* The home-page procedure uses the same numbered-only presentation. */
.epilog-process .epilog-step__number {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto .75rem;
    border-radius: 50%;
    background: var(--epilog-pink);
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
}

.epilog-step:not(:last-child)::after {
    top: 1.5rem;
}

/* Show the entire entrance photograph without cropping its edges. */
.epilog-about__media img {
    height: auto;
    aspect-ratio: 1536 / 1024;
    object-fit: contain;
}

@media (max-width: 47.5em) {
    .epilog-detailed-steps--numbered .epilog-detailed-step {
        grid-template-columns: 2.5rem minmax(0, 1fr);
        gap: .875rem;
        padding: 1.125rem;
    }

    .epilog-detailed-steps--numbered .epilog-detailed-step__number {
        width: 2.5rem;
        height: 2.5rem;
    }

    .epilog-process .epilog-step {
        grid-template-columns: 3rem minmax(0, 1fr);
        grid-template-rows: auto;
        column-gap: 1rem;
    }

    .epilog-process .epilog-step__number {
        align-self: start;
        margin: 0;
    }

    .epilog-process .epilog-step p {
        margin: 0;
        align-self: center;
    }

    .epilog-process .epilog-step:not(:last-child)::after {
        top: 3.25rem;
        left: 1.5rem;
        height: calc(100% - 1.875rem);
    }
}
