:root {
    color-scheme: light;
    --maroon: #752d20;
    --deep-maroon: #4f1d17;
    --gold: #b17a25;
    --gold-text: #8a5a14;
    --ink: #453126;
    --muted: #766456;
    --cream: #fffaf0;
    --parchment: #f8ecd1;
    --sand: #f4ead7;
    --line: rgba(144, 91, 33, 0.2);
    /* Invitation page, top to bottom: hero (dark picture) > shloka (gold band) > invitation
       (cream) > programme (sand) > story links (cream) > vakta (parchment) > closing (deep maroon). */
    --serif: "Noto Serif Devanagari", "Nirmala UI", "Mangal", serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: var(--serif);
    line-height: 1.8;
}

a {
    color: inherit;
}

/* Bootstrap's reboot (assets/vendor/bootstrap, loaded before this file) changes browser defaults
   this design was built on: headings set to weight 500 and line-height 1.2, and paragraph, list
   and figure margins. Put them back so Bootstrap's utilities can be used without moving anything. */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: inherit;
}

h1 {
    margin: 0.67em 0;
    font-size: 2em;
}

h2 {
    margin: 0.83em 0;
    font-size: 1.5em;
}

h3 {
    margin: 1em 0;
    font-size: 1.17em;
}

p,
ol,
ul {
    margin: 1em 0;
}

ol,
ul {
    padding-left: 40px;
}

figure {
    margin: 1em 40px;
}

img,
svg {
    vertical-align: baseline;
}

.hero {
    display: grid;
    min-height: min(820px, 100svh);
    padding: 138px 24px 72px;
    place-items: center;
    background:
        linear-gradient(180deg, rgba(47, 22, 14, 0.48), rgba(54, 28, 14, 0.24) 48%, rgba(39, 20, 12, 0.68)),
        url("../images/background.png") center top / cover no-repeat;
    color: #fffaf0;
    text-align: center;
}

.hero-content {
    width: min(800px, 100%);
    margin-top: 24px;
}

.hero-content>* {
    animation: hero-enter 700ms both;
}

.hero-content> :nth-child(1) {
    animation-delay: 80ms;
}

.hero-content> :nth-child(2) {
    animation-delay: 180ms;
}

.hero-content> :nth-child(3) {
    animation-delay: 280ms;
}

.hero-content> :nth-child(4) {
    animation-delay: 380ms;
}

.hero-content> :nth-child(5) {
    animation-delay: 480ms;
}

.hero-content> :nth-child(6) {
    animation-delay: 580ms;
}

.hero-content> :nth-child(7) {
    animation-delay: 680ms;
}

@keyframes hero-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-invocation {
    margin: 0 0 14px;
    color: #ffe3a2;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
}

.eyebrow {
    margin: 0 0 12px;
    color: #f5d28f;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.hero h1 {
    margin: 0 auto 18px;
    color: #fffaf0;
    font-size: clamp(2.15rem, 6vw, 4.5rem);
    line-height: 1.4;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.4);
}

.hero-copy {
    max-width: 700px;
    margin: 0 auto;
    color: rgba(255, 250, 240, 0.94);
    font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero-date {
    margin: 26px 0 22px;
    color: #ffe3a2;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 700;
}

.button {
    display: inline-flex;
    min-height: 48px;
    padding: 10px 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid #f4d18c;
    border-radius: 999px;
    background: #f4d18c;
    color: var(--deep-maroon);
    font-weight: 700;
    text-decoration: none;
    transition: background-color 160ms ease, transform 160ms ease;
}

.button:hover {
    transform: translateY(-2px);
    background: #ffe6af;
}

[hidden] {
    display: none !important;
}

.button {
    gap: 8px;
}

.icon {
    flex: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button-whatsapp {
    border-color: #1e7e4a;
    background: #1e7e4a;
    color: #fff;
}

.button-whatsapp:hover {
    background: #196b3f;
}

.button-maroon {
    border-color: var(--maroon);
    background: var(--maroon);
    color: #fff6e3;
}

.button-maroon:hover {
    background: var(--deep-maroon);
}

.countdown {
    display: inline-block;
    margin: -6px 0 24px;
    padding: 5px 20px;
    border: 1px solid rgba(244, 209, 140, 0.55);
    border-radius: 999px;
    background: rgba(40, 18, 10, 0.45);
    color: #fff6e3;
    font-size: 0.98rem;
}

.countdown strong {
    color: #ffe3a2;
    font-size: 1.12em;
}

.shloka-band {
    padding: 28px 20px 24px;
    border-bottom: 1px solid rgba(177, 122, 37, 0.3);
    background:
        radial-gradient(ellipse at center, rgba(255, 250, 240, 0.7), transparent 70%),
        linear-gradient(90deg, #f1dcae, #f8ecd1 50%, #f1dcae);
    text-align: center;
}

.shloka {
    margin: 0;
    color: var(--deep-maroon);
    font-size: clamp(1.08rem, 2.6vw, 1.4rem);
    font-weight: 600;
    line-height: 1.9;
}

.shloka-source {
    margin: 6px 0 0;
    color: var(--gold-text);
    font-size: 0.88rem;
    font-weight: 600;
}

.shloka-meaning {
    max-width: 720px;
    margin: 14px auto 0;
    padding-top: 14px;
    border-top: 1px solid rgba(177, 122, 37, 0.3);
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.85;
}

.section {
    padding: clamp(54px, 8vw, 90px) 24px;
}

.section-inner {
    width: min(1050px, 100%);
    margin: 0 auto;
}

.section-heading {
    max-width: 740px;
    margin: 0 auto 32px;
    text-align: center;
}

.section-heading .eyebrow {
    color: var(--gold-text);
}

.section-heading h1,
.section-heading h2 {
    margin: 0 0 10px;
    color: var(--deep-maroon);
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.5;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.invitation-section {
    background:
        radial-gradient(ellipse at top, rgba(239, 215, 164, 0.24), transparent 60%),
        var(--cream);
}

.home-stories {
    background:
        radial-gradient(ellipse at top, rgba(239, 215, 164, 0.2), transparent 62%),
        var(--cream);
}

.home-story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.home-story-card {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 250, 240, 0.88);
    box-shadow: 0 6px 18px rgba(92, 48, 16, 0.08);
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.home-story-card:hover {
    transform: translateY(-3px);
    border-color: rgba(117, 45, 32, 0.38);
    box-shadow: 0 12px 26px rgba(92, 48, 16, 0.14);
}

.home-story-card:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

/* The paintings are 3:4 portraits. The frame follows the card's width through
   aspect-ratio (not a fixed height), so the crop stays the same proportion at every
   screen size, and each image's focal point keeps the faces in view. */
.home-story-art {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--deep-maroon);
}

.home-story-art::after {
    position: absolute;
    inset: auto 0 0;
    height: 28%;
    background: linear-gradient(to top, rgba(79, 29, 23, 0.28), transparent);
    content: "";
    pointer-events: none;
}

.home-story-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* वेणु: crown, face and flute stay in the frame */
    object-position: center 20%;
    transition: transform 400ms ease;
}

.home-story-art-bhagwat img {
    /* श्रीकृष्ण in the clouds, the संत's face and the open ग्रंथ */
    object-position: center 10%;
}

.home-story-card:hover .home-story-art img,
.home-story-card:focus-visible .home-story-art img {
    transform: scale(1.04);
}

.home-story-content {
    display: flex;
    width: 100%;
    min-height: 205px;
    padding: clamp(20px, 3vw, 28px);
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
}

.home-story-number {
    color: var(--gold-text);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.home-story-card h3 {
    margin: 8px 0;
    color: var(--deep-maroon);
    font-size: 1.35rem;
}

.home-story-description {
    margin: 0 0 18px;
    color: var(--muted);
}

.home-story-link {
    display: inline-flex;
    margin-top: auto;
    align-items: center;
    gap: 6px;
    color: var(--maroon);
    font-weight: 700;
}

.home-story-link .icon {
    width: 20px;
    height: 20px;
}

@media (min-width: 600px) {
    .home-story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    /* Narrow two-column cards: a square frame shows more of the portrait */
    .home-story-art {
        aspect-ratio: 1 / 1;
    }
}

@media (min-width: 900px) {
    .home-story-art {
        aspect-ratio: 5 / 4;
    }
}

.invitation-copy,
.profile-copy {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.invitation-copy p,
.profile-copy p {
    margin: 0 0 16px;
}

.blessing {
    color: var(--gold-text);
    font-weight: 700;
}

.highlight {
    color: var(--maroon);
    font-size: 1.08rem;
    font-weight: 700;
}

.event-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 38px;
}

.detail-card {
    padding: 22px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
    text-align: center;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.detail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(92, 48, 16, 0.1);
}

.detail-card span {
    display: block;
    margin-bottom: 4px;
    color: var(--gold-text);
    font-size: 0.9rem;
    font-weight: 700;
}

.detail-card strong {
    color: var(--deep-maroon);
    font-size: 1.05rem;
}

.detail-link {
    display: block;
    margin-top: 4px;
    color: var(--maroon);
    font-size: 0.92rem;
    font-weight: 600;
    text-underline-offset: 3px;
}

/* Where the katha is held: the hall on Google Maps (app/views/partials/venue-map.php). */
/* Comes right after the programme (#f4ead7), so it takes the cream of the invitation. */
.venue-section {
    background:
        radial-gradient(ellipse at top, rgba(239, 215, 164, 0.24), transparent 60%),
        var(--cream);
}

.speaker-section {
    background:
        radial-gradient(ellipse at center, rgba(244, 209, 140, 0.16), transparent 65%),
        linear-gradient(180deg, var(--maroon), var(--deep-maroon));
    color: #fff6e3;
    text-align: center;
}

.home-speaker-section {
    background:
        radial-gradient(ellipse at top, rgba(239, 215, 164, 0.3), transparent 65%),
        linear-gradient(180deg, var(--parchment), var(--cream));
    color: var(--ink);
}

.home-speaker-section .eyebrow {
    color: var(--gold-text);
}

.speaker-card {
    max-width: 760px;
    margin: 0 auto;
}

/* The प्रवक्ता's picture in a gold-ringed circle: on the invitation page and, larger, on the
   profile page. A picture of any shape fits; it is cropped to the circle, keeping the upper
   part where a portrait has the face. */
.speaker-photo {
    display: block;
    width: clamp(132px, 36vw, 164px);
    margin: 0 auto 18px;
    overflow: hidden;
    border: 2px solid rgba(244, 209, 140, 0.85);
    border-radius: 50%;
    background: #f1dcae;
    box-shadow: 0 0 0 6px rgba(244, 209, 140, 0.14);
    aspect-ratio: 1;
    transition: box-shadow 200ms ease;
}

a.speaker-photo:hover {
    box-shadow: 0 0 0 9px rgba(244, 209, 140, 0.24);
}

a.speaker-photo:focus-visible {
    outline: 2px solid #ffe3a2;
    outline-offset: 8px;
}

.speaker-photo-large {
    width: clamp(176px, 48vw, 232px);
    margin-bottom: 22px;
}

.speaker-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.speaker-more {
    margin: 24px 0 0;
}

.speaker-section h1,
.speaker-section h2 {
    margin: 0 0 14px;
    color: #ffe3a2;
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    line-height: 1.4;
}

.home-speaker-section h1,
.home-speaker-section h2 {
    color: var(--deep-maroon);
}

.speaker-copy {
    max-width: 640px;
    margin: 0 auto;
    color: rgba(255, 246, 227, 0.9);
}

.home-speaker-section .speaker-copy {
    color: var(--muted);
}

.youtube-section {
    background: rgba(255, 250, 240, 0.82);
}

.youtube-card {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(24px, 5vw, 48px);
    max-width: 760px;
    margin: 0 auto;
    padding: 24px;
    border: 1px solid rgba(177, 122, 37, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.youtube-qr {
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(92, 48, 16, 0.12);
}

.youtube-qr img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.youtube-copy p {
    margin: 0 0 18px;
}

@media (max-width: 620px) {
    .youtube-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .youtube-qr {
        max-width: 220px;
        width: 100%;
        margin: 0 auto;
    }
}

/* Profile page: the प्रवक्ता's life as an article. An opening paragraph, three figures
   from the कथा-यात्रा, the life in short chapters, then the same facts as a list to scan. */
.profile-lead {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.08rem;
    text-align: center;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    max-width: 820px;
    margin: 30px auto 0;
    padding: 0;
    list-style: none;
}

.profile-stats li {
    padding: 18px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
    line-height: 1.5;
    text-align: center;
}

.profile-stats strong {
    display: block;
    color: var(--maroon);
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.profile-stats span {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

/* Unlike the short centred copy elsewhere, the chapters are long enough to read from the left. */
.profile-article {
    max-width: 760px;
    margin: 40px auto 0;
}

.profile-article section + section {
    margin-top: 28px;
}

.profile-article h3 {
    margin: 0 0 8px;
    padding-left: 14px;
    border-left: 3px solid var(--gold);
    color: var(--deep-maroon);
    font-size: clamp(1.2rem, 3vw, 1.4rem);
    line-height: 1.5;
}

.profile-article p {
    margin: 0;
}

.profile-article p + p {
    margin-top: 10px;
}

.profile-facts {
    max-width: 760px;
    margin: 40px auto 0;
    padding: 22px clamp(18px, 4vw, 34px);
    border: 1px solid rgba(177, 122, 37, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
}

.profile-facts h3 {
    margin: 0 0 10px;
    color: var(--maroon);
    font-size: 1.2rem;
    text-align: center;
}

.profile-facts dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 22px;
    margin: 0;
}

.profile-facts dt,
.profile-facts dd {
    margin: 0;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.profile-facts dt {
    color: var(--gold-text);
    font-size: 0.95rem;
    font-weight: 700;
}

.profile-facts dd {
    color: var(--deep-maroon);
    font-weight: 600;
}

/* The shloka between two sections of a page, not under the hero, is ruled off on both sides. */
.section + .shloka-band {
    border-top: 1px solid rgba(177, 122, 37, 0.3);
}

@media (max-width: 620px) {
    /* Each figure becomes a row: the figure on the left, what it counts beside it. */
    .profile-stats {
        grid-template-columns: 1fr;
        gap: 10px;
        max-width: 520px;
    }

    .profile-stats li {
        display: grid;
        padding: 12px 18px;
        grid-template-columns: 8rem minmax(0, 1fr);
        align-items: center;
        gap: 14px;
        text-align: left;
    }

    .profile-stats strong {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    /* Each fact's name sits above it, so a long fact keeps the full width. */
    .profile-facts dl {
        grid-template-columns: 1fr;
    }

    .profile-facts dt {
        padding-bottom: 0;
    }

    .profile-facts dd {
        padding-top: 0;
        border-top: 0;
    }
}

.schedule-section {
    background: var(--sand);
}

/* Timeline: a spine with one dated circle per day. A single rail on the left by default;
   from 761px up the cards alternate down both sides of a central spine. */
.schedule {
    --marker: 42px; /* date circle sitting on the spine */
    --stem: 14px;   /* connector between a card and its circle */
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0 0 calc(var(--marker) + var(--stem));
    list-style: none;
}

.schedule::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--marker) / 2 - 1px);
    width: 2px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(177, 122, 37, 0.65) 20px,
            rgba(177, 122, 37, 0.65) calc(100% - 110px),
            transparent);
    content: "";
}

.schedule > li {
    position: relative;
    padding: 16px 20px;
    border: 1px solid rgba(177, 122, 37, 0.32);
    border-radius: 12px;
    background: rgba(255, 250, 240, 0.92) no-repeat right 12px bottom 10px / 88px;
    transition: box-shadow 180ms ease;
}

.schedule > li:hover {
    box-shadow: 0 9px 20px rgba(92, 48, 16, 0.09);
}

/* A motif from each day's प्रसंग sits in the empty corner of its card. */
.schedule > li[data-day="18"] {
    background-image: url("../images/schedule/kalash.svg");
}

.schedule > li[data-day="19"] {
    background-image: url("../images/schedule/dhruva.svg");
}

.schedule > li[data-day="20"] {
    background-image: url("../images/schedule/stambh.svg");
}

.schedule > li[data-day="21"] {
    background-image: url("../images/schedule/chakra.svg");
}

.schedule > li[data-day="22"] {
    background-image: url("../images/schedule/matki.svg");
}

.schedule > li[data-day="23"] {
    background-image: url("../images/schedule/bansuri.svg");
}

.schedule > li[data-day="24"] {
    background-image: url("../images/schedule/granth.svg");
}

.schedule > li[data-day="25"] {
    background-image: url("../images/schedule/havan.svg");
}

.schedule > li::before {
    position: absolute;
    top: 12px;
    right: calc(100% + 1px + var(--stem));
    display: grid;
    box-sizing: border-box;
    width: var(--marker);
    height: var(--marker);
    place-items: center;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: var(--cream);
    color: var(--maroon);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    content: attr(data-day);
}

.schedule > li::after {
    position: absolute;
    top: calc(11px + var(--marker) / 2);
    right: calc(100% + 1px);
    width: var(--stem);
    height: 2px;
    background: rgba(177, 122, 37, 0.65);
    content: "";
}

.schedule > li.closing-day {
    background-color: #fff3d9;
}

.schedule > li.closing-day::before {
    border-color: var(--gold-text);
    background: var(--gold-text);
    color: #fffaf0;
}

.schedule > li.is-today {
    border-color: var(--maroon);
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(117, 45, 32, 0.18), 0 10px 24px rgba(92, 48, 16, 0.12);
}

.schedule > li.is-today::before {
    border-color: var(--maroon);
    background: var(--maroon);
    color: #fff6e3;
    animation: today-pulse 2.2s ease-out infinite;
}

.schedule > li.is-today::after {
    background: var(--maroon);
}

.schedule > li.is-today strong {
    padding-right: 46px;
}

@keyframes today-pulse {
    from {
        box-shadow: 0 0 0 0 rgba(117, 45, 32, 0.45);
    }

    to {
        box-shadow: 0 0 0 12px rgba(117, 45, 32, 0);
    }
}

@media (min-width: 761px) {
    .schedule {
        --marker: 48px;
        --stem: 16px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px calc(var(--marker) + 2 * var(--stem));
        padding-left: 0;
    }

    .schedule::before {
        left: calc(50% - 1px);
    }

    /* Every card spans two rows. Starting the second card one row down staggers the two
       columns, and auto-placement keeps the rest alternating along the spine. */
    .schedule > li {
        grid-row: span 2;
        align-self: start;
        background-position: right 18px bottom 14px;
        background-size: clamp(84px, 11vw, 108px);
    }

    .schedule > li:nth-child(2) {
        grid-row: 2 / span 2;
    }

    .schedule > li:nth-child(odd) {
        grid-column: 1;
    }

    .schedule > li:nth-child(even) {
        grid-column: 2;
    }

    .schedule > li:nth-child(odd)::before {
        right: auto;
        left: calc(100% + 1px + var(--stem));
    }

    .schedule > li:nth-child(odd)::after {
        right: auto;
        left: calc(100% + 1px);
    }
}

.today-badge {
    position: absolute;
    top: 16px;
    right: 14px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--maroon);
    color: #fff6e3;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.8;
}

.schedule strong {
    display: block;
    margin-bottom: 2px;
    color: var(--maroon);
    font-size: 0.98rem;
}

.tithi {
    display: block;
    margin-bottom: 8px;
    color: var(--gold-text);
    font-size: 0.85rem;
    font-style: normal;
    font-weight: 600;
}

.prasang {
    margin: 0;
    padding: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
    list-style: none;
}

.prasang li {
    position: relative;
    padding-left: 16px;
}

.prasang li + li {
    margin-top: 3px;
}

.prasang li::before {
    position: absolute;
    top: 0.72em;
    left: 2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    content: "";
}

.special-note {
    max-width: 850px;
    margin: 34px auto 0;
    padding: 22px clamp(18px, 4vw, 34px);
    border: 1px solid rgba(177, 122, 37, 0.28);
    border-radius: 14px;
    background: rgba(255, 250, 240, 0.78);
    text-align: center;
}

.special-note h3 {
    margin: 0 0 8px;
    color: var(--maroon);
    font-size: 1.2rem;
}

.special-note p {
    margin: 0;
}

/* The leela section of the invitation page and the whole Krishna Leela page. */
.krishna-leela-section {
    background:
        radial-gradient(ellipse at top, rgba(239, 215, 164, 0.24), transparent 60%),
        var(--cream);
}

/* The leela darshan on the invitation page is the one dark band between the light programme and
   vakta sections: the paintings glow on maroon, like a temple's inner sanctum. */
.krishna-leela-section.leela-section {
    background:
        radial-gradient(ellipse at top, rgba(244, 209, 140, 0.18), transparent 62%),
        linear-gradient(180deg, var(--maroon), var(--deep-maroon));
    color: #fff6e3;
}

.leela-section .section-heading .eyebrow {
    color: #f5d28f;
}

.leela-section .section-heading h2 {
    color: #ffe3a2;
}

.leela-section .section-heading p,
.leela-section .leela-caption {
    color: rgba(255, 246, 227, 0.88);
}

.leela-section .leela-count {
    color: #ffe3a2;
}

.leela-section .leela-card {
    border-color: rgba(226, 192, 120, 0.5);
    box-shadow: 0 8px 18px rgba(20, 6, 3, 0.35);
}

.leela-section .leela-nav,
.leela-section .leela-nav[aria-disabled="true"] {
    border-color: rgba(244, 209, 140, 0.7);
    background: transparent;
    color: #f4d18c;
}

.leela-section .leela-nav:not([aria-disabled="true"]):hover {
    background: #f4d18c;
    color: var(--deep-maroon);
}

.leela-section .leela-nav:focus-visible {
    outline-color: #ffe3a2;
}

/* Gold button on maroon, as in the hero. */
.leela-section .button-maroon {
    border-color: #f4d18c;
    background: #f4d18c;
    color: var(--deep-maroon);
}

.leela-section .button-maroon:hover {
    background: #ffe6af;
}

.story-invitation {
    margin: 30px 0 0;
    text-align: center;
}

/* Leela carousel on the invitation page (Owl Carousel). Every picture is the same 3:4 size, so
   every card is the same height. Until Owl has loaded, or without JavaScript, it is a plain
   swipeable row of the same cards. */
.leela-carousel {
    /* Card width in the fallback row; each value matches what Owl gives it at that breakpoint
       (see the responsive option in main.js), so nothing moves when Owl takes over. */
    --card: calc(100% - 104px);
}

@media (min-width: 540px) {
    .leela-carousel {
        --card: calc((100% - 14px) / 2);
    }
}

@media (min-width: 860px) {
    .leela-carousel {
        --card: calc((100% - 28px) / 3);
    }
}

/* No horizontal padding here: Owl measures this box before it adds .owl-loaded. */
.leela-carousel:not(.owl-loaded) {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 6px 0 22px;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.leela-carousel:not(.owl-loaded)::-webkit-scrollbar {
    display: none;
}

.leela-carousel:not(.owl-loaded) .leela-card {
    flex: 0 0 var(--card);
    scroll-snap-align: center;
}

.leela-carousel:not(.owl-loaded) .leela-card:first-child {
    margin-left: calc(50% - var(--card) / 2);
}

.leela-carousel:not(.owl-loaded) .leela-card:last-child {
    margin-right: calc(50% - var(--card) / 2);
}

.leela-carousel .owl-stage-outer {
    padding: 6px 0 22px; /* room for the cards' shadow */
}

.leela-card {
    position: relative;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(177, 122, 37, 0.55);
    border-radius: 14px;
    background: radial-gradient(ellipse at center, #6a2a1e, #34130e);
    box-shadow: 0 6px 14px rgba(92, 48, 16, 0.16);
    aspect-ratio: 3 / 4;
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.leela-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leela-card figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 46px 14px 12px;
    background: linear-gradient(to top, rgba(40, 15, 8, 0.9), rgba(40, 15, 8, 0.55) 55%, transparent);
    color: #ffe3a2;
    line-height: 1.5;
    text-align: center;
}

.leela-card figcaption span {
    display: block;
    color: #e8c684;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.leela-card figcaption strong {
    display: block;
    font-size: 1.15rem;
}

/* The picture in the middle is the one the caption below describes. */
.leela-carousel .owl-item.center .leela-card {
    border-color: #e2c078;
    box-shadow: 0 0 0 2px #e2c078, 0 8px 14px rgba(92, 48, 16, 0.28);
}

.leela-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.leela-count {
    min-width: 4.5em;
    margin: 0;
    color: var(--maroon);
    font-weight: 700;
    text-align: center;
}

/* Tall enough for the longest caption, so the page below does not jump as the pictures change. */
.leela-caption {
    max-width: 640px;
    min-height: 5.4em;
    margin: 12px auto 0;
    color: var(--ink);
    text-align: center;
}

@media (max-width: 539px) {
    /* One picture with its neighbours peeking in from the screen edges. */
    .leela-carousel {
        width: auto;
        margin-inline: -18px;
    }
}

@media (min-width: 761px) {
    .leela-caption {
        min-height: 3.6em;
    }
}

/* Inner pages (Krishna Leela, 404): a slim bar back to the invitation, and the footer kept at the bottom. */
.page-sub {
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    flex-direction: column;
}

.page-sub main {
    display: flex;
    flex: 1;
    flex-direction: column;
}

/* On a screen taller than the page, the last section stretches down to the footer. */
.page-sub main > :last-child {
    flex: 1;
}

.page-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    padding: 6px 20px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: linear-gradient(180deg, var(--maroon), var(--deep-maroon));
    box-shadow: 0 2px 12px rgba(40, 15, 8, 0.28);
    color: #ffe3a2;
}

.page-back {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-self: start;
    gap: 4px;
    color: #fff6e3;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
}

.page-back .fa-arrow-left {
    margin-right: 4px;
}

.page-back:hover {
    color: #ffe3a2;
}

.page-bar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
}

.page-return {
    display: flex;
    margin: 28px 0 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* ------------------------------------------------------------------------------------------
   श्रीमद्भागवत महापुराण page (app/Views/pages/shri-mad-bhagwat-puran/index.php) and its three
   प्रसंग pages (राजा परीक्षित, शुकदेव जी, तक्षक नाग). Light sections alternate cream and sand; the
   चतुःश्लोकी and the leela carousel are the maroon bands.
   ------------------------------------------------------------------------------------------ */
.bhagwat-page .section {
    scroll-margin-top: 56px; /* clear the sticky page bar when jumped to */
}

.bhagwat-page .eyebrow {
    color: var(--gold-text);
}

.bp-sand,
.prasang-cards-section {
    background: var(--sand);
}

.bp-cream,
.prasang-story {
    background: var(--cream);
}

/* Top of the page: the title and मंगलाचरण beside the book. */
.bp-hero,
.prasang-hero {
    padding-top: clamp(30px, 6vw, 64px);
    background:
        radial-gradient(circle at 80% 32%, rgba(244, 209, 140, 0.42), transparent 40%),
        radial-gradient(ellipse at top, rgba(239, 215, 164, 0.32), transparent 68%),
        linear-gradient(180deg, #fff8e9, var(--cream));
}

.bp-hero-grid {
    display: grid;
    gap: clamp(20px, 5vw, 56px);
    align-items: center;
}

.bp-hero-text h1,
.prasang-hero-text h1 {
    margin: 0 0 14px;
    color: var(--deep-maroon);
    font-size: clamp(2rem, 5.4vw, 3.2rem);
    line-height: 1.4;
}

.bp-lead {
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2.4vw, 1.15rem);
}

.bp-mangal {
    margin: 24px 0 8px;
    padding: 16px 20px;
    border: 1px solid rgba(177, 122, 37, 0.35);
    border-left: 4px solid var(--gold);
    border-radius: 6px 14px 14px 6px;
    background: rgba(255, 255, 255, 0.72);
}

.bp-mangal p {
    margin: 0;
    color: var(--deep-maroon);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.9;
}

.bp-mangal cite {
    display: block;
    margin-top: 4px;
    color: var(--gold-text);
    font-size: 0.85rem;
    font-style: normal;
}

.bp-mangal-meaning {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

@media (min-width: 860px) {
    .bp-hero-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    }
}

/* The book: a cloth-bound volume in the manner of the classic Sanskrit-Hindi editions — deep red
   cloth, gold rules and lettering, a painting in an arched frame — drawn in CSS so the Devanagari
   stays sharp. It stands turned to show its spine and straightens a little on hover. */
.granth-stage {
    display: grid;
    margin: 0;
    justify-items: center;
}

.granth-stage figcaption {
    max-width: 300px;
    color: var(--gold-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.granth {
    position: relative;
    width: min(290px, 68vw);
    margin: 12px 0 40px 22px; /* room on the left for the spine */
    aspect-ratio: 3 / 4;
    container-type: inline-size;
    perspective: 1300px;
}

/* The glow behind it, like lamplight on the vyaspeeth. */
.granth::before {
    position: absolute;
    inset: -22% -30%;
    z-index: -1;
    background: radial-gradient(circle, rgba(244, 196, 104, 0.55), transparent 62%);
    content: "";
}

.granth-book {
    position: absolute;
    inset: 0;
    transform: rotateY(24deg) rotateX(3deg);
    transform-style: preserve-3d;
    transition: transform 700ms ease;
}

.granth:hover .granth-book {
    transform: rotateY(12deg) rotateX(2deg);
}

.granth-cover {
    position: absolute;
    inset: 0;
    display: flex;
    padding: 9% 9% 7%;
    flex-direction: column;
    align-items: center;
    border-radius: 3px 10px 10px 3px;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 4px),
        radial-gradient(ellipse at 30% 18%, #a8392c, #7b1f18 55%, #4c110c);
    box-shadow:
        inset 0 0 0 7px #64170f,
        inset 0 0 0 9px #d9a94c,
        inset 0 0 0 12px #64170f,
        inset 0 0 0 13px rgba(217, 169, 76, 0.7),
        inset 8px 0 16px rgba(0, 0, 0, 0.35),
        14px 22px 34px rgba(60, 20, 12, 0.35);
    color: #f5d48a;
    text-align: center;
    transform: translateZ(20px);
}

.granth-om {
    font-size: 5cqw;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

.granth-title {
    margin-top: 2%;
    background: linear-gradient(180deg, #fff3c9, #e8b955 55%, #b4802a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(40, 8, 4, 0.6));
    font-size: 9.6cqw;
    font-weight: 700;
    line-height: 1.3;
}

.granth-title span {
    display: block;
    font-size: 1.22em;
}

.granth-art {
    display: block;
    overflow: hidden;
    width: 58%;
    margin: 6% 0 5%;
    border: 2px solid #e2b04f;
    border-radius: 50% 50% 6px 6px / 34% 34% 6px 6px;
    box-shadow: 0 0 0 4px #64170f, 0 0 0 5px rgba(226, 176, 79, 0.7);
    aspect-ratio: 4 / 5;
}

.granth-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 18%;
}

.granth-sub {
    font-size: 4.6cqw;
    font-weight: 600;
    line-height: 1.5;
}

.granth-foot {
    margin-top: auto;
    padding-top: 2.5%;
    border-top: 1px solid rgba(226, 176, 79, 0.55);
    font-size: 4.8cqw;
    letter-spacing: 0.03em;
    line-height: 1.5;
}

/* The spine: the left face of the book, 40px deep, with gold bands and the title running up it. */
.granth-spine {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 40px;
    height: 100%;
    place-items: center;
    border-radius: 3px 0 0 3px;
    background:
        linear-gradient(180deg, transparent 7%, #d9a94c 7% 8%, transparent 8% 10%, #d9a94c 10% 10.6%, transparent 10.6% 89.4%, #d9a94c 89.4% 90%, transparent 90% 92%, #d9a94c 92% 93%, transparent 93%),
        linear-gradient(90deg, #3e0d09, #8a2a20 50%, #3e0d09);
    color: #f1cd7d;
    transform: translateZ(-20px) rotateY(-90deg);
    transform-origin: left center;
}

.granth-spine span {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    writing-mode: vertical-rl;
}

/* Its shadow on the vyaspeeth. */
.granth-cloth {
    position: absolute;
    right: -12%;
    bottom: -26px;
    left: -18%;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(79, 29, 23, 0.38), transparent 70%);
    filter: blur(3px);
}

/* The Bhagwat at a glance: skandh, adhyay, shlok, days. */
.katha-facts {
    display: grid;
    max-width: 780px;
    margin: 30px auto 0;
    padding: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
}

.katha-facts li {
    padding: 12px 8px;
    border: 1px solid rgba(177, 122, 37, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
    text-align: center;
}

.katha-facts strong {
    display: block;
    color: var(--deep-maroon);
    font-size: clamp(1.3rem, 3.6vw, 1.7rem);
    line-height: 1.4;
}

@media (min-width: 600px) {
    .katha-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Jump links: one pill for each section. */
.katha-jump {
    display: flex;
    margin: 24px 0 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.katha-jump a {
    display: inline-flex;
    padding: 8px 18px;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(177, 122, 37, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--maroon);
    font-weight: 700;
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease;
}

.katha-jump a:hover,
.katha-jump a:focus-visible {
    background: var(--maroon);
    color: #ffe3a2;
}

/* Running text, with a narrower measure than the section. */
.bp-prose {
    max-width: 780px;
    margin: 0 auto;
}

.bp-prose p {
    margin: 0 0 16px;
    line-height: 1.95;
}

.bp-subhead {
    margin: clamp(30px, 5vw, 44px) 0 22px;
    color: var(--deep-maroon);
    font-size: clamp(1.25rem, 3vw, 1.55rem);
    line-height: 1.5;
    text-align: center;
}

/* परंपरा: eight steps from Narayan to the rishis of Naimisharanya, read left to right and down,
   an arrow between each. */
.parampara {
    display: grid;
    margin: 0;
    padding: 0;
    grid-template-columns: 1fr;
    gap: 28px;
    list-style: none;
}

.parampara li {
    position: relative;
    padding: 16px 14px 14px;
    border: 1px solid rgba(177, 122, 37, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    text-align: center;
}

.parampara li:not(:last-child)::after {
    position: absolute;
    bottom: -25px;
    left: 50%;
    color: var(--gold);
    content: "↓";
    font-size: 1.2rem;
    line-height: 1;
    transform: translateX(-50%);
}

.parampara-num {
    display: inline-grid;
    width: 30px;
    height: 30px;
    margin-bottom: 6px;
    place-items: center;
    border-radius: 50%;
    background: var(--maroon);
    color: #ffe3a2;
    font-size: 0.85rem;
    font-weight: 700;
}

.parampara-name {
    display: block;
    color: var(--deep-maroon);
    font-size: 1.05rem;
    font-weight: 700;
}

a.parampara-name {
    text-decoration: underline;
    text-decoration-color: rgba(177, 122, 37, 0.55);
    text-underline-offset: 5px;
}

a.parampara-name:hover {
    color: var(--maroon);
}

.parampara-role {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

@media (min-width: 600px) {
    .parampara {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 30px;
    }

    .parampara li:not(:last-child)::after {
        top: 50%;
        right: -22px;
        bottom: auto;
        left: auto;
        content: "→";
        transform: translateY(-50%);
    }

    .parampara li:nth-child(2n)::after {
        display: none;
    }
}

@media (min-width: 960px) {
    .parampara {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .parampara li:nth-child(2n)::after {
        display: block;
    }

    .parampara li:nth-child(4n)::after {
        display: none;
    }
}

/* चतुःश्लोकी भागवत: the four shlokas as cream cards on maroon, each numbered in a gold coin. */
.chatuh-section {
    background:
        radial-gradient(ellipse at top, rgba(244, 209, 140, 0.2), transparent 60%),
        linear-gradient(180deg, var(--maroon), var(--deep-maroon));
    color: #fff6e3;
}

.chatuh-section .section-heading .eyebrow {
    color: #f5d28f;
}

.chatuh-section .section-heading h2 {
    color: #ffe3a2;
}

.chatuh-section .section-heading p {
    color: rgba(255, 246, 227, 0.88);
}

.chatuh-intro {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.chatuh-intro p {
    margin: 0;
    color: #ffe3a2;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.9;
}

.chatuh-intro cite {
    color: #f5d28f;
    font-size: 0.85rem;
    font-style: normal;
}

.chatuh-intro-meaning {
    max-width: 640px;
    margin: 8px auto 44px;
    color: rgba(255, 246, 227, 0.8);
    font-size: 0.95rem;
    text-align: center;
}

.chatuh-list {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 40px 22px;
    list-style: none;
}

.chatuh-card {
    position: relative;
    padding: 32px 22px 22px;
    border: 1px solid rgba(226, 192, 120, 0.9);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffaf0, var(--parchment));
    box-shadow: 0 0 0 5px rgba(244, 209, 140, 0.16), 0 14px 30px rgba(20, 6, 3, 0.35);
    color: var(--ink);
}

.chatuh-num {
    position: absolute;
    top: -21px;
    left: 50%;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(180deg, #f4d18c, #c9923a);
    box-shadow: 0 0 0 4px var(--maroon);
    color: var(--deep-maroon);
    font-size: 1.15rem;
    font-weight: 700;
    transform: translateX(-50%);
}

.chatuh-saar {
    margin: 0 0 10px;
    color: var(--gold-text);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

.chatuh-card blockquote {
    margin: 0;
    padding: 0 0 14px;
    border-bottom: 1px dashed rgba(177, 122, 37, 0.45);
    text-align: center;
}

.chatuh-card blockquote p {
    margin: 0;
    color: var(--deep-maroon);
    font-size: clamp(1.05rem, 2.6vw, 1.2rem);
    font-weight: 700;
    line-height: 1.95;
}

.chatuh-card cite {
    display: block;
    margin-top: 6px;
    color: var(--gold-text);
    font-size: 0.82rem;
    font-style: normal;
}

.chatuh-hi {
    margin: 14px 0 0;
    line-height: 1.9;
}

.chatuh-hi span {
    display: block;
    margin-bottom: 2px;
    color: var(--maroon);
    font-size: 0.8rem;
    font-weight: 700;
}

.chatuh-note {
    max-width: 780px;
    margin: 36px auto 0;
    padding: 18px 22px;
    border: 1px solid rgba(244, 209, 140, 0.4);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 246, 227, 0.92);
    text-align: center;
}

@media (min-width: 760px) {
    .chatuh-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* बारह स्कंध: twelve cards, the दशम स्कंध (the heart) in maroon. */
.skandh-grid {
    display: grid;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 16px;
    list-style: none;
}

.skandh-card {
    position: relative;
    padding: 20px 18px 18px;
    border: 1px solid rgba(177, 122, 37, 0.28);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(79, 29, 23, 0.06);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.skandh-card:hover {
    box-shadow: 0 12px 24px rgba(79, 29, 23, 0.12);
    transform: translateY(-3px);
}

.skandh-num {
    position: absolute;
    top: 12px;
    right: 16px;
    color: rgba(177, 122, 37, 0.3);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.skandh-card h3 {
    margin: 0;
    color: var(--deep-maroon);
    font-size: 1.15rem;
}

.skandh-vishay {
    display: inline-block;
    margin: 6px 0 10px;
    padding: 2px 12px;
    border-radius: 999px;
    background: rgba(239, 215, 164, 0.45);
    color: var(--gold-text);
    font-size: 0.82rem;
    font-weight: 700;
}

.skandh-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.75;
}

.skandh-card-hriday {
    border-color: rgba(226, 192, 120, 0.8);
    background: linear-gradient(160deg, var(--maroon), var(--deep-maroon));
}

.skandh-card-hriday h3 {
    color: #ffe3a2;
}

.skandh-card-hriday p {
    color: rgba(255, 246, 227, 0.88);
}

.skandh-card-hriday .skandh-vishay {
    background: rgba(244, 209, 140, 0.2);
    color: #f5d28f;
}

.skandh-card-hriday .skandh-num {
    color: rgba(244, 209, 140, 0.35);
}

/* A large painting beside text (महात्म्य); the picture stays in view while the text scrolls,
   and sits above it on phones. */
.katha-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(24px, 4vw, 48px);
}

.katha-figure {
    width: min(420px, 100%);
    margin: 0 auto;
}

.katha-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 3px solid rgba(226, 192, 120, 0.95);
    border-radius: 18px;
    background: #34130e;
    box-shadow: 0 0 0 6px rgba(244, 209, 140, 0.22), 0 18px 36px rgba(79, 29, 23, 0.22);
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.katha-figure figcaption {
    margin-top: 16px;
    color: var(--gold-text);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
}

@media (min-width: 860px) {
    .katha-grid {
        grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
        align-items: start;
    }

    .katha-grid .katha-figure {
        position: sticky;
        top: 76px;
        width: 100%;
    }
}

.katha-text p {
    margin: 0 0 14px;
    line-height: 1.9;
}

.mahatmya-story h3 {
    margin: 0 0 8px;
    color: var(--deep-maroon);
    font-size: clamp(1.2rem, 3vw, 1.45rem);
    line-height: 1.5;
}

.mahatmya-story + .mahatmya-story {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* A Sanskrit shloka inside running text, with its meaning below. */
.katha-quote {
    margin: 22px 0 8px;
    padding: 14px 18px;
    border-left: 3px solid var(--gold);
    border-radius: 0 12px 12px 0;
    background: rgba(239, 215, 164, 0.3);
}

.katha-quote p {
    margin: 0;
    color: var(--deep-maroon);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.9;
}

.katha-quote cite {
    display: block;
    margin-top: 4px;
    color: var(--gold-text);
    font-size: 0.85rem;
    font-style: normal;
}

p.katha-quote-meaning {
    color: var(--muted);
    font-size: 0.95rem;
}

/* कथा श्रवण के नियम. */
.niyam-grid {
    display: grid;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 16px;
    list-style: none;
}

.niyam-card {
    display: grid;
    padding: 18px;
    grid-template-columns: 48px 1fr;
    column-gap: 14px;
    align-items: start;
    border: 1px solid rgba(177, 122, 37, 0.25);
    border-radius: 16px;
    background: #fff;
}

.niyam-card i {
    display: grid;
    width: 48px;
    height: 48px;
    grid-row: span 2;
    place-items: center;
    border-radius: 50%;
    background: var(--maroon);
    color: #ffe3a2;
    font-size: 1.1rem;
}

.niyam-card h3 {
    margin: 2px 0;
    color: var(--deep-maroon);
    font-size: 1.08rem;
}

.niyam-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.7;
}

.katha-message {
    max-width: 820px;
    margin: clamp(34px, 5vw, 52px) auto 0;
    padding: 24px clamp(18px, 4vw, 32px);
    border-radius: 16px;
    background: linear-gradient(135deg, var(--maroon), var(--deep-maroon));
    color: #fff6e3;
    text-align: center;
}

.katha-message .fa-om {
    margin-bottom: 8px;
    color: #ffe3a2;
    font-size: 1.6rem;
}

.katha-message p {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

/* Cards for the प्रसंग pages (partials/prasang-cards.php). */
.prasang-grid {
    display: grid;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 22px;
    list-style: none;
}

.prasang-grid-two {
    max-width: 760px;
    margin: 0 auto;
}

.prasang-card {
    display: flex;
    overflow: hidden;
    height: 100%;
    flex-direction: column;
    border: 1px solid rgba(177, 122, 37, 0.3);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(79, 29, 23, 0.1);
    color: inherit;
    text-decoration: none;
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.prasang-card:hover,
.prasang-card:focus-visible {
    box-shadow: 0 18px 34px rgba(79, 29, 23, 0.18);
    transform: translateY(-4px);
}

.prasang-card-art {
    display: block;
    overflow: hidden;
    background: #34130e;
    aspect-ratio: 4 / 3;
}

.prasang-card-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 22%;
    transition: transform 500ms ease;
}

.prasang-card:hover .prasang-card-art img {
    transform: scale(1.04);
}

.prasang-card-body {
    display: flex;
    padding: 18px 20px 20px;
    flex: 1;
    flex-direction: column;
}

.prasang-card-eyebrow {
    color: var(--gold-text);
    font-size: 0.85rem;
    font-weight: 700;
}

.prasang-card-title {
    margin: 2px 0 8px;
    color: var(--deep-maroon);
    font-size: 1.35rem;
    line-height: 1.5;
}

.prasang-card-text {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.75;
}

.prasang-card-link {
    display: inline-flex;
    margin-top: auto;
    padding-top: 14px;
    align-items: center;
    gap: 6px;
    color: var(--maroon);
    font-weight: 700;
}

/* प्रसंग page: breadcrumb, then the painting beside the name and facts. */
.crumbs ol {
    display: flex;
    margin: 0 0 22px;
    padding: 0;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.88rem;
    list-style: none;
}

.crumbs li + li::before {
    margin: 0 8px;
    color: var(--gold);
    content: "›";
}

.crumbs a {
    color: var(--maroon);
    text-decoration: none;
}

.crumbs a:hover {
    text-decoration: underline;
}

.prasang-hero-grid {
    display: grid;
    gap: clamp(24px, 4vw, 48px);
    align-items: center;
}

.prasang-facts {
    display: grid;
    margin: 24px 0 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.prasang-facts div {
    padding: 10px 14px;
    border: 1px solid rgba(177, 122, 37, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
}

.prasang-facts dt {
    color: var(--gold-text);
    font-size: 0.8rem;
    font-weight: 700;
}

.prasang-facts dd {
    margin: 0;
    color: var(--deep-maroon);
    font-weight: 600;
    line-height: 1.6;
}

.prasang-start {
    display: inline-flex;
    margin-top: 22px;
    padding: 10px 22px;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: var(--maroon);
    color: #ffe3a2;
    font-weight: 700;
    text-decoration: none;
    transition: background 180ms ease;
}

.prasang-start:hover {
    background: var(--deep-maroon);
}

@media (min-width: 860px) {
    .prasang-hero-grid {
        grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    }
}

@media (max-width: 359px) {
    .prasang-facts {
        grid-template-columns: 1fr;
    }
}

/* The story in numbered chapters down a gold line; a scene painting floats beside one of them. */
.prasang-story .prasang-story-inner {
    width: min(860px, 100%);
}

.adhyay-list {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.adhyay-list::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 21px;
    width: 2px;
    background: linear-gradient(180deg, var(--gold), rgba(177, 122, 37, 0.12));
    content: "";
}

.adhyay {
    position: relative;
    padding-left: 66px;
}

.adhyay::after {
    display: table;
    clear: both;
    content: "";
}

.adhyay + .adhyay {
    margin-top: clamp(34px, 5vw, 50px);
}

.adhyay-num {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--maroon), var(--deep-maroon));
    box-shadow: 0 0 0 5px var(--cream), 0 0 0 6px rgba(177, 122, 37, 0.45);
    color: #ffe3a2;
    font-size: 1.1rem;
    font-weight: 700;
}

.adhyay h2 {
    margin: 2px 0 12px;
    color: var(--deep-maroon);
    font-size: clamp(1.35rem, 3.2vw, 1.75rem);
    line-height: 1.5;
}

.adhyay p {
    margin: 0 0 14px;
    line-height: 1.95;
}

.adhyay a {
    color: var(--maroon);
    font-weight: 600;
    text-decoration-color: rgba(177, 122, 37, 0.55);
    text-underline-offset: 3px;
}

.adhyay-figure {
    margin: 4px 0 20px;
}

.adhyay-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 3px solid rgba(226, 192, 120, 0.95);
    border-radius: 14px;
    background: #34130e;
    box-shadow: 0 0 0 5px rgba(244, 209, 140, 0.22), 0 14px 28px rgba(79, 29, 23, 0.2);
}

.adhyay-figure figcaption {
    margin-top: 12px;
    color: var(--gold-text);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
}

@media (min-width: 700px) {
    .adhyay-figure {
        float: right;
        width: 280px;
        margin: 6px 0 16px 28px;
    }
}

@media (max-width: 540px) {
    .adhyay {
        padding-left: 52px;
    }

    .adhyay-list::before {
        left: 17px;
    }

    .adhyay-num {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

.prasang-seekh {
    margin: clamp(40px, 6vw, 60px) 0 0;
    padding: 28px clamp(20px, 4vw, 36px);
    border-radius: 18px;
    background: linear-gradient(135deg, var(--maroon), var(--deep-maroon));
    box-shadow: 0 16px 34px rgba(79, 29, 23, 0.25);
    color: #fff6e3;
    text-align: center;
}

.prasang-seekh > i {
    color: #ffe3a2;
    font-size: 1.6rem;
}

.prasang-seekh h2 {
    margin: 8px 0 10px;
    color: #ffe3a2;
    font-size: clamp(1.3rem, 3vw, 1.6rem);
}

.prasang-seekh p {
    margin: 0;
    color: rgba(255, 246, 227, 0.92);
    font-size: 1.02rem;
    line-height: 1.95;
}

/* Round arrow buttons of the leela carousel. */
.leela-nav {
    display: grid;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(177, 122, 37, 0.55);
    border-radius: 50%;
    background: var(--maroon);
    color: #f4d18c;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.leela-nav:hover {
    transform: scale(1.06);
    background: var(--deep-maroon);
}

/* The carousel does not loop: the arrow at the end it has reached goes dead. */
.leela-nav[aria-disabled="true"] {
    transform: none;
    background: var(--maroon);
    cursor: default;
    opacity: 0.35;
}

.leela-nav:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.leela-more {
    margin: 22px 0 0;
    text-align: center;
}

/* Leela timeline (Krishna Leela page): the carousel's pictures from first to last down a spine, each
   with its short story. A single rail on the left by default; from 761px up the spine runs down
   the middle, picture and story face each other across it and swap sides at every step. */
.leela-timeline {
    --marker: 42px; /* numbered circle sitting on the spine */
    --stem: 14px;   /* connector between the circle and the picture */
    position: relative;
    display: grid;
    gap: 36px;
    max-width: 940px;
    margin: 0 auto;
    padding: 0 0 0 calc(var(--marker) + var(--stem));
    counter-reset: leela;
    list-style: none;
}

.leela-timeline::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--marker) / 2 - 1px);
    width: 2px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(177, 122, 37, 0.65) 20px,
            rgba(177, 122, 37, 0.65) calc(100% - 60px),
            transparent);
    content: "";
}

.leela-timeline > li {
    position: relative;
    display: grid;
    gap: 14px;
    counter-increment: leela;
    scroll-margin-top: 20px;
}

.leela-timeline > li::before {
    position: absolute;
    top: 12px;
    right: calc(100% + var(--stem));
    z-index: 1;
    display: grid;
    box-sizing: border-box;
    width: var(--marker);
    height: var(--marker);
    place-items: center;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: var(--cream);
    color: var(--maroon);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    content: counter(leela);
}

.leela-timeline > li::after {
    position: absolute;
    top: calc(11px + var(--marker) / 2);
    right: 100%;
    width: var(--stem);
    height: 2px;
    background: rgba(177, 122, 37, 0.65);
    content: "";
}

/* The last step closes the story: a filled circle, like the closing day of the schedule. */
.leela-timeline > li:last-child::before {
    border-color: var(--gold-text);
    background: var(--gold-text);
    color: #fffaf0;
}

.leela-timeline .leela-card {
    width: 100%;
    max-width: 420px;
}

.leela-story h2 {
    margin: 0 0 4px;
    color: var(--deep-maroon);
    font-size: 1.35rem;
    line-height: 1.5;
}

.leela-story p {
    margin: 0;
    color: var(--ink);
}

@media (min-width: 761px) {
    .leela-timeline {
        --marker: 48px;
        --stem: 18px;
        gap: 48px;
        padding-left: 0;
    }

    .leela-timeline::before {
        left: calc(50% - 1px);
    }

    /* Two equal columns with the spine in the gap between them. */
    .leela-timeline > li {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0 calc(var(--marker) + 2 * var(--stem));
        align-items: center;
    }

    .leela-timeline > li::before {
        top: calc(50% - var(--marker) / 2);
        right: auto;
        left: calc(50% - var(--marker) / 2);
    }

    /* One line through the circle, reaching the picture on one side and the story on the other. */
    .leela-timeline > li::after {
        top: calc(50% - 1px);
        right: auto;
        left: calc(50% - var(--marker) / 2 - var(--stem));
        width: calc(var(--marker) + 2 * var(--stem));
    }

    .leela-timeline .leela-card {
        max-width: 380px;
        justify-self: end;
    }

    .leela-story {
        max-width: 400px;
    }

    .leela-timeline > li:nth-child(even) .leela-card {
        order: 2;
        justify-self: start;
    }

    .leela-timeline > li:nth-child(even) .leela-story {
        justify-self: end;
    }

    .leela-story h2 {
        margin-bottom: 8px;
        font-size: 1.7rem;
    }

    .leela-story p {
        font-size: 1.05rem;
    }
}

.closing-section {
    padding-top: 56px;
    padding-bottom: 56px;
    background: var(--deep-maroon);
    color: #fff6e3;
    text-align: center;
}

.closing-section h2 {
    margin: 0 0 8px;
    color: #ffe3a2;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.closing-section p {
    margin: 4px 0;
}

/* The आयोजक's picture, a square; a picture of any shape is cropped to it. */
.organizer-photo {
    display: block;
    width: clamp(150px, 44vw, 200px);
    height: auto;
    margin: 18px auto 0;
    border: 2px solid rgba(244, 209, 140, 0.85);
    border-radius: 14px;
    background: #f1dcae;
    box-shadow: 0 0 0 6px rgba(244, 209, 140, 0.14);
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center 20%;
}

/* A phone number to tap, on the dark sections: the आयोजक's on the invitation page and the
   प्रवक्ता's on the profile page. */
.contact-link {
    display: inline-flex;
    min-height: 44px;
    padding: 6px 20px;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(244, 209, 140, 0.55);
    border-radius: 999px;
    color: #ffe3a2;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease;
}

.contact-link:hover {
    background: rgba(244, 209, 140, 0.14);
}

.closing-section .contact {
    margin-top: 16px;
}

.closing-section .family {
    margin-top: 14px;
    color: #ffe3a2;
    font-weight: 700;
}

.closing-section .share-cta {
    max-width: 520px;
    margin: 28px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(244, 209, 140, 0.25);
}

.closing-section .share-cta p {
    margin: 0 0 14px;
    color: rgba(255, 246, 227, 0.85);
}

.music-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    display: grid;
    width: 52px;
    height: 52px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(244, 209, 140, 0.7);
    border-radius: 50%;
    background: var(--deep-maroon);
    box-shadow: 0 8px 22px rgba(40, 15, 8, 0.35);
    color: #f4d18c;
    cursor: pointer;
    transition: transform 160ms ease;
}

.music-toggle:hover {
    transform: scale(1.06);
}

.music-toggle .icon {
    width: 24px;
    height: 24px;
}

.music-toggle .icon-on,
.music-toggle.is-playing .icon-off {
    display: none;
}

.music-toggle.is-playing .icon-on {
    display: block;
}

.music-toggle.is-playing::after {
    position: absolute;
    inset: -1px;
    border: 1px solid rgba(244, 209, 140, 0.7);
    border-radius: 50%;
    animation: music-pulse 2.4s ease-out infinite;
    content: "";
}

@keyframes music-pulse {
    from {
        opacity: 0.9;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(1.5);
    }
}

.site-footer {
    padding: 14px 20px;
    background: #3e1712;
    color: rgba(255, 246, 227, 0.78);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.site-footer p + p {
    margin-top: 4px;
}

.site-footer a {
    color: #ffe3a2;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@supports (animation-timeline: view()) {

    .section-heading,
    .invitation-copy,
    .profile-copy,
    .profile-lead,
    .profile-stats li,
    .profile-article section,
    .profile-facts,
    .detail-card,
    .speaker-card,
    .schedule > li,
    .special-note,
    .leela,
    .leela-timeline > li,
    .closing-section .section-inner {
        animation: reveal-on-scroll linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 45%;
    }

    .event-details .detail-card:nth-child(2) {
        animation-range: entry 5% entry 50%;
    }

    .event-details .detail-card:nth-child(3) {
        animation-range: entry 10% entry 55%;
    }
}

@keyframes reveal-on-scroll {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    .event-details {
        grid-template-columns: 1fr;
        gap: 10px;
        max-width: 520px;
        margin-right: auto;
        margin-left: auto;
    }

    .detail-card {
        padding: 16px;
    }
}

@media (max-width: 540px) {
    html {
        scroll-padding-top: 20px;
    }

    .hero {
        min-height: 720px;
        min-height: 100svh;
        padding: 130px 20px 58px;
        background-position: center top;
    }

    .hero h1 br {
        display: none;
    }

    .page-bar {
        grid-template-columns: auto 1fr;
    }

    /* Sub-pages keep their bar fixed at the top; a jump to an anchor lands below it. */
    html:has(body.page-sub) {
        scroll-padding-top: 68px;
    }

    .page-bar-title {
        justify-self: end;
    }

    .section {
        padding-right: 18px;
        padding-left: 18px;
    }

    .schedule {
        --marker: 38px;
        --stem: 10px;
        gap: 12px;
    }

    .schedule > li {
        padding: 14px 16px;
    }
}

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {

    .button,
    .countdown,
    .share-cta,
    .music-toggle {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: 35mm 15mm;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .section,
    .closing-section,
    .site-footer {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* The link to the वंश वृक्ष, under the आयोजक's name on the invitation page. */
.closing-section .vansh-link {
    margin-top: 18px;
}

/* ---------------------------------------------------------------------------------------------
   वंश वृक्ष page: the family drawn as a banyan. Top to bottom: the canopy (शाखाएँ, the next
   generations), the trunk (तना, the root couple on a plaque), and the earth (जड़ें, the
   ancestors). The art is inline SVG in the view; the names come from app/Data/vansh.php.
   --------------------------------------------------------------------------------------------- */
.vansh-intro {
    padding-top: clamp(42px, 7vw, 72px);
    padding-bottom: clamp(24px, 4vw, 40px);
    background: linear-gradient(180deg, #fff8e9, #fbf1d9);
    text-align: center;
}

.vansh-intro .eyebrow {
    color: var(--gold-text);
}

.vansh-intro h1 {
    margin: 0 0 14px;
    color: var(--deep-maroon);
    font-size: clamp(2rem, 6vw, 3.2rem);
    line-height: 1.4;
}

.vansh-lead {
    max-width: 760px;
    margin: 0 auto;
    color: var(--muted);
    font-size: clamp(1rem, 2.4vw, 1.12rem);
}

.vansh-verse {
    margin: 18px 0 0;
    color: #2f6a35;
    font-weight: 700;
}

/* Shown while app/Data/vansh.php still holds sample names ('sample' => true). */
.vansh-sample {
    display: inline-flex;
    max-width: 640px;
    margin: 18px auto 0;
    padding: 8px 16px;
    align-items: baseline;
    gap: 8px;
    border: 1px dashed rgba(177, 122, 37, 0.6);
    border-radius: 12px;
    background: rgba(255, 243, 205, 0.8);
    color: var(--gold-text);
    font-size: 0.92rem;
}

/* Sky behind the tree, warm at the horizon. */
.vansh-tree-section {
    overflow: hidden;
    background: linear-gradient(180deg, #fbf1d9 0%, #f6e7c4 70%, #efd9a8 100%);
}

.vansh-tree {
    position: relative;
    width: min(1200px, 100%);
    margin: 0 auto;
}

/* A label for each part of the tree. */
.vansh-part {
    display: inline-flex;
    margin: 0 0 18px;
    padding: 6px 16px;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: rgba(255, 250, 238, 0.92);
    color: #2f5d34;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(30, 50, 25, 0.18);
}

.vansh-empty {
    max-width: 420px;
    margin: 0 auto;
    padding: 12px 18px;
    border: 1px dashed rgba(255, 246, 227, 0.7);
    border-radius: 14px;
    background: rgba(28, 52, 30, 0.55);
    color: #fff6e3;
    font-size: 0.95rem;
}

/* Canopy */
.vansh-canopy {
    position: relative;
    z-index: 1;
    display: flex;
    padding: clamp(100px, 15vw, 170px) 16px clamp(80px, 10vw, 130px);
    flex-direction: column;
    justify-content: center;
    text-align: center;
    /* The art's own shape (1200 x 560), so the whole crown shows on wide screens; on phones, or
       with many names, the box grows taller and the crown is cropped at the sides instead.
       (No min-height here: through the aspect ratio it would also force a minimum width.) */
    aspect-ratio: 1200 / 560;
}

.vansh-canopy-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.vansh-canopy-content {
    position: relative;
}

.vansh-branches {
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 22px clamp(14px, 2.4vw, 26px);
    list-style: none;
}

.vansh-branch {
    display: flex;
    width: min(240px, 100%);
    flex-direction: column;
    align-items: center;
}

/* Grandchildren grow as leaves above their parent's card, joined to it by a stem. */
.vansh-leaves {
    position: relative;
    display: flex;
    margin: 0 0 14px;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
}

.vansh-leaves::after {
    position: absolute;
    bottom: -14px;
    left: 50%;
    width: 3px;
    height: 14px;
    background: #6b4a2f;
    content: "";
}

.vansh-leaf {
    padding: 6px 14px;
    border: 1px solid #7fb35c;
    border-radius: 18px 4px 18px 4px;
    background: linear-gradient(135deg, #f3f9ea, #dcefc9);
    color: #234a28;
    font-weight: 700;
    line-height: 1.5;
    box-shadow: 0 4px 10px rgba(20, 45, 20, 0.25);
}

.vansh-leaf span,
.vansh-leaf small {
    display: block;
    color: #4f7d3c;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Phones: two branches side by side, so the crown stays compact instead of one tall column. */
@media (max-width: 559px) {
    .vansh-branches {
        gap: 18px 10px;
    }

    .vansh-branch {
        width: calc(50% - 5px);
    }

    .vansh-branch .vansh-card {
        padding: 10px 8px;
    }

    .vansh-leaves {
        gap: 6px;
    }

    .vansh-leaf {
        padding: 4px 9px;
        font-size: 0.86rem;
    }
}

.vansh-card {
    display: flex;
    width: 100%;
    padding: 14px 16px;
    flex-direction: column;
    gap: 2px;
    border: 2px solid rgba(226, 192, 120, 0.95);
    border-radius: 16px;
    background: linear-gradient(180deg, #fffaf0, #f8ecd1);
    color: var(--ink);
    text-align: center;
    box-shadow: 0 0 0 4px rgba(255, 250, 240, 0.35), 0 10px 22px rgba(25, 40, 20, 0.35);
}

.vansh-card strong {
    color: var(--deep-maroon);
    font-size: 1.08rem;
    line-height: 1.5;
}

.vansh-relation {
    color: var(--gold-text);
    font-size: 0.78rem;
    font-weight: 700;
}

.vansh-spouse {
    color: var(--maroon);
    font-size: 0.92rem;
}

.vansh-note {
    color: var(--muted);
    font-size: 0.82rem;
}

/* Trunk: the SVG sets the height; the root couple hangs on it as a name plaque. */
.vansh-trunk {
    position: relative;
    /* Tuck the tops of the limbs under the canopy's scalloped lower edge. */
    margin-top: calc(-1 * clamp(28px, 6vw, 72px));
}

/* Beyond 1200px the tree stops growing; carry the ground on to both edges of the screen. Its
   height matches the ground at the sides of the drawing (28 of its 480 units). */
@media (min-width: 1201px) {
    .vansh-trunk {
        z-index: 0;
    }

    .vansh-trunk::after {
        position: absolute;
        z-index: -1;
        right: calc(50% - 50vw);
        bottom: 0;
        left: calc(50% - 50vw);
        height: 28px;
        background: linear-gradient(180deg, #6b4c2e, #5d3f25);
        content: "";
    }
}

.vansh-trunk-art {
    display: block;
    width: 100%;
    height: auto;
}

.vansh-root-couple {
    position: relative;
    display: flex;
    width: min(320px, calc(100% - 32px));
    margin: -18px auto 24px;
    padding: 16px 18px 18px;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 3px solid #e2c078;
    border-radius: 22px;
    background: linear-gradient(180deg, #fffaf0, #f4e3bc);
    text-align: center;
    box-shadow: 0 0 0 6px rgba(107, 74, 47, 0.35), 0 16px 30px rgba(40, 22, 10, 0.4);
}

.vansh-root-couple .vansh-part {
    margin-bottom: 12px;
    background: #2f5d34;
    color: #fff6e3;
}

.vansh-photo {
    display: block;
    width: 112px;
    height: 112px;
    margin-bottom: 10px;
    border: 3px solid #e2c078;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 4px rgba(226, 192, 120, 0.3);
}

.vansh-root-couple strong {
    color: var(--deep-maroon);
    font-size: 1.2rem;
    line-height: 1.5;
}

@media (min-width: 760px) {
    /* On wide screens the plaque hangs on the trunk itself, above the kalawa. */
    .vansh-root-couple {
        position: absolute;
        top: 34%;
        left: 50%;
        margin: 0;
        transform: translate(-50%, -34%);
    }
}

/* Roots: dark earth, the ancestors and where the family is from. */
.vansh-roots {
    position: relative;
    margin: -1px calc(50% - 50vw) 0; /* the earth runs to both edges of the screen */
    padding: clamp(40px, 6vw, 64px) 16px clamp(48px, 7vw, 72px);
    background: linear-gradient(180deg, #5d3f25 0%, #47301c 45%, #33210f 100%);
    color: #fff6e3;
    text-align: center;
}

.vansh-roots-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.vansh-roots-content {
    position: relative;
}

.vansh-roots .vansh-part {
    background: rgba(255, 246, 227, 0.12);
    color: #f5d28f;
    box-shadow: none;
}

.vansh-roots .vansh-empty {
    border-color: rgba(245, 210, 143, 0.5);
    background: rgba(0, 0, 0, 0.2);
}

.vansh-ancestors {
    display: flex;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    list-style: none;
}

.vansh-card-root {
    width: min(260px, 100%);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.vansh-kul {
    display: flex;
    margin: 26px auto 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 28px;
}

.vansh-kul div {
    display: flex;
    gap: 8px;
}

.vansh-kul dt {
    color: #f5d28f;
    font-weight: 700;
}

.vansh-kul dt::after {
    content: ":";
}

.vansh-kul dd {
    margin: 0;
}

/* What the banyan stands for. */
.vansh-meaning {
    background: var(--cream);
}

.vansh-symbols {
    display: grid;
    max-width: 960px;
    margin: 0 auto;
    padding: 0;
    grid-template-columns: 1fr;
    gap: 16px;
    list-style: none;
}

.vansh-symbols li {
    padding: 22px 20px;
    border: 1px solid rgba(177, 122, 37, 0.25);
    border-radius: 16px;
    background: #fff;
    text-align: center;
    box-shadow: 0 8px 22px rgba(79, 29, 23, 0.06);
}

.vansh-symbols .fa-solid {
    color: #43803f;
    font-size: 1.8rem;
}

.vansh-symbols h3 {
    margin: 10px 0 6px;
    color: var(--deep-maroon);
    font-size: 1.25rem;
}

.vansh-symbols p {
    margin: 0;
    color: var(--ink);
}

@media (min-width: 700px) {
    .vansh-symbols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
