/**
 * Memoriam Slider block
 *
 * Full-screen, one-entry-at-a-time slideshow: a portrait in a white-marble
 * frame with white flowers laid beneath it, name / dates / details fading in
 * gently, and content text scrolling slowly up a masked (top + bottom faded)
 * column. See memoriam-slider.js for the animation timing.
 */

/* ---------------------------------------------------------------- shell -- */
/* Theme tokens, mirroring the memoriam grid/cover blocks:
   light = white overlay + navy ink, dark = navy overlay + white ink.
   Only the overlay OPACITY is configurable (--rn-slider-overlay). */
.rn-memoriam-slider {
    --rn-s-ink: 22, 54, 92;            /* text + controls (brand navy) */
    --rn-s-overlay-rgb: 255, 255, 255; /* overlay colour */
    --rn-s-panel-rgb: 255, 255, 255;   /* frosted scene panel */
    --rn-s-base: #eef1f5;              /* background behind the portrait */
    --rn-s-paper: #ffffff;             /* button text on an ink fill */
    --rn-s-halo: rgba(255, 255, 255, 0.7);

    position: relative;
    width: 100%;
    overflow: hidden;
    color: rgb(var(--rn-s-ink));
    background: var(--rn-s-base);
    isolation: isolate;
}
html[data-theme="dark"] .rn-memoriam-slider {
    --rn-s-ink: 255, 255, 255;
    --rn-s-overlay-rgb: 22, 54, 92;
    --rn-s-panel-rgb: 18, 26, 38;
    --rn-s-base: #0b1729;
    --rn-s-paper: #16365c;
    --rn-s-halo: rgba(0, 0, 0, 0.5);
}

/* Screen-height mode — fill the viewport below the fixed chrome.
   JS sets --rn-slider-height (vh minus header + admin) and
   --rn-slider-top (countdown bar height). */
.rn-memoriam-slider--screen {
    height: var(--rn-slider-height, calc(100svh - 80px));
    min-height: var(--rn-slider-height, calc(100svh - 80px));
}

/* Push the actual content (frame + scrolling text) down by the fixed
   countdown bar height so the bar never overlaps any memoriam content.
   The padded area at the very top is covered by the fixed bar. */
.rn-memoriam-slider__inner {
    padding-top: var(--rn-slider-top, 0);
}

.rn-memoriam-slider.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }

.rn-memoriam-slider--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: rgba(var(--rn-s-ink), 0.7);
}

/* Fixed heading over the top of the stage. */
.rn-memoriam-slider__heading {
    position: absolute;
    top: clamp(0.9rem, 3vh, 2rem);
    left: 0;
    right: 0;
    z-index: 6;
    text-align: center;
    pointer-events: none;
}
.rn-memoriam-slider__heading span {
    display: inline-block;
    padding-left: 0.5em; /* balance the leading letter-spacing */
    font-size: clamp(0.9rem, 1.5vw, 1.15rem);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: rgba(var(--rn-s-ink), 0.92);
    text-shadow: 0 1px 8px var(--rn-s-halo);
}
.rn-memoriam-slider__heading span::after {
    content: "";
    display: block;
    width: 46px;
    height: 1px;
    margin: 0.5rem auto 0;
    background: rgba(var(--rn-s-ink), 0.4);
}

/* Optional fixed background image for the whole block (behind the slides).
   Shows through when the per-slide blurred portrait is turned off. */
.rn-memoriam-slider__fixed-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.rn-memoriam-slider__fixed-bg--parallax { background-attachment: fixed; }
@media screen and (max-width: 782px) {
    /* iOS handles fixed attachment poorly — fall back to scroll on mobile. */
    .rn-memoriam-slider__fixed-bg--parallax { background-attachment: scroll; }
}

/* ---------------------------------------------------------------- stage -- */
.rn-memoriam-slider__stage { position: absolute; inset: 0; z-index: 1; }

.rn-memoriam-slider__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    display: flex;
    will-change: opacity;
}

/* Blurred backdrop of the same portrait + navy scrim. */
.rn-memoriam-slider__bg {
    position: absolute;
    inset: -6%;
    z-index: 0;
    background-size: cover;
    background-position: center 20%;
    filter: blur(26px) saturate(0.85);
    transform: scale(1.12);
}
/* Theme-coloured overlay (white in light, navy in dark); opacity configurable. */
.rn-memoriam-slider__slide::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(var(--rn-s-overlay-rgb), var(--rn-slider-overlay, 0.55));
}

.rn-memoriam-slider__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 5vw, 5rem);
    padding: clamp(3rem, 7vh, 5rem) clamp(1.5rem, 6vw, 5rem) clamp(6rem, 15vh, 9rem);
    box-sizing: border-box;
}

/* --------------------------------------------------------- frame column -- */
.rn-memoriam-slider__frame-col {
    flex: 0 0 auto;
    width: clamp(240px, 27vw, 380px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Outer frame wrapping the portrait, candles and full-width plaque as one
   framed memorial piece. A slim dark mat with a warm gold keyline that ties
   in with the brass plaque. */
.rn-memoriam-slider__scene {
    position: relative;
    width: 100%;
    padding: clamp(12px, 2.2vw, 20px);
    border-radius: 6px;
    background: linear-gradient(160deg, rgba(var(--rn-s-panel-rgb), 0.42), rgba(var(--rn-s-panel-rgb), 0.6));
    /* Light mode: much softer throw — heavy black shadows look muddy on the
       pale overlay. Dark mode restores the deeper shadows further down. */
    box-shadow:
        inset 0 0 0 5px rgba(0, 0, 0, 0.1),
        0 18px 40px rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(2px);
            backdrop-filter: blur(2px);
}
html[data-theme="dark"] .rn-memoriam-slider__scene {
    box-shadow:
        inset 0 0 0 5px rgba(0, 0, 0, 0.1),
        0 26px 58px rgba(0, 0, 0, 0.4);
}
.rn-memoriam-slider__scene-content { position: relative; z-index: 1; width: 100%; }

/* Gold frame art: a drawn-on outline + filigree corners. */
.rn-memoriam-slider__frame-art { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.rn-memoriam-slider__frame-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.rn-memoriam-slider__corner {
    position: absolute;
    width: clamp(20px, 3.6vw, 38px);
    height: clamp(20px, 3.6vw, 38px);
    /* transform is reserved for the intro "flourish in" animation */
}
/* Mirror on the inner SVG so it doesn't clash with the corner's animation. */
.rn-memoriam-slider__corner svg { width: 100%; height: 100%; display: block; }
.rn-memoriam-slider__corner--tl { top: 3px; left: 3px; }
.rn-memoriam-slider__corner--tr { top: 3px; right: 3px; }
.rn-memoriam-slider__corner--tr svg { transform: scaleX(-1); }
.rn-memoriam-slider__corner--bl { bottom: 3px; left: 3px; }
.rn-memoriam-slider__corner--bl svg { transform: scaleY(-1); }
.rn-memoriam-slider__corner--br { bottom: 3px; right: 3px; }
.rn-memoriam-slider__corner--br svg { transform: scale(-1, -1); }

/* Portrait + flanking candles row; the plaque sits directly beneath it. */
.rn-memoriam-slider__portrait-row {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.rn-memoriam-slider__frame-wrap {
    position: relative;
    width: 78%;
    display: flex;
    justify-content: center;
    z-index: 1;
}

/* White-marble frame. */
.rn-memoriam-slider__frame {
    position: relative;
    width: 100%;
    margin: 0;
    padding: clamp(14px, 1.8vw, 24px);
    border-radius: 6px;
    background:
        radial-gradient(60% 40% at 25% 20%, rgba(255, 255, 255, 0.65), transparent 60%),
        radial-gradient(50% 45% at 80% 75%, rgba(180, 172, 158, 0.4), transparent 55%),
        linear-gradient(135deg, #f5f2ec 0%, #ded8ce 42%, #efe9df 60%, #cec6b8 100%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.65),
        inset 0 0 22px rgba(120, 110, 95, 0.35),
        0 14px 32px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}
html[data-theme="dark"] .rn-memoriam-slider__frame {
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.65),
        inset 0 0 22px rgba(120, 110, 95, 0.35),
        0 22px 55px rgba(0, 0, 0, 0.5);
}
/* Subtle marble veining. */
.rn-memoriam-slider__frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(58deg, rgba(150, 140, 124, 0.08) 0 2px, transparent 2px 26px),
        repeating-linear-gradient(-32deg, rgba(120, 110, 96, 0.05) 0 1px, transparent 1px 34px);
    pointer-events: none;
}

.rn-memoriam-slider__frame-inner {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 2px;
    overflow: hidden;
    background: #14263d;
}
/* Sharp rebate: photo sits recessed in the marble, not floating with a soft
   drop. Inset shadows paint UNDER child elements, so the bevel lives on an
   overlay pseudo-element above the img — otherwise the photo hides it and
   only stray slivers show (the old top/bottom-only artifact on mobile). */
.rn-memoriam-slider__frame-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px rgba(20, 14, 8, 0.85),
        inset 3px 3px 0 rgba(0, 0, 0, 0.4),
        inset -2px -2px 0 rgba(255, 255, 255, 0.28),
        inset 0 5px 8px rgba(0, 0, 0, 0.4);
}
.rn-memoriam-slider__frame-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}
/* Soft diagonal light band drifting across the framed photo — same glossy
   "polaroid shimmer" as the memoriam dialog / single post, kept subtle. */
.rn-memoriam-slider__frame-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(115deg,
        transparent 38%,
        rgba(255, 255, 255, 0.16) 50%,
        transparent 62%);
    background-size: 250% 100%;
    background-position: 150% 0;
    animation: rn-slider-photo-shimmer 5.5s ease-in-out infinite;
}
@keyframes rn-slider-photo-shimmer {
    0%, 50%  { background-position: 150% 0; }
    100%     { background-position: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .rn-memoriam-slider__frame-inner::after { animation: none; }
}
.rn-memoriam-slider__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
    background: linear-gradient(160deg, #2b4a70, #16365c);
}

/* ------------------------------------------------------ falling-rose canvas -- */
/* Spans the whole scene so roses can fall from above the portrait and land
   below the name plaque. */
.rn-memoriam-slider__flower-canvas {
    position: absolute;
    left: -6%;
    width: 112%;
    top: -18%;
    height: 150%;
    z-index: 4;
    pointer-events: none;
}

/* -------------------------------------------------------- plaque + candles -- */
/* Plaque row: the brass plaque with a candle standing at each end. Pulled up
   slightly so the candles read as sitting either side of the plaque. */
.rn-memoriam-slider__plaque-row {
    position: relative;
    width: 100%;
    margin-top: clamp(-14px, -2vw, -6px);
    z-index: 3;
}
/* Soft shading behind the plaque to lift it off the scene. */
.rn-memoriam-slider__plaque-row::before {
    content: "";
    position: absolute;
    left: 3%;
    right: 3%;
    top: 12%;
    bottom: -16%;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.28) 55%, transparent 78%);
    filter: blur(7px);
    pointer-events: none;
}

.rn-memoriam-slider__candle {
    position: absolute;
    /* Raised + pushed out so the holders sit clear of the plaque's engraved
       name — long names were disappearing under the candle bases. */
    bottom: 4%;
    width: clamp(36px, 8vw, 54px);
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}
html[data-theme="dark"] .rn-memoriam-slider__candle {
    filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.5));
}
.rn-memoriam-slider__candle--left  { left: clamp(-16px, -3%, -4px); }
.rn-memoriam-slider__candle--right { right: clamp(-16px, -3%, -4px); }
.rn-memoriam-slider__candle-svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Wax drips creep downwards very slowly — scaleY from each drip's own top
   so the tail visibly lengthens, alternating so it never snaps back.
   Duration/phase are randomised inline per drip (see makeCandle in JS). */
.rn-memoriam-slider__candle-drip {
    transform-box: fill-box;
    transform-origin: 50% 0;
    animation: rn-candle-drip linear infinite alternate;
    /* Slightest shadow so the raised wax reads as sitting proud of the body. */
    filter: drop-shadow(0.4px 0.7px 0.4px rgba(60, 45, 20, 0.35));
}
@keyframes rn-candle-drip {
    from { transform: scaleY(0.72); }
    to   { transform: scaleY(1); }
}

.rn-memoriam-slider__candle-flame {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: rn-flame 1.7s ease-in-out infinite alternate;
}
.rn-memoriam-slider__candle-glow {
    transform-box: fill-box;
    transform-origin: 50% 60%;
    opacity: 0.5;
    filter: blur(4px);
    animation: rn-glow 1.7s ease-in-out infinite alternate;
}
.rn-memoriam-slider__candle--right .rn-memoriam-slider__candle-flame,
.rn-memoriam-slider__candle--right .rn-memoriam-slider__candle-glow { animation-delay: -0.85s; }

@keyframes rn-flame {
    0%   { transform: scale(1, 1)       translateX(0);     opacity: 0.9; }
    25%  { transform: scale(0.95, 1.06) translateX(-0.5px); }
    50%  { transform: scale(1.05, 0.96) translateX(0.6px); opacity: 1; }
    75%  { transform: scale(0.97, 1.04) translateX(-0.4px); }
    100% { transform: scale(1.03, 0.98) translateX(0.4px); opacity: 0.95; }
}
@keyframes rn-glow {
    from { opacity: 0.32; transform: scale(0.9); }
    to   { opacity: 0.6;  transform: scale(1.1); }
}

/* ------------------------------------------------------------------ meta -- */
.rn-memoriam-slider__meta { margin-top: calc(clamp(3.1rem, 5vh, 4.1rem) + var(--rn-rose-room, 0px)); }
/* No falling roses → no landing band to reserve; tuck the location up. */
.rn-memoriam-slider:not(.rn-memoriam-slider--flowers) .rn-memoriam-slider__meta { margin-top: 0.9rem; }

/* Full-width engraved brass plaque, mounted just beneath the marble frame. */
.rn-memoriam-slider__plaque {
    display: block;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    /* Wide side padding keeps the engraved name clear of the candles, which
       now sit further in over the plaque ends. */
    padding: 0.88em 2.4em 0.54em;
    border-radius: 3px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(0, 0, 0, 0.12)),
        linear-gradient(160deg, #ecd49a 0%, #c1a05c 48%, #9c7c3f 100%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.28),
        inset 0 -3px 7px rgba(80, 55, 15, 0.4),
        inset 0 2px 3px rgba(255, 255, 255, 0.45),
        0 5px 14px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .rn-memoriam-slider__plaque {
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.28),
        inset 0 -3px 7px rgba(80, 55, 15, 0.4),
        inset 0 2px 3px rgba(255, 255, 255, 0.45),
        0 8px 22px rgba(0, 0, 0, 0.5);
}
.rn-memoriam-slider__name {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.75rem);
    line-height: 1;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35), 0 -1px 1px rgba(60, 40, 10, 0.35);
}
/* The plaque is brass in both themes — keep name + dates dark, whatever the
   theme's link/paragraph colours try to do. */
.rn-memoriam-slider .rn-memoriam-slider__name,
.rn-memoriam-slider .rn-memoriam-slider__name a { color: #2c2411 !important; }
.rn-memoriam-slider .rn-memoriam-slider__dates { color: #4a3714 !important; }
/* Hard override — no underline on the name, whatever the theme does to links. */
.rn-memoriam-slider .rn-memoriam-slider__name a,
.rn-memoriam-slider .rn-memoriam-slider__name a:link,
.rn-memoriam-slider .rn-memoriam-slider__name a:visited,
.rn-memoriam-slider .rn-memoriam-slider__name a:hover,
.rn-memoriam-slider .rn-memoriam-slider__name a:focus {
    color: #2c2411;
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
}
.rn-memoriam-slider .rn-memoriam-slider__name a:hover { color: #1f1a0b; }
.rn-memoriam-slider__dates {
    margin: 0.17em 0 0;
    font-size: clamp(0.88rem, 1.2vw, 1rem);
    letter-spacing: 0.14em;
    font-weight: 600;
    color: #493919;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* White-marble plaque variant. */
.rn-memoriam-slider--plaque-marble .rn-memoriam-slider__plaque {
    background:
        radial-gradient(60% 40% at 25% 20%, rgba(255, 255, 255, 0.75), transparent 60%),
        radial-gradient(50% 45% at 80% 78%, rgba(180, 172, 158, 0.35), transparent 55%),
        linear-gradient(135deg, #f6f3ed 0%, #ded8ce 45%, #efe9df 62%, #cec6b8 100%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.6),
        inset 0 -3px 7px rgba(120, 110, 95, 0.35),
        inset 0 2px 3px rgba(255, 255, 255, 0.55),
        0 5px 14px rgba(0, 0, 0, 0.22);
}
html[data-theme="dark"] .rn-memoriam-slider--plaque-marble .rn-memoriam-slider__plaque {
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.6),
        inset 0 -3px 7px rgba(120, 110, 95, 0.35),
        inset 0 2px 3px rgba(255, 255, 255, 0.55),
        0 8px 22px rgba(0, 0, 0, 0.45);
}
.rn-memoriam-slider--plaque-marble .rn-memoriam-slider__name,
.rn-memoriam-slider--plaque-marble .rn-memoriam-slider__name a { color: #28303c !important; }
.rn-memoriam-slider--plaque-marble .rn-memoriam-slider__dates { color: #4b5563 !important; }

.rn-memoriam-slider__location {
    margin: 0.9rem 0 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-size: 0.92rem;
    color: rgba(var(--rn-s-ink), 0.78);
}
/* Perpetrator faces — hidden until the footer button reveals them. */
.rn-memoriam-slider__perps-reveal {
    flex: 0 0 auto;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    transition: max-height 0.4s ease, opacity 0.35s ease, margin 0.4s ease;
}
.rn-memoriam-slider__perps-reveal.is-revealed {
    max-height: 280px;
    opacity: 1;
    margin: 0.2rem 0 0.5rem;
}
.rn-memoriam-slider__perps-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.3rem;
}
.rn-memoriam-slider__perp-img {
    height: clamp(60px, 6.5vw, 80px);
    width: auto;
    max-width: 140px;
    border-radius: 6px;
    border: 1.5px solid rgba(var(--rn-s-ink), 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------- text column -- */
.rn-memoriam-slider__text-col {
    flex: 1 1 auto;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    max-width: 60ch;
    min-height: 0;
}
.rn-memoriam-slider__scroll {
    flex: 1 1 auto;
    position: relative;
    min-height: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 13%, #000 87%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0%, #000 13%, #000 87%, transparent 100%);
}
.rn-memoriam-slider__scroll-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-right: 0.5rem;
    will-change: transform;
    font-size: clamp(1.02rem, 1.35vw, 1.2rem);
    line-height: 1.85;
    color: rgba(var(--rn-s-ink), 0.94);
    text-shadow: 0 1px 8px var(--rn-s-halo);
}
.rn-memoriam-slider__scroll-inner p { margin: 0 0 1.1em; }
.rn-memoriam-slider__scroll-inner a { color: rgb(var(--rn-s-ink)); }

/* Reduced-motion / no-WAAPI: let the reader scroll the column themselves. */
.rn-memoriam-slider__scroll.is-static { overflow-y: auto; -webkit-mask-image: none; mask-image: none; }
.rn-memoriam-slider__scroll.is-static .rn-memoriam-slider__scroll-inner { position: static; will-change: auto; }

/* Slide footer — perpetrator faces (hidden) + action buttons. Lives at slide
   level so it centres to the full page width, and is pinned to the bottom so
   it never scrolls with the text. */
.rn-memoriam-slider__footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(1.8rem, 6vh, 4.5rem);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 clamp(1rem, 5vw, 3rem);
    pointer-events: none;
}
/* 1fr auto 1fr keeps the CTA dead-centre on the page whatever the side buttons
   do: the perp button (right-aligned in the left cell) grows leftward as its
   "Perpetrator(s)" label changes, and the source button sits in the right cell,
   so neither can nudge the centred CTA. */
.rn-memoriam-slider__actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    pointer-events: auto;
}
.rn-memoriam-slider__actions > .rn-memoriam-slider__perp-btn   { grid-column: 1; justify-self: end; }
.rn-memoriam-slider__actions > .rn-memoriam-slider__cta        { grid-column: 2; justify-self: center; }
.rn-memoriam-slider__actions > .rn-memoriam-slider__source-btn { grid-column: 3; justify-self: start; }
.rn-memoriam-slider__perps-reveal { pointer-events: auto; }
/* Pill buttons, theme-aware: dark-on-white in light mode, white-on-dark in dark
   mode. Primary = solid ink pill, secondary = ink outline pill. */
.rn-memoriam-slider .rn-memoriam-slider__cta,
.rn-memoriam-slider .rn-memoriam-slider__source-btn,
.rn-memoriam-slider .rn-memoriam-slider__perp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    padding: 0.62em 1.6em !important;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    border-radius: 999px !important;
    text-decoration: none !important;
    opacity: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* Primary — solid ink pill. */
.rn-memoriam-slider .rn-memoriam-slider__cta {
    color: var(--rn-s-paper) !important;
    background: rgb(var(--rn-s-ink));
    border: 1.5px solid rgb(var(--rn-s-ink)) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.rn-memoriam-slider .rn-memoriam-slider__cta:hover,
.rn-memoriam-slider .rn-memoriam-slider__cta:focus-visible { transform: translateY(-1px); background: rgba(var(--rn-s-ink), 0.85); border-color: rgba(var(--rn-s-ink), 0.85) !important; outline: none; }
/* Dark mode: hover to dark-blue fill, white text, white border. */
html[data-theme="dark"] .rn-memoriam-slider .rn-memoriam-slider__cta:hover,
html[data-theme="dark"] .rn-memoriam-slider .rn-memoriam-slider__cta:focus-visible {
    background: #16365c;
    color: #fff !important;
    border-color: #fff !important;
}

/* Secondary — ink outline pill (View source + Perpetrators). */
.rn-memoriam-slider .rn-memoriam-slider__source-btn,
.rn-memoriam-slider .rn-memoriam-slider__perp-btn {
    color: rgb(var(--rn-s-ink)) !important;
    background: transparent;
    border: 1.5px solid rgba(var(--rn-s-ink), 0.6) !important;
    box-shadow: none;
}
.rn-memoriam-slider .rn-memoriam-slider__source-btn:hover,
.rn-memoriam-slider .rn-memoriam-slider__source-btn:focus-visible,
.rn-memoriam-slider .rn-memoriam-slider__perp-btn:hover,
.rn-memoriam-slider .rn-memoriam-slider__perp-btn:focus-visible,
.rn-memoriam-slider .rn-memoriam-slider__perp-btn.is-active {
    transform: translateY(-1px);
    color: rgb(var(--rn-s-ink)) !important;
    background: rgba(var(--rn-s-ink), 0.12);
    border-color: rgb(var(--rn-s-ink)) !important;
    outline: none;
}
/* The perpetrators button is a <button> — inherit the typography. */
.rn-memoriam-slider .rn-memoriam-slider__perp-btn { font-family: inherit; }

/* ----------------------------------------------------------- navigation -- */
.rn-memoriam-slider__nav { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.rn-memoriam-slider__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0 !important;
    border-radius: 50%;
    color: rgb(var(--rn-s-ink));
    background: rgba(var(--rn-s-ink), 0.08);
    backdrop-filter: blur(3px);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.25s ease, background 0.25s ease;
}
.rn-memoriam-slider__btn:hover,
.rn-memoriam-slider__btn:focus-visible { opacity: 1; background: rgba(var(--rn-s-ink), 0.18); outline: none; }
.rn-memoriam-slider__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rn-memoriam-slider__btn--prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.rn-memoriam-slider__btn--next { right: clamp(0.5rem, 2vw, 1.5rem); }

/* ------------------------------------------------------ scroll indicator -- */
.rn-memoriam-slider__scroll-indicator {
    position: absolute;
    right: clamp(0.8rem, 2vw, 1.8rem);
    bottom: clamp(1.8rem, 6vh, 4.5rem); /* in line with the footer buttons */
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0 !important;
    border-radius: 50%;
    color: rgb(var(--rn-s-ink));
    background: rgba(var(--rn-s-ink), 0.08);
    cursor: pointer;
    opacity: 0.7;
    animation: rn-slider-bob 3s ease-in-out infinite;
    transition: opacity 0.3s ease, background 0.3s ease;
    pointer-events: auto !important;
    z-index: 10; /* bump above footer/actions if needed */
}
.rn-memoriam-slider__scroll-indicator:hover { opacity: 1; background: rgba(var(--rn-s-ink), 0.18); }
.rn-memoriam-slider__scroll-indicator svg { margin-top: 8px; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes rn-slider-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------------------------------------------------------------- loader -- */
.rn-memoriam-slider__loader {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.rn-memoriam-slider__loader.is-visible { opacity: 1; }
.rn-memoriam-slider__spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(var(--rn-s-ink), 0.25);
    border-top-color: rgba(var(--rn-s-ink), 0.9);
    animation: rn-slider-spin 0.9s linear infinite;
}
@keyframes rn-slider-spin { to { transform: rotate(360deg); } }

.rn-memoriam-slider__noscript { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; }

/* --------------------------------------------------------------- mobile -- */
@media screen and (max-width: 782px) {
    /* ~10px between frame/roses and scrolling text; shorter bottom padding
       so the text column gains height. */
    .rn-memoriam-slider__inner { flex-direction: column; gap: 10px; padding: clamp(2.6rem, 6vh, 3.6rem) 1.1rem clamp(3.4rem, 9vh, 4.6rem); }
    /* Smaller framed piece on mobile → more room for the scrolling text. */
    .rn-memoriam-slider__frame-col { width: min(60vw, 240px); flex: 0 0 auto; }
    /* Location is hidden on mobile — keep only a slim rose band under the
       plaque instead of the desktop meta margin that left a 30–40px gap. */
    .rn-memoriam-slider__meta { margin-top: calc(0.55rem + var(--rn-rose-room, 0px)); }
    .rn-memoriam-slider:not(.rn-memoriam-slider--flowers) .rn-memoriam-slider__meta { margin-top: 0.55rem; }
    /* Move the CTA + scroll-down button down ~20px to free room for the text. */
    .rn-memoriam-slider__footer { bottom: clamp(0.8rem, 2.5vh, 1.6rem); }
    .rn-memoriam-slider__scroll-indicator { bottom: clamp(0.8rem, 3.7vh, 1.6rem); }
    .rn-memoriam-slider__text-col { width: 100%; max-width: none; align-self: stretch; min-height: 0; }
    .rn-memoriam-slider__btn { width: 40px; height: 40px; opacity: 0.75; }
    /* Larger candles on mobile, raised + nudged outwards like desktop so the
       holders clear the plaque name (still tucked in enough to clear the
       prev/next buttons). */
    .rn-memoriam-slider__candle { width: clamp(33px, 10.2vw, 47px); bottom: 4%; }
    .rn-memoriam-slider__candle--left  { left: -6px; }
    .rn-memoriam-slider__candle--right { right: -6px; }

    /* Smaller scrolling text + location on mobile. */
    .rn-memoriam-slider__scroll-inner { font-size: clamp(0.92rem, 3.6vw, 1.02rem); line-height: 1.7; }
    .rn-memoriam-slider__location { font-size: 0.78rem; display: none; }

    /* Just the CTA on mobile — drop the perpetrators + source buttons, and give
       the CTA a little more presence. */
    .rn-memoriam-slider__perp-btn,
    .rn-memoriam-slider__source-btn { display: none !important; }
    .rn-memoriam-slider .rn-memoriam-slider__cta {
        padding: 0.66em 1.9em !important;
        font-size: 1rem;
    }
    /* Optional: hide the whole CTA / actions row on mobile. */
    .rn-memoriam-slider--hide-cta-mobile .rn-memoriam-slider__footer {
        display: none;
    }
}

/* -------------------------------------------------------- reduced motion -- */
@media (prefers-reduced-motion: reduce) {
    .rn-memoriam-slider__scroll-indicator { animation: none; }
    .rn-memoriam-slider__spinner { animation-duration: 1.6s; }
    .rn-memoriam-slider__candle-flame,
    .rn-memoriam-slider__candle-glow,
    .rn-memoriam-slider__candle-drip { animation: none; }
}
