.story-hero {
    position: relative;
    z-index: 1;
    overflow: hidden;
    background-color: #0b365e;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.story-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(4, 31, 56, .66), rgba(4, 31, 56, .35));
}

.story-hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(340px, 42vw, 480px);
    padding-top: 80px;
    padding-bottom: 40px;
    text-align: center;
}

.story-hero h1 {
    position: relative;
    margin: 0;
    padding-bottom: 12px;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: clamp(34px, 4vw, 52px);
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    overflow-wrap: anywhere;
}

.story-hero h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 78px;
    height: 4px;
    border-radius: 4px;
    background: #2d87d3;
    transform: translateX(-50%);
}

.story-content-section {
    padding: clamp(55px, 6vw, 85px) 0;
    background: linear-gradient(180deg, #f7f9fb 0%, #fff 46%, #f7f9fb 100%);
}

.story-main {
    display: grid;
    gap: 26px;
}

.story-section-card,
.story-info-card {
    font-family: 'Roboto', sans-serif;
    background: #fff;
    border: 1px solid #e3eaf0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(16, 76, 153, .08);
}

.story-section-card {
    padding: clamp(25px, 3.2vw, 40px);
    scroll-margin-top: 105px;
}

.story-section-title {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 25px;
    padding: 10px 18px;
    border-left: 4px solid #104C99;
    border-radius: 0 6px 6px 0;
    color: #17324d;
    background: linear-gradient(90deg, #eef3f7, #fafcfd);
    box-shadow: 6px 6px 18px rgba(25, 57, 87, .08);
    font-size: clamp(23px, 2.1vw, 29px);
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.story-rich-text {
    color: #263b4d;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.story-rich-text > :last-child {
    margin-bottom: 0;
}

.story-rich-text p {
    margin-bottom: 17px;
}

.story-rich-text ul,
.story-rich-text ol {
    margin-bottom: 18px;
    padding-left: 23px;
}

.story-rich-text ul {
    list-style: disc;
}

.story-rich-text ol {
    list-style: decimal;
}

.story-rich-text li {
    margin-bottom: 9px;
    padding-left: 3px;
}

.story-rich-text strong {
    color: #143f69;
    font-weight: 700;
}

.story-rich-text a {
    color: #104C99;
    font-weight: 500;
}

.story-rich-text img,
.story-rich-text iframe {
    max-width: 100%;
}

.story-rich-text table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.story-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 24px 0 28px;
}

.story-gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #dfe8ef;
    box-shadow: 0 4px 14px rgba(11, 54, 94, .12);
    isolation: isolate;
}

.story-gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .35s ease, filter .35s ease;
}

.story-gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    color: #fff;
    background: linear-gradient(180deg, rgba(4, 31, 56, .05), rgba(4, 31, 56, .72));
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .02em;
    opacity: 0;
    transition: opacity .3s ease;
}

.story-gallery-expand-icon {
    width: 27px;
    height: 27px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    backdrop-filter: blur(4px);
}

.story-gallery-item:hover img,
.story-gallery-item:focus img {
    filter: saturate(1.08);
    transform: scale(1.045);
}

.story-gallery-item:hover .story-gallery-overlay,
.story-gallery-item:focus .story-gallery-overlay {
    opacity: 1;
}

.story-gallery-item:focus-visible {
    outline: 3px solid #2d87d3;
    outline-offset: 3px;
}

/* Album viewer refinements */
.vbox-overlay {
    font-family: 'Roboto', sans-serif;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.vbox-content {
    padding: 18px 76px;
}

.vbox-content > img.figlio {
    width: auto !important;
    height: auto !important;
    max-width: min(820px, calc(100vw - 170px)) !important;
    max-height: min(66vh, 600px) !important;
    padding: 7px !important;
    border-radius: 13px;
    background: rgba(255, 255, 255, .97) !important;
    object-fit: contain;
    box-shadow: 0 22px 65px rgba(1, 16, 29, .35), 0 3px 12px rgba(1, 16, 29, .2);
}

.vbox-title {
    right: 20px;
    bottom: 18px !important;
    left: 50%;
    width: auto;
    max-width: min(720px, calc(100vw - 140px));
    height: auto;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 9px;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
    transform: translateX(-50%);
    box-shadow: 0 8px 24px rgba(1, 16, 29, .2);
}

.vbox-num {
    top: 16px;
    left: 16px;
    height: auto;
    padding: 6px 11px;
    border-radius: 18px;
    background: rgba(16, 76, 153, .9);
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 5px 16px rgba(1, 16, 29, .18);
}

.vbox-close {
    top: 14px;
    right: 16px;
    width: 38px;
    height: 38px;
    padding: 2px;
    border-radius: 50%;
    font-size: 27px;
    line-height: 32px;
    box-shadow: 0 5px 16px rgba(1, 16, 29, .2);
}

.vbox-next,
.vbox-prev {
    top: 50%;
    width: 44px;
    height: 52px;
    margin-top: -26px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 12px;
    background: rgba(16, 76, 153, .86);
    box-shadow: 0 8px 24px rgba(1, 16, 29, .22);
    transition: background .2s ease, transform .2s ease;
}

.vbox-prev {
    left: max(14px, calc(50% - 480px));
}

.vbox-next {
    right: max(14px, calc(50% - 480px));
}

.vbox-next:hover,
.vbox-prev:hover {
    background: #1768bb;
    transform: scale(1.04);
}

.vbox-next span,
.vbox-prev span {
    top: 50%;
    width: 12px;
    height: 12px;
    margin: 0;
}

.vbox-prev span {
    left: 50%;
    transform: translate(-35%, -50%) rotate(-135deg);
}

.vbox-next span {
    right: auto;
    left: 50%;
    transform: translate(-65%, -50%) rotate(45deg);
}

.story-value-card {
    position: relative;
    overflow: hidden;
}

.story-value-card::after {
    content: "";
    position: absolute;
    right: -50px;
    bottom: -50px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(16, 76, 153, .035);
    pointer-events: none;
}

.story-sidebar {
    position: sticky;
    top: 105px;
    display: grid;
    gap: 18px;
}

.story-info-card {
    position: relative;
    overflow: hidden;
    padding: 23px 21px;
    border-top: 3px solid #104C99;
}

.story-info-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 75px;
    height: 75px;
    border-radius: 0 0 0 100%;
    background: rgba(16, 76, 153, .045);
    pointer-events: none;
}

.story-info-card h2 {
    position: relative;
    margin-bottom: 17px;
    padding-bottom: 11px;
    color: #17324d;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.story-info-card h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 42px;
    height: 2px;
    background: #104C99;
}

.story-info-card .story-rich-text {
    font-size: 15px;
    line-height: 1.6;
}

.story-host-logo {
    display: flex;
    align-items: center;
    min-height: 70px;
    margin-bottom: 16px;
    padding: 8px 0;
}

.story-host-logo img {
    width: auto;
    max-width: 100%;
    max-height: 76px;
    object-fit: contain;
}

@media (max-width: 991.98px) {
    .story-sidebar {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 28px;
    }

    .story-info-card {
        height: 100%;
    }
}

@media (max-width: 767.98px) {
    .story-hero-content {
        min-height: 330px;
        padding-top: 95px;
        padding-bottom: 35px;
    }

    .story-hero h1 {
        font-size: 34px;
    }

    .story-content-section {
        padding: 48px 0;
    }

    .story-main {
        gap: 20px;
    }

    .story-section-card {
        padding: 23px 20px;
        border-radius: 8px;
    }

    .story-section-title {
        margin-bottom: 21px;
        padding: 9px 14px;
        font-size: 24px;
    }

    .story-rich-text {
        font-size: 15.5px;
        line-height: 1.68;
    }

    .story-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 20px 0 24px;
    }

    .story-gallery-overlay {
        opacity: 1;
        background: linear-gradient(180deg, transparent 55%, rgba(4, 31, 56, .7));
    }

    .story-gallery-expand-icon {
        display: none;
    }

    .story-gallery-overlay span {
        position: absolute;
        right: 10px;
        bottom: 8px;
        font-size: 11px;
    }

    .vbox-content {
        padding: 14px 10px;
    }

    .vbox-content > img.figlio {
        max-width: calc(100vw - 24px) !important;
        max-height: 62vh !important;
        padding: 5px !important;
        border-radius: 10px;
    }

    .vbox-title {
        right: 12px;
        bottom: 12px !important;
        max-width: calc(100vw - 90px);
        padding: 8px 12px;
        font-size: 12px;
    }

    .vbox-next,
    .vbox-prev {
        top: 50%;
        width: 38px;
        height: 46px;
        margin-top: -23px;
        border-radius: 10px;
    }

    .vbox-prev {
        left: 7px;
    }

    .vbox-next {
        right: 7px;
    }

    .vbox-num {
        top: 10px;
        left: 10px;
        padding: 5px 9px;
        font-size: 12px;
    }

    .vbox-close {
        top: 9px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 25px;
        line-height: 30px;
    }

    .story-sidebar {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 20px;
    }

    .story-info-card {
        padding: 22px 20px;
    }
}

@media (max-width: 359.98px) {
    .story-hero h1 {
        font-size: 30px;
    }

    .story-section-card,
    .story-info-card {
        padding-right: 17px;
        padding-left: 17px;
    }

    .story-section-title {
        font-size: 22px;
    }

    .story-gallery {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-gallery-item img,
    .story-gallery-overlay {
        transition: none;
    }
}
