:root {
  --bg: #0b1018;
  --panel: #131d2b;
  --text: #eef2f8;
  --muted: #b7c2d5;
  --gold: #dcb26c;
  --line: #27374d;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #1c2a3e, var(--bg) 35%);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* Ambient background motion (subtle, non-distracting) */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: -22vmax;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    radial-gradient(circle at 20% 25%, rgba(90, 140, 255, 0.14) 0%, rgba(90, 140, 255, 0) 45%),
    radial-gradient(circle at 78% 38%, rgba(220, 178, 108, 0.11) 0%, rgba(220, 178, 108, 0) 44%),
    radial-gradient(circle at 55% 72%, rgba(120, 210, 200, 0.08) 0%, rgba(120, 210, 200, 0) 40%);
  filter: blur(10px) saturate(1.08);
  animation: aurora-drift 34s ease-in-out infinite alternate;
}
body::after {
  background:
    linear-gradient(110deg, rgba(255,255,255,0.018) 10%, rgba(255,255,255,0.004) 45%, rgba(255,255,255,0.018) 90%);
  opacity: 0.34;
  animation: sheen-shift 26s linear infinite;
}

@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-1.2%, -1.8%, 0) scale(1.03); }
  100% { transform: translate3d(1.6%, 1.1%, 0) scale(1.02); }
}

@keyframes sheen-shift {
  0%   { transform: translate3d(-2%, 0, 0) rotate(0.001deg); }
  100% { transform: translate3d(2%, 0, 0) rotate(0.001deg); }
}
.container { width: min(1120px, 92vw); margin: 0 auto; }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; margin: 0 0 .8rem; line-height: 1.15; }
a { color: var(--gold); }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgb(8 12 18 / 85%); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand { color: white; text-decoration: none; font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: .5rem; }
.brand span {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem;
  margin-right: .45rem; border-radius: 999px; color: #111;
  background: linear-gradient(120deg, #f4d38f, #bb8740);
}
.brand-logo {
  width: 36px; height: 36px; object-fit: contain;
  border-radius: 999px; flex-shrink: 0;
}
.foot-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.foot-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 999px; flex-shrink: 0; }
.site-nav { display: flex; gap: 1rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: var(--gold); }
.menu-btn { display: none; }

.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero .container {
  position: relative;
  padding-top: 5rem;
  padding-bottom: 5rem;
}
.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.1) brightness(0.85);
}
/* Left-to-right gradient: text is readable on the left, photo shows on the right */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(6, 10, 20, 0.65) 0%,
    rgba(6, 10, 20, 0.35) 50%,
    rgba(6, 10, 20, 0.05) 100%
  );
}
/* Text column — glass card on the left, photo visible to the right */
.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  max-width: 540px;
  background: rgba(6, 10, 20, 0.62);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  padding: 2.4rem 2.2rem 2rem;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}
.hero-logo {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 1.1rem;
  opacity: 1;
  transition: opacity .3s ease;
  transform: translateY(0);
  animation: none;
}
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.13em;
  font-weight: 700;
  font-size: 0.78rem;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.55);
}
.hero p {
  color: rgba(238, 245, 255, 0.9);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 1.4rem;
  text-shadow: 0 1px 10px rgba(0,0,0,0.45);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.hero-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.hero-meta span {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  color: rgba(238, 245, 255, 0.88);
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
}
.hero-slide-caption {
  margin-top: 1.2rem;
  color: rgba(238, 245, 255, 0.82);
  font-size: 0.88rem;
  font-style: italic;
}

.section { padding: 4rem 0; }
.alt { background: rgb(255 255 255 / 2%); border-top: 1px solid rgb(255 255 255 / 5%); border-bottom: 1px solid rgb(255 255 255 / 5%); }
.muted { color: var(--muted); }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1.2rem; align-items: start; }

/* Speed up off-screen rendering cost on long pages */
#highlights,
#programme,
#tablers,
#visiting-book,
#faq {
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}
.info-card,
.month-card,
.tabler-card,
.entry-list li,
.guestbook-form,
.faq-grid details,
.dash-grid label {
  background: linear-gradient(180deg, #131f2f, #101927);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgb(0 0 0 / 25%);
}
.info-card { padding: 1rem; }
.info-card ul { margin: 0; padding-left: 1.1rem; }

/* ---- Frontend Gallery: event-grouped ---- */
#gallery-grid { display: flex; flex-direction: column; gap: 3rem; margin-top: 1.5rem; }

.gallery-event-group { display: flex; flex-direction: column; gap: 1rem; }

.gallery-event-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.gallery-event-name { font-size: 1.25rem; margin: 0; }
.gallery-event-date {
  background: rgba(220, 178, 108, 0.12); color: var(--gold);
  border: 1px solid rgba(220, 178, 108, 0.25); border-radius: 999px;
  padding: .25rem .8rem; font-size: .82rem; font-weight: 600;
}
.gallery-event-count { color: var(--muted); font-size: .85rem; margin-left: auto; }

.gallery-event-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}

.gallery-event-photo {
  margin: 0; position: relative;
  overflow: hidden; border-radius: 14px;
  border: 1px solid var(--line);
  min-height: 200px; cursor: pointer;
  background: #0d1622;
}
.gallery-event-photo img {
  width: 100%; height: 100%; min-height: 200px;
  object-fit: cover; display: block;
  transition: transform .5s ease;
}
.gallery-event-photo:hover img { transform: scale(1.06); }
.gallery-event-photo figcaption {
  position: absolute; left: .5rem; right: .5rem; bottom: .5rem;
  background: rgba(6, 10, 18, 0.75); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: .35rem .55rem; font-size: .82rem; color: #f4f7fc;
  opacity: 0; transform: translateY(5px); transition: opacity .28s, transform .28s;
}
.gallery-event-photo:hover figcaption { opacity: 1; transform: translateY(0); }

.gallery-empty {
  padding: 3rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 18px; font-size: .95rem;
}
.gallery-more-wrap {
  margin-top: .5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.gallery-more.hidden { display: none; }

/* ---- Lightbox ---- */
.gallery-lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.gallery-lightbox.hidden { display: none; }
.lb-overlay {
  position: absolute; inset: 0;
  background: rgba(4, 8, 16, 0.94); backdrop-filter: blur(6px);
}
.lb-content {
  position: relative; display: flex; align-items: center; justify-content: center;
  gap: 1rem; width: 100%; max-width: 1100px; padding: 1.5rem;
}
.lb-img-wrap {
  flex: 1; max-width: 820px; display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.lb-img-wrap img {
  max-width: 100%; max-height: 80vh; border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.65); object-fit: contain; display: block;
}
.lb-footer { text-align: center; margin-top: .75rem; }
.lb-caption { color: #f0f4fc; font-size: .95rem; margin: 0 0 .35rem; }
.lb-counter { color: var(--muted); font-size: .82rem; }
.lb-close {
  position: absolute; top: .75rem; right: 1rem; z-index: 10;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: 999px; width: 2.2rem; height: 2.2rem;
  font-size: 1rem; cursor: pointer; display: grid; place-items: center;
}
.lb-close:hover { background: rgba(255,255,255,.16); }
.lb-nav {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  color: #fff; border-radius: 999px; width: 2.8rem; height: 2.8rem;
  font-size: 1.6rem; cursor: pointer; display: grid; place-items: center;
  flex-shrink: 0; transition: background .2s;
}
.lb-nav:hover { background: rgba(255,255,255,.15); }

.programme-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.programme-group {
  display: grid;
  gap: 0.85rem;
}
.programme-list {
  display: grid;
  gap: 0.85rem;
}
.event-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19, 31, 48, 0.95), rgba(9, 16, 28, 0.95));
  cursor: pointer;
}
.event-card:hover {
  transform: translateY(-3px);
}
.event-card-date {
  min-width: 85px;
  text-align: center;
  padding: 0.8rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}
.event-card-day {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.event-card-month {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.event-card-info h3 {
  margin-bottom: 0.45rem;
}
.event-card-meta,
.event-card-contact {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.event-detail {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 12, 0.88);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 200;
}
.event-detail.hidden {
  display: none;
}
.event-detail-panel {
  width: min(680px, 100%);
  background: #0f1a2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}
.event-detail-panel h2 {
  margin-top: 0;
}
.event-detail-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.2rem 0;
}
.event-detail-list dt {
  color: var(--gold);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.event-detail-list dd {
  margin: 0;
  color: var(--text);
}
.event-detail-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.admin-events {
  margin-top: 1rem;
}
.admin-event-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-event-row {
  padding: 1rem;
}
.admin-event-row-top {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
}
.admin-event-row label {
  display: grid;
  gap: 0.35rem;
}
.admin-event-row .btn {
  width: 100%;
}
@media (max-width: 900px) {
  .hero { min-height: 100svh; align-items: flex-end; }
  .hero .container { padding-bottom: 3rem; }
  .hero-content { max-width: 100%; border-radius: 16px; padding: 1.8rem 1.4rem 1.6rem; }
  .hero-overlay {
    background: linear-gradient(
      to top,
      rgba(6, 10, 20, 0.80) 0%,
      rgba(6, 10, 20, 0.25) 60%,
      rgba(6, 10, 20, 0.04) 100%
    );
  }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid figure:nth-child(1) { grid-column: auto; grid-row: auto; }
  .admin-event-row-top { grid-template-columns: 1fr; }
}

.programme-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.month-card { padding: 1rem; }
.month-card ul { margin: .6rem 0 0; padding-left: 1rem; }
.month-card li { margin-bottom: .4rem; color: #d9e0ec; }

.tablers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: .9rem; }
/* Desktop tabler cards — no 3D flip; bio slides in below photo on hover */
.tabler-card {
  padding: 0; background: transparent; border: none; box-shadow: none;
  animation: rise .6s ease both;
}
.tabler-card:not(.tabler-mobile) {
  cursor: pointer;
  background: linear-gradient(180deg, #131f2f, #101927);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgb(0 0 0 / 25%);
  overflow: hidden;
}
.tabler-card.tabler-mobile { user-select: none; -webkit-user-select: none; }
.tabler-card:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Desktop front panel — normal flow, not 3D */
.tabler-card:not(.tabler-mobile) .tabler-front {
  position: relative;
  inset: auto;
  backface-visibility: visible;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: none;
  overflow: visible;
  padding: .9rem .9rem 0;
}

/* Mobile front panel — used for expand/collapse layout */
.tabler-front,
.tabler-back {
  position: absolute; inset: 0; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #131f2f, #101927); box-shadow: 0 14px 34px rgb(0 0 0 / 25%);
  padding: .9rem; backface-visibility: hidden; overflow: hidden;
}
.tabler-mobile .tabler-front {
  position: relative;
  inset: auto;
  backface-visibility: visible;
  overflow: visible;
  box-shadow: none;
}

/* Portrait — monochrome-gold default, full colour on desktop card hover */
.tabler-front img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 10px;
  margin-bottom: .7rem;
  filter: grayscale(1) sepia(.65) hue-rotate(342deg) saturate(.95) contrast(1.02) brightness(.95);
  transition: filter .4s ease;
}
.tabler-card:not(.tabler-mobile):hover .tabler-front img,
.tabler-card:not(.tabler-mobile):focus-within .tabler-front img,
.tabler-mobile.is-open .tabler-front img {
  filter: none;
}

/* Desktop bio slide-in panel */
.tabler-bio-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 .9rem;
  transition: max-height .44s ease, opacity .34s ease, padding .34s ease;
}
.tabler-bio-panel p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--muted);
  padding-bottom: .15rem;
}
.tabler-card:not(.tabler-mobile):hover .tabler-bio-panel,
.tabler-card:not(.tabler-mobile):focus-within .tabler-bio-panel {
  max-height: 280px;
  opacity: 1;
  padding: .45rem .9rem .9rem;
}

.tabler-card h3 { margin-bottom: .2rem; font-size: 1.25rem; }
.tabler-card .title { color: var(--gold); font-weight: 600; margin-bottom: .4rem; }
.tabler-card p { color: var(--muted); margin: 0; }

/* Mobile: expandable bio section */
.tabler-bio-expand { 
  background: linear-gradient(180deg, rgba(16, 28, 44, 0.85), rgba(10, 18, 30, 0.92));
  border-top: 1px solid rgba(220, 178, 108, 0.22);
  padding: .95rem 1rem 1rem;
}
.tabler-bio-expand p { margin: 0; line-height: 1.5; }
.tabler-mobile {
  border-radius: 18px;
  border: 1px solid rgba(220, 178, 108, 0.28);
  background: linear-gradient(180deg, #122033, #0f1b2c 52%, #0d1725);
  box-shadow: 0 16px 36px rgb(0 0 0 / 28%);
  overflow: hidden;
}
.tabler-mobile .tabler-front {
  padding: 1rem;
  border: none;
  background: linear-gradient(180deg, rgba(20, 34, 54, 0.8), rgba(13, 23, 37, 0.88));
}
.tabler-mobile .tabler-front img {
  margin-bottom: .9rem;
  border-radius: 14px;
  aspect-ratio: 4 / 5;
  object-position: center 22%;
}
.tabler-mobile .title {
  margin-bottom: .55rem;
}
.tabler-mobile .tap-note {
  margin-top: .25rem;
  font-size: .82rem;
  color: #94a6bf;
}
.tabler-bio-btn {
  margin-top: .85rem;
  border: 1px solid rgba(220, 178, 108, 0.36);
  background: rgba(220, 178, 108, 0.08);
  color: #f0d4a1;
  border-radius: 999px;
  padding: .44rem .82rem;
  font: 600 .82rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.tabler-bio-btn:active {
  transform: scale(.98);
}
.tabler-mobile.is-open .tabler-bio-btn {
  background: rgba(220, 178, 108, 0.16);
}

.guestbook-form { padding: 1rem; display: grid; gap: .65rem; }
label { display: grid; gap: .35rem; font-weight: 600; }
input, textarea {
  width: 100%; border-radius: 10px; border: 1px solid var(--line); padding: .65rem .7rem;
  background: #0d1522; color: var(--text); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.entry-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.entry-list li { padding: .8rem; }
.entry-list p { margin: .25rem 0 0; color: var(--muted); }

.faq-grid { display: grid; gap: .7rem; }
.faq-grid details { padding: .8rem 1rem; }
.faq-grid summary { cursor: pointer; font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: .8rem; margin-bottom: .9rem; }
.dash-grid label { padding: .7rem; }

.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px;
  padding: .72rem 1.1rem; text-decoration: none; font-weight: 700; cursor: pointer;
  position: relative; overflow: hidden;
  transition: filter .18s ease, transform .15s ease, background .25s ease,
              border-color .25s ease, opacity .22s ease, color .2s ease, box-shadow .2s ease;
}
.btn-primary { background: linear-gradient(120deg, #e2bf86, #b8873d); color: #17120a; }
.btn-secondary { border-color: rgb(255 255 255 / 40%); color: var(--text); background: transparent; }

/* Hover lift */
.btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
/* Press feel */
.btn:active:not(:disabled) { transform: scale(.96) translateY(0) !important; box-shadow: none !important; filter: brightness(.95); }

/* Disabled / clean (no changes) */
.btn:disabled { opacity: .4; cursor: default; }

/* Loading shimmer */
.btn--loading { pointer-events: none; }
.btn--loading::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: btn-shimmer 1.1s linear infinite;
}
@keyframes btn-shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}

/* Saved success state */
.btn-primary.btn--saved { background: linear-gradient(120deg, #4ade80, #16a34a); color: #f0fff4; }
.btn-secondary.btn--saved { border-color: #4ade80; color: #4ade80; }

.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* Improved input / textarea focus ring */
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(220, 178, 108, 0.18);
}


.foot-grid { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; }

@media (max-width: 900px) {
  .split, .foot-grid { grid-template-columns: 1fr; }
  .menu-btn {
    display: inline-flex; align-items: center;
    background: transparent; border: 1px solid var(--line); color: var(--text);
    border-radius: 999px; padding: .5rem .9rem;
  }
  .site-nav {
    position: absolute; top: 68px; right: 4vw; left: 4vw;
    background: #0f1826; border: 1px solid var(--line); border-radius: 12px;
    display: none; flex-direction: column; padding: .75rem;
  }
  .site-nav.open { display: flex; }
}


.anim-rise {
  animation: rise .7s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.gallery-grid figure,
.tabler-card,
.month-card,
.entry-list li,
.btn {
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}

.gallery-grid figure:hover,
.tabler-card:hover,
.month-card:hover,
.entry-list li:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgb(0 0 0 / 34%);
}

.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ==============================
   Admin CMS layout
   ============================== */
.admin-body { background: #07101d; }
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; align-items: start; }

.admin-sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0e1828, #0a1220);
  border-right: 1px solid var(--line); overflow-y: auto;
}
.admin-sidebar-brand { padding: 1.4rem 1.2rem 1rem; border-bottom: 1px solid var(--line); }
.admin-sidebar-brand .brand { font-size: .96rem; }
.admin-sidebar-label { font-size: .72rem; color: var(--muted); margin: .25rem 0 0; text-transform: uppercase; letter-spacing: .1em; }

.admin-sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: .2rem; padding: .7rem .55rem; }
.admin-nav-btn {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem .85rem; border: none; border-radius: 10px;
  background: transparent; color: var(--muted);
  font: 600 .88rem/1 Inter, system-ui, sans-serif;
  cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.admin-nav-btn:hover { background: rgb(255 255 255 / 5%); color: var(--text); }
.admin-nav-btn.active { background: rgb(220 178 108 / 12%); color: var(--gold); }
.admin-nav-btn svg { flex-shrink: 0; opacity: .65; }
.admin-nav-btn.active svg { opacity: 1; }

.admin-sidebar-footer { padding: .7rem .7rem 1.2rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .45rem; }
.admin-sidebar-link { display: block; text-align: center; color: var(--muted); font-size: .84rem; text-decoration: none; padding: .35rem; }
.admin-sidebar-link:hover { color: var(--gold); }
.admin-sidebar-logout { width: 100%; }

.admin-main { min-height: 100vh; padding: 2rem 2.2rem; display: flex; flex-direction: column; gap: 1.4rem; max-width: 900px; }

.admin-panel { display: none; flex-direction: column; gap: 1.4rem; }
.admin-panel.active { display: flex; }

.admin-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
}
.admin-panel-title { font-size: 1.55rem; margin-bottom: .15rem; }

.admin-card {
  background: linear-gradient(180deg, #111b2c, #0d1624);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 1.4rem; display: flex; flex-direction: column; gap: 1rem;
}
.admin-card-title { font-size: 1.05rem; margin: 0; }
.admin-card-header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.admin-field-group { display: grid; gap: .75rem; }
.admin-field-group-inline { grid-template-columns: 1fr 1fr; }

/* Image rows */
.admin-image-rows { display: flex; flex-direction: column; gap: .6rem; }
.admin-image-row {
  display: grid; grid-template-columns: 80px 1fr auto; gap: .7rem; align-items: center;
  background: rgb(255 255 255 / 2%); border: 1px solid var(--line); border-radius: 12px; padding: .65rem;
}
.admin-image-row-preview {
  width: 80px; height: 60px; border-radius: 8px; overflow: hidden;
  background: #0d1623; display: grid; place-items: center; border: 1px solid var(--line);
}
.admin-row-preview-img { width: 100%; height: 100%; object-fit: cover; }
.admin-row-preview-placeholder { font-size: .68rem; color: var(--muted); text-align: center; padding: .4rem; }
.admin-image-row-fields { display: grid; gap: .4rem; }
.admin-image-row-fields input { width: 100%; margin: 0; }
.admin-row-remove { flex-shrink: 0; padding: .4rem .7rem; font-size: .8rem; }

/* Tabler rows */
.admin-tabler-list { display: grid; gap: 1rem; }
.admin-tabler-row-inner { display: grid; grid-template-columns: 90px 1fr auto; gap: 1rem; align-items: start; }
.admin-tabler-preview {
  width: 90px; height: 90px; border-radius: 10px; overflow: hidden;
  background: #0d1623; display: grid; place-items: center; border: 1px solid var(--line); flex-shrink: 0;
}
.admin-tabler-preview-img { width: 100%; height: 100%; object-fit: cover; }
.admin-tabler-preview-placeholder { font-size: .68rem; color: var(--muted); text-align: center; padding: .5rem; }
.admin-tabler-fields { display: flex; flex-direction: column; gap: .55rem; }
.admin-tabler-remove { align-self: start; flex-shrink: 0; padding: .4rem .7rem; font-size: .8rem; }

/* Event rows (admin) */
.admin-event-list { display: grid; gap: 1rem; }

/* Guestbook */
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.admin-badge {
  display: inline-flex; align-items: center; padding: .1rem .45rem;
  border-radius: 999px; background: var(--gold); color: #111;
  font-size: .7rem; font-weight: 700; margin-left: .35rem; vertical-align: middle;
}
.admin-entry-card {
  padding: .85rem; background: rgb(255 255 255 / 2%);
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: .55rem;
}
.admin-entry-meta { display: flex; justify-content: space-between; margin-bottom: .35rem; gap: .5rem; }
.admin-entry-actions { display: flex; gap: .45rem; margin-top: .55rem; }

/* Message toast */
.admin-message {
  padding: 0; font-size: .88rem; border-radius: 10px; position: sticky; top: 1rem; z-index: 50;
  opacity: 0; max-height: 0; overflow: hidden; transition: opacity .25s, max-height .3s, padding .25s;
}
.admin-message.visible { opacity: 1; max-height: 60px; padding: .7rem 1rem; }
.admin-message.notice { background: rgba(96,165,250,.12); border: 1px solid rgba(96,165,250,.3); color: #93c5fd; }

/* Mobile admin */
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; }
  .admin-sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: .5rem; }
  .admin-nav-btn { font-size: .78rem; padding: .55rem .65rem; }
  .admin-main { padding: 1rem; }
  .admin-tabler-row-inner { grid-template-columns: 1fr; }
  .admin-image-row { grid-template-columns: 1fr; }
  .admin-cols { grid-template-columns: 1fr; }
  .admin-field-group-inline { grid-template-columns: 1fr; }
}

/* ==============================
   Gallery section improvements
   ============================== */
#highlights {
  background: linear-gradient(180deg, #07101d, #0b1420 60%, #07101d);
  padding: 5rem 0;
}
#highlights h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: .3rem;
}
#highlights h2::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-top: .6rem;
}
.gallery-empty {
  padding: 3rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
  font-size: .95rem;
}
.gallery-grid figcaption {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .3s;
}
.gallery-grid figure:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* Section heading accent for all sections */
.section h2 {
  position: relative;
}

/* ==============================
   Admin Gallery Albums
   ============================== */
#admin-gallery-albums { display: flex; flex-direction: column; gap: 1.2rem; }

.gallery-album-card { gap: .8rem; }
.gallery-album-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.gallery-album-info { flex: 1; min-width: 0; }
.gallery-album-name { margin: 0 0 .2rem; font-size: 1.1rem; }
.gallery-album-meta { font-size: .82rem; }
.gallery-album-actions { display: flex; gap: .5rem; flex-wrap: wrap; flex-shrink: 0; }

.gallery-album-preview {
  display: flex; gap: .4rem; flex-wrap: wrap;
  padding: .5rem 0;
}
.gallery-album-thumb {
  width: 60px; height: 60px; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--line);
}
.gallery-album-extra {
  width: 60px; height: 60px; border-radius: 8px;
  background: rgb(255 255 255 / 6%); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: .82rem; color: var(--muted);
}

.gallery-album-body {
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
  display: flex; flex-direction: column; gap: 1.2rem;
}
.gallery-album-body.hidden { display: none; }

.gallery-album-edit-meta {
  display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap;
}

/* Upload zone */
.gallery-upload-zone {
  border: 2px dashed var(--line); border-radius: 14px;
  padding: 2rem 1.5rem; text-align: center;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.gallery-upload-zone:hover,
.gallery-upload-zone.drag-over {
  border-color: var(--gold); background: rgba(220, 178, 108, 0.04);
}
.gallery-upload-zone svg { display: block; margin: 0 auto .75rem; color: var(--muted); }
.gallery-upload-zone p { margin: 0 0 .35rem; }

.gallery-upload-label {
  color: var(--gold); text-decoration: underline; cursor: pointer;
  font-weight: 600; display: inline;
}
.gallery-upload-label input[type="file"] { display: none; }
.gallery-upload-progress {
  margin-top: .75rem; font-size: .88rem; color: var(--gold);
}
.gallery-upload-progress.hidden { display: none; }

/* Photo grid in admin */
.gallery-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}
.gallery-photo-item {
  background: rgb(255 255 255 / 2%); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.gallery-photo-img-wrap {
  aspect-ratio: 4 / 3; overflow: hidden;
  background: #0c1520;
}
.gallery-photo-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease;
}
.gallery-photo-item:hover .gallery-photo-img-wrap img { transform: scale(1.04); }

.gallery-photo-caption-row {
  display: flex; flex-direction: column; gap: .4rem; padding: .55rem;
}
.gallery-caption-input {
  width: 100%; font-size: .82rem; padding: .5rem .65rem;
  border-radius: 8px; min-width: 0; margin: 0; resize: none;
  min-height: 52px; font: inherit; line-height: 1.45;
  transition: border-color .25s, box-shadow .25s;
}
.gallery-caption-actions {
  display: flex; gap: .4rem; justify-content: flex-end;
}
.gallery-photo-item--new {
  animation: photo-reveal .35s ease forwards;
}
.gallery-photo-item--new .gallery-caption-input {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(220, 178, 108, 0.22);
  background: rgba(220, 178, 108, 0.06);
}
@keyframes photo-reveal {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);   }
}
.gallery-btn-save-caption,
.gallery-btn-del-photo {
  flex-shrink: 0; padding: .35rem .7rem; font-size: .8rem;
}

/* Nav link hover underline sweep */
.site-nav a {
  position: relative;
}
.site-nav a::after {
  content: '';
  position: absolute; bottom: -3px; left: 0; right: 100%;
  height: 2px; background: var(--gold); border-radius: 2px;
  transition: right .22s ease;
}
.site-nav a:hover::after { right: 0; }

/* =============================================
   Scroll-reveal animations
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger siblings inside reveal parents */
.stagger > *:nth-child(1)  { transition-delay: 0s;    }
.stagger > *:nth-child(2)  { transition-delay: .08s;  }
.stagger > *:nth-child(3)  { transition-delay: .16s;  }
.stagger > *:nth-child(4)  { transition-delay: .24s;  }
.stagger > *:nth-child(5)  { transition-delay: .32s;  }
.stagger > *:nth-child(6)  { transition-delay: .40s;  }
.stagger > *:nth-child(7)  { transition-delay: .48s;  }
.stagger > *:nth-child(8)  { transition-delay: .56s;  }
.stagger > *:nth-child(n+9){ transition-delay: .64s;  }
@media (prefers-reduced-motion: reduce) {
  .reveal, .btn, .gallery-event-photo img, .tabler-card-inner,
  .gallery-photo-item--new, .timeline-item, body::before, body::after {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Responsive tweaks for admin gallery */
@media (max-width: 768px) {
  .gallery-album-header { flex-direction: column; }
  .gallery-album-actions { width: 100%; }
  .gallery-album-edit-meta { flex-direction: column; }
  .gallery-photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* =============================================
   Mobile-specific fixes (≤600px)
   ============================================= */
@media (max-width: 600px) {

  /* ---- Lightbox: column layout, nav overlaid on sides ---- */
  .lb-content {
    flex-direction: column;
    padding: 3.2rem .5rem .75rem;
    gap: .5rem;
    justify-content: flex-start;
    align-items: center;
  }
  /* Nav buttons float over the image sides instead of being flex siblings */
  .lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
  }
  .lb-prev { left: .25rem; }
  .lb-next { right: .25rem; }
  .lb-img-wrap {
    max-width: 100%;
    width: 100%;
  }
  .lb-img-wrap img {
    max-height: 62vh;
    width: 100%;
    border-radius: 10px;
  }
  .lb-footer {
    margin-top: 0;
    text-align: center;
    padding: 0 3rem; /* clear of the overlaid nav buttons */
  }

  /* Tabler cards on mobile: photo + expandable bio */
  .tabler-card { min-height: auto; }

  /* ---- Nav links: generous tap targets on mobile ---- */
  .site-nav a { display: block; padding: .65rem .5rem; }
}


/* =============================================
   Content added from Chairman's doc
   ============================================= */

/* ---- About: Westender Identity Pillars ---- */
.identity-pillars {
  display: grid;
  gap: .85rem;
  margin-top: 1.5rem;
}
.identity-pill {
  border-left: 3px solid rgba(220, 178, 108, 0.55);
  padding: .6rem 0 .6rem 1rem;
}
.identity-pill h3 {
  font-size: .95rem;
  margin: 0 0 .3rem;
  color: var(--gold);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: .01em;
}
.identity-pill p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}
.info-logo-note {
  margin-top: .9rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}

/* ---- Chairman's Note ---- */
#chairman { padding: 3.5rem 0; }
.chairman-layout {
  margin: 1.5rem auto 0;
  max-width: 860px;
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}
.chairman-profile {
  margin: 0;
  width: 145px;
  justify-self: start;
  border: 1px solid rgba(220, 178, 108, 0.28);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #122033, #0f1b2c 52%, #0d1725);
  box-shadow: 0 12px 32px rgb(0 0 0 / 28%);
}
.chairman-profile img {
  display: block;
  width: 100%;
  height: 195px;
  object-fit: cover;
  object-position: center 12%;
}
.chairman-profile figcaption {
  display: grid;
  gap: .18rem;
  padding: .85rem .92rem .95rem;
  border-top: 1px solid rgba(220, 178, 108, 0.18);
}
.chairman-profile strong {
  color: var(--text);
  font-size: .94rem;
  line-height: 1.25;
}
.chairman-profile span {
  color: var(--gold);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.chairman-note {
  margin: 0;
  position: relative;
  padding: 2.25rem 2.2rem 1.9rem 4rem;
  background: linear-gradient(160deg, rgba(19, 31, 52, 0.72), rgba(13, 21, 36, 0.82));
  border: 1px solid rgba(220, 178, 108, 0.22);
  border-radius: 22px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.30);
}
.chairman-note::before {
  content: '\201C';
  position: absolute;
  top: .4rem;
  left: 1.1rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 5.5rem;
  line-height: 1;
  color: rgba(220, 178, 108, 0.28);
  pointer-events: none;
}
.chairman-note p {
  color: rgba(238, 245, 255, 0.9);
  line-height: 1.75;
  margin: 0 0 .9rem;
  font-size: .99rem;
}
.chairman-note p:last-of-type { margin-bottom: 0; }
.chairman-note footer {
  margin-top: 1.4rem;
  padding-top: .9rem;
  border-top: 1px solid rgba(220, 178, 108, 0.2);
  color: var(--gold);
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .04em;
}

/* ---- Gallery: Activity Tags ---- */
.activity-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .9rem 0 1.5rem;
}
.activity-tag {
  background: rgba(220, 178, 108, 0.1);
  border: 1px solid rgba(220, 178, 108, 0.24);
  color: var(--gold);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ---- Club History Timeline ---- */
.history-timeline {
  list-style: none;
  margin-top: 2rem;
  margin-bottom: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--line);
}
.timeline-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: .7rem 1.4rem;
  padding: 1.15rem 0 1.15rem 1.8rem;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 1.7rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(220, 178, 108, 0.15);
}
.timeline-item + .timeline-item {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.timeline-year {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
  padding-top: .55rem;
  word-break: keep-all;
}
.timeline-content {
  background: linear-gradient(180deg, rgba(19, 31, 48, 0.95), rgba(9, 16, 28, 0.95));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgb(0 0 0 / 22%);
  padding: 1.05rem 1.15rem 1.05rem;
}
.timeline-content h3 {
  font-size: 1.08rem;
  margin-bottom: .38rem;
}
.timeline-content > p {
  color: var(--muted);
  margin: 0 0 .42rem;
  line-height: 1.58;
  font-size: .94rem;
}
.history-achievements {
  margin: .5rem 0 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .32rem;
}
.history-achievements li {
  color: var(--muted);
  font-size: .9rem;
}
.history-achievements li::marker { color: var(--gold); }

@media (hover: none), (pointer: coarse) {
  .tabler-front img {
    filter: none;
  }
}

/* ---- Join Section ---- */
.join-card {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: 3.2rem 2.4rem;
  background: linear-gradient(160deg, rgba(19, 31, 52, 0.65), rgba(13, 21, 36, 0.78));
  border: 1px solid rgba(220, 178, 108, 0.22);
  border-radius: 24px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.3);
}
.join-card h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: .8rem;
}
.join-card p {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto .5rem;
  line-height: 1.65;
}
.join-card .hero-actions {
  justify-content: center;
  margin-top: 1.8rem;
  margin-bottom: 0;
}

/* ---- content-visibility: extend to new sections ---- */
#chairman,
#history,
#join {
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

@media (max-width: 680px) {
  .chairman-layout {
    grid-template-columns: 1fr;
    gap: .9rem;
  }
  .chairman-profile {
    width: min(145px, 100%);
    justify-self: center;
    border-radius: 14px;
  }
  .chairman-note {
    padding: 1.55rem 1.05rem 1.3rem 1.2rem;
    border-radius: 18px;
  }
  .chairman-note::before {
    font-size: 2.9rem;
    left: .55rem;
    top: .35rem;
  }
  .chairman-note p {
    font-size: .92rem;
    line-height: 1.62;
    margin-bottom: .72rem;
  }
  .chairman-note footer {
    margin-top: .95rem;
    padding-top: .65rem;
    font-size: .78rem;
  }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: .42rem;
    padding-left: 1.05rem;
    padding-top: .9rem;
    padding-bottom: .9rem;
  }
  .timeline-year {
    font-size: 1.18rem;
    padding-top: 0;
  }
  .timeline-content {
    padding: .85rem .9rem .9rem;
    border-radius: 14px;
  }
  .timeline-content h3 {
    font-size: 1rem;
  }
  .timeline-content > p,
  .history-achievements li {
    font-size: .88rem;
  }
  .join-card {
    padding: 2.4rem 1.4rem 2rem;
  }
}

