/* ==========================================================================
   Silver Spur — tribute page
   Design language: English manor library. Deep bottle-green walls (the
   colour of the car's own hide), gilt brass fittings, burr walnut, and
   framed photographs — the coachbuilder plate motif rendered in gold leaf
   rather than steel.
   ========================================================================== */

:root {
  --bg: #23402d;            /* library green — the leather's own shade */
  --bg-panel: #2c4d37;      /* panel green, one step lighter */
  --gold: #b6924f;          /* antique brass / gilt */
  --gold-light: #e2c78b;    /* polished gilt highlight */
  --parchment: #f1e8d6;     /* magnolia hide */
  --parchment-dim: #cabf9e;
  --walnut: #6b4226;        /* burr walnut trim */
  --hairline: rgba(198, 163, 100, 0.22);
  --hairline-soft: rgba(198, 163, 100, 0.13);

  --font-display: "Cormorant Garamond", "Georgia", serif;
  --font-body: "Source Serif 4", "Georgia", serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --max-width: 1120px;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 600px at 50% -10%, rgba(226, 199, 139, 0.06), transparent 60%),
    var(--bg);
  color: var(--parchment);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

header, main, footer {
  position: relative;
  z-index: 1;
}

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

a {
  color: var(--parchment);
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--gold-light); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* -- coachline: the recurring signature rule, rendered in gilt ---------- */
.coachline {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  position: relative;
}
.coachline::after {
  content: "";
  position: absolute;
  inset: 0;
  height: 1px;
  top: 1px;
  background: rgba(241, 232, 214, 0.14);
}

/* -- header ---------------------------------------------------------------*/
header.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) var(--gap) clamp(2.5rem, 6vw, 4rem);
  background:
    linear-gradient(180deg, rgba(15, 26, 19, 0.62) 0%, rgba(15, 26, 19, 0.8) 45%, var(--bg) 92%),
    radial-gradient(ellipse at top, rgba(226, 199, 139, 0.1), transparent 60%),
    url('../images/hero-side-profile.jpg') center 40% / cover no-repeat;
  text-align: center;
}

.hero.no-photo {
  background:
    radial-gradient(ellipse at top, rgba(226, 199, 139, 0.07), transparent 60%),
    var(--bg);
}

.plate {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #241a0c;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  padding: 0.4em 0.9em;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 1px 3px rgba(0,0,0,0.4);
}
.plate .rivet {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(36,26,12,0.4);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.3);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0.6em 0 0.15em;
  color: var(--parchment);
  text-shadow: 0 2px 10px rgba(0,0,0,0.55), 0 1px 0 rgba(0,0,0,0.3);
}
.hero h1 em {
  font-style: normal;
}

.hero .subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin: 0 0 1.8rem;
}

.hero .intro {
  max-width: 46ch;
  margin: 0 auto;
  color: var(--parchment-dim);
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  text-decoration: none;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover { color: var(--gold-light); border-color: var(--hairline); }
.site-nav a.active { color: var(--gold-light); border-color: var(--gold); }

footer .site-nav { margin: 0 0 1.2rem; }

.footer-admin-links {
  margin-top: 0.9rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 0.55;
}
.footer-admin-links a {
  color: inherit;
  text-decoration: none;
}
.footer-admin-links a:hover { color: var(--gold-light); }

.page-link-row {
  display: block;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(0,0,0,0.06)), var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.page-link-row:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  transform: translateY(-1px);
}
.page-link-row .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.3rem;
}
.page-link-row .title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--parchment);
}
.page-link-row .desc {
  color: var(--parchment-dim);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}
.page-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

/* -- section scaffolding --------------------------------------------------*/
section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin: 0;
  letter-spacing: 0.01em;
  position: relative;
  padding-bottom: 0.7rem;
}
.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section-head .tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 0.3em 0.7em;
  border-radius: 2px;
}

/* -- gallery: framed like paintings on a manor wall -----------------------*/
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.4rem;
}

.frame {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.frame:hover {
  box-shadow: 0 16px 34px rgba(0,0,0,0.48), 0 3px 8px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}
.frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(226, 199, 139, 0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 0 0 1px rgba(0,0,0,0.15);
  border-radius: 1px;
  pointer-events: none;
  z-index: 1;
}

.frame .photo {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #325940, #23402d);
}

.frame .photo.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(226, 199, 139, 0.4);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 1rem;
}

.frame figcaption {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--gold-light);
  border-top: 1px solid var(--hairline);
  background: var(--bg-panel);
}
.frame figcaption .date { color: var(--parchment-dim); white-space: nowrap; }

.gallery-empty {
  border: 1px dashed var(--hairline);
  border-radius: 3px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* -- spec plate --------------------------------------------------------- */
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border: 1px solid var(--hairline);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(226, 199, 139, 0.08);
}

.spec {
  padding: 1rem 1.2rem;
  border-right: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(0,0,0,0.08));
  box-shadow: inset 0 1px 0 rgba(226, 199, 139, 0.06);
  position: relative;
}

.spec .label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.spec .value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--parchment);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.spec .value:empty::after {
  content: "—";
  color: rgba(226, 199, 139, 0.35);
}

.colour-swatch {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  border: 1px solid rgba(226, 199, 139, 0.4);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.35), inset 0 -2px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

/* -- provenance / history — vertical timeline ----------------------------*/
.history {
  position: relative;
  padding-left: 1.7rem;
}

.history-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0 0 1.9rem 0.9rem;
  transition: padding-left 0.2s ease;
}
.history-row:last-child { padding-bottom: 0; }
.history-row:hover { padding-left: 1.2rem; }

.history-row::before {
  content: "";
  position: absolute;
  left: -1.7rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6df, var(--gold-light) 55%, var(--gold) 100%);
  box-shadow: 0 0 0 3px var(--bg), 0 0 10px rgba(226, 199, 139, 0.6), 0 1px 3px rgba(0,0,0,0.5);
}
.history-row::after {
  content: "";
  position: absolute;
  left: calc(-1.7rem + 4px);
  top: 0.85rem;
  bottom: -0.15rem;
  width: 1px;
  background: linear-gradient(180deg, var(--hairline), transparent);
}
.history-row:last-child::after { display: none; }

.history-row .date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.history-row .event {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--parchment);
  margin: 0.15rem 0 0.25rem;
}

.history-row .detail {
  color: var(--parchment-dim);
  font-size: 0.9rem;
  white-space: pre-line;
}

.prev-owner-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 0.12em 0.5em;
  margin-left: 0.7em;
  vertical-align: middle;
  opacity: 0.75;
}

/* -- journey map: stylised voyage chart ----------------------------------*/
.journey-map {
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--bg-panel);
  padding: 1rem;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(0,0,0,0.15), 0 8px 22px rgba(0,0,0,0.28);
}
.journey-map svg {
  width: 100%;
  height: auto;
  display: block;
}

.journey-graticule line {
  stroke: rgba(226, 199, 139, 0.08);
  stroke-width: 1;
}

.journey-land {
  fill: rgba(226, 199, 139, 0.09);
  stroke: rgba(226, 199, 139, 0.22);
  stroke-width: 1;
}

.journey-route {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  opacity: 0.85;
}

.journey-stop circle {
  fill: var(--gold-light);
  stroke: var(--bg-panel);
  stroke-width: 2;
}

.journey-place {
  font-family: var(--font-display);
  font-size: 15px;
  fill: var(--parchment);
}

.journey-year {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  fill: var(--gold);
}

@media (max-width: 640px) {
  .journey-place { font-size: 13px; }
}
.links {
  display: grid;
  gap: 0.9rem;
}

.link-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(0,0,0,0.06)), var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.link-row:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  transform: translateY(-1px);
}

.link-row .title {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.new-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #241a0c;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: 2px;
  padding: 0.18em 0.55em;
  margin-left: 0.6em;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
  animation: badge-glow 2.5s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.35); }
  50% { box-shadow: 0 1px 3px rgba(0,0,0,0.35), 0 0 8px rgba(226,199,139,0.7); }
}

.link-row .desc {
  color: var(--parchment-dim);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.link-row .arrow {
  font-family: var(--font-mono);
  color: var(--gold-light);
  flex-shrink: 0;
}

/* -- visitors by country ---------------------------------------------------*/
.visitor-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.visitor-row {
  display: grid;
  grid-template-columns: 2rem 1.6rem 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1.1rem;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}
.visitor-row .rank {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  text-align: right;
}
.visitor-row .flag {
  font-size: 1.3rem;
  line-height: 1;
}
.visitor-row .country {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--parchment);
}
.visitor-row .count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gold-light);
  white-space: nowrap;
}

/* -- footer ----------------------------------------------------------------*/
footer {
  padding: 2.5rem var(--gap) 3rem;
  text-align: center;
  color: rgba(226, 199, 139, 0.45);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* -- odometer visit counter, styled like the car's own instrument --------*/
.odometer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.4rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.odometer-wrap:hover {
  transform: translateY(-1px);
}
.odometer-wrap:hover .odometer {
  border-color: var(--gold);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), 0 0 10px rgba(226, 199, 139, 0.35);
}
.odometer-wrap:hover .odometer-label {
  color: var(--gold-light);
}
.odometer-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(226, 199, 139, 0.5);
  transition: color 0.15s ease;
}
.odometer {
  display: flex;
  gap: 2px;
  padding: 0.4rem 0.5rem;
  background: #0e1712;
  border: 2px solid #3a3226;
  border-radius: 2px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), 0 2px 6px rgba(0,0,0,0.4);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.odometer .digit {
  width: 1.1rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  color: #e8dcc0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  border-radius: 1px;
  box-shadow: inset 0 0 3px rgba(0,0,0,0.8);
}

/* -- guestbook -------------------------------------------------------------*/
.guestbook-form {
  display: grid;
  gap: 0.9rem;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 1.5rem;
  box-shadow: 0 8px 22px rgba(0,0,0,0.3);
}
.guestbook-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
@media (max-width: 560px) {
  .guestbook-form .row { grid-template-columns: 1fr; }
}
.guestbook-form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.guestbook-form input[type="text"],
.guestbook-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--hairline-soft);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  border-radius: 2px;
  box-sizing: border-box;
}
.guestbook-form input[type="text"]:focus,
.guestbook-form textarea:focus {
  outline: 1px solid var(--gold);
  border-color: var(--gold);
}
.guestbook-form textarea {
  min-height: 6rem;
  resize: vertical;
}
.guestbook-form .hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.guestbook-submit {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.8em 1.6em;
  border-radius: 2px;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #241a0c;
  cursor: pointer;
  font-weight: 500;
  justify-self: start;
}
.guestbook-submit:hover { filter: brightness(1.08); }

.guestbook-notice {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gold-light);
  background: rgba(226,199,139,0.08);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 0.8rem 1.1rem;
  margin-bottom: 1.5rem;
}

.guestbook-entries {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}
.guestbook-entry {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 1.1rem 1.3rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.24);
}
.guestbook-entry .gb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.guestbook-entry .gb-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--parchment);
}
.guestbook-entry .gb-name .gb-location {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--parchment-dim);
  text-transform: none;
  letter-spacing: 0.02em;
  margin-left: 0.6em;
}
.guestbook-entry .gb-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold);
  white-space: nowrap;
}
.guestbook-entry .gb-message {
  color: var(--parchment-dim);
  font-size: 0.92rem;
  white-space: pre-line;
}

/* -- lightbox -------------------------------------------------------------*/
.frame .photo { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 22, 16, 0.93);
  padding: clamp(1rem, 5vw, 3rem);
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

.lightbox-figure img {
  max-width: min(90vw, 1100px);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #16261c;
}

.lightbox-figure figcaption {
  padding: 0.8rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.lightbox-figure figcaption .lb-date { color: var(--parchment-dim); white-space: nowrap; }
.lightbox-figure figcaption .lb-count { color: var(--parchment-dim); white-space: nowrap; }

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--gold-light);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { border-color: var(--gold); color: var(--parchment); }

.lightbox-close {
  top: clamp(0.75rem, 3vw, 1.75rem);
  right: clamp(0.75rem, 3vw, 1.75rem);
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.1rem;
}
.lightbox-prev { left: clamp(0.5rem, 3vw, 2rem); }
.lightbox-next { right: clamp(0.5rem, 3vw, 2rem); }

@media (max-width: 640px) {
  .lightbox-nav { width: 2.3rem; height: 2.3rem; }
  .lightbox-close { width: 2.1rem; height: 2.1rem; }
}

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