/* ============================================================
   Regnum musicale — editorial redesign
   Ivory + deep burgundy. Judson display, Inter UI/body.
   ============================================================ */

:root {
  --bg:           #F4EFE3;   /* warm ivory */
  --bg-alt:       #EBE3D1;   /* deeper ivory band */
  --paper:        #FAF6EC;   /* paler ivory for cards */
  --ink:          #1B1410;   /* near-black with brown */
  --ink-soft:     #5B4F44;   /* muted brown for body */
  --ink-mute:     #8A7E70;   /* labels, captions */
  --burgundy:     #6B1F2A;   /* primary accent — deep wine */
  --burgundy-d:   #4A1419;
  --gold:         #B08D57;   /* secondary accent — brass */
  --line:         #D8CDB3;   /* warm hairline */
  --line-soft:    #E5DCC6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  /* Ivory page with soft out-of-focus white/brass lights behind it. */
  background: var(--bg) url('/img/backdrop.svg') no-repeat center / cover fixed;
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--burgundy); color: var(--paper); }

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

a { color: inherit; text-decoration: none; }

/* ---------- Typography ---------- */

.font-display {
  font-family: 'Judson', 'EB Garamond', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.06;
}

.font-display-it {
  font-family: 'Judson', Georgia, serif;
  font-style: italic;
  font-weight: 400;
}

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.eyebrow-burgundy { color: var(--burgundy); }

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

.rule-burgundy {
  height: 2px;
  width: 40px;
  background: var(--burgundy);
  border: 0;
  margin: 0;
}

.lead {
  font-family: 'Judson', Georgia, serif;
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1.5;
  color: var(--ink);
}

.prose p {
  margin: 0 0 1.1em;
  color: var(--ink-soft);
}
.prose p:last-child { margin-bottom: 0; }
.prose h2, .prose h3 {
  font-family: 'Judson', Georgia, serif;
  font-weight: 700;
  color: var(--ink);
  margin: 2em 0 0.6em;
  letter-spacing: -0.01em;
}
.prose h2 { font-size: 32px; }
.prose h3 { font-size: 24px; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 0 0 0 1.4em;
  border-left: 2px solid var(--burgundy);
  font-family: 'Judson', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
}
.prose ul { padding-left: 1.2em; color: var(--ink-soft); }
.prose a {
  color: var(--burgundy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--burgundy-d); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,239,227, 0.88);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(244,239,227, 0.96);
}
.site-header .wordmark {
  font-family: 'Judson', Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--burgundy); }
.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--burgundy);
}
.lang-switch a {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
}
.lang-switch a.is-active { color: var(--burgundy); }
.lang-switch span { color: var(--line); margin: 0 6px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #15110d;
}
.hero img.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.78) contrast(1.02) saturate(0.92);
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,15,12,0.35) 0%, rgba(20,15,12,0) 30%, rgba(20,15,12,0) 55%, rgba(20,15,12,0.78) 100%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; color: #F4EFE3; }
.hero h1 {
  font-family: 'Judson', Georgia, serif;
  font-weight: 400;
  font-size: clamp(56px, 9vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero h1 em { font-style: italic; color: #E6C58C; }

/* ---------- Sub-hero (smaller pages) ---------- */
.subhero {
  padding: 96px 0 32px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: background .2s, color .2s, border-color .2s;
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-burgundy { border-color: var(--burgundy); color: var(--burgundy); }
.btn-burgundy:hover { background: var(--burgundy); color: var(--paper); }
.btn-light { border-color: rgba(244,239,227,0.6); color: var(--paper); }
.btn-light:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.linklike {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy);
  display: inline-flex; align-items: center; gap: 10px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
}
.linklike:hover { color: var(--burgundy-d); }

/* ---------- Member cards ---------- */
.member-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 64px;
  align-items: start;
}
@media (max-width: 700px) {
  .member-grid { grid-template-columns: 1fr; }
}
.member {
  position: relative;
  overflow: hidden;
  background: #2a201a;
}
.member img {
  display: block;
  width: 100%; height: auto;
  filter: grayscale(20%) brightness(0.95);
  transition: transform .8s ease, filter .8s;
}
.member:hover img { transform: scale(1.04); filter: grayscale(0%) brightness(1); }
.member-tag {
  position: absolute; left: 18px; bottom: 18px; right: 18px;
  color: #F4EFE3;
  z-index: 2;
}
.member::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 50%);
  z-index: 1;
}
.member-tag h3 {
  font-family: 'Judson', Georgia, serif;
  font-size: 26px;
  margin: 0 0 2px;
  line-height: 1.05;
}
.member-tag .ins { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(244,239,227,0.78); }

/* ---------- Concert item / timeline ---------- */
.concert-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 32px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.concert-row:hover { background: rgba(176,141,87,0.06); }
.concert-row .date {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.concert-row .date strong {
  display: block;
  color: var(--burgundy);
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.concert-row h3 {
  font-family: 'Judson', Georgia, serif;
  font-size: 28px;
  margin: 0 0 4px;
  line-height: 1.15;
  color: var(--ink);
}
.concert-row .venue {
  font-size: 14px;
  color: var(--ink-soft);
}
.concert-row .arrow {
  font-family: 'Judson', Georgia, serif;
  font-size: 26px;
  color: var(--ink-mute);
  transition: transform .25s, color .25s;
}
.concert-row:hover .arrow { transform: translateX(6px); color: var(--burgundy); }

/* Concert rows rendered as links should not look like default anchors. */

/* ---------- Memories card ---------- */
.memory-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.memory-card .thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
}
.memory-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.memory-card:hover .thumb img { transform: scale(1.04); }
.memory-card h3 {
  font-family: 'Judson', Georgia, serif;
  font-size: 32px;
  line-height: 1.12;
  margin: 0 0 8px;
  color: var(--ink);
}
.memory-card h3 a:hover { color: var(--burgundy); }
.memory-card .excerpt { color: var(--ink-soft); font-size: 16px; margin: 0 0 14px; }

/* ---------- Masonry gallery ---------- */
.gallery {
  column-count: 4;
  column-gap: 20px;
}
@media (max-width: 1100px) { .gallery { column-count: 3; column-gap: 18px; } }
@media (max-width: 720px)  { .gallery { column-count: 1; display: flex; flex-direction: column; gap: 10px; } }
.gallery .item {
  display: block;
  margin: 0 0 20px;
  break-inside: avoid;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  background: #2a201a;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(15,12,9,0.10);
  transition: box-shadow .35s ease, transform .35s ease;
}
@media (max-width: 720px) { .gallery .item { margin-bottom: 0; } }
.gallery .item img {
  width: 100%;
  display: block;
  border-radius: 4px;
  transition: transform .7s ease, filter .4s ease, opacity .3s;
  opacity: 0.96;
}
/* Hover: the photo leans in, warms up, and lifts off the band. */
.gallery .item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(27,20,16,0.5) 0%, rgba(27,20,16,0) 60%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.gallery .item:hover {
  box-shadow: 0 16px 36px rgba(15,12,9,0.26);
  transform: translateY(-3px);
}
.gallery .item:hover img {
  transform: scale(1.06);
  filter: brightness(1.04) saturate(1.06);
  opacity: 1;
}
.gallery .item:hover::after { opacity: 1; }
.gallery .item:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }

.gallery-band { padding: 64px 24px; }
@media (max-width: 720px) { .gallery-band { padding: 32px 12px; } }

@media (prefers-reduced-motion: reduce) {
  .gallery .item, .gallery .item img { transition: none; }
  .gallery .item:hover { transform: none; }
  .gallery .item:hover img { transform: none; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(15,12,9,0.94);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 32px;
}
.lightbox.is-open { display: flex; }
.lightbox .lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw; max-height: 88vh;
}
.lightbox img {
  max-width: 92vw; max-height: 80vh;
  box-shadow: 0 40px 120px rgba(0,0,0,0.5);
}
.lightbox .lb-caption {
  margin-top: 12px;
  max-width: 92vw;
  color: rgba(244,239,227,0.85);
  font-family: 'Judson', Georgia, serif;
  font-size: 16px;
  text-align: center;
  line-height: 1.4;
}
.lightbox .lb-caption:empty { display: none; }
.lightbox .lb-close,
.lightbox .lb-prev,
.lightbox .lb-next {
  position: absolute;
  background: transparent;
  border: 1px solid rgba(244,239,227,0.4);
  color: #F4EFE3;
  width: 48px; height: 48px;
  cursor: pointer;
  font-family: 'Judson', Georgia, serif;
  font-size: 22px;
  transition: background .2s, border-color .2s;
}
.lightbox button:hover { background: rgba(244,239,227,0.12); border-color: rgba(244,239,227,0.8); }
.lightbox .lb-close { top: 24px; right: 24px; }
.lightbox .lb-prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.lightbox .lb-next  { right: 24px; top: 50%; transform: translateY(-50%); }

/* ---------- Mobile drawer ---------- */
.drawer {
  position: fixed; inset: 0;
  background: var(--ink);
  color: var(--paper);
  z-index: 60;
  transform: translateY(-100%);
  transition: transform .35s ease;
  padding: 80px 32px 32px;
  display: none;
}
.drawer.is-open { transform: translateY(0); }
.drawer a {
  display: block;
  font-family: 'Judson', Georgia, serif;
  font-size: 38px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(244,239,227,0.12);
  color: var(--paper);
}
@media (max-width: 860px) { .drawer { display: block; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(244,239,227,0.78);
  padding: 80px 0 32px;
  margin-top: 120px;
}
.site-footer a { color: rgba(244,239,227,0.9); }
.site-footer a:hover { color: #E6C58C; }
/* ---------- Misc ---------- */
.divider-ornament {
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-family: 'Judson', Georgia, serif;
  font-size: 22px;
  gap: 16px;
}
.divider-ornament::before,
.divider-ornament::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: var(--line);
}

/* ---------- Layout helpers (replace Tailwind utilities from preview.html) ---------- */

.header-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 0 24px; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
@media (min-width: 1024px) { .header-inner { padding: 0 40px; } }

.desktop-nav { display: none; align-items: center; gap: 36px; }
@media (min-width: 768px) { .desktop-nav { display: flex; } }

.header-actions { display: flex; align-items: center; gap: 20px; }

.drawer-toggle { display: flex; padding: 8px; background: none; border: none; cursor: pointer; color: var(--ink); }
@media (min-width: 768px) { .drawer-toggle { display: none; } }

.footer-inner { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .footer-inner { padding: 0 40px; } }

.footer-top { display: grid; gap: 48px; padding-bottom: 64px; }
@media (min-width: 1024px) { .footer-top { grid-template-columns: 1fr 1fr; } }

.footer-nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; font-size: 14px; }

.footer-eyebrow { color: rgba(244,239,227,0.6); }
.footer-contact { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 32px; }
.footer-contact a { color: rgba(244,239,227,0.85); }
.footer-contact a:hover { color: #E6C58C; }

.footer-rule { background: rgba(244,239,227,0.15); margin: 0; border: 0; height: 1px; }

.footer-bottom {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px 0; font-size: 12px; color: rgba(244,239,227,0.55);
}
@media (min-width: 768px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li + li { margin-top: 8px; }
.text-gold { color: var(--gold); }

/* ---------- Inner page container ---------- */
.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px 24px;
}
@media (max-width: 720px) { .page-shell { padding: 40px 16px; } }

/* ---------- Event page ---------- */
.event-page { max-width: 1000px; }
.event-title {
  font-size: clamp(32px, 5vw, 48px);
  margin: 8px 0 12px;
}
.event-date {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 40px;
}
.event-time { color: var(--burgundy); font-weight: 600; }

.event-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 800px) {
  .event-layout { grid-template-columns: 1fr; gap: 32px; }
}

.event-sidebar { display: flex; flex-direction: column; gap: 20px; }
.event-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
}
.event-card-title {
  font-family: 'Judson', Georgia, serif;
  font-size: 20px;
  margin-top: 8px;
  color: var(--ink);
}
.event-card-note {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 8px;
}
.event-card-text {
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.event-card-link { margin-top: 16px; }

.performer-list, .programme-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.performer-list li {
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}
.performer-list li:first-child { border-top: none; padding-top: 8px; }
.performer-name { color: var(--ink); }
.performer-role {
  color: var(--ink-mute);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
}

/* ---------- Bootstrap compat inside legacy content areas ---------- */
.legacy-content a { color: #337ab7; }
.legacy-content a:hover { color: #23527c; text-decoration: underline; }

/* ---------- Sitemap page ---------- */
.sitemap-page {
  max-width: 900px;
  margin: 60px auto 80px;
  padding: 0 24px;
}
@media (max-width: 720px) { .sitemap-page { padding: 0 16px; } }
.sitemap-group { margin-top: 40px; }
.sitemap-group h2 {
  font-family: 'Judson', Georgia, serif;
  font-size: 22px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.sitemap-list { list-style: none; padding: 0; margin: 0; }
.sitemap-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.sitemap-new {
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
}
.sitemap-new:hover { color: var(--burgundy); text-decoration: underline; }
.sitemap-old {
  flex: none;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  white-space: nowrap;
}
.sitemap-old:hover { color: var(--gold); }

/* ---------- Legacy content: typography and calls to action ---------- */
/* .page-shell supplies the margins; this is what goes inside it. */
.legacy-content > *:first-child { margin-top: 0; }

.legacy-content h1,
.legacy-content h2,
.legacy-content h3 {
  font-family: 'Judson', 'EB Garamond', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 48px 0 16px;
}
.legacy-content h1 { font-size: clamp(34px, 5vw, 52px); }
.legacy-content h2 { font-size: clamp(26px, 3.4vw, 36px); }
.legacy-content h3 { font-size: 22px; }

/* A paragraph that is nothing but a link reads as a call to action, so give
   it a button. Image links (a wrapping only an <img>) keep their own look. */
.legacy-content p > a:only-child:not(:has(img)) {
  display: inline-block;
  margin: 8px 0;
  padding: 13px 26px;
  background: var(--burgundy);
  border: 1px solid var(--burgundy);
  color: var(--paper);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background .25s ease, color .25s ease;
}
.legacy-content p > a:only-child:not(:has(img)):hover {
  background: transparent;
  color: var(--burgundy);
  text-decoration: none;
}
.legacy-content p > a:only-child:not(:has(img)):focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 3px;
}

/* ---------- Card grid (concerts, memories) ---------- */

.index-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px 24px 24px;
}
@media (min-width: 1024px) { .index-page { padding: 80px 40px 24px; } }

.index-title {
  font-family: 'Judson', 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 16px 0 0;
}
.index-intro { max-width: 620px; margin: 20px 0 48px; color: var(--ink-soft); }

.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px)  { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tile-grid { grid-template-columns: repeat(4, 1fr); } }

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--ink);
  border: 1px solid var(--line);
  isolation: isolate;
  transition: transform .35s ease, box-shadow .35s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(27,20,16,0.18); }
.tile:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }

/* Cover photo — darkened and gently scaled on hover. Concerts with no photo
   fall back to the blurred placeholder, the page backdrop taken into the dark. */
.tile__media {
  position: absolute;
  inset: 0;
  background-image: var(--cover, url('/img/tile-placeholder.svg'));
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform .7s ease;
}
.tile:hover .tile__media { transform: scale(1.07); }

/* Rotate the placeholder a little so a run of them does not read as a repeat. */
.tile:not(.has-cover):nth-child(2n) .tile__media { transform: scale(1.02) rotate(180deg); }
.tile:not(.has-cover):nth-child(3n) .tile__media { transform: scale(1.02) scaleX(-1); }
.tile:not(.has-cover):nth-child(5n) .tile__media { transform: scale(1.02) scaleY(-1); }
.tile:not(.has-cover):nth-child(2n):hover .tile__media { transform: scale(1.07) rotate(180deg); }
.tile:not(.has-cover):nth-child(3n):hover .tile__media { transform: scale(1.07) scaleX(-1); }
.tile:not(.has-cover):nth-child(5n):hover .tile__media { transform: scale(1.07) scaleY(-1); }

/* Darkening veil so light text stays legible over any photo */
.tile__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(27,20,16,0.88) 0%, rgba(27,20,16,0.45) 45%, rgba(27,20,16,0.18) 100%),
    rgba(27,20,16,0.15);
}
/* The placeholder is already dark and has nothing to obscure, so let its
   colour through instead of veiling it twice. */
.tile:not(.has-cover) .tile__veil {
  background: linear-gradient(to top, rgba(27,20,16,0.75) 0%, rgba(27,20,16,0.15) 55%, rgba(27,20,16,0) 100%);
}

.tile__body {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px 24px;
  /* Frosted glass behind the text — blurs only the area under the caption */
  backdrop-filter: blur(7px) saturate(105%);
  -webkit-backdrop-filter: blur(7px) saturate(105%);
  -webkit-mask-image: linear-gradient(to top, #000 82%, transparent 100%);
  mask-image: linear-gradient(to top, #000 82%, transparent 100%);
}

.tile__date {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #E6C58C;
}
.tile__title {
  font-family: 'Judson', 'EB Garamond', Georgia, serif;
  font-size: 25px;
  line-height: 1.15;
  color: #F4EFE3;
  text-shadow: 0 1px 12px rgba(0,0,0,0.45);
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile__media { transition: none; }
  .tile:hover { transform: none; }
  .tile:hover .tile__media { transform: scale(1.02); }
}

/* ---------- Video row (data/videos.toml) ---------- */

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 48px;
}
@media (min-width: 640px)  { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(15,12,9,0.10);
  transition: box-shadow .35s ease, transform .35s ease;
}
.video:hover { box-shadow: 0 16px 36px rgba(15,12,9,0.26); transform: translateY(-3px); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .video { transition: none; }
  .video:hover { transform: none; }
}

/* Standalone photo inside a migrated page (About, memories). */
.legacy-content .page-figure {
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 24px 0 32px;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(15,12,9,0.12);
}
