/* =====================================================================
   Public memorial page
   ===================================================================== */

/* --- owner notice --------------------------------------------------- */

.owner-bar {
    background: var(--ink);
    color: rgba(255, 255, 255, .8);
    padding: .7rem 0;
    font-size: .88rem;
}

/* --- masthead ------------------------------------------------------- */

.mem-head {
    position: relative;
    text-align: center;
    /* A cover, not a header: it holds the page on its own until the
       reader chooses to move down. */
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2.5rem, 6vw, 4rem) 1rem clamp(3.5rem, 7vw, 5rem);
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, var(--gold-pale), transparent 70%),
        var(--paper);
    border-bottom: 1px solid var(--silver-line);
}

/* The engraved frame from the printed programme */
.mem-head::before {
    content: "";
    position: absolute;
    inset: clamp(12px, 2.5vw, 28px);
    border: 1px solid var(--gold-light);
    opacity: .45;
    pointer-events: none;
}

.mem-head > .container { position: relative; z-index: 1; }

.mem-portrait {
    width: clamp(200px, 30vw, 320px);
    aspect-ratio: 4 / 5;
    margin: 0 auto 2rem;
    border-radius: 2px;
    overflow: hidden;
    background: var(--gold-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    /* engraved double frame, as on a printed programme */
    box-shadow:
        0 0 0 1px var(--gold),
        0 0 0 7px var(--paper),
        0 0 0 8px var(--silver-line),
        var(--shadow);
}
.mem-portrait img { width: 100%; height: 100%; object-fit: cover; }
.mem-portrait span {
    font-family: var(--font-display);
    font-size: 5rem;
    color: var(--gold);
}

.mem-eyebrow {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--silver);
    margin-bottom: .6rem;
}

.mem-name {
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    font-weight: 400;
    margin-bottom: .2rem;
}

.mem-nick {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--gold-deep);
    margin-bottom: 0;
}

.mem-years {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.6vw, 1.75rem);
    letter-spacing: .08em;
    color: var(--ink);
    margin-bottom: .4rem;
}

.mem-sub {
    font-size: .95rem;
    color: var(--ink-muted);
    margin-bottom: 2rem;
}

/* --- jump nav ------------------------------------------------------- */

.mem-jump {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .3rem 1.6rem;
    padding-top: 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--silver-line);
    max-width: 720px;
    margin-inline: auto;
    width: 100%;
}
.mem-jump a {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    padding: .4rem 0;
}
.mem-jump a:hover { color: var(--gold-deep); }

/* --- sections ------------------------------------------------------- */

.mem-section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.mem-section .section-head { margin-bottom: 2.5rem; }

.mem-prose {
    font-size: 1.08rem;
    line-height: 1.9;
    color: var(--ink-soft);
}
.mem-prose::first-letter {
    font-family: var(--font-display);
    font-size: 3.2rem;
    line-height: .9;
    float: left;
    margin: .25rem .6rem 0 0;
    color: var(--gold);
}

.mem-embed {
    border: 1px solid var(--silver-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--paper-alt);
}
.mem-embed iframe, .mem-embed video { border: 0; width: 100%; height: 100%; }

/* --- timeline ------------------------------------------------------- */

.mem-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid var(--silver-line);
}
.mem-timeline li {
    display: flex;
    gap: 1.5rem;
    padding: 0 0 2rem 2rem;
    position: relative;
}
.mem-timeline li::before {
    content: "";
    position: absolute;
    left: -4px;
    top: .55rem;
    width: 7px;
    height: 7px;
    background: var(--gold);
    transform: rotate(45deg);
}
.mem-timeline__year {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--gold-deep);
    flex: none;
    width: 4rem;
}
.mem-timeline h3 { font-size: 1.2rem; margin-bottom: .25rem; }

/* --- family --------------------------------------------------------- */

.mem-family-group {
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-top: 2px solid var(--gold-light);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.5rem;
    height: 100%;
    text-align: center;
}
.mem-family-group h3 {
    font-size: .76rem;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--silver);
    margin-bottom: 1rem;
}
.mem-family-group ul { list-style: none; padding: 0; margin: 0; }
.mem-family-group li {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--ink);
    padding: .35rem 0;
}
.mem-family-group li .meta { display: block; font-family: var(--font-body); }

.mem-late {
    font-family: var(--font-body);
    font-size: .72rem;
    font-style: italic;
    color: var(--silver);
    letter-spacing: .04em;
}

/* --- order of service ----------------------------------------------- */

.mem-service {
    list-style: none;
    counter-reset: svc;
    padding: 0;
    margin: 0;
}
.mem-service li {
    counter-increment: svc;
    padding: 1.3rem 0;
    border-bottom: 1px solid var(--silver-line);
}
.mem-service li:first-child { border-top: 1px solid var(--silver-line); }

.mem-service__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.mem-service__head h3 {
    font-size: 1.28rem;
    margin: 0;
}
.mem-service__head h3::before {
    content: counter(svc, upper-roman) ". ";
    color: var(--gold);
    font-size: .85em;
}
.mem-service__text {
    margin-top: .7rem;
    padding-left: 1.1rem;
    border-left: 1px solid var(--gold-light);
    font-size: .96rem;
    color: var(--ink-muted);
    white-space: pre-line;
}

/* --- arrangements --------------------------------------------------- */

.mem-event {
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.3rem;
    height: 100%;
    text-align: center;
}
.mem-event__date {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: .2rem;
}
.mem-event__time {
    font-size: .9rem;
    color: var(--gold-deep);
    letter-spacing: .06em;
    margin-bottom: .5rem;
}
.mem-event__venue { font-size: .92rem; color: var(--ink-muted); }

.mem-notes {
    background: var(--paper-alt);
    border-left: 2px solid var(--gold);
    padding: 1.2rem 1.4rem;
    font-size: .95rem;
}
.mem-notes p { margin-bottom: .5rem; }
.mem-notes strong { color: var(--ink); }

/* --- gallery -------------------------------------------------------- */

.mem-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .7rem;
}
.mem-gallery__item {
    border: 1px solid var(--silver-line);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    padding: 0;
    background: var(--paper-alt);
    cursor: zoom-in;
}
.mem-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease, opacity .3s ease;
}
.mem-gallery__item:hover img { transform: scale(1.05); opacity: .92; }

/* --- lightbox ------------------------------------------------------- */

.mem-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(14, 12, 10, .94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.mem-lightbox[hidden] { display: none; }
.mem-lightbox figure { margin: 0; text-align: center; max-width: 100%; }
.mem-lightbox img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 1px solid rgba(217, 188, 122, .3);
}
.mem-lightbox figcaption {
    color: rgba(255, 255, 255, .7);
    font-size: .9rem;
    margin-top: 1rem;
}
.mem-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
}

/* --- tributes ------------------------------------------------------- */

.mem-tribute {
    display: flex;
    gap: 1.2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--silver-line);
}
.mem-tribute:first-child { border-top: 1px solid var(--silver-line); }

.mem-tribute__photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    border: 1px solid var(--gold-light);
}
.mem-tribute__message {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: .7rem;
}
.mem-tribute__by strong {
    font-size: .95rem;
    color: var(--ink);
}
.mem-tribute__by .meta { margin-left: .5rem; }

/* --- forms ---------------------------------------------------------- */

.mem-form {
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-top: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.6rem;
    position: sticky;
    top: 6rem;
}
.mem-form h3 { font-size: 1.35rem; }

@media (max-width: 991.98px) {
    .mem-form { position: static; }
}

/* --- guest book ----------------------------------------------------- */

.mem-guestbook { list-style: none; padding: 0; margin: 0; }
.mem-guestbook li {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--silver-line);
}
.mem-candle {
    font-size: 1.3rem;
    flex: none;
    filter: sepia(.4) saturate(1.6);
}

/* --- share ---------------------------------------------------------- */

.mem-share {
    padding: clamp(2.5rem, 6vw, 4rem) 0;
    background: var(--paper-alt);
    border-top: 1px solid var(--silver-line);
}
.mem-share__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* --- print ---------------------------------------------------------- */

@media print {
    .mem-jump, .mem-form, .mem-share, .owner-bar,
    .mem-lightbox, .mem-gallery__item:nth-child(n+7) { display: none !important; }

    .mem-head { padding: 0 0 1.5rem; background: none; }
    .mem-section { padding: 1rem 0; page-break-inside: avoid; }
    .mem-portrait { box-shadow: none; border: 1px solid #999; width: 150px; }
    .mem-prose::first-letter { font-size: 1em; float: none; margin: 0; }
}

/* =====================================================================
   CUSTOM SECTIONS
   ===================================================================== */

.mem-prose--plain::first-letter {
    font-size: inherit;
    float: none;
    margin: 0;
    color: inherit;
    font-family: inherit;
}

.mem-custom__image {
    margin: 0 0 1.8rem;
    border: 1px solid var(--silver-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.mem-custom__image img { width: 100%; height: auto; display: block; }

.mem-details {
    display: grid;
    grid-template-columns: minmax(120px, 34%) 1fr;
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--silver-line);
}
.mem-details dt,
.mem-details dd {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--silver-line);
    margin: 0;
}
.mem-details dt {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--silver);
    background: var(--paper-alt);
}
.mem-details dd {
    font-family: var(--font-display);
    font-size: 1.12rem;
    color: var(--ink);
}

@media (max-width: 575.98px) {
    .mem-details { grid-template-columns: 1fr; }
    .mem-details dt { border-bottom: none; padding-bottom: .3rem; }
}

.mem-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 2.5rem;
}
.mem-bullets li {
    font-family: var(--font-display);
    font-size: 1.12rem;
    color: var(--ink);
    padding: .45rem 0 .45rem 1.4rem;
    position: relative;
    break-inside: avoid;
}
.mem-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.05em;
    width: 5px;
    height: 5px;
    background: var(--gold);
    transform: rotate(45deg);
}

@media (max-width: 575.98px) {
    .mem-bullets { columns: 1; }
}

/* =====================================================================
   FAMILY LISTING  (set as it appears in a printed brochure)
   ===================================================================== */

.mem-family { margin: 0; }

.mem-family dt {
    font-family: var(--font-body);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-top: 1.6rem;
    margin-bottom: .35rem;
}
.mem-family dt:first-child { margin-top: 0; }

.mem-family dd {
    font-family: var(--font-display);
    font-size: 1.18rem;
    line-height: 1.75;
    color: var(--ink);
    margin: 0 0 .2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--silver-line);
}
.mem-family dd:last-child { border-bottom: none; }

.mem-family .mem-note {
    font-family: var(--font-body);
    font-size: .84rem;
    color: var(--ink-muted);
}

.mem-family__list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 2rem;
}
.mem-family__list li { padding: .2rem 0; break-inside: avoid; }

@media (max-width: 575.98px) {
    .mem-family__list { columns: 1; }
    .mem-family dd { font-size: 1.08rem; }
}

/* =====================================================================
   FAMILY TRIBUTES
   Set apart from visitor messages: these are the pieces read aloud.
   ===================================================================== */

.mem-tribute--family {
    background: var(--paper-alt);
    border: 1px solid var(--silver-line);
    border-left: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
    margin-bottom: 1.25rem;
}
.mem-tribute--family + .mem-tribute--family { border-top: 1px solid var(--silver-line); }

.mem-tribute__heading {
    font-family: var(--font-body);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-bottom: .8rem;
}

/* --- family tribute photograph ------------------------------------------
   Sized generously and left in its own shape: a portrait stays a portrait,
   a landscape group photograph is not cropped into one. Click to enlarge.
   ------------------------------------------------------------------------ */

.mem-tribute__figure {
    flex: none;
    width: 200px;
    margin: 0;
    padding: 5px;
    border: 0;
    background: var(--surface);
    box-shadow:
        0 0 0 1px var(--gold),
        0 0 0 5px var(--surface),
        0 0 0 6px var(--silver-line);
    cursor: zoom-in;
    line-height: 0;
    border-radius: 2px;
    transition: box-shadow .25s ease, transform .25s ease;
}
.mem-tribute__figure:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 1px var(--gold),
        0 0 0 5px var(--surface),
        0 0 0 6px var(--gold-light),
        var(--shadow);
}
.mem-tribute__figure:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; }

.mem-tribute__figure img {
    width: 100%;
    height: auto;          /* the shape of the photograph is kept */
    max-height: 320px;
    object-fit: contain;   /* nothing is cropped away */
    display: block;
    background: var(--paper-alt);
}

/* A landscape photograph earns more width than a portrait one */
@media (min-width: 992px) {
    .mem-tribute__figure { width: 230px; }
}

@media (max-width: 767.98px) {
    .mem-tribute--family { flex-direction: column; }
    .mem-tribute__figure {
        width: 100%;
        max-width: 320px;
        margin: 0 auto .5rem;
    }
    .mem-tribute__figure img { max-height: 380px; }
}

/* --- lightbox handles either orientation ------------------------------ */

.mem-lightbox img {
    max-width: min(100%, 1200px);
    max-height: 84vh;
    width: auto;
    height: auto;
    object-fit: contain;
    background: var(--ink);
}

@media (max-width: 575.98px) {
    .mem-lightbox { padding: 1rem; }
    .mem-lightbox img { max-height: 74vh; }
}

/* =====================================================================
   LIVESTREAM
   ===================================================================== */

.mem-section--live {
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, var(--gold-pale), transparent 70%),
        var(--paper);
}

.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: .4rem;
    border-radius: 50%;
    background: var(--danger);
    vertical-align: middle;
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot { animation: none; }
}

/* =====================================================================
   HYMN PLAYER
   Small, quiet, and always dismissible.
   ===================================================================== */

.hymn-player {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .5rem .5rem .5rem;
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-radius: 40px;
    box-shadow: var(--shadow);
}

.hymn-player__toggle {
    width: 38px;
    height: 38px;
    flex: none;
    border: none;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    font-size: .8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease;
}
.hymn-player__toggle:hover { background: var(--gold-deep); }

.hymn-player__label {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-right: .5rem;
}

.hymn-player__title {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    white-space: nowrap;
}

.hymn-player.is-playing .hymn-player__title { color: var(--gold-deep); }

.hymn-player__close {
    background: none;
    border: none;
    color: var(--silver);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 .15rem;
}
.hymn-player__close:hover { color: var(--danger); }

@media print { .hymn-player { display: none !important; } }


/* A short screen must not force scrolling past an empty cover */
@media (max-height: 620px) {
    .mem-head { min-height: 0; padding-top: 2rem; padding-bottom: 2rem; }
}

/* =====================================================================
   SECTION RAIL
   Appears once the cover has been passed, and follows the reader down.
   A long memorial page is a lot of scrolling otherwise.
   ===================================================================== */

/* Only one bar may stick to the top of a memorial page. The site header
   scrolls away with the cover; the rail takes over from there. Two
   sticky bars at the same offset fight each other, which is why the rail
   seemed to come and go. */
.has-rail .site-nav {
    position: static !important;
    top: auto !important;
}

.mem-rail {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1035;
    background: rgba(251, 250, 248, .94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--silver-line);
    /* Hidden until the reader is past the cover */
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform .35s ease, opacity .35s ease;
}

[data-bs-theme="dark"] .mem-rail { background: rgba(20, 18, 15, .94); }

.mem-rail.is-shown {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mem-rail__inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: .55rem 0;
    min-height: 46px;
}

.mem-rail__name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--ink);
    white-space: nowrap;
    flex: none;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1.25rem;
    border-right: 1px solid var(--silver-line);
}

.mem-rail__links {
    display: flex;
    gap: .15rem;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.mem-rail__links::-webkit-scrollbar { display: none; }

.mem-rail__links a {
    flex: none;
    padding: .45rem .8rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-muted);
    white-space: nowrap;
    border-radius: 2px;
    position: relative;
    transition: color .2s ease;
}
.mem-rail__links a:hover { color: var(--ink); }

.mem-rail__links a::after {
    content: "";
    position: absolute;
    left: .8rem;
    right: .8rem;
    bottom: .15rem;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .25s ease;
}

.mem-rail__links a.is-here {
    color: var(--gold-deep);
}
.mem-rail__links a.is-here::after { transform: scaleX(1); }

.mem-rail__top {
    flex: none;
    width: 32px;
    height: 32px;
    border: 1px solid var(--silver-line);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    font-size: .95rem;
    transition: border-color .2s ease, color .2s ease;
}
.mem-rail__top:hover { border-color: var(--gold); color: var(--gold-deep); }

/* Anchored sections must clear the rail when jumped to */
.mem-section, #tributes, #guestbook, #arrangements, #gallery, #family,
#service, #life, #timeline, #details, #livestream {
    scroll-margin-top: 60px;
}

@media (max-width: 767.98px) {
    .mem-rail__name,
    .mem-rail__top { display: none; }

    .mem-rail__inner { gap: 0; padding: .4rem 0; min-height: 42px; }
    .mem-rail__links a { font-size: .68rem; padding: .4rem .7rem; }

    .mem-section, #tributes, #guestbook, #arrangements, #gallery, #family,
    #service, #life, #timeline, #details, #livestream {
        scroll-margin-top: 52px;
    }
}

@media print { .mem-rail { display: none !important; } }

/* =====================================================================
   HYMNS
   The index reads like the board at the front of the church: numbers
   first, because that is how a hymn is announced.
   ===================================================================== */

.hymn-index {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--silver-line);
}

/* Each book's numbers sit together, the way a hymn board is set out */
.hymn-index__book {
    display: flex;
    align-items: baseline;
    gap: .9rem;
    flex-wrap: wrap;
}

.hymn-index__label {
    flex: none;
    min-width: 3.5rem;
    padding-top: .5rem;
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--silver);
    border-right: 1px solid var(--silver-line);
    padding-right: .9rem;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.hymn-index__numbers {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    flex: 1;
}

/* --- book headings in the list ----------------------------------------- */

.hymn-book-head {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin: 2rem 0 0;
    padding: .9rem .25rem .5rem;
    border-top: 1px solid var(--gold-light);
}
.hymn-list > .hymn-book-head:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}
.hymn-book-head span {
    font-size: .68rem;
    color: var(--silver);
    letter-spacing: .08em;
}

.hymn-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .1rem;
    padding: .6rem .95rem;
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-left: 2px solid var(--gold);
    border-radius: var(--radius);
    text-align: left;
    transition: border-color .2s ease, transform .15s ease, box-shadow .2s ease;
    min-width: 120px;
}
.hymn-chip:hover {
    border-color: var(--gold-light);
    border-left-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.hymn-chip.is-open {
    background: var(--gold-pale);
    border-color: var(--gold);
}

.hymn-chip__ref {
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-deep);
    white-space: nowrap;
}
.hymn-chip__title {
    font-family: var(--font-display);
    font-size: .92rem;
    color: var(--ink-muted);
    line-height: 1.3;
}

/* --- the hymns themselves --------------------------------------------- */

.hymn-list { border-top: 1px solid var(--silver-line); }

.hymn {
    border-bottom: 1px solid var(--silver-line);
    transition: background-color .5s ease;
}
.hymn.is-flash { background: var(--gold-pale); }

.hymn__head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    width: 100%;
    padding: 1.15rem .25rem;
    background: none;
    border: none;
    text-align: left;
}
.hymn__head:hover .hymn__title { color: var(--gold-deep); }

.hymn__index {
    flex: none;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    width: 1.4rem;
}

.hymn__naming { flex: 1; min-width: 0; }

.hymn__ref {
    display: inline-block;
    font-family: var(--font-body);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-right: .6rem;
    vertical-align: middle;
}

.hymn__title {
    font-family: var(--font-display);
    font-size: 1.22rem;
    color: var(--ink);
    transition: color .2s ease;
}

.hymn__lang {
    display: block;
    font-size: .76rem;
    color: var(--silver);
    margin-top: .15rem;
}

.hymn__chev {
    flex: none;
    color: var(--silver);
    font-size: .9rem;
    transition: transform .25s ease;
}
.hymn.is-open .hymn__chev { transform: rotate(180deg); }

/* --- the words --------------------------------------------------------- */

.hymn__body { padding: 0 .25rem 1.75rem 2.4rem; }
.hymn__body[hidden] { display: none; }

.hymn__audio { width: 100%; max-width: 420px; margin-bottom: 1.25rem; }

.hymn__verses {
    columns: 2;
    column-gap: 3rem;
}

.hymn__verse, .hymn__chorus {
    display: flex;
    gap: .9rem;
    margin-bottom: 1.4rem;
    break-inside: avoid;
}

.hymn__verse-no {
    flex: none;
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--gold);
    width: 1.1rem;
    padding-top: .1rem;
}

.hymn__verse p, .hymn__chorus p {
    font-family: var(--font-display);
    font-size: 1.12rem;
    line-height: 1.65;
    color: var(--ink);
    margin: 0;
}

.hymn__chorus {
    padding-left: 1.1rem;
    border-left: 2px solid var(--gold-light);
    flex-direction: column;
    gap: .3rem;
}
.hymn__chorus p { font-style: italic; color: var(--ink-soft); }

.hymn__chorus-label {
    font-family: var(--font-body);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold-deep);
}

/* --- link from the order of service ------------------------------------ */

.service-hymn-link {
    display: inline-block;
    margin-left: .6rem;
    font-family: var(--font-body);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-deep);
    white-space: nowrap;
}
.service-hymn-link:hover { color: var(--gold); }

@media (max-width: 767.98px) {
    .hymn-index { gap: 1.25rem; }

    .hymn-index__book { flex-direction: column; gap: .45rem; align-items: stretch; }
    .hymn-index__label {
        border-right: none;
        border-bottom: 1px solid var(--silver-line);
        padding: 0 0 .35rem;
        min-width: 0;
    }
    .hymn-index__numbers { gap: .4rem; }

    .hymn-chip { min-width: 0; flex: 1 1 calc(50% - .4rem); padding: .5rem .7rem; }
    .hymn-chip__title { display: none; }
    .hymn-chip__ref { font-size: .84rem; }

    .hymn__body { padding-left: .25rem; }
    .hymn__verses { columns: 1; }
    .hymn__title { font-size: 1.1rem; }
    .hymn__verse p, .hymn__chorus p { font-size: 1.05rem; }
}

/* A chip with no book or number falls back to the first line, which
   needs the room a number would not. */
.hymn-chip__ref:empty + .hymn-chip__title { font-size: 1rem; color: var(--ink); }

/* =====================================================================
   CONTRIBUTIONS
   ===================================================================== */

.give-total {
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-top: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.6rem;
    margin-top: 1.5rem;
}

.give-total__raised {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1;
    color: var(--ink);
}

.give-rail {
    height: 4px;
    background: var(--silver-line);
    border-radius: 2px;
    overflow: hidden;
}
.give-rail span {
    display: block;
    height: 100%;
    background: var(--gold);
    transition: width .6s ease;
}

.give-list { list-style: none; padding: 0; margin: 0; }
.give-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--silver-line);
}
.give-list__amount {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--gold-deep);
    white-space: nowrap;
}

.give-amounts { display: flex; gap: .5rem; flex-wrap: wrap; }

.give-preset {
    flex: 1;
    min-width: 74px;
    padding: .6rem .5rem;
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--ink);
    transition: all .2s ease;
}
.give-preset:hover { border-color: var(--gold-light); }
.give-preset.is-chosen {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
}

/* =====================================================================
   MOTIF RULE
   Replaces the plain diamond divider with whatever the family chose.
   ===================================================================== */

.motif-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    margin: 1.75rem auto;
    max-width: 300px;
    color: var(--gold);
}

.motif-rule__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}
.motif-rule__line:last-child {
    background: linear-gradient(90deg, var(--gold), transparent);
}

/* The symbol is the point of the divider, so it is set at a size where
   the design can actually be read rather than guessed at. */
.motif-rule__mark {
    flex: none;
    display: block;
    width: 38px;
    height: 38px;
}

.motif-rule.is-wide { max-width: 480px; }

.motif-rule.is-left {
    margin-left: 0;
    justify-content: flex-start;
    max-width: 280px;
}
.motif-rule.is-left .motif-rule__line:first-child { display: none; }

/* On the dark cover the symbol takes the lighter gold */
.hero .motif-rule,
.section--ink .motif-rule { color: var(--gold-light); }
.hero .motif-rule__line,
.section--ink .motif-rule__line { background: linear-gradient(90deg, transparent, var(--gold-light)); }
.hero .motif-rule__line:last-child,
.section--ink .motif-rule__line:last-child { background: linear-gradient(90deg, var(--gold-light), transparent); }

/* The cover carries it larger, behind the portrait */
.mem-head .motif-rule__mark,
.hero .motif-rule__mark {
    width: 54px;
    height: 54px;
}

@media (max-width: 575.98px) {
    .motif-rule { gap: .8rem; max-width: 240px; }
    .motif-rule__mark { width: 32px; height: 32px; }
    .mem-head .motif-rule__mark,
    .hero .motif-rule__mark { width: 44px; height: 44px; }
}

@media print {
    .motif-rule { color: #B08D3F; }
    .motif-rule__line { background: #B08D3F !important; }
}

/* --- the portrait on the password gate --------------------------------- */

.gate-portrait {
    width: 132px;
    height: 165px;
    margin: 0 auto 1.25rem;
    overflow: hidden;
    border-radius: 2px;
    background: var(--gold-pale);
    box-shadow:
        0 0 0 1px var(--gold),
        0 0 0 5px var(--surface),
        0 0 0 6px var(--silver-line);
}
.gate-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =====================================================================
   THE TRIBUTE PAGE
   One task, one page. Shared before a funeral, opened on a phone.
   ===================================================================== */

.tribute-intro { text-align: center; margin-bottom: 2rem; }

.tribute-intro__portrait {
    width: 140px;
    height: 175px;
    margin: 0 auto 1.4rem;
    overflow: hidden;
    border-radius: 2px;
    background: var(--gold-pale);
    box-shadow:
        0 0 0 1px var(--gold),
        0 0 0 5px var(--surface),
        0 0 0 6px var(--silver-line);
}
.tribute-intro__portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tribute-intro__name {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    margin: 0;
}

.tribute-intro__nick {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--gold-deep);
    margin: .2rem 0 0;
}

/* --- after sending ----------------------------------------------------- */

.tribute-done {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-top: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.6rem;
}
.tribute-done h2 { font-size: 1.8rem; margin-bottom: .6rem; }

.tribute-done__actions {
    display: flex;
    gap: .6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.tribute-share {
    padding-top: 1.5rem;
    border-top: 1px solid var(--silver-line);
}

.btn-whatsapp {
    background: #25D366;
    border: 1px solid #25D366;
    color: #fff;
}
.btn-whatsapp:hover { background: #1FB855; border-color: #1FB855; color: #fff; }

/* A family's own wording can run long, so it wraps rather than overflowing */
.mem-eyebrow {
    max-width: 34ch;
    margin-inline: auto;
    line-height: 1.5;
    word-break: break-word;
}

/* =====================================================================
   RECEIPT
   Plain, legible, and printable on half a sheet.
   ===================================================================== */

.receipt {
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 2rem 1.8rem;
}

.receipt__head {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--silver-line);
}
.receipt__head h1 { font-size: 2rem; margin: .4rem 0 .3rem; }

.receipt__site {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold-deep);
}

.receipt__amount {
    text-align: center;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--silver-line);
}

.receipt__label {
    display: block;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-bottom: .5rem;
}

.receipt__figure {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 7vw, 3rem);
    line-height: 1;
    color: var(--ink);
}

.receipt__rows {
    display: grid;
    grid-template-columns: minmax(9rem, 38%) 1fr;
    gap: 0;
    margin: 0;
    padding: .5rem 0 0;
}
.receipt__rows dt {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-deep);
    padding: .85rem 0;
    border-bottom: 1px solid var(--silver-line);
}
.receipt__rows dd {
    margin: 0;
    padding: .8rem 0;
    color: var(--ink);
    border-bottom: 1px solid var(--silver-line);
    word-break: break-word;
}
.receipt__ref { font-family: monospace; font-size: .88rem; }

.receipt__note {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    background: var(--gold-pale);
    border-radius: var(--radius);
}
.receipt__note p {
    font-family: var(--font-display);
    font-style: italic;
    margin: 0;
    color: var(--ink-soft);
}

.receipt__foot {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--silver-line);
    font-size: .82rem;
    line-height: 1.6;
    color: var(--silver);
}

.receipt__actions {
    display: flex;
    gap: .6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

@media print {
    .site-nav, .site-foot, .no-print, .hymn-player { display: none !important; }
    .receipt {
        border: none;
        border-top: 2px solid #B08D3F;
        padding: 0;
    }
    body { background: #fff; }
}

@media (max-width: 575.98px) {
    .receipt { padding: 1.5rem 1.1rem; }
    .receipt__rows { grid-template-columns: 1fr; }
    .receipt__rows dt { border-bottom: none; padding-bottom: .15rem; }
    .receipt__rows dd { padding-top: 0; }
    .receipt__actions .btn { flex: 1 1 100%; }
}

/* An embed can refuse for reasons the family cannot see, so there is
   always a way through to the stream itself. */
.mem-embed__escape {
    text-align: center;
    font-size: .84rem;
    color: var(--silver);
    margin: .9rem 0 0;
}
.mem-embed__escape a { color: var(--gold-deep); font-weight: 500; }

/* =====================================================================
   WATCH CARD
   For a stream that opens elsewhere. Made to look like a deliberate
   choice rather than something that failed to load.
   ===================================================================== */

.watch-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.3rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--silver-line);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.watch-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold-light);
    border-left-color: var(--gold);
    box-shadow: var(--shadow);
}

.watch-card__play {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    padding-left: 3px;
}

.watch-card__text { flex: 1; min-width: 0; }

.watch-card__title {
    display: block;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--ink);
    line-height: 1.2;
}

.watch-card__note {
    display: block;
    font-size: .85rem;
    color: var(--ink-muted);
    margin-top: .2rem;
}

.watch-card__arrow {
    flex: none;
    color: var(--gold);
    font-size: 1.3rem;
}

.mem-section--live .watch-card {
    border-color: var(--gold);
    background: var(--surface);
}

@media (max-width: 575.98px) {
    .watch-card { padding: 1.1rem 1.1rem; gap: .9rem; }
    .watch-card__play { width: 44px; height: 44px; font-size: .9rem; }
    .watch-card__title { font-size: 1.12rem; }
    .watch-card__arrow { display: none; }
}

/* --- formatting a family may apply to what they write ------------------ */

.txt-center { text-align: center; }
.txt-right  { text-align: right; }
.txt-large  { font-size: 1.18em; }
.txt-small  { font-size: .88em; }
.txt-gold   { color: var(--gold-deep); }
.txt-muted  { color: var(--ink-muted); }
.txt-lead   { font-size: 1.1em; line-height: 1.75; }

/* A paragraph inside a family's own writing takes the body colour.
   Wrapping their text in <p> made it inherit the muted colour used for
   secondary paragraphs, so the biography came out lighter than it had
   been before there was an editor at all. */
.mem-prose p {
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.85;
    margin: 0 0 1.1rem;
}
.mem-prose p:last-child { margin-bottom: 0; }

.mem-prose strong, .mem-prose b { color: var(--ink); font-weight: 600; }
.mem-prose li { color: var(--ink); }

/* Their headings and quotations, set to belong with the page */
.mem-prose h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 2rem 0 .6rem;
    color: var(--ink);
}
.mem-prose h4 {
    font-family: var(--font-display);
    font-size: 1.22rem;
    margin: 1.5rem 0 .5rem;
    color: var(--ink);
}
.mem-prose ul, .mem-prose ol { margin: 0 0 1.2rem; padding-left: 1.5rem; }
.mem-prose li { margin-bottom: .4rem; }
.mem-prose blockquote {
    margin: 1.5rem 0;
    padding: .3rem 0 .3rem 1.4rem;
    border-left: 2px solid var(--gold);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--ink-soft);
}
.mem-prose a { color: var(--gold-deep); text-decoration: underline; }

/* The order of service text and the pocket programme use the same prose */
.mem-service__text.mem-prose p,
.pocket-details .mem-prose p {
    font-size: .96rem;
    line-height: 1.7;
    color: var(--ink-soft);
}

/* A family tribute is prose, so it takes the prose spacing rather than
   sitting as one long paragraph. */
.mem-tribute__message.mem-prose p {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--ink);
    margin: 0 0 1rem;
}
.mem-tribute__message.mem-prose p:last-child { margin-bottom: 0; }

/* --- a long tribute, shown short -------------------------------------- */

.mem-tribute__message.is-clamped {
    position: relative;
    overflow: hidden;
    transition: max-height .45s ease;
}

/* The text fades rather than stopping mid-word */
.mem-tribute__message.is-clamped:not(.is-open)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5rem;
    background: linear-gradient(transparent, var(--paper));
    pointer-events: none;
}

/* The family tributes sit on the shaded band, so the fade must match */
.section--alt .mem-tribute__message.is-clamped:not(.is-open)::after {
    background: linear-gradient(transparent, var(--paper-alt));
}
.mem-tribute--family .mem-tribute__message.is-clamped:not(.is-open)::after {
    background: linear-gradient(transparent, var(--surface));
}

.mem-tribute__more {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .9rem;
    padding: .5rem 1.1rem;
    background: none;
    border: 1px solid var(--silver-line);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-deep);
    transition: border-color .2s ease, background-color .2s ease;
}
.mem-tribute__more:hover {
    border-color: var(--gold);
    background: var(--gold-pale);
}

@media print {
    /* Everything prints, whatever is open on screen */
    .mem-tribute__message.is-clamped { max-height: none !important; overflow: visible; }
    .mem-tribute__message.is-clamped::after { display: none; }
    .mem-tribute__more { display: none; }
}

/* --- who the contribution is for --------------------------------------- */

.give-intro {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: .5rem;
}

.give-intro__portrait {
    flex: none;
    width: 92px;
    height: 115px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--gold-pale);
    box-shadow:
        0 0 0 1px var(--gold),
        0 0 0 4px var(--surface),
        0 0 0 5px var(--silver-line);
}
.give-intro__portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.give-intro__name {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    margin: .15rem 0 .1rem;
    line-height: 1.15;
}

@media (max-width: 575.98px) {
    .give-intro { gap: .9rem; }
    .give-intro__portrait { width: 74px; height: 92px; }
}

/* =====================================================================
   PHOTOGRAPHS BY GROUP
   The spouse, the children, brothers and sisters, and so on down.
   ===================================================================== */

.mem-album { margin-bottom: 3rem; }
.mem-album:last-child { margin-bottom: 0; }

.mem-album__head {
    text-align: center;
    margin-bottom: 1.4rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--silver-line);
}

.mem-album__head h3 {
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin: 0;
}

.mem-gallery__figure { margin: 0; }

.mem-gallery__figure figcaption {
    padding-top: .45rem;
    font-size: .8rem;
    line-height: 1.4;
    color: var(--ink-muted);
    text-align: center;
}

@media (max-width: 575.98px) {
    .mem-album { margin-bottom: 2.2rem; }
    .mem-gallery__figure figcaption { font-size: .74rem; }
}
