/* ============================================================
   Maritime Museum — front-end stylesheet
   Brand palette and patterns from ui/museum + ui/reference.
   ============================================================ */

:root {
    --ml-ink: #0b2748;
    --ml-blue: #174d7a;
    --ml-cream: #f4f0e6;
    --ml-cream-2: #ece5d4;
    --ml-tan: #d1b48c;
    --ml-tan-soft: rgba(209, 180, 140, 0.55);
    --ml-brown: #6b5a4b;
    --ml-white: #ffffff;
    --ml-shadow: 0 14px 38px rgba(11, 39, 72, 0.10);
    --ml-shadow-strong: 0 24px 60px rgba(0, 0, 0, 0.50);
    --ml-maxw: 1280px;
    --ml-radius: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color: var(--ml-brown);
    background: var(--ml-cream);
    line-height: 1.7;
    letter-spacing: 0.01em;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a {
    color: var(--ml-blue);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: var(--ml-brown); }

h1, h2, h3, h4, h5, h6 {
    color: var(--ml-ink);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.25;
}

strong, b { color: var(--ml-ink); }

ul, ol { padding-left: 1.25em; }

.main { min-height: 60vh; }

/* ============================================================
   Layout containers
   ============================================================ */

.m-container {
    max-width: var(--ml-maxw);
    margin: 0 auto;
    padding: 0 2em;
}
.m-container--narrow { max-width: 880px; }

/* ============================================================
   Buttons
   ============================================================ */

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.9em 1.4em;
    background: var(--ml-ink);
    color: var(--ml-cream);
    border: 1px solid var(--ml-tan);
    border-radius: 2px;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.button:hover { background: var(--ml-blue); color: var(--ml-cream); }

.button.alt {
    background: rgba(244, 240, 230, 0.08);
    color: var(--ml-cream);
    border-color: rgba(209, 180, 140, 0.7);
}
.button.alt:hover { background: rgba(244, 240, 230, 0.20); color: var(--ml-cream); }

.button.cream {
    background: var(--ml-cream);
    color: var(--ml-ink);
    border-color: var(--ml-tan);
}
.button.cream:hover { background: var(--ml-tan); color: var(--ml-ink); }

.button.ghost {
    background: transparent;
    color: var(--ml-ink);
    border-color: var(--ml-tan);
}
.button.ghost:hover { background: var(--ml-cream); }

/* ============================================================
   Header: brand + nav
   ============================================================ */

.m-site-header {
    background: var(--ml-ink);
    color: var(--ml-cream);
    border-bottom: 1px solid rgba(209, 180, 140, 0.25);
}
.m-site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5em;
    padding: 1.1em 2em;
    flex-wrap: wrap;
    max-width: 1480px;
    margin: 0 auto;
}

.m-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85em;
    color: var(--ml-cream);
    text-decoration: none;
}
.m-brand:hover { color: var(--ml-cream); }
.m-brand i {
    color: var(--ml-tan);
    font-size: 28px;
}
.m-brand__text { display: flex; flex-direction: column; }
.m-brand__ru {
    font-weight: 700;
    font-size: 18px;
    color: var(--ml-cream);
    letter-spacing: 0.02em;
    line-height: 1;
}
.m-brand__en {
    font-weight: 700;
    font-size: 11px;
    color: var(--ml-tan);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-top: 4px;
}

.museum-nav {
    list-style: none;
    display: flex;
    gap: 2px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}
.museum-nav a,
.museum-nav span {
    color: var(--ml-cream);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 8px 12px;
    border-radius: 2px;
    display: inline-block;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    text-transform: uppercase;
}
.museum-nav li.current a,
.museum-nav a:hover {
    background: rgba(209, 180, 140, 0.85);
    color: var(--ml-ink);
}

.m-site-aside {
    display: flex;
    align-items: center;
    gap: 14px;
}
.lang-switcher {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    font-size: 0.78em;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.lang-switcher__item a,
.lang-switcher__item span {
    color: var(--ml-cream);
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 2px;
    display: inline-block;
    font-weight: 700;
}
.lang-switcher__item a:hover {
    color: var(--ml-ink);
    background: var(--ml-tan);
}
.lang-switcher__item.is-current span {
    color: var(--ml-tan);
    border-color: rgba(209, 180, 140, 0.5);
}

.m-header-search {
    display: flex;
    align-items: stretch;
    background: rgba(244, 240, 230, 0.08);
    border: 1px solid rgba(209, 180, 140, 0.5);
    border-radius: 2px;
}
.m-header-search input {
    background: transparent;
    border: 0;
    padding: 0.55em 0.75em;
    color: var(--ml-cream);
    font-size: 13px;
    width: 160px;
    outline: none;
    font-family: inherit;
}
.m-header-search input::placeholder { color: rgba(244, 240, 230, 0.55); }
.m-header-search button {
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(209, 180, 140, 0.5);
    color: var(--ml-tan);
    padding: 0 0.85em;
    cursor: pointer;
    font-size: 13px;
}
.m-header-search button:hover { color: var(--ml-cream); }

/* ============================================================
   Hero (root + page heroes)
   ============================================================ */

.m-hero {
    position: relative;
    padding: 4em 0 5em 0;
    background: var(--ml-ink);
    color: var(--ml-cream);
}
.m-hero--root {
    padding: 5em 0 6em 0;
    min-height: 620px;
    background: var(--ml-ink);
    overflow: hidden;
    isolation: isolate;
}
.m-hero__slider {
    position: absolute;
    left: 0;
    right: 0;
    top: -8%;
    bottom: -22%;
    z-index: 0;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}
.m-hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    overflow: hidden;
    animation: m-hero-cycle 56s linear infinite;
}
.m-hero__slide-inner {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform-origin: center;
    will-change: transform;
    animation: 56s ease-in-out infinite;
    /* default effect; JS may swap and CSS nth-child below overrides */
    animation-name: m-hero-zoom-in;
}
.m-hero__slide:nth-child(1) { animation-delay:  0s; }
.m-hero__slide:nth-child(2) { animation-delay:  7s; }
.m-hero__slide:nth-child(3) { animation-delay: 14s; }
.m-hero__slide:nth-child(4) { animation-delay: 21s; }
.m-hero__slide:nth-child(5) { animation-delay: 28s; }
.m-hero__slide:nth-child(6) { animation-delay: 35s; }
.m-hero__slide:nth-child(7) { animation-delay: 42s; }
.m-hero__slide:nth-child(8) { animation-delay: 49s; }
.m-hero__slide:nth-child(1) .m-hero__slide-inner { animation-delay:  0s; }
.m-hero__slide:nth-child(2) .m-hero__slide-inner { animation-delay:  7s; }
.m-hero__slide:nth-child(3) .m-hero__slide-inner { animation-delay: 14s; }
.m-hero__slide:nth-child(4) .m-hero__slide-inner { animation-delay: 21s; }
.m-hero__slide:nth-child(5) .m-hero__slide-inner { animation-delay: 28s; }
.m-hero__slide:nth-child(6) .m-hero__slide-inner { animation-delay: 35s; }
.m-hero__slide:nth-child(7) .m-hero__slide-inner { animation-delay: 42s; }
.m-hero__slide:nth-child(8) .m-hero__slide-inner { animation-delay: 49s; }
/* 8 slides × 7s window each = 56s. Each slide: 6s held + 1s cross-fade. */
@keyframes m-hero-cycle {
    0%      { opacity: 0; }
    1.5%    { opacity: 1; }
    12.5%   { opacity: 1; }
    14%     { opacity: 0; }
    100%    { opacity: 0; }
}

/* Ken Burns: each effect plays during the 0%–14% window of the slide's
   own cycle (= the 7s when it is visible) and snaps back while invisible. */
@keyframes m-hero-zoom-in {
    0%   { transform: scale(1.02); }
    14%  { transform: scale(1.18); }
    14.01%, 100% { transform: scale(1.02); }
}
@keyframes m-hero-zoom-out {
    0%   { transform: scale(1.20); }
    14%  { transform: scale(1.04); }
    14.01%, 100% { transform: scale(1.20); }
}
@keyframes m-hero-pan-left {
    0%   { transform: scale(1.12) translate3d( 3%, 0, 0); }
    14%  { transform: scale(1.12) translate3d(-3%, 0, 0); }
    14.01%, 100% { transform: scale(1.12) translate3d(3%, 0, 0); }
}
@keyframes m-hero-pan-right {
    0%   { transform: scale(1.12) translate3d(-3%, 0, 0); }
    14%  { transform: scale(1.12) translate3d( 3%, 0, 0); }
    14.01%, 100% { transform: scale(1.12) translate3d(-3%, 0, 0); }
}
@keyframes m-hero-pan-up {
    0%   { transform: scale(1.12) translate3d(0,  2%, 0); }
    14%  { transform: scale(1.12) translate3d(0, -2%, 0); }
    14.01%, 100% { transform: scale(1.12) translate3d(0, 2%, 0); }
}
@keyframes m-hero-pan-zoom {
    0%   { transform: scale(1.04) translate3d(-2%, 1%, 0); }
    14%  { transform: scale(1.18) translate3d( 2%, -2%, 0); }
    14.01%, 100% { transform: scale(1.04) translate3d(-2%, 1%, 0); }
}

/* Deterministic fallback distribution when JS is off — 8 slides cycle the 6 effects. */
.m-hero__slide:nth-child(1) .m-hero__slide-inner { animation-name: m-hero-zoom-in; }
.m-hero__slide:nth-child(2) .m-hero__slide-inner { animation-name: m-hero-pan-left; }
.m-hero__slide:nth-child(3) .m-hero__slide-inner { animation-name: m-hero-zoom-out; }
.m-hero__slide:nth-child(4) .m-hero__slide-inner { animation-name: m-hero-pan-right; }
.m-hero__slide:nth-child(5) .m-hero__slide-inner { animation-name: m-hero-pan-zoom; }
.m-hero__slide:nth-child(6) .m-hero__slide-inner { animation-name: m-hero-pan-up; }
.m-hero__slide:nth-child(7) .m-hero__slide-inner { animation-name: m-hero-zoom-in; }
.m-hero__slide:nth-child(8) .m-hero__slide-inner { animation-name: m-hero-pan-left; }

.m-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(rgba(11, 39, 72, 0.62), rgba(11, 39, 72, 0.82));
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .m-hero__slider { transform: none !important; }
    .m-hero__slide { animation: none; opacity: 0; }
    .m-hero__slide.is-active { opacity: 1; }
    .m-hero__slide-inner { animation: none; transform: none; }
}
.m-hero--section {
    min-height: 380px;
    background:
        linear-gradient(rgba(11, 39, 72, 0.62), rgba(11, 39, 72, 0.85)),
        url("../images/homepage.aecc6969809e.png") center/cover no-repeat,
        var(--ml-ink);
}
.m-hero--funds {
    min-height: 380px;
    background:
        linear-gradient(rgba(11, 39, 72, 0.62), rgba(11, 39, 72, 0.85)),
        url("../images/search-header.3641e8077e7a.png") center/cover no-repeat,
        var(--ml-ink);
}
.m-hero--archives {
    background-image:
        linear-gradient(rgba(11, 39, 72, 0.62), rgba(11, 39, 72, 0.85)),
        url("../images/personas.38254b65956f.png");
    background-size: cover;
    background-position: center;
}
.m-hero--library {
    background-image:
        linear-gradient(rgba(11, 39, 72, 0.62), rgba(11, 39, 72, 0.85)),
        url("../images/books.baaf5b6949a5.png");
    background-size: cover;
    background-position: center;
}
.m-hero--news {
    background-image:
        linear-gradient(rgba(11, 39, 72, 0.62), rgba(11, 39, 72, 0.85)),
        url("../images/periodical.e24012bfcfb9.png");
    background-size: cover;
    background-position: center;
}
.m-hero--about {
    background-image:
        linear-gradient(rgba(11, 39, 72, 0.62), rgba(11, 39, 72, 0.85)),
        url("../images/about.8f08f22a37a9.png");
    background-size: cover;
    background-position: center;
}
.m-hero--detail {
    background:
        linear-gradient(rgba(11, 39, 72, 0.82), rgba(11, 39, 72, 0.94)),
        var(--ml-ink);
    min-height: 360px;
}

.m-hero__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 2em;
}

.m-hero__eyebrow {
    font-size: 12.5px;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--ml-tan);
    margin: 0 0 1em 0;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.m-hero__title {
    font-size: 56px;
    line-height: 1.1;
    color: var(--ml-cream);
    margin: 0 0 0.4em 0;
    letter-spacing: 0.01em;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}
.m-hero--root .m-hero__title { font-size: 64px; }
.m-hero--section .m-hero__title,
.m-hero--detail .m-hero__title { font-size: 44px; }

.m-hero__subtitle {
    font-size: 17px;
    line-height: 1.55;
    color: var(--ml-cream);
    margin: 0 auto 1.8em auto;
    max-width: 44em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    opacity: 0.94;
}

.m-hero__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5em;
}

.m-hero__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em;
    flex-wrap: wrap;
    margin-top: 1.6em;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ml-tan);
    font-weight: 700;
}
.m-hero__meta a {
    color: var(--ml-tan);
    border-bottom: 1px dotted var(--ml-tan);
}
.m-hero__meta a:hover { color: var(--ml-cream); }

/* ---- inventory strip ---- */
.m-inv {
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin-top: 2.4em;
    flex-wrap: wrap;
}
.m-inv__cell {
    padding: 0.7em 1.8em;
    border-right: 1px solid rgba(209, 180, 140, 0.5);
    text-align: center;
}
.m-inv__cell:last-child { border-right: 0; }
.m-inv__lbl {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ml-tan);
    font-weight: 700;
    margin: 0 0 4px 0;
}
.m-inv__val {
    font-size: 18px;
    font-weight: 700;
    color: var(--ml-cream);
    margin: 0;
    letter-spacing: 0.02em;
}

/* ============================================================
   Breadcrumbs
   ============================================================ */

.breadcrumbs {
    background: var(--ml-cream);
    border-bottom: 1px solid var(--ml-tan);
}
.breadcrumbs__list {
    list-style: none;
    margin: 0;
    padding: 0.9em 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 0.6em;
    font-size: 0.78em;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ml-brown);
    max-width: var(--ml-maxw);
    margin: 0 auto;
    padding-left: 2em;
    padding-right: 2em;
}
.breadcrumbs__item a {
    color: var(--ml-brown);
    border-bottom: 1px dotted rgba(107, 90, 75, 0.45);
}
.breadcrumbs__item a:hover {
    color: var(--ml-ink);
    border-bottom-color: var(--ml-ink);
}
.breadcrumbs__item + .breadcrumbs__item::before {
    content: "/";
    margin-right: 0.45em;
    opacity: 0.5;
}
.breadcrumbs__item [aria-current="page"] { color: var(--ml-ink); font-weight: 700; }

/* ============================================================
   Section heading (block heading inside artboards)
   ============================================================ */

.m-block-head {
    text-align: center;
    max-width: 44em;
    margin: 0 auto 3em auto;
    padding: 0 2em;
}
.m-block-head .eb {
    font-size: 12.5px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--ml-brown);
    font-weight: 700;
    margin: 0 0 0.8em 0;
}
.m-block-head h2 {
    color: var(--ml-ink);
    font-size: 32px;
    line-height: 1.22;
    margin: 0 0 0.5em 0;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.m-block-head p {
    color: var(--ml-brown);
    font-size: 17px;
    margin: 0;
    line-height: 1.6;
}

/* ============================================================
   Wrappers: section bands
   ============================================================ */

.m-section {
    padding: 5em 0;
    background: var(--ml-cream);
}
.m-section--white { background: var(--ml-white); }
.m-section--bordered {
    border-top: 1px solid var(--ml-tan);
    border-bottom: 1px solid var(--ml-tan);
}

/* ============================================================
   7-section grid (root sections on home)
   ============================================================ */

.m-section-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2em;
    max-width: var(--ml-maxw);
    margin: 0 auto;
    padding: 0 2em;
}
.m-section-grid > :nth-child(n+5):nth-child(-n+7) { /* second row */ }

.m-section-card {
    background: var(--ml-white);
    border: 1px solid var(--ml-tan);
    border-top: 4px solid var(--ml-ink);
    border-radius: var(--ml-radius);
    padding: 2.2em 1.8em 1.8em 1.8em;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    min-height: 240px;
}
.m-section-card:hover {
    box-shadow: 0 16px 36px rgba(11, 39, 72, 0.12);
    transform: translateY(-2px);
    color: inherit;
}
.m-section-card__num {
    font-family: "PT Serif", Georgia, serif;
    font-size: 12px;
    letter-spacing: 0.3em;
    color: var(--ml-tan);
    font-weight: 700;
    margin: 0;
}
.m-section-card__chip {
    width: 52px;
    height: 52px;
    background: var(--ml-ink);
    color: var(--ml-cream);
    border-radius: 3px;
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4em;
}
.m-section-card__title {
    font-size: 22px;
    color: var(--ml-ink);
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}
.m-section-card__body {
    font-size: 14px;
    color: var(--ml-brown);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}
.m-section-card__count {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ml-brown);
    font-weight: 700;
    padding-top: 0.8em;
    border-top: 1px dashed var(--ml-tan);
}
.m-section-card__count strong {
    color: var(--ml-ink);
    font-size: 16px;
    letter-spacing: 0;
}

/* ============================================================
   On view / exhibitions row
   ============================================================ */

.m-onview { padding: 5em 0; background: var(--ml-cream); }
.m-onview__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 2em 1em 2em;
    margin: 0 auto 2em auto;
    border-bottom: 1px solid var(--ml-tan);
    max-width: var(--ml-maxw);
}
.m-onview__head h2 {
    color: var(--ml-ink);
    font-size: 28px;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.m-onview__head .all {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ml-blue);
    font-weight: 700;
}
.m-onview__row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4em;
    padding: 0 2em;
    max-width: var(--ml-maxw);
    margin: 0 auto;
}

.m-exhib {
    background: var(--ml-white);
    border: 1px solid var(--ml-tan);
    border-radius: var(--ml-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s, transform 0.18s;
}
.m-exhib:hover {
    box-shadow: 0 16px 36px rgba(11, 39, 72, 0.12);
    transform: translateY(-2px);
    color: inherit;
}
.m-exhib__media {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: var(--ml-ink);
    position: relative;
}
.m-exhib__media img { width: 100%; height: 100%; object-fit: cover; }
.m-exhib__status {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--ml-tan);
    color: var(--ml-ink);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 2px;
}
.m-exhib__status--past {
    background: rgba(11, 39, 72, 0.85);
    color: var(--ml-cream);
}
.m-exhib__body { padding: 1.4em 1.6em; flex: 1; }
.m-exhib__dates {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ml-brown);
    margin: 0 0 0.4em 0;
    font-weight: 700;
}
.m-exhib__title {
    font-size: 19px;
    color: var(--ml-ink);
    margin: 0 0 0.4em 0;
    font-weight: 700;
    line-height: 1.3;
}
.m-exhib__sub {
    font-size: 14px;
    color: var(--ml-brown);
    margin: 0;
    line-height: 1.5;
}

/* ============================================================
   News strip on home / news index
   ============================================================ */

.m-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5em;
    max-width: var(--ml-maxw);
    margin: 0 auto;
    padding: 0 2em;
}

.m-news-card {
    background: var(--ml-cream);
    border: 1px solid var(--ml-tan);
    border-radius: var(--ml-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.m-news-card:hover {
    box-shadow: 0 16px 36px rgba(11, 39, 72, 0.12);
    transform: translateY(-2px);
    color: inherit;
}
.m-news-card__media {
    aspect-ratio: 16 / 9;
    background: var(--ml-ink);
    overflow: hidden;
}
.m-news-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.m-news-card:hover .m-news-card__media img { transform: scale(1.04); }
.m-news-card__placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ml-ink), var(--ml-blue));
    color: var(--ml-tan);
    font-size: 2em;
}
.m-news-card__body {
    padding: 1.3em 1.4em 1.5em 1.4em;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.m-news-card__meta {
    font-size: 0.78em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ml-brown);
    margin: 0 0 0.55em 0;
    font-weight: 700;
}
.m-news-card__title {
    font-size: 1.15em;
    margin: 0 0 0.6em 0;
    color: var(--ml-ink);
    line-height: 1.3;
}
.m-news-card__summary {
    color: var(--ml-brown);
    margin: 0 0 1.2em 0;
    line-height: 1.55;
    font-size: 0.95em;
    flex: 1;
}
.m-news-card__link {
    align-self: flex-start;
    font-size: 0.9em;
    letter-spacing: 0.05em;
    color: var(--ml-blue);
    font-weight: 700;
}

/* ============================================================
   CTA strip
   ============================================================ */

.m-cta {
    background: linear-gradient(165deg, var(--ml-ink) 0%, var(--ml-blue) 100%);
    padding: 5em 2em;
    text-align: center;
    border-top: 1px solid var(--ml-tan);
}
.m-cta h2 {
    color: var(--ml-cream);
    font-size: 32px;
    margin: 0 0 0.55em 0;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    font-weight: 700;
}
.m-cta p {
    color: var(--ml-cream);
    margin: 0 auto 1.8em auto;
    max-width: 36em;
    font-size: 17px;
    line-height: 1.6;
    opacity: 0.92;
}
.m-cta__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   Footer
   ============================================================ */

.m-footer {
    background: linear-gradient(165deg, var(--ml-cream) 12%, var(--ml-cream-2) 88%);
    border-top: 1px solid var(--ml-tan);
    padding: 3.5em 2em 1.6em 2em;
    color: var(--ml-ink);
}
.m-footer__cols {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 3em;
    max-width: var(--ml-maxw);
    margin: 0 auto 2em auto;
}
.m-footer__col h4 {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ml-brown);
    margin: 0 0 1em 0;
    font-weight: 700;
    padding-bottom: 0.7em;
    border-bottom: 1px solid var(--ml-tan);
}
.m-footer__col p {
    font-size: 14px;
    color: var(--ml-brown);
    line-height: 1.55;
    margin: 0 0 0.5em 0;
}
.m-footer__col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.m-footer__col li { margin: 0 0 6px 0; }
.m-footer__col a {
    font-size: 14px;
    color: var(--ml-blue);
    text-decoration: none;
    border-bottom: 1px dotted var(--ml-brown);
}
.m-footer__col a:hover {
    color: var(--ml-brown);
    border-bottom-color: var(--ml-ink);
}
.m-footer__copy {
    display: flex;
    justify-content: space-between;
    padding: 1.4em 0 0 0;
    border-top: 1px dashed var(--ml-tan);
    font-size: 13px;
    color: var(--ml-ink);
    max-width: var(--ml-maxw);
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1em;
}

/* ============================================================
   Detail (article / news / document / object) layout
   ============================================================ */

.detail-page {
    background: var(--ml-cream);
    padding: 0 0 5em 0;
}
.detail-page .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2em;
}
.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1em;
    padding: 1.5em 0 1.4em 0;
}
.detail-meta__type {
    display: inline-block;
    font-size: 0.78em;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ml-cream);
    background: var(--ml-ink);
    padding: 0.5em 1.1em;
    font-weight: 700;
    border-radius: 2px;
    border: 1px solid var(--ml-tan);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2.5em;
    align-items: start;
    padding-top: 2em;
}
.detail-layout--single { grid-template-columns: minmax(0, 1fr); }

.detail-main {
    background: var(--ml-white);
    border: 1px solid var(--ml-tan);
    border-radius: var(--ml-radius);
    padding: 2.4em 2.6em;
    box-shadow: var(--ml-shadow);
    min-width: 0;
}
.detail-main > *:first-child { margin-top: 0; }
.detail-main > *:last-child { margin-bottom: 0; }

.detail-cover {
    margin: 0 0 1.8em 0;
    border: 1px solid var(--ml-tan);
    border-radius: 3px;
    overflow: hidden;
    background: var(--ml-cream);
    box-shadow: 0 8px 20px rgba(11, 39, 72, 0.12);
}
.detail-cover img { display: block; width: 100%; height: auto; }

.detail-section-title {
    font-size: 0.78em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ml-brown);
    margin: 2.2em 0 1.1em 0;
    padding-bottom: 0.6em;
    border-bottom: 1px solid var(--ml-tan);
    font-weight: 700;
}

.detail-side {
    position: sticky;
    top: 1.5em;
    display: flex;
    flex-direction: column;
    gap: 1.3em;
    min-width: 0;
}

.fact-card {
    background: var(--ml-white);
    border: 1px solid var(--ml-tan);
    border-radius: var(--ml-radius);
    padding: 1.4em 1.5em;
    box-shadow: 0 4px 14px rgba(11, 39, 72, 0.06);
}
.fact-card__title {
    font-size: 0.78em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ml-brown);
    margin: 0 0 1em 0;
    padding-bottom: 0.7em;
    border-bottom: 1px solid var(--ml-tan);
    font-weight: 700;
}
.fact-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    margin-top: 1.1em;
    width: 100%;
    padding: 0.85em 1em;
    background: var(--ml-ink);
    color: var(--ml-cream);
    border: 1px solid var(--ml-tan);
    border-radius: 2px;
    font-size: 0.92em;
    letter-spacing: 0.06em;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.15s ease;
}
.fact-card__action:hover { background: var(--ml-blue); color: var(--ml-cream); }

.fact-list { list-style: none; margin: 0; padding: 0; }
.fact-list li {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    padding: 0.65em 0;
    border-bottom: 1px dashed var(--ml-tan-soft);
}
.fact-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.fact-list li:first-child { padding-top: 0; }
.fact-list__label {
    font-size: 0.72em;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ml-brown);
    font-weight: 700;
}
.fact-list__value {
    font-size: 0.98em;
    color: var(--ml-ink);
    line-height: 1.45;
}

/* tags & prose */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}
.tag-pill {
    display: inline-block;
    font-size: 0.78em;
    padding: 0.25em 0.75em;
    background: var(--ml-cream);
    border: 1px solid var(--ml-tan);
    border-radius: 12px;
    color: var(--ml-brown);
    line-height: 1.4;
}

.prose {
    color: var(--ml-ink);
    line-height: 1.7;
}
.prose p, .prose ul, .prose ol { margin: 0 0 1em 0; color: var(--ml-ink); }
.prose h2, .prose h3 {
    color: var(--ml-ink);
    margin: 1.6em 0 0.6em 0;
    letter-spacing: 0.01em;
}
.prose h2 { font-size: 1.5em; }
.prose h3 { font-size: 1.2em; }
.prose blockquote {
    margin: 1.4em 0;
    padding: 0.4em 0 0.4em 1.2em;
    border-left: 4px solid var(--ml-tan);
    color: var(--ml-brown);
    font-style: italic;
}
.prose a { color: var(--ml-blue); border-bottom: 1px dotted var(--ml-brown); }
.prose a:hover { color: var(--ml-brown); border-bottom-color: var(--ml-ink); }
.prose img { margin: 1.2em 0; border: 1px solid var(--ml-tan); border-radius: 3px; }

/* StreamField blocks */
.content-heading {
    font-size: 1.5em;
    color: var(--ml-ink);
    margin: 1.8em 0 0.6em 0;
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--ml-tan);
    letter-spacing: 0.01em;
}
.content-image {
    margin: 1.6em 0;
    border: 1px solid var(--ml-tan);
    border-radius: 3px;
    overflow: hidden;
    background: var(--ml-cream);
}
.content-image__img { width: 100%; display: block; }
.content-image__caption {
    font-size: 0.85em;
    color: var(--ml-brown);
    padding: 0.7em 1em;
    background: var(--ml-cream);
    border-top: 1px dashed var(--ml-tan);
    margin: 0;
    font-style: italic;
}
.content-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.7em;
    margin: 1.6em 0;
}
.content-gallery__item {
    margin: 0;
    border: 1px solid var(--ml-tan);
    border-radius: 3px;
    overflow: hidden;
    background: var(--ml-cream);
}
.content-gallery__img { display: block; width: 100%; }
.content-quote {
    border: 1px solid var(--ml-tan);
    border-left: 4px solid var(--ml-blue);
    background: var(--ml-cream);
    padding: 1.3em 1.6em;
    margin: 1.6em 0;
    border-radius: 0 3px 3px 0;
}
.content-quote__text {
    font-family: "PT Serif", Georgia, serif;
    font-size: 1.2em;
    font-style: italic;
    color: var(--ml-ink);
    margin: 0 0 0.6em 0;
    line-height: 1.5;
}
.content-quote__cite {
    font-size: 0.85em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ml-brown);
    font-style: normal;
    font-weight: 700;
}
.content-document {
    margin: 1.6em 0;
    background: var(--ml-cream);
    border: 1px solid var(--ml-tan);
    border-radius: 3px;
    padding: 1em 1.2em;
}
.content-document__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    color: var(--ml-blue);
    font-weight: 700;
}
.content-document__ext {
    display: inline-block;
    background: var(--ml-ink);
    color: var(--ml-cream);
    font-size: 0.7em;
    letter-spacing: 0.15em;
    padding: 0.2em 0.6em;
    border-radius: 2px;
    margin-left: 0.45em;
}

/* ============================================================
   Museum object card layout
   ============================================================ */

.object-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.7em;
    margin-top: 1.4em;
}
.object-gallery__item {
    margin: 0;
    border: 1px solid var(--ml-tan);
    border-radius: 3px;
    overflow: hidden;
    background: var(--ml-cream);
}
.object-gallery__item img { display: block; width: 100%; }
.object-gallery__item figcaption {
    font-size: 0.78em;
    color: var(--ml-brown);
    padding: 0.4em 0.6em;
    border-top: 1px dashed var(--ml-tan);
}

/* ============================================================
   News index list
   ============================================================ */

.news-list { margin-top: 1.5em; }
.news-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1.6em;
    padding: 1.6em 0;
    border-bottom: 1px dashed var(--ml-tan);
}
.news-item__date {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ml-brown);
    font-weight: 700;
    align-self: start;
}
.news-item__title {
    font-size: 19px;
    color: var(--ml-ink);
    margin: 0 0 0.4em 0;
    font-weight: 700;
    line-height: 1.3;
}
.news-item__title a {
    color: var(--ml-ink);
    border-bottom: 1px solid transparent;
}
.news-item__title a:hover {
    color: var(--ml-blue);
    border-bottom-color: var(--ml-tan);
}
.news-item__text {
    font-size: 14px;
    color: var(--ml-brown);
    margin: 0;
    line-height: 1.5;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5em;
    margin: 3em 0 1em 0;
    font-size: 0.92em;
}
.pagination__link {
    color: var(--ml-blue);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.78em;
}
.pagination__status {
    color: var(--ml-brown);
    font-size: 0.85em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ============================================================
   Search
   ============================================================ */

.search-page {
    background: var(--ml-cream);
    padding: 0 0 5em 0;
}
.search-page > .container {
    max-width: var(--ml-maxw);
    margin: 0 auto;
    padding: 0 2em;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--ml-white);
    border: 1px solid var(--ml-tan);
    border-radius: var(--ml-radius);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.30);
    overflow: hidden;
    max-width: 720px;
    margin: -2.5em auto 2.5em auto;
    position: relative;
    z-index: 5;
}
.search-bar__icon {
    padding: 0 0.9em 0 1.1em;
    color: var(--ml-blue);
    font-size: 1.05em;
}
.search-bar input[type="search"],
.search-bar input[type="text"] {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 1em 0.6em;
    font-size: 1.02em;
    color: var(--ml-ink);
    outline: none;
    font-family: inherit;
}
.search-bar input::placeholder { color: rgba(107, 90, 75, 0.65); }
.search-bar button {
    border: 0;
    border-left: 1px solid var(--ml-tan);
    background: var(--ml-ink);
    color: var(--ml-cream);
    padding: 0 1.6em;
    font-weight: 700;
    font-size: 0.9em;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-transform: uppercase;
    font-family: inherit;
}
.search-bar button:hover { background: var(--ml-blue); }

.results-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.6em;
    padding-bottom: 1.1em;
    margin-bottom: 1.4em;
    border-bottom: 1px solid var(--ml-tan);
    color: var(--ml-brown);
    font-size: 0.95em;
}
.results-meta__count strong { color: var(--ml-ink); font-weight: 700; }
.results-meta__query { font-style: italic; }

.result-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1em;
}
.result-card {
    background: var(--ml-white);
    border: 1px solid var(--ml-tan);
    border-left: 4px solid var(--ml-blue);
    border-radius: 3px;
    padding: 1.3em 1.5em;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.result-card:hover {
    box-shadow: 0 12px 28px rgba(11, 39, 72, 0.10);
    transform: translateY(-1px);
}
.result-card__type {
    display: inline-block;
    font-size: 0.7em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ml-brown);
    background: var(--ml-cream);
    padding: 0.25em 0.7em;
    border: 1px solid var(--ml-tan);
    border-radius: 2px;
    margin-bottom: 0.7em;
    font-weight: 700;
}
.result-card__title {
    font-size: 1.25em;
    margin: 0 0 0.5em 0;
    color: var(--ml-ink);
    line-height: 1.3;
}
.result-card__title a {
    color: var(--ml-ink);
    border-bottom: 1px solid transparent;
}
.result-card__title a:hover {
    color: var(--ml-blue);
    border-bottom-color: var(--ml-tan);
}
.result-card__summary {
    color: var(--ml-brown);
    margin: 0;
    line-height: 1.55;
}

.empty-state {
    text-align: center;
    padding: 3.5em 2em;
    background: var(--ml-white);
    border: 1px dashed var(--ml-tan);
    border-radius: var(--ml-radius);
    color: var(--ml-brown);
    margin: 1.5em 0;
}
.empty-state__icon {
    font-size: 2.4em;
    color: var(--ml-tan);
    margin-bottom: 0.6em;
    display: block;
}
.empty-state h3 {
    color: var(--ml-ink);
    margin: 0 0 0.4em 0;
    font-size: 1.2em;
}
.empty-state p { margin: 0; font-size: 0.95em; }

/* ============================================================
   Fund / collection card grid (used on Funds section)
   ============================================================ */

.m-fund-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4em;
    max-width: var(--ml-maxw);
    margin: 0 auto;
    padding: 0 2em;
}
.m-fund-card {
    background: var(--ml-white);
    border: 1px solid var(--ml-tan);
    border-radius: var(--ml-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s, transform 0.18s;
    display: flex;
    flex-direction: column;
}
.m-fund-card:hover {
    box-shadow: 0 16px 36px rgba(11, 39, 72, 0.12);
    transform: translateY(-2px);
    color: inherit;
}
.m-fund-card__media {
    aspect-ratio: 4 / 3;
    background-color: var(--ml-ink);
    background-size: cover;
    background-position: center;
    position: relative;
}
.m-fund-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(11, 39, 72, 0.6) 0%, rgba(11, 39, 72, 0) 50%);
}
.m-fund-card__media-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ml-tan);
    font-size: 2.4em;
}
.m-fund-card__num {
    position: absolute;
    bottom: 14px;
    left: 16px;
    font-family: "PT Serif", Georgia, serif;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--ml-tan);
    font-weight: 700;
    z-index: 1;
}
.m-fund-card__body {
    padding: 1.3em 1.5em 1.4em 1.5em;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}
.m-fund-card__title {
    font-size: 19px;
    color: var(--ml-ink);
    margin: 0;
    font-weight: 700;
    line-height: 1.25;
}
.m-fund-card__sub {
    font-size: 13px;
    color: var(--ml-brown);
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
    .m-section-grid { grid-template-columns: repeat(3, 1fr); }
    .m-onview__row { grid-template-columns: repeat(2, 1fr); }
    .m-news-grid { grid-template-columns: repeat(2, 1fr); }
    .m-footer__cols { grid-template-columns: repeat(2, 1fr); gap: 2em; }
    .detail-layout { grid-template-columns: minmax(0, 1fr); }
    .detail-side { position: static; }
    .m-fund-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    body { font-size: 15px; }
    .m-hero { padding: 3em 0 4em 0; }
    .m-hero--root { padding: 4em 0 4.5em 0; min-height: 0; }
    .m-hero__title { font-size: 36px; }
    .m-hero--root .m-hero__title { font-size: 42px; }
    .m-hero__subtitle { font-size: 16px; }
    .m-section { padding: 3em 0; }
    .m-section-grid { grid-template-columns: 1fr; gap: 1em; padding: 0 1.2em; }
    .m-onview__row { grid-template-columns: 1fr; padding: 0 1.2em; }
    .m-news-grid { grid-template-columns: 1fr; padding: 0 1.2em; }
    .m-onview__head { padding-left: 1.2em; padding-right: 1.2em; }
    .m-fund-grid { grid-template-columns: 1fr; padding: 0 1.2em; }

    .m-site-header__inner { padding: 0.9em 1.2em; gap: 0.9em; }
    .museum-nav { order: 3; flex-basis: 100%; gap: 0; }
    .museum-nav a { padding: 6px 8px; font-size: 11.5px; }
    .m-site-aside { gap: 8px; }
    .m-header-search input { width: 110px; }

    .detail-page .container { padding: 0 1.2em; }
    .detail-main { padding: 1.5em 1.3em; }
    .m-footer { padding: 2.5em 1.2em 1.2em 1.2em; }
    .m-footer__cols { grid-template-columns: 1fr; gap: 1.5em; }
    .m-footer__copy { padding-left: 0; padding-right: 0; }
    .m-cta { padding: 3em 1.2em; }
    .m-cta h2 { font-size: 24px; }
    .breadcrumbs__list { padding-left: 1.2em; padding-right: 1.2em; }
    .news-item { grid-template-columns: 1fr; gap: 0.4em; }
}

/* ============================================================
   Lightbox — fullscreen image viewer (vanilla JS)
   ============================================================ */
.m-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(7, 23, 44, 0.94);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem 4rem;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.m-lightbox.is-open {
    display: flex;
    opacity: 1;
}
body.m-lightbox-open {
    overflow: hidden;
}
.m-lightbox__stage {
    max-width: 100%;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.m-lightbox__img {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    background: #000;
    border-radius: 2px;
    transition: opacity 0.18s ease;
}
.m-lightbox.is-loading .m-lightbox__img {
    opacity: 0.4;
}
.m-lightbox__close,
.m-lightbox__prev,
.m-lightbox__next {
    position: absolute;
    background: rgba(244, 240, 230, 0.10);
    color: var(--ml-cream);
    border: 1px solid rgba(209, 180, 140, 0.4);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    padding: 0;
}
.m-lightbox__close { top: 1.2rem; right: 1.2rem; }
.m-lightbox__prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.m-lightbox__next { right: 1.2rem; top: 50%; transform: translateY(-50%); }
.m-lightbox__close:hover,
.m-lightbox__prev:hover,
.m-lightbox__next:hover {
    background: rgba(244, 240, 230, 0.22);
    border-color: var(--ml-tan);
}
.m-lightbox__close:focus-visible,
.m-lightbox__prev:focus-visible,
.m-lightbox__next:focus-visible {
    outline: 2px solid var(--ml-tan);
    outline-offset: 2px;
}
.m-lightbox__caption {
    position: absolute;
    bottom: 1.4rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--ml-cream);
    text-align: center;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    pointer-events: none;
}
.m-lightbox__title {
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.m-lightbox__title:empty { display: none; }
.m-lightbox__counter {
    opacity: 0.7;
    font-size: 12px;
    letter-spacing: 0.08em;
}
.m-lightbox__counter:empty { display: none; }

/* Trigger styles */
a.js-lightbox {
    display: inline-block;
    cursor: zoom-in;
    text-decoration: none;
    line-height: 0;
}
a.js-lightbox img {
    transition: opacity 0.15s ease, transform 0.18s ease;
}
a.js-lightbox:hover img,
a.js-lightbox:focus-visible img {
    opacity: 0.92;
}
.js-zoomable { cursor: zoom-in; }

@media (max-width: 640px) {
    .m-lightbox { padding: 0.8rem; }
    .m-lightbox__prev, .m-lightbox__next { width: 38px; height: 38px; font-size: 15px; }
    .m-lightbox__close { width: 38px; height: 38px; font-size: 15px; top: 0.6rem; right: 0.6rem; }
    .m-lightbox__prev { left: 0.4rem; }
    .m-lightbox__next { right: 0.4rem; }
    .m-lightbox__caption { bottom: 0.6rem; font-size: 12px; }
}
