/* ==========================================================================
   Edna's Transformation Journey - patient story carousel (HELP page)
   Sits between the three-phase section (which ends on #F5EAE1) and the
   testimonials section (which starts on #FFFFFF), so this panel fades from a
   warm cream up to pure white and the seams disappear.
   ========================================================================== */

.edna-story-section {
    position: relative;
    padding: 76px 40px 88px;
    background:
        radial-gradient(ellipse at 18% 12%, rgba(201, 168, 76, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 84% 88%, rgba(141, 110, 99, 0.08) 0%, transparent 55%),
        linear-gradient(180deg, #F7EDE6 0%, #FFFFFF 100%);
    overflow: hidden;
}

.edna-story-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header ------------------------------------------------------------------ */
.edna-story-header {
    text-align: center;
    margin-bottom: 44px;
}

.edna-story-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    border: 1px solid #EADFD8;
    border-radius: 999px;
    padding: 10px 22px;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8D6E63;
    box-shadow: 0 2px 8px rgba(74, 51, 44, 0.06);
}

.edna-story-title {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 600;
    color: #4A332C;
    margin: 22px 0 0;
    line-height: 1.2;
}

.edna-story-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #8D6E63 0%, #C9A84C 100%);
    border-radius: 2px;
    margin: 18px auto 0;
}

.edna-story-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 16.5px;
    color: #6B5A52;
    line-height: 1.7;
    max-width: 640px;
    margin: 20px auto 0;
}

/* Carousel ---------------------------------------------------------------- */
.edna-story-carousel {
    position: relative;
}

.edna-story-track {
    display: flex;
    align-items: stretch;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 6px 4px 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.edna-story-track::-webkit-scrollbar {
    display: none;
}

/* Slides are <button>s: reset the UA chrome so only our frame shows. */
.edna-story-slide {
    flex: 0 0 calc((100% - 48px) / 3);
    min-width: 0;
    scroll-snap-align: start;
    display: block;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    color: inherit;
    text-align: left;
}

.edna-story-frame {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5; /* source stills are 2048x2560 - nothing is cropped */
    border-radius: 20px;
    overflow: hidden;
    background: #EADFD8; /* placeholder tint while the still loads */
    border: 1px solid #EDE5E0;
    box-shadow: 0 12px 32px rgba(74, 51, 44, 0.10);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.edna-story-slide:hover .edna-story-frame,
.edna-story-slide:focus-visible .edna-story-frame {
    transform: translateY(-6px);
    border-color: #D9C7BD;
    box-shadow: 0 22px 48px rgba(74, 51, 44, 0.18);
}

.edna-story-slide:focus-visible {
    outline: 2px solid #8D6E63;
    outline-offset: 4px;
    border-radius: 22px;
}

.edna-story-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.edna-story-slide:hover .edna-story-img,
.edna-story-slide:focus-visible .edna-story-img {
    transform: scale(1.06);
}

/* Bottom scrim keeps the index chip and zoom hint legible on light photos */
.edna-story-scrim {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 42%;
    background: linear-gradient(180deg, rgba(46, 28, 22, 0) 0%, rgba(46, 28, 22, 0.42) 100%);
    opacity: 0.9;
    transition: opacity 0.35s ease;
}

.edna-story-slide:hover .edna-story-scrim,
.edna-story-slide:focus-visible .edna-story-scrim {
    opacity: 1;
}

.edna-story-index {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #8D6E63;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* Zoom hint fades in on hover so the frame reads as "openable" */
.edna-story-zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.94);
    color: #8D6E63;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.edna-story-slide:hover .edna-story-zoom,
.edna-story-slide:focus-visible .edna-story-zoom {
    opacity: 1;
    transform: scale(1);
}

/* Nav --------------------------------------------------------------------- */
.edna-story-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.edna-story-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #EDE5E0;
    color: #8D6E63;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
        transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 12px rgba(74, 51, 44, 0.06);
}

.edna-story-arrow:hover:not(:disabled) {
    background: linear-gradient(135deg, #8D6E63 0%, #C9A84C 100%);
    color: #FFFFFF;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(141, 110, 99, 0.28);
}

.edna-story-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.edna-story-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    row-gap: 6px;
    gap: 8px;
    padding: 0 12px;
}

.edna-story-dot {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #E7D8CE;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s ease, width 0.25s ease;
}

.edna-story-dot.is-active {
    background: linear-gradient(135deg, #8D6E63 0%, #C9A84C 100%);
    width: 26px;
    border-radius: 6px;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.edna-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999999;
    align-items: center;
    justify-content: center;
}

.edna-lightbox.active {
    display: flex;
}

.edna-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 16, 12, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.edna-lightbox-panel {
    position: relative;
    width: 92%;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: #FAF5F2;
    border-radius: 18px;
    box-shadow: 0 28px 60px -12px rgba(0, 0, 0, 0.6);
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.edna-lightbox.active .edna-lightbox-panel {
    transform: scale(1);
    opacity: 1;
}

.edna-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: calc(88vh - 90px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: #EADFD8;
}

.edna-lightbox-caption {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #6B5A52;
    margin: 0;
    text-align: center;
}

.edna-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background-color: #8D6E63;
    color: #FFFFFF;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.edna-lightbox-close:hover {
    background-color: #6D4C41;
    transform: scale(1.08);
}

.edna-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.94);
    color: #8D6E63;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.edna-lightbox-arrow:hover {
    background-color: #8D6E63;
    color: #FFFFFF;
}

.edna-lightbox-arrow--prev { left: 14px; }
.edna-lightbox-arrow--next { right: 14px; }

/* ==========================================================================
   Responsive - 3 per view (desktop) / 2 (tablet) / 1 (mobile)
   ========================================================================== */
@media (max-width: 992px) {
    .edna-story-section { padding: 56px 22px 68px; }
    .edna-story-title { font-size: 28px; }
    .edna-story-subtitle { font-size: 15.5px; }
    .edna-story-track { gap: 20px; }
    .edna-story-slide { flex-basis: calc((100% - 20px) / 2); }
    .edna-story-arrow { width: 46px; height: 46px; }
    .edna-lightbox-arrow { width: 40px; height: 40px; }
}

@media (max-width: 640px) {
    .edna-story-section { padding: 48px 16px 60px; }
    .edna-story-title { font-size: 24px; }
    .edna-story-subtitle { font-size: 15px; margin-top: 16px; }
    .edna-story-header { margin-bottom: 32px; }
    /* Exactly one full-width photo per view - no partial slide peeking in */
    .edna-story-track { gap: 16px; padding: 4px 0 16px; }
    .edna-story-slide { flex-basis: 100%; }
    .edna-story-frame { border-radius: 16px; }
    /* Bigger arrows on mobile: the 40px circles were a fiddly tap target. */
    .edna-story-nav { gap: 18px; margin-top: 24px; }
    .edna-story-arrow { width: 60px; height: 60px; box-shadow: 0 6px 16px rgba(74, 51, 44, 0.12); }
    .edna-story-arrow svg { width: 26px; height: 26px; }
    .edna-story-dot { width: 10px; height: 10px; }
    .edna-story-dot.is-active { width: 28px; }
    .edna-lightbox-panel { width: 94%; padding: 14px; }
    .edna-lightbox-arrow--prev { left: 8px; }
    .edna-lightbox-arrow--next { right: 8px; }
    .edna-lightbox-arrow { width: 36px; height: 36px; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .edna-story-track { scroll-behavior: auto; }
    .edna-story-frame,
    .edna-story-img,
    .edna-story-scrim,
    .edna-story-zoom,
    .edna-story-arrow,
    .edna-lightbox-panel,
    .edna-lightbox-arrow,
    .edna-lightbox-close {
        transition: none;
    }
    .edna-story-slide:hover .edna-story-frame,
    .edna-story-slide:focus-visible .edna-story-frame {
        transform: none;
    }
    .edna-story-slide:hover .edna-story-img,
    .edna-story-slide:focus-visible .edna-story-img {
        transform: none;
    }
    .edna-story-arrow:hover:not(:disabled) { transform: none; }
}
