/* Heritage page — presentation layer only (scoped) */

.heritage-page {
    --heritage-gold: var(--bdf-khaki-300, #b8a36a);
    --heritage-gold-light: #d4c08a;
    --heritage-gold-deep: #8f7840;
    --heritage-green-dark: var(--bdf-green-900, #202719);
    --heritage-green-mid: var(--bdf-green-700, #2f3822);
    --heritage-cream: var(--bdf-cream, #fbfaf6);
    --heritage-cream-soft: var(--bdf-khaki-100, #f5f2e8);
    --heritage-cream-deep: #ebe4d4;
    --heritage-shadow: 0 20px 52px rgba(32, 39, 25, 0.12), 0 4px 14px rgba(32, 39, 25, 0.06);
    --heritage-shadow-lifted: 0 28px 64px rgba(32, 39, 25, 0.16), 0 8px 20px rgba(184, 163, 106, 0.08);
    --heritage-shadow-soft: 0 12px 32px rgba(32, 39, 25, 0.07);
    --heritage-shadow-memorial: 0 36px 80px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(184, 163, 106, 0.2);
    --heritage-radius: 1.125rem;
    --heritage-radius-lg: 1.625rem;
    --heritage-radius-xl: 2rem;
    --heritage-section-space: clamp(4.75rem, 9.5vw, 7.75rem);
    --heritage-header-offset: clamp(5.5rem, 11vh, 7rem);
    --heritage-copy-max: 34rem;
    background: var(--heritage-cream);
    overflow-x: clip;
    scroll-behavior: smooth;
}

/* Preserve heritage typography under military theme */
body.bdf-theme-military .heritage-page .heritage-hero-title {
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 900;
    font-size: clamp(1.3rem, 3vw, 2.25rem);
    line-height: 1.08;
}

body.bdf-theme-military .heritage-page .heritage-hero-breadcrumb,
body.bdf-theme-military .heritage-page .heritage-hero-breadcrumb a {
    color: var(--tm-gold, var(--heritage-gold-light));
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

body.bdf-theme-military .heritage-page .heritage-hero-content {
    padding: clamp(2rem, 4.5vh, 3rem) 0;
    min-height: clamp(210px, 30vh, 320px);
}

body.bdf-theme-military .heritage-page .heritage-hero {
    min-height: clamp(210px, 30vh, 320px);
    height: clamp(210px, 30vh, 320px);
    margin-bottom: 0;
}

body.bdf-theme-military .heritage-page .heritage-hero-title-accent {
    display: none;
}

body.bdf-theme-military .heritage-page .heritage-section-title {
    text-transform: none;
    letter-spacing: 0.02em;
}

body.bdf-theme-military .heritage-page .heritage-section--dark .heritage-section-title {
    color: #fff !important;
}

body.bdf-theme-military .heritage-page .heritage-section--cream .heritage-section-title {
    color: var(--heritage-green-dark) !important;
}

.heritage-page [id] {
    scroll-margin-top: calc(var(--heritage-header-offset) + 0.75rem);
}

.heritage-page img {
    max-width: 100%;
    height: auto;
}

/* ── Hero — matches standard internal-page-hero dimensions ── */
.heritage-hero {
    position: relative;
    min-height: clamp(210px, 30vh, 320px);
    height: clamp(210px, 30vh, 320px);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    color: #fff;
    margin-bottom: 0;
    isolation: isolate;
    border-bottom: 2px solid rgba(200, 163, 72, 0.35);
}

.heritage-hero-media {
    position: absolute;
    inset: 0;
}

.heritage-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: var(--bdf-photo-fit, cover);
    object-position: var(--bdf-photo-position, top center);
    transform: scale(1.02);
    animation: heritage-hero-zoom 28s ease-in-out infinite alternate;
}

@keyframes heritage-hero-zoom {
    from { transform: scale(1.02); }
    to { transform: scale(1.07); }
}

.heritage-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 18% 22%, rgba(184, 163, 106, 0.12), transparent 48%),
        linear-gradient(105deg, rgba(32, 39, 25, 0.64) 0%, rgba(32, 39, 25, 0.16) 50%, rgba(32, 39, 25, 0.44) 100%),
        linear-gradient(180deg, rgba(23, 27, 19, 0.32) 0%, rgba(23, 27, 19, 0.52) 42%, rgba(23, 27, 19, 0.72) 100%);
}

.heritage-hero-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.heritage-hero::after {
    display: none;
}

.heritage-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: clamp(2rem, 4.5vh, 3rem) 0;
    min-height: clamp(210px, 30vh, 320px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.heritage-hero-breadcrumb {
    margin-bottom: 0.5rem;
    opacity: 0.82;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
}

.heritage-hero-breadcrumb a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: color 0.2s ease;
}

.heritage-hero-breadcrumb a:hover {
    color: var(--heritage-gold-light);
}

.heritage-hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0;
    color: #fff;
    font-size: clamp(1.3rem, 3vw, 2.25rem);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
    text-wrap: balance;
}

.heritage-hero-title::before {
    display: none;
}

.heritage-hero-title-accent {
    display: none;
}

/* ── Shared section blocks ── */
.heritage-section {
    position: relative;
    padding: var(--heritage-section-space) 0;
}

.heritage-section--cream {
    background:
        radial-gradient(circle at 88% 12%, rgba(184, 163, 106, 0.07), transparent 22%),
        radial-gradient(circle at 6% 88%, rgba(184, 163, 106, 0.05), transparent 28%),
        linear-gradient(180deg, var(--heritage-cream) 0%, var(--heritage-cream-soft) 55%, var(--heritage-cream) 100%);
}

.heritage-section--cream:first-of-type {
    margin-top: 0;
    padding-top: clamp(2.5rem, 5vw, 3.5rem);
    z-index: 4;
}

.heritage-section--cream + .heritage-section--dark {
    margin-top: 0;
}

.heritage-section--dark {
    background:
        radial-gradient(ellipse at 15% 0%, rgba(184, 163, 106, 0.13), transparent 42%),
        radial-gradient(ellipse at 85% 100%, rgba(184, 163, 106, 0.07), transparent 38%),
        linear-gradient(168deg, #161b11 0%, var(--heritage-green-dark) 42%, #121610 100%);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(184, 163, 106, 0.08);
}

.heritage-section--dark::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: clamp(3rem, 6vw, 5rem);
    background: linear-gradient(180deg, rgba(251, 250, 246, 0.06) 0%, transparent 100%);
    pointer-events: none;
}

.heritage-section--cream:last-of-type.heritage-section--compact {
    padding-bottom: clamp(2.25rem, 4.5vw, 3.5rem);
}

.heritage-section--dark::before,
.heritage-section--cream:not(:first-of-type)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(92%, 68rem);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 163, 106, 0.35), transparent);
    pointer-events: none;
}

.heritage-section--dark::before {
    background: linear-gradient(90deg, transparent, rgba(184, 163, 106, 0.28), transparent);
}

.heritage-section-label {
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--heritage-gold-deep);
    margin-bottom: 1.1rem;
}

.heritage-section--dark .heritage-section-label {
    color: var(--heritage-gold-light);
}

.heritage-section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 4.4vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: 0.02em;
    margin-bottom: 1.35rem;
    color: var(--heritage-green-dark);
    text-wrap: balance;
    position: relative;
    padding-bottom: 1.15rem;
}

.heritage-section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: clamp(3rem, 18%, 4.5rem);
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--heritage-gold-deep), var(--heritage-gold-light));
    opacity: 0.88;
}

.heritage-section--dark .heritage-section-title {
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.heritage-section--dark .heritage-section-title::after {
    opacity: 0.72;
}

.heritage-section-text {
    font-size: 1.0625rem;
    line-height: 1.82;
    color: var(--bdf-muted);
    margin-bottom: 2.15rem;
    max-width: var(--heritage-copy-max);
    text-wrap: pretty;
}

.heritage-section--dark .heritage-section-text {
    color: rgba(255, 255, 255, 0.78);
}

.heritage-section-copy {
    padding-right: clamp(0rem, 3.5vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    align-self: flex-start;
}

.heritage-section-copy .btn {
    margin-top: 0.35rem;
    letter-spacing: 0.03em;
}

/* Shared split layout — Previous Commanders / Hall of Honour / Honours & Awards */
.heritage-section--split {
    padding: clamp(2.25rem, 4.5vw, 3.5rem) 0;
}

.heritage-split-row {
    align-items: flex-start !important;
}

.heritage-split-row > [class*="col-"] {
    align-self: flex-start;
}

.heritage-split-media {
    min-width: 0;
}

/* ── Introduction — full container width ── */
.heritage-intro {
    padding-top: clamp(2.5rem, 5vw, 3.5rem);
    padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.heritage-intro-inner {
    width: 100%;
    max-width: none;
}

.heritage-intro .heritage-section-title {
    margin-bottom: 1.75rem;
}

.heritage-intro-text {
    font-size: 1.0625rem;
    line-height: 1.82;
    color: var(--bdf-muted);
    margin-bottom: 1.35rem;
    max-width: none;
    text-wrap: pretty;
}

.heritage-intro-text:last-child {
    margin-bottom: 0;
}

/* ── Compact sections ── */
.heritage-section--compact {
    padding: clamp(2.25rem, 4.5vw, 3.5rem) 0;
}

.heritage-section--commanders {
    padding: clamp(2.25rem, 4.5vw, 3.5rem) 0;
}

/* ── Carousels ── */
.heritage-carousel {
    position: relative;
    padding-top: 0.35rem;
}

.heritage-carousel::before,
.heritage-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 2.75rem;
    width: clamp(1.25rem, 4vw, 2.75rem);
    z-index: 2;
    pointer-events: none;
}

.heritage-carousel::before {
    left: 0;
    background: linear-gradient(90deg, var(--heritage-cream-soft) 15%, transparent);
}

.heritage-section--cream .heritage-carousel::before {
    background: linear-gradient(90deg, var(--heritage-cream) 10%, transparent);
}

.heritage-carousel::after {
    right: 0;
    background: linear-gradient(270deg, var(--heritage-cream-soft) 15%, transparent);
}

.heritage-section--cream .heritage-carousel::after {
    background: linear-gradient(270deg, var(--heritage-cream) 10%, transparent);
}

.heritage-carousel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0.65rem clamp(0.5rem, 2vw, 1rem) 1.85rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 163, 106, 0.4) transparent;
}

.heritage-carousel-track:focus-visible {
    outline: 2px solid rgba(184, 163, 106, 0.55);
    outline-offset: 4px;
    border-radius: var(--heritage-radius);
}

.heritage-carousel-track::-webkit-scrollbar {
    height: 5px;
}

.heritage-carousel-track::-webkit-scrollbar-thumb {
    background: rgba(184, 163, 106, 0.42);
    border-radius: 999px;
}

.heritage-carousel-nav {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.15rem;
    padding-right: 0.35rem;
}

.heritage-carousel-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 1px solid rgba(184, 163, 106, 0.32);
    background: rgba(255, 255, 255, 0.96);
    color: var(--heritage-green-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--bdf-transition-premium);
    box-shadow: var(--heritage-shadow-soft);
}

.heritage-carousel-btn:hover,
.heritage-carousel-btn:focus-visible {
    background: var(--heritage-green-dark);
    color: #fff;
    border-color: var(--heritage-green-dark);
    transform: translateY(-2px);
    box-shadow: var(--heritage-shadow);
    outline: none;
}

.heritage-carousel-btn:focus-visible {
    box-shadow: var(--heritage-shadow), 0 0 0 3px rgba(184, 163, 106, 0.45);
}

/* Desktop static grids — no carousel scrolling */
@media (min-width: 992px) {
    .heritage-commanders-grid .heritage-carousel-track,
    .heritage-awards-grid .heritage-carousel-track {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow: visible;
        scroll-snap-type: none;
        gap: clamp(0.85rem, 1.5vw, 1.25rem);
        padding-bottom: 0.35rem;
    }

    .heritage-commanders-grid .heritage-carousel-nav,
    .heritage-awards-grid .heritage-carousel-nav,
    .heritage-commanders-grid .heritage-carousel::before,
    .heritage-commanders-grid .heritage-carousel::after,
    .heritage-awards-grid .heritage-carousel::before,
    .heritage-awards-grid .heritage-carousel::after {
        display: none;
    }

    .heritage-commanders-grid .heritage-commander-card,
    .heritage-awards-grid .heritage-medal-card {
        flex: none;
        width: auto;
        min-width: 0;
    }

    .heritage-commanders-grid .heritage-commander-portrait {
        margin: 0.65rem 0.65rem 0;
    }

    .heritage-commanders-grid .heritage-commander-body {
        padding: 1.1rem 0.85rem 1.35rem;
    }

    .heritage-commanders-grid .heritage-commander-name {
        font-size: 1.15rem;
        min-height: 0;
    }
}

.heritage-section--dark .heritage-carousel-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--heritage-gold-light);
    border-color: rgba(184, 163, 106, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.heritage-section--dark .heritage-carousel-btn:hover,
.heritage-section--dark .heritage-carousel-btn:focus-visible {
    background: var(--heritage-gold);
    color: var(--heritage-green-dark);
    border-color: var(--heritage-gold);
}

/* ── Commander cards ── */
.heritage-commander-card {
    flex: 0 0 clamp(248px, 26vw, 276px);
    scroll-snap-align: start;
    background: #fff;
    border-radius: var(--heritage-radius-xl);
    border: 1px solid rgba(184, 163, 106, 0.16);
    box-shadow: var(--heritage-shadow);
    overflow: hidden;
    transition: transform 0.4s var(--bdf-ease-cinematic), box-shadow 0.4s ease, border-color 0.4s ease;
}

.heritage-commander-card:hover {
    transform: translateY(-9px);
    border-color: rgba(184, 163, 106, 0.36);
    box-shadow: var(--heritage-shadow-lifted);
}

.heritage-commander-card--name {
    flex-basis: min(100%, 320px);
}

.heritage-commander-portrait {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--bdf-surface-portrait, #ece8df);
    margin: 0.9rem 0.9rem 0;
    border-radius: calc(var(--heritage-radius-lg) - 0.15rem);
    box-shadow: inset 0 0 0 1px rgba(184, 163, 106, 0.2);
}

.heritage-commander-portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 -28px 36px rgba(32, 39, 25, 0.18);
    pointer-events: none;
}

.heritage-commander-portrait img {
    width: 100%;
    height: 100%;
    object-fit: var(--bdf-photo-fit, cover);
    object-position: var(--bdf-photo-position, top center);
    transition: transform 0.65s var(--bdf-ease-cinematic);
}

.heritage-commander-card:hover .heritage-commander-portrait img {
    transform: scale(1.05);
}

.heritage-commander-body {
    padding: 1.4rem 1.5rem 1.75rem;
    text-align: center;
}

.heritage-commander-rank {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--heritage-gold-deep);
    margin-bottom: 0.65rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(184, 163, 106, 0.1);
    border: 1px solid rgba(184, 163, 106, 0.18);
}

.heritage-commander-name {
    font-family: var(--font-display);
    font-size: 1.38rem;
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: 0.015em;
    color: var(--heritage-green-dark);
    margin: 0 0 0.95rem;
    min-height: 2.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-wrap: balance;
}

.heritage-commander-years {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bdf-muted);
    margin: 0;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(184, 163, 106, 0.24);
}

/* ── Memorial section ── */
.heritage-memorial-grid {
    align-items: flex-start;
    --bs-gutter-x: clamp(1rem, 2vw, 1.75rem);
}

.heritage-memorial-grid > [class*="col-"] {
    display: flex;
    flex-direction: column;
    align-self: flex-start;
}

.heritage-memorial-image-col {
    padding-inline: clamp(0.15rem, 0.75vw, 0.5rem);
}

.heritage-memorial-roll-col {
    padding-left: clamp(0.25rem, 1vw, 0.75rem);
}

.heritage-memorial-copy-col {
    padding-right: clamp(0.5rem, 1.5vw, 1.25rem);
}

.heritage-memorial-copy-col.heritage-section-copy,
.heritage-memorial-copy-col .heritage-section-copy {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 0;
    padding-right: 0;
    min-height: 0;
}

.heritage-memorial-image-wrap {
    position: relative;
    border-radius: var(--heritage-radius-xl);
    overflow: hidden;
    box-shadow: var(--heritage-shadow-memorial);
    width: 100%;
    height: min(420px, 48vh);
    max-height: min(420px, 48vh);
    min-height: min(420px, 48vh);
    margin-inline: auto;
    flex: 1;
}

.heritage-memorial-image-wrap::before {
    content: "";
    position: absolute;
    inset: 0.2rem;
    border: 1px solid rgba(184, 163, 106, 0.22);
    border-radius: calc(var(--heritage-radius-xl) - 0.2rem);
    z-index: 2;
    pointer-events: none;
}

.heritage-memorial-image-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(23, 27, 19, 0.06) 0%, transparent 28%, rgba(23, 27, 19, 0.42) 100%);
    pointer-events: none;
    z-index: 1;
}

.heritage-memorial-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: var(--bdf-photo-fit, cover);
    object-position: var(--bdf-photo-position, top center);
    transition: transform 8s var(--bdf-ease-cinematic);
}

.heritage-memorial-image-wrap:hover img {
    transform: scale(1.04);
}

.heritage-memorial-roll {
    position: relative;
    background:
        linear-gradient(168deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 48%, rgba(0, 0, 0, 0.04) 100%);
    border: 1px solid rgba(184, 163, 106, 0.22);
    border-radius: var(--heritage-radius-lg);
    padding: 0.7rem 0.65rem 0.65rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.14),
        0 16px 36px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(6px);
    height: min(420px, 48vh);
    max-height: min(420px, 48vh);
    min-height: min(420px, 48vh);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.heritage-memorial-roll::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1rem;
    right: 1rem;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(184, 163, 106, 0.45), transparent);
    opacity: 0.55;
}

.heritage-memorial-roll-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--heritage-gold-light);
    margin-bottom: 1.15rem;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid rgba(184, 163, 106, 0.22);
    flex-shrink: 0;
}

.heritage-memorial-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 163, 106, 0.35) transparent;
    padding-right: 0.08rem;
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
    flex: 1;
}

.heritage-memorial-list::-webkit-scrollbar {
    width: 4px;
}

.heritage-memorial-list::-webkit-scrollbar-thumb {
    background: rgba(184, 163, 106, 0.38);
    border-radius: 999px;
}

.heritage-memorial-list li,
.heritage-memorial-entry {
    display: grid;
    grid-template-columns: minmax(2.6rem, 0.55fr) minmax(0, 1.55fr) auto;
    gap: 0.2rem 0.45rem;
    align-items: baseline;
    padding: 0.18rem 0.06rem;
    text-align: left;
    line-height: 1.2;
}

.heritage-memorial-list li:last-child,
.heritage-memorial-entry:last-child {
    padding-bottom: 0;
}

.heritage-memorial-rank {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.58rem;
    color: rgba(212, 192, 138, 0.92);
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.32);
}

.heritage-memorial-name {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.72rem;
    line-height: 1.2;
    min-width: 0;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.heritage-memorial-year {
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.66rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-align: right;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.24);
}

/* ── Medal / excellence cards ── */
.heritage-medal-card {
    flex: 0 0 clamp(260px, 27.5vw, 288px);
    scroll-snap-align: start;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background:
        linear-gradient(180deg, #fff 0%, #faf7ef 52%, var(--heritage-cream-soft) 100%);
    border: 1px solid rgba(184, 163, 106, 0.22);
    border-radius: var(--heritage-radius-xl);
    box-shadow: var(--heritage-shadow-soft);
    padding: 1.45rem 1.15rem 1.55rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s var(--bdf-ease-cinematic), box-shadow 0.4s ease, border-color 0.4s ease;
}

.heritage-medal-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--heritage-gold-deep), var(--heritage-gold-light), var(--heritage-gold-deep));
    opacity: 0.85;
}

.heritage-medal-card:hover {
    transform: translateY(-7px);
    border-color: rgba(184, 163, 106, 0.38);
    box-shadow: var(--heritage-shadow-lifted);
}

.heritage-medal-visual {
    width: 6.75rem;
    height: 6.75rem;
    margin: 0.15rem auto 1.15rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.78), transparent 52%),
        linear-gradient(155deg, #ecd9ad 0%, #b8a36a 38%, #8f7840 100%);
    box-shadow:
        0 12px 24px rgba(122, 84, 50, 0.22),
        inset 0 2px 0 rgba(255, 255, 255, 0.55),
        inset 0 -4px 10px rgba(79, 58, 24, 0.2);
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.heritage-medal-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 55%),
        linear-gradient(160deg, #e8dcc0 0%, #c9b07a 42%, #9a8048 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.heritage-medal-visual::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1.15rem;
    transform: translateX(-50%);
    width: 5rem;
    height: 0.55rem;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(32, 39, 25, 0.16) 0%, transparent 72%);
    pointer-events: none;
}

.heritage-medal-visual::after {
    content: "";
    position: absolute;
    inset: -0.5rem;
    border-radius: inherit;
    border: 1px solid rgba(184, 163, 106, 0.32);
    opacity: 0.75;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.heritage-medal-visual img,
.heritage-medal-portrait {
    width: 100%;
    height: 100%;
    object-fit: var(--bdf-photo-fit, cover);
    object-position: var(--bdf-photo-position, top center);
    border-radius: inherit;
}

.heritage-medal-visual img:not(.heritage-medal-portrait) {
    width: 3.4rem;
    height: 3.4rem;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(32, 39, 25, 0.18));
}

.heritage-medal-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.015em;
    text-align: center;
    color: var(--heritage-green-dark);
    margin-bottom: 0.55rem;
    max-width: 100%;
    text-wrap: balance;
}

.heritage-medal-desc {
    text-align: justify;
    text-justify: inter-word;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--bdf-muted);
    margin: 0;
    max-width: 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* ── Scroll reveal ── */
.heritage-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s var(--bdf-ease-cinematic), transform 0.75s var(--bdf-ease-cinematic);
}

.heritage-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.heritage-reveal--delay-1 { transition-delay: 0.1s; }
.heritage-reveal--delay-2 { transition-delay: 0.18s; }
.heritage-reveal--delay-3 { transition-delay: 0.26s; }

/* ── Responsive ── */
@media (min-width: 992px) {
    .heritage-memorial-grid .heritage-memorial-roll-col {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .heritage-memorial-grid .heritage-memorial-image-col {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }

    .heritage-memorial-grid .heritage-memorial-copy-col {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        min-height: 0;
    }
}

@media (max-width: 991.98px) {
    .heritage-hero-content {
        max-width: none;
    }

    .heritage-section-copy {
        padding-right: 0;
        margin-bottom: 2.25rem;
        width: 100%;
    }

    .heritage-memorial-grid > [class*="col-"]:not(:last-child) {
        margin-bottom: 2rem;
    }

    .heritage-memorial-grid > [class*="col-"] {
        display: block;
    }

    .heritage-memorial-copy-col.heritage-section-copy {
        display: flex;
        flex: none;
    }

    .heritage-memorial-image-col {
        padding-inline: 0;
    }

    .heritage-memorial-roll-col,
    .heritage-memorial-copy-col {
        padding-inline: 0;
    }

    .heritage-memorial-image-wrap {
        max-height: none;
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 11;
        flex: none;
    }

    .heritage-memorial-roll {
        max-height: none;
        min-height: 0;
        height: auto;
        flex: none;
    }

    .heritage-memorial-entry {
        grid-template-columns: minmax(2.4rem, 0.55fr) minmax(0, 1.5fr) auto;
        gap: 0.18rem 0.4rem;
        padding: 0.16rem 0.06rem;
    }

    .heritage-carousel::before,
    .heritage-carousel::after {
        display: none;
    }

    .heritage-commanders-grid .heritage-carousel-track,
    .heritage-awards-grid .heritage-carousel-track {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        scroll-snap-type: none;
        gap: 1rem;
        padding-bottom: 0.35rem;
    }

    .heritage-commanders-grid .heritage-carousel-nav,
    .heritage-awards-grid .heritage-carousel-nav {
        display: none;
    }

    .heritage-commanders-grid .heritage-commander-card,
    .heritage-awards-grid .heritage-medal-card {
        flex: none;
        width: auto;
    }
}

@media (max-width: 575.98px) {
    .heritage-hero {
        min-height: clamp(210px, 30vh, 320px);
        height: auto;
    }

    .heritage-hero-content {
        min-height: clamp(210px, 30vh, 320px);
    }

    .heritage-commanders-grid .heritage-carousel-track,
    .heritage-awards-grid .heritage-carousel-track {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 1.25rem;
    }

    .heritage-commanders-grid .heritage-carousel-nav,
    .heritage-awards-grid .heritage-carousel-nav {
        display: flex;
    }

    .heritage-commander-card,
    .heritage-medal-card {
        flex: 0 0 84vw;
    }

    .heritage-commander-name {
        font-size: 1.28rem;
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .heritage-page {
        scroll-behavior: auto;
    }

    .heritage-hero-media img {
        animation: none;
        transform: none;
    }

    .heritage-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .heritage-commander-card:hover,
    .heritage-medal-card:hover {
        transform: none;
    }

    .heritage-carousel-track {
        scroll-behavior: auto;
    }

    .heritage-commander-card:hover .heritage-commander-portrait img,
    .heritage-memorial-image-wrap:hover img {
        transform: none;
    }
}

.heritage-empty-note {
    color: rgba(32, 39, 25, 0.62);
    font-size: 0.95rem;
    line-height: 1.5;
}

.heritage-section--dark .heritage-empty-note {
    color: rgba(255, 255, 255, 0.72);
}
