/*
Theme Name: Redbridge Vihara
Theme URI: https://redbridgebuddhistvihara.org
Author: Redbridge Buddhist Vihara
Description: Custom theme for Redbridge Buddhist Vihara — Sri Lankan Theravada, calm and editorial.
Version: 1.0
Requires PHP: 8.0
Text Domain: redbridge-vihara
*/

/* ============================================================
   Redbridge Buddhist Vihara — design system
   Sri Lankan Theravada · calm, accessible, editorial.
   Warm paper ground, quiet ink, one restrained gold accent, one
   temple-green accent. Edit the variables below to reskin the site.
   ============================================================ */

:root {
  --paper:   #f6f3ec;   /* warm cream base */
  --paper-2: #e8ecdd;   /* soft sage-green tint band */
  --ink:     #26231f;
  --head:    #223c2d;   /* deep green — headings carry a subtle green cast */
  --muted:   #64655b;
  --gold:    #c0812a;   /* warm Buddhist saffron-gold — brand marks & labels */
  --gold-d:  #7d5410;   /* darkened from #9a6414 2026-08-14 — original was ~4.48:1 on --paper, under WCAG AA's 4.5:1 for the small eyebrow-label text it's used on */
  --green:   #35624a;   /* calm temple green — the accent "touch" (links, rules, nav) */
  --green-d: #27503b;
  --maroon:  #6a2528;   /* deep monastic red — used sparingly for depth */
  --line:    #e3ddd0;
  --white:   #fffdf9;

  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1040px;
  --narrow: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.18; color: var(--head); margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 3.6rem); letter-spacing: .005em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1.15rem; }
a { color: var(--green-d); text-decoration: none; border-bottom: 1px solid rgba(39,80,59,.32); padding-bottom: 1px; transition: color .15s, border-color .15s; }
a:hover { color: var(--ink); border-color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: var(--narrow); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--tint { background: var(--paper-2); }
.center { text-align: center; }
.lead { font-size: 1.2rem; line-height: 1.7; color: var(--muted); }

.eyebrow { font-family: var(--sans); font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  font-size: .72rem; color: var(--gold-d); margin: 0 0 1rem; }
.rule { width: 54px; height: 2px; background: var(--green); border: 0; margin: 1.5rem auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 1000; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: .95rem; letter-spacing: .02em;
  padding: .75rem 1.75rem; border: 1px solid var(--ink); color: var(--ink); background: transparent;
  text-decoration: none; border-radius: 0; transition: background .18s, color .18s; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--light { border-color: #fff; color: #fff; }
.btn--light:hover { background: #fff; color: var(--ink); }

/* ---------- Header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--paper); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0;
  width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; border: 0; color: var(--ink);
  flex: 0 0 auto; white-space: nowrap; }
.brand__logo { width: 36px; height: 36px; flex: 0 0 auto; }
.brand__name { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; line-height: 1.1; white-space: nowrap; }
.brand__sub { display: block; font-family: var(--sans); font-size: .6rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold-d); }

.nav__links { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.nav__links li { position: relative; }
.nav__links a { display: block; padding: .45rem .55rem; border: 0; text-decoration: none; color: var(--muted);
  font-weight: 500; font-size: .88rem; white-space: nowrap; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ink); }
.nav__links a[aria-current="page"] { border-bottom: 2px solid var(--green); padding-bottom: calc(.45rem - 2px); }

/* Home icon (replaces the "Home" text label) */
.nav__links .menu-item-home > a { display: flex; align-items: center; padding: .45rem .6rem; }
.nav__home-icon { width: 19px; height: 19px; display: block; }

/* Submenu (e.g. Learn & Practice > Dhamma School / Sermons) */
.nav__links .menu-item-has-children > a::after { content: "\25BE"; font-size: .7em; margin-left: .35em; opacity: .65; }
.nav__links .sub-menu { list-style: none; margin: 0; padding: .35rem 0; position: absolute; top: 100%; left: 0;
  background: var(--paper); border: 1px solid var(--line); min-width: 190px; box-shadow: 0 10px 24px rgba(38,35,31,.1);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 150; }
.nav__links li:hover > .sub-menu, .nav__links li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__links .sub-menu a { padding: .65rem 1.1rem; white-space: nowrap; color: var(--muted); }
.nav__links .sub-menu a:hover { background: var(--paper-2); color: var(--ink); }

.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: .3rem; color: var(--ink); }
.nav__toggle svg { width: 26px; height: 26px; }

/* Below this width there isn't room for the nav items + brand on one line —
   switch to the mobile hamburger menu rather than let items wrap awkwardly. */
@media (max-width: 1000px) {
  .nav__toggle { display: inline-flex; }
  .nav__links { position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: .25rem 1.25rem 1rem; display: none;
    width: auto; }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .85rem .3rem; border-bottom: 1px solid var(--line); white-space: normal; }
  .nav__links a[aria-current="page"] { border-bottom: 1px solid var(--line); }

  /* Submenu just becomes a plain indented list — the whole nav is already a
     vertical dropdown, so no separate hover/open interaction is needed. */
  .nav__links .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; background: transparent; padding: 0 0 0 1rem; min-width: 0; }
  .nav__links .sub-menu a { padding: .7rem .3rem; }
  .nav__links .menu-item-has-children > a::after { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; text-align: center; background: #33251f; overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }

/* Per-photo crop focus — each hero shot frames its subject differently, so one
   blanket object-position crops the wrong one out (e.g. top-anchoring hides the
   statue in the ceiling-medallion shot, where it sits low in the frame). */
.hero__slide--1 { object-position: center 0%; }  /* monks + statue: pushed to top-anchored so the crop ends near the monks' shoulders, not their backs, keeping the statue fully visible */
.hero__slide--2 { object-position: center 78%; }  /* ceiling medallion: statue sits low in the frame */
.hero__slide--3 { object-position: center 25%; }  /* wide hall: statue + altar sit above the cushions */
/* Graduated scrim, not a flat wash — darkest in a soft pool behind the text
   (centred to match the ambient glow below), fading out toward the edges so
   each photo's own colour and light still show through at the corners. */
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 62% at 50% 46%,
    rgba(24,18,14,.62) 0%, rgba(24,18,14,.42) 45%, rgba(24,18,14,.14) 74%, transparent 90%);
}

/* Hero rotation — stacked slides crossfading; first slide is the no-JS/reduced-motion fallback */
.hero__slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity 1.8s ease;
}
.hero__slide.is-active { opacity: 1; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero__slide { transition: none; }
}

/* Ambient hero effects — barely-there glow + resonance ripples (gold + green) */
.hero__fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.hero__fx::before {           /* the slow "breathing" glow */
  content: ""; position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%) scale(1);
  width: min(92vw, 900px); aspect-ratio: 1; border-radius: 50%; filter: blur(8px);
  background: radial-gradient(circle,
    rgba(60,110,82,.30) 0%, rgba(205,150,70,.14) 46%, transparent 68%);
  animation: heroGlow 9s ease-in-out infinite alternate; will-change: transform, opacity;
}
.ripple {                     /* concentric rings that expand and fade */
  position: absolute; left: 50%; top: 46%; width: 300px; height: 300px; margin: -150px 0 0 -150px;
  border-radius: 50%; border: 1.5px solid rgba(60,110,82,.42); opacity: 0;
  animation: heroRipple 12s linear infinite; will-change: transform, opacity;
}
.ripple:nth-child(2) { border-color: rgba(205,150,70,.26); animation-delay: 4s; }
.ripple:nth-child(3) { border-color: rgba(60,110,82,.34); animation-delay: 8s; }
@keyframes heroGlow {
  from { opacity: .55; transform: translate(-50%,-50%) scale(.9); }
  to   { opacity: 1;   transform: translate(-50%,-50%) scale(1.1); }
}
@keyframes heroRipple {
  0%   { transform: scale(.35); opacity: 0; }
  12%  { opacity: .85; }
  100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__fx::before { animation: none; opacity: .85; }
  .ripple { animation: none; opacity: .3; }
  .ripple:nth-child(1) { transform: scale(1); }
  .ripple:nth-child(2) { transform: scale(1.7); }
  .ripple:nth-child(3) { transform: scale(2.3); }
}

.hero__inner { position: relative; z-index: 2; padding: clamp(5rem, 15vw, 10rem) 0; }
.hero .eyebrow { color: #e6c48c; }  /* warm gold, brand-matched — was a one-off inline style */
.hero h1 { color: #f8f1e2; }  /* soft warm ivory, not stark white */
.hero p { font-size: 1.2rem; color: #ede2cc; max-width: 44ch; margin: 1rem auto 0; }
.hero .rule { background: rgba(230,196,140,.75); }
.hero__cta { margin-top: 2.25rem; display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Blocks ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.75rem, 5vw, 4rem); align-items: center; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.verse { font-family: var(--serif); font-size: clamp(1.4rem, 3.2vw, 2rem); line-height: 1.4; color: var(--head);
  font-style: italic; max-width: 30ch; }
.feature h3 { margin-bottom: .35em; }
.feature p { color: var(--muted); }

/* Times — minimal ruled list */
.times { width: 100%; border-collapse: collapse; }
.times caption { text-align: left; font-family: var(--serif); font-size: 1.3rem; margin-bottom: .6rem; color: var(--head); }
.times td { padding: .85rem .2rem; border-bottom: 1px solid var(--line); }
.times tr:last-child td { border-bottom: 0; }
.times td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }

/* What's happening cards */
.happenings { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin-top: 2.5rem; text-align: left; }
.hcard { background: var(--white); border: 1px solid var(--line); padding: 1.5rem; }
.hcard .date { font-family: var(--sans); font-weight: 600; font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold-d); margin: 0 0 .4rem; }
.hcard h3 { font-size: 1.25rem; margin-bottom: .35rem; }
.hcard p { color: var(--muted); margin-bottom: .6rem; }

/* Placeholder box for missing imagery */
.ph { display: grid; place-items: center; background: var(--paper-2); color: var(--muted); border: 1px solid var(--line);
  min-height: 260px; font-style: italic; text-align: center; padding: 1rem; }

.split img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; border: 1px solid var(--line); }

/* Contact page: a small uncropped wayfinding photo under the map, not stretched
   to the split's height like .split img above (needs to out-specificity it). */
.split img.contact-photo { display: block; width: 100%; max-width: 280px; height: auto; min-height: 0;
  margin-top: 1.25rem; border: 1px solid var(--line); }
@media (max-width: 760px) { .split img.contact-photo { margin-inline: auto; } }

/* ---------- Footer ---------- */
.site-footer { background: #1f382a; color: #c7d1bc; padding: 3.75rem 0 1.75rem; }
.footer__top { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 720px) { .footer__top { grid-template-columns: 1fr; gap: 2rem; } }
.footer__brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer__mark { width: 46px; height: 46px; flex: 0 0 auto; }
.footer__name { font-family: var(--serif); font-size: 1.4rem; color: #fff; margin: 0 0 .4rem; line-height: 1.15; }
.footer__tag { color: #9fac93; max-width: 36ch; margin: 0 0 .7rem; font-size: .95rem; }
.footer__visit h3 { font-family: var(--serif); color: #fff; font-size: 1.25rem; margin: 0 0 .6rem; }
.footer__visit p { color: #c7d1bc; margin: 0 0 .6rem; line-height: 1.65; }
.footer__visit strong { color: #fff; font-weight: 600; }
.site-footer a { color: #d8b25a; border-bottom: 1px solid rgba(216,178,90,.35); }
.site-footer a:hover { color: #fff; border-color: #fff; }
.footer__bar { border-top: 1px solid rgba(255,255,255,.13); margin-top: 2.75rem; padding-top: 1.5rem; text-align: center; }
.footer__legal { color: #8b9781; font-size: .8rem; margin: 0; }

.stack > * + * { margin-top: 1rem; }

/* ---------- Interior-page header ---------- */
.page-head { background: var(--paper-2); text-align: center; padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.page-head .lead { margin-inline: auto; }

/* Photo variant — stays on the site's normal tinted band (like every other
   page-head) but adds a generously sized, fully visible portrait photo next
   to the text, same trusted .split pattern as History's "Our Teacher"
   section. No forced aspect-ratio/object-fit — the image renders at its own
   natural proportions (portrait or landscape), so nothing gets cropped off. */
.page-head--photo { text-align: left; }
.page-head--photo .page-head__split { align-items: center; }
.page-head--photo .page-head__text .lead { margin-inline: 0; }
.page-head--photo .page-head__media img {
  display: block; width: 100%; height: auto; border: none; background: transparent;
}
@media (max-width: 760px) {
  .page-head--photo .page-head__split { grid-template-columns: 1fr; }
  .page-head--photo .page-head__media { max-width: 340px; margin-inline: auto; }
  .page-head--photo .page-head__text { text-align: center; margin-top: 1.5rem; }
  .page-head--photo .page-head__text .lead { margin-inline: auto; }
}

/* Banner variant — full-width, full-length photo (natural proportions, no
   crop) above the heading, instead of a half-width side-by-side card. */
.page-head--banner { text-align: center; }
.page-head__banner { display: block; width: 100%; height: auto; margin-bottom: clamp(2rem, 5vw, 3rem); border: 1px solid var(--line); }

/* ---------- Timeline (History milestones + Programmes) ---------- */
.timeline { position: relative; max-width: 640px; margin: 2.5rem auto 0; }
.tl-item { position: relative; padding: 0 0 2.25rem 2.5rem; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: .5rem; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: .3rem; width: 15px; height: 15px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--paper-2); box-sizing: border-box; }
.tl-item:nth-child(even) .tl-dot { background: var(--green); }
.tl-year { font-family: var(--sans); font-weight: 700; letter-spacing: .1em; font-size: .78rem;
  text-transform: uppercase; color: var(--gold-d); margin: 0 0 .2rem; }
.tl-item h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.tl-item p { color: var(--muted); margin: 0; }

/* ---------- Gallery grid (History photos + Gallery page) ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.gallery .ph { min-height: 160px; }

/* ---------- Gallery page: event albums + lightbox ---------- */
.album { margin-top: 3.5rem; }
.album:first-child { margin-top: 2.5rem; }
.album__head { text-align: center; max-width: 640px; margin: 0 auto 1.75rem; }
.album-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
@media (max-width: 860px) { .album-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .album-grid { grid-template-columns: 1fr; } }

.gallery__item { position: relative; display: block; aspect-ratio: 4/3; overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 0; cursor: pointer;
  transition: transform .18s, box-shadow .18s; }
.gallery__item:hover, .gallery__item:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(38,35,31,.12); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__item.is-placeholder { display: grid; place-items: center; color: var(--muted); font-style: italic;
  font-size: .9rem; text-align: center; padding: 1rem; cursor: default; }
.gallery__item.is-placeholder:hover, .gallery__item.is-placeholder:focus-visible { transform: none; box-shadow: none; }
.gallery__item.is-placeholder img { display: none; }
.gallery__item.is-placeholder::after { content: "Photo coming soon"; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; background: rgba(20,17,14,.92);
  align-items: center; justify-content: center; padding: 2rem; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 84vh; width: auto; height: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox__close, .lightbox__prev, .lightbox__next { position: absolute; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.3); color: #fff; cursor: pointer; width: 44px; height: 44px;
  border-radius: 50%; display: grid; place-items: center; transition: background .15s; }
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,.2); }
.lightbox__close { top: 1.25rem; right: 1.25rem; }
.lightbox__prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox__caption { position: absolute; left: 0; right: 0; bottom: 1.25rem; text-align: center; color: #e9e4d8; font-size: .9rem; }
@media (max-width: 640px) {
  .lightbox__prev, .lightbox__next { width: 38px; height: 38px; }
  .lightbox__close { top: .6rem; right: .6rem; }
}

/* ---------- Gallery archive cards (collapsed past/other events) ---------- */
.archive-cards { max-width: 760px; margin: 2.5rem auto 0; display: flex; flex-direction: column; gap: .75rem; }
.archive-card { background: var(--white); border: 1px solid var(--line); }
.archive-card summary { list-style: none; cursor: pointer; padding: 1.1rem 1.4rem; font-family: var(--serif);
  font-size: 1.15rem; color: var(--head); display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; }
.archive-card summary::-webkit-details-marker { display: none; }
.archive-card summary::after { content: "+"; font-family: var(--sans); font-size: 1.4rem; font-weight: 400;
  color: var(--gold-d); line-height: 1; transition: transform .18s; }
.archive-card[open] summary::after { content: "\2212"; }
.archive-card summary:hover { color: var(--ink); }
.archive-card summary:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.archive-card .album-grid { padding: 0 1.4rem 1.4rem; }

/* ---------- Learn & Practice: sermon video embeds ---------- */
.videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
@media (max-width: 760px) { .videos { grid-template-columns: 1fr; } }
.video-slot { aspect-ratio: 16/9; background: var(--paper-2); border: 1px solid var(--line); overflow: hidden; position: relative; }
.video-slot iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-slot.is-placeholder { display: grid; place-items: center; color: var(--muted); font-style: italic;
  font-size: .9rem; text-align: center; padding: 1rem; }
.video-slot.is-placeholder::before { content: "\25B6"; display: block; font-size: 1.6rem; color: var(--gold-d);
  margin-bottom: .5rem; font-style: normal; }

/* ---------- Names line (founders) ---------- */
.names { font-family: var(--serif); font-size: 1.3rem; color: var(--head); line-height: 1.7; }

/* ---------- News & Events (interactive feed) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 0 0 2.75rem; }
.filter { font-family: var(--sans); font-weight: 600; font-size: .9rem; padding: .42rem 1.15rem;
  border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s; }
.filter:hover { color: var(--ink); }
.filter.is-active { background: var(--green); color: #fff; border-color: var(--green); }
.feed { max-width: 720px; margin: 0 auto; }
.item { display: grid; grid-template-columns: 92px 1fr; gap: 1.25rem; padding: 1.6rem 0; border-bottom: 1px solid var(--line); }
.item:first-child { padding-top: 0; }
@media (max-width: 560px) { .item { grid-template-columns: 1fr; gap: .35rem; } }
.item__date { font-family: var(--serif); color: var(--head); line-height: 1.05; }
.item__date .d { font-size: 1.7rem; display: block; }
.item__date .m { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.item__tag { display: inline-block; font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 4px; margin: 0 .4rem .5rem 0; }
.tag--event { background: rgba(53,98,74,.14); color: var(--green-d); }
.tag--news { background: rgba(192,129,42,.18); color: var(--gold-d); }
.tag--upcoming { background: var(--green); color: #fff; }
.item h3 { margin: .1rem 0 .35rem; font-size: 1.25rem; }
.item__excerpt { color: var(--muted); margin: 0; }
.item__more { background: none; border: 0; color: var(--green-d); font-weight: 600; font-size: .95rem;
  cursor: pointer; padding: 0; margin-top: .55rem; border-bottom: 1px solid rgba(39,80,59,.35); }
.item__more:hover { color: var(--ink); border-color: var(--ink); }
.item__body { display: none; margin-top: .7rem; color: var(--ink); }
.item.is-open .item__body { display: block; }
.feed__more { text-align: center; margin-top: 2.25rem; }
.feed__empty { text-align: center; color: var(--muted); padding: 2rem 0; font-style: italic; }

/* ---------- Programmes: annual programme table ---------- */
.prog { width: 100%; border-collapse: collapse; margin-top: 2rem; }
.prog th { text-align: left; font-family: var(--sans); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-d); padding: .6rem .5rem; border-bottom: 2px solid var(--line); }
.prog td { padding: .85rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prog tr:hover td { background: rgba(53,98,74,.05); }
.prog td:first-child { white-space: nowrap; color: var(--head); font-weight: 600; padding-right: 1.5rem; width: 1%; }
.prog .fest { display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; background: var(--green); color: #fff; padding: .12rem .5rem; border-radius: 4px;
  margin-left: .5rem; vertical-align: middle; }
.prog .sub { display: block; color: var(--muted); font-size: .9rem; margin-top: .15rem; }

/* Sinhala text (bilingual content) */
.si { display: block; font-family: "Noto Sans Sinhala", "Iskoola Pota", "Nirmala UI", var(--sans);
  font-size: .95rem; color: var(--muted); margin-top: .25rem; line-height: 1.6; }

/* ---------- WordPress core alignment/caption support ---------- */
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 0 auto 1rem; }
.wp-caption-text { color: var(--muted); font-size: .85rem; text-align: center; }
.screen-reader-text { position: absolute; left: -9999px; }

/* History: newspaper photos from the opening day */
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2rem; }
.figs figure { margin: 0; }
.figs img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.figs figcaption { margin-top: .5rem; font-size: .9rem; color: var(--muted, #5b6b66); }
.source { margin-top: 1.25rem; font-size: .85rem; font-style: normal; text-align: center; opacity: .8; }
@media (max-width: 760px) { .figs { grid-template-columns: 1fr; } }

.gallery .hist-photo { width: 100%; height: 100%; min-height: 160px; aspect-ratio: 4/3; object-fit: cover; display: block; border: 1px solid var(--line); }

/* Page head with a soft illustrated background (Bodhi leaves); text stays centred on the clear middle */
.page-head--bg { background: var(--paper-2) url("assets/page-head-bodhi.svg") center / cover no-repeat; }

/* Photo page heads: same treatment as the homepage hero (photo, graduated radial scrim,
   ivory/gold type, ambient glow + ripples via .hero__fx, light outline buttons). */
.page-head--photobg { position: relative; overflow: hidden; color: #fff; background: #33251f center / cover no-repeat; padding: clamp(4.5rem, 12vw, 8rem) 0; }
.page-head--photobg::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 62% at 50% 46%,
    rgba(24,18,14,.62) 0%, rgba(24,18,14,.42) 45%, rgba(24,18,14,.14) 74%, transparent 90%);
}
.page-head--photobg > .wrap { position: relative; z-index: 2; }
.page-head--photobg .eyebrow { color: #e6c48c; }
.page-head--photobg h1 { color: #f8f1e2; }
.page-head--photobg .lead { font-size: 1.2rem; color: #ede2cc; max-width: 44ch; margin: 1rem auto 0; }
.page-head--photobg .rule { background: rgba(230,196,140,.75); border-color: rgba(230,196,140,.75); }
.page-head--visit  { background-image: url("assets/visit-hero-leaves.jpg"); }
.page-head--dhamma { background-image: url("assets/dhamma-hero-manuscript.jpg"); }
.page-head--temple { background-image: url("assets/temple-life-hero-statue.jpg"); background-position: 15% 40%; }
.page-head--about { background-image: url("assets/about-hero-buddha-candle.jpg"); background-position: 0% 50%; }
.page-head--photobg .verse { color: #e6c48c; }

/* Falling petals and flowers (js/petals.js) — replaces the expanding ripples in every hero */
.hero__fx .ripple { display: none; }
.petal { position: absolute; top: -40px; background: center / contain no-repeat; will-change: transform;
  animation: petalFall linear infinite; }
@keyframes petalFall {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(var(--sway), 50vh, 0) rotate(calc(var(--spin) / 2)); }
  100% { transform: translate3d(calc(var(--sway) * -.4), 105vh, 0) rotate(var(--spin)); }
}

/* Featured upcoming event (poster + schedule) */
.feature-event { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; margin-top: 2.5rem; background: var(--white); border: 1px solid var(--line); padding: clamp(1.25rem, 3vw, 2rem); }
.feature-event__poster img { width: 100%; height: auto; display: block; border: 1px solid var(--line); }
.feature-event__body h3 { margin-top: .2rem; }
.feature-event__when { font-family: var(--serif); font-size: 1.35rem; color: var(--maroon); margin: .2rem 0 .8rem; }
.feature-event .times td:first-child { white-space: nowrap; font-weight: 600; width: 5rem; }
.feature-event .times td:last-child { text-align: left; font-weight: 400; white-space: normal; }
@media (max-width: 760px) { .feature-event { grid-template-columns: 1fr; } }
