/* ===== Info-page enhancements (shared by condition & surgery pages) =====
   Loaded after style.css. Everything here is additive UI built by
   js/info-enhance.js — with JS disabled none of these elements exist
   and the page renders exactly as before. */

:root {
    --ie-accent: #5d93b8;
}

/* -----------------------------------------------------------------------
   HERO — shoulder hero background image + centered text overlay
   ----------------------------------------------------------------------- */
.hero {
    background-image: url('/images/shoulder_hero_desktop.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #eaf3f8;  /* fallback while image loads */
    overflow: hidden;
    /* full-bleed banner, slightly shorter than the image's natural ratio */
    width: 100%;
    height: clamp(300px, 30vw, 430px);
    min-height: 0 !important;
    margin: 88px 0 0;            /* flush edge-to-edge, just below the fixed header */
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid rgba(51, 101, 138, 0.12);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    align-items: center !important;  /* vertical centering of the text */
}

/* hide old decorations — the image provides the whole design */
.hero::before,
.hero::after,
.hero .hero-shape {
    display: none;
}

/* text centered on the image */
.hero .container {
    text-align: center !important;
    padding-left: 6% !important;
    padding-right: 6% !important;
    position: relative;
    z-index: 2;
}

.hero .container p {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* type scaled to the banner */
.hero h1 {
    font-size: clamp(2.1rem, 3.8vw, 3rem) !important;
    margin-bottom: 0 !important;
}

.hero .container p {
    font-size: clamp(1.1rem, 1.7vw, 1.35rem) !important;
}

/* Reference-style hero for the arthroscopy page */
.hero.reference-hero {
    height: clamp(380px, 31vw, 560px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 252, 255, 0.95) 58%, rgba(231, 243, 250, 0.94) 100%),
        linear-gradient(115deg, #ffffff 0%, #f7fbfd 52%, #e9f5fb 100%);
    background-size: auto;
    background-position: center center;
    background-color: #eef6fb;
    isolation: isolate;
}

.hero.reference-hero .container {
    transform: translateY(-3%);
}

.hero.reference-hero::before,
.hero.reference-hero::after {
    content: '';
    display: block;
    position: absolute;
    pointer-events: none;
}

.hero.reference-hero::before {
    inset: 0 auto 0 0;
    width: min(43vw, 570px);
    min-width: 340px;
    background-image: url('/images/shoulder_hero_mobile_fade.webp');
    background-repeat: no-repeat;
    background-size: auto 124%;
    background-position: left center;
    opacity: 0.92;
    z-index: 0;
}

.hero.reference-hero::after {
    inset: auto 0 -16px;
    height: 90%;
    z-index: 1;
    opacity: 1;
    background-image: url('/images/shoulder-hero-waves.svg?v=3');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center bottom;
}

.hero.reference-hero .guide-badge {
    display: none;
}

.hero.reference-hero h1 {
    color: #263a56;
    font-family: Heebo, Assistant, Arial, sans-serif;
    font-size: clamp(3.4rem, 5.1vw, 5.6rem) !important;
    font-weight: 700;
    line-height: 1.04;
    margin-bottom: 0 !important;
    text-shadow: 0 1px 5px rgba(30, 47, 73, 0.05);
}

.hero.reference-hero .hero-title-divider {
    width: 82px;
    height: 3px;
    margin: 1.1rem auto 1.25rem;
    background: #2f6d99;
    opacity: 0.95;
}

.hero.reference-hero .container p {
    color: #5b687b;
    font-size: clamp(1.35rem, 1.75vw, 2rem) !important;
    font-weight: 500;
    line-height: 1.25;
    margin-top: 0 !important;
}

/* ---- Guide badge above H1 ------------------------------------------ */
.guide-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(51, 101, 138, 0.18);
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.45rem 1.15rem;
    border-radius: 50px;
    margin-bottom: 1.1rem;
    box-shadow: 0 2px 10px rgba(51, 101, 138, 0.08);
    backdrop-filter: blur(4px);
}

.guide-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ---- Thin divider between H1 and subtitle --------------------------- */
.hero-title-divider {
    width: 48px;
    height: 3px;
    background: rgba(51, 101, 138, 0.40);
    border-radius: 2px;
    margin: 0.65rem auto 0.1rem;
}

/* -----------------------------------------------------------------------
   READING PROGRESS BAR
   ----------------------------------------------------------------------- */
.read-progress {
    position: fixed;
    top: 0;
    right: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(to left, var(--primary-blue), var(--ie-accent));
    z-index: 10002;
    pointer-events: none;
    transition: width 0.1s linear;
}

/* -----------------------------------------------------------------------
   IN-PAGE TABLE OF CONTENTS
   ----------------------------------------------------------------------- */
.page-toc {
    background: white;
    border: 1px solid rgba(51, 101, 138, 0.14);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

.page-toc summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.4rem;
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.02rem;
    user-select: none;
    background: linear-gradient(to left, rgba(51, 101, 138, 0.05), rgba(93, 147, 184, 0.06));
}

.page-toc summary::-webkit-details-marker {
    display: none;
}

.page-toc summary svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.page-toc summary .toc-chevron {
    margin-inline-start: auto;
    transition: transform 0.25s ease;
}

.page-toc[open] summary .toc-chevron {
    transform: rotate(180deg);
}

.page-toc ol {
    list-style: none;
    margin: 0;
    padding: 0.25rem 1.4rem 1.1rem;
}

.page-toc li {
    margin: 0;
}

.page-toc a {
    display: block;
    padding: 0.45rem 0.9rem;
    font-size: 0.94rem;
    color: var(--text-muted);
    border-inline-start: 2px solid var(--border-color);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.page-toc a:hover {
    color: var(--primary-blue);
    background: rgba(51, 101, 138, 0.05);
}

.page-toc a.active {
    color: var(--primary-blue);
    font-weight: 600;
    border-inline-start-color: var(--primary-blue);
    background: rgba(51, 101, 138, 0.06);
}

.info-text-column h2[id] {
    scroll-margin-top: 110px;
}

/* -----------------------------------------------------------------------
   UNIFIED LIST BULLETS
   ----------------------------------------------------------------------- */
.info-text-column .info-card ul {
    list-style: none;
    padding-inline-start: 0;
    margin: 1.1rem 0 1.4rem;
}

.info-text-column .info-card ul li {
    position: relative;
    padding-inline-start: 1.5rem !important;
    padding-inline-end: 0 !important;
    margin-bottom: 0.6rem;
}

.info-text-column .info-card ul li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0.15rem;
    top: 0.62em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(51, 101, 138, 0.1);
}

.info-text-column .info-card ul li::after {
    display: none !important;
}

.info-text-column .info-card ul ul {
    margin: 0.5rem 0 0;
}

/* -----------------------------------------------------------------------
   SECTION HEADING ACCENT
   ----------------------------------------------------------------------- */
.info-text-column .info-card h2,
.info-text-column .page-faq h2 {
    position: relative;
    padding-bottom: 0.65rem;
}

.info-text-column .info-card h2::after,
.info-text-column .page-faq h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 44px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(to left, var(--primary-blue), var(--ie-accent));
}

/* -----------------------------------------------------------------------
   BACK TO TOP
   ----------------------------------------------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(51, 101, 138, 0.35);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    z-index: 9000;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #27516f;
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* -----------------------------------------------------------------------
   SUBTLE CARD REVEAL
   ----------------------------------------------------------------------- */
.ie-fade {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.ie-fade.ie-visible {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------------------------------------------------
   RESPONSIVE
   ----------------------------------------------------------------------- */
@media (max-width: 900px) {
    /* mobile: portrait shoulder render as the hero background, centered text */
    .hero {
        background-image: url('/images/shoulder_hero_mobile.webp');
        background-size: cover;
        background-position: center top;
        background-repeat: no-repeat;
        background-color: #eef4f9;
        width: 100%;
        height: auto;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        min-height: 30vh !important;
        padding-top: 120px !important;
        padding-bottom: 2.5rem !important;
    }

    .hero .container {
        text-align: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .hero .container p {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .hero.reference-hero {
        min-height: 48vh !important;
        padding-top: 105px !important;
        padding-bottom: 2.5rem !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 247, 252, 0.9) 100%),
            linear-gradient(115deg, #ffffff 0%, #eaf5fb 100%) !important;
        background-position: center top;
    }

    .hero.reference-hero::before {
        width: 62vw;
        min-width: 250px;
        opacity: 0.45;
        background-image: url('/images/shoulder_hero_mobile_fade.webp');
        background-size: auto 104%;
        background-position: left top;
    }

    .hero.reference-hero::after {
        bottom: 10px;
        height: 42%;
    }

    .hero.reference-hero .container {
        transform: none;
    }

    .hero.reference-hero h1 {
        font-size: clamp(2.35rem, 11vw, 3.3rem) !important;
        line-height: 1.12;
    }

    .hero.reference-hero .hero-title-divider {
        width: 64px;
        margin: 0.9rem auto 1rem;
    }

    .hero.reference-hero .container p {
        font-size: clamp(1.15rem, 5vw, 1.45rem) !important;
    }

    .back-to-top {
        bottom: 18px;
        right: 16px;
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ie-fade {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .read-progress {
        transition: none;
    }

    .back-to-top {
        transition: none;
    }
}
