/* ---------------------------------------------------------
   Design tokens
   A quiet gallery at night: warm near-black walls, a single
   spotlighted canvas, and museum wall-label typography.
--------------------------------------------------------- */
:root {
  --wall: #15130f;
  --wall-raised: #1d1a15;
  --wood: #221c14;
  --wood-edge: #3d3426;
  --ink: #efe6d6;
  --ink-dim: #a89d88;
  --ink-faint: #6f6754;
  --brass: #b3904f;
  --brass-soft: rgba(179, 144, 79, 0.35);
  --line: #35301f;

  --serif: 'Fraunces', Georgia, 'Iowan Old Style', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--brass-soft);
  transition: border-color 150ms ease, color 150ms ease;
}
a:hover, a:focus-visible {
  color: var(--brass);
  border-color: var(--brass);
}
a:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* ---------------------------------------------------------
   Header
--------------------------------------------------------- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 24px;
  padding: 22px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  grid-column: 2;
}

.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.today-date {
  font-size: 0.8rem;
  color: var(--ink-dim);
}

.site-nav {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 18px;
  align-items: center;
  position: relative;
}

.site-nav-link {
  font-size: 0.82rem;
  color: var(--ink-dim);
  white-space: nowrap;
}

.site-menu {
  display: none;
  position: relative;
}

.site-menu summary {
  list-style: none;
  cursor: pointer;
  font-size: 1.55rem;
  line-height: 1;
  padding: 4px 2px 4px 10px;
  color: var(--ink);
  border-bottom: none;
}

.site-menu summary::-webkit-details-marker,
.site-menu summary::marker {
  content: "";
  display: none;
}

.site-menu summary:hover,
.site-menu summary:focus-visible,
.site-menu[open] summary {
  color: var(--brass);
}

.site-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 11.5rem;
  display: flex;
  flex-direction: column;
  background: var(--wall-raised);
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  z-index: 30;
  padding: 6px 0;
}

.site-menu-panel a {
  font-size: 0.9rem;
  color: var(--ink);
  padding: 12px 16px;
  border-bottom: none;
  white-space: nowrap;
}

.site-menu-panel a:hover,
.site-menu-panel a:focus-visible {
  color: var(--brass);
  background: rgba(179, 144, 79, 0.08);
  border-bottom-color: transparent;
}

.site-header {
  position: relative;
  z-index: 5;
}

.site-header a {
  border-bottom-color: transparent;
}
.site-header a:hover,
.site-header a:focus-visible {
  border-bottom-color: var(--brass);
}
.site-nav a[aria-current="page"] {
  color: var(--brass);
}

/* ---------------------------------------------------------
   Viewing room / hero
--------------------------------------------------------- */
main {
  flex: 1;
  width: 100%;
}

.viewing-room {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(4px, 1.2vw, 12px) 20px 56px;
  /* The halo lives on this box, which also holds the caption, so the
     fade can finish below the text instead of clipping mid-label. */
  background:
    radial-gradient(
      ellipse 42% 28% at 50% 34%,
      rgba(255, 236, 196, 0.22),
      transparent 70%
    ),
    radial-gradient(
      ellipse 74% 42% at 50% 32%,
      rgba(179, 144, 79, 0.28),
      rgba(179, 144, 79, 0.10) 42%,
      transparent 70%
    );
}

.spotlight {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: clamp(28px, 4.5vw, 48px) 24px 0;
}

.frame {
  margin: 0;
  /* Slim dark moulding with a faint brass lip — no cream mat. */
  background: linear-gradient(180deg, var(--wood-edge) 0%, var(--wood) 55%, #16130f 100%);
  padding: 5px;
  border: 1px solid var(--brass-soft);
  box-shadow:
    inset 0 1px 0 rgba(227, 198, 140, 0.18),
    0 1px 0 #0a0907,
    0 18px 48px rgba(0, 0, 0, 0.55);
  max-width: min(720px, 90vw);
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  background: #0d0b08;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

/* ---------------------------------------------------------
   Wall label
--------------------------------------------------------- */
.wall-label {
  margin-top: 22px;
  max-width: 46ch;
  text-align: center;
}

.painting-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.25;
  margin: 0 0 6px;
}

.painting-medium {
  font-family: var(--serif);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-dim);
  margin: 0 0 10px;
}
.painting-medium:empty {
  display: none;
}

.painting-meta {
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin: 0 0 18px;
}

.painting-bio {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 14px;
}

.artist-life {
  display: inline-block;
  margin-top: 2px;
  font-size: 1.15rem;
  line-height: 1.45;
}

.painting-links {
  font-size: 0.82rem;
  color: var(--ink-dim);
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
}

.countdown {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}
.countdown:empty {
  display: none;
}

.countdown span {
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}

.update-note {
  margin: 0;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------
   About page content
--------------------------------------------------------- */
.about-content {
  max-width: 62ch;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 72px) 20px 64px;
}

.about-content h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.25;
  margin: 0 0 28px;
}

.about-content h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: normal;
  font-size: 1.05rem;
  color: var(--brass);
  margin: 36px 0 10px;
}

.about-content h2:first-of-type {
  margin-top: 8px;
}

.about-content p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 4px;
}

/* ---------------------------------------------------------
   Administrator
--------------------------------------------------------- */
.admin-main {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.admin-panel h1,
.admin-panel h2 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 12px;
}

.admin-panel h2 {
  margin-top: 36px;
  color: var(--brass);
  font-size: 1.15rem;
}

.admin-panel p {
  line-height: 1.6;
  color: var(--ink-dim);
}

.admin-panel:not(.admin-wide) {
  max-width: 440px;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink-dim);
}

.admin-form input {
  background: var(--wall-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
}

.admin-form button,
.pool-card button,
.admin-toolbar button {
  align-self: flex-start;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--brass);
  border-radius: 4px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.admin-form button:hover,
.pool-card button:hover,
.admin-toolbar button:hover {
  color: var(--brass);
}

.pool-card button.danger {
  border-color: #8a4a3a;
  color: #e2c2b6;
}

.admin-toolbar button.quiet {
  border-color: var(--line);
  color: var(--ink-dim);
}

.admin-hint {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.admin-alert {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.admin-alert-error { border-color: #8a4a3a; color: #e2c2b6; }
.admin-alert-ok { border-color: var(--brass-soft); color: var(--ink); }

.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.pool-card {
  background: var(--wall-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.pool-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--wall);
}

.pool-card-body {
  padding: 12px 14px 16px;
}

.pool-card h2 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--ink);
}

.pool-card p { margin: 0 0 8px; }

/* ---------------------------------------------------------
   Archive filmstrip
--------------------------------------------------------- */
.archive {
  border-top: 1px solid var(--line);
  padding: 28px clamp(20px, 5vw, 64px) 56px;
}

.archive-heading h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink-dim);
  margin: 0 0 16px;
}

.filmstrip-scroller {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.filmstrip-arrow {
  width: 40px;
  height: 40px;
  margin-top: 28px;
  border: 1px solid #f3e2b8;
  background: #e3c68c;
  color: #1a160f;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.filmstrip-arrow:hover,
.filmstrip-arrow:focus-visible {
  background: #f3e2b8;
  color: #1a160f;
  border-color: #fff6e0;
}

.filmstrip-arrow:disabled {
  background: #3d3426;
  color: #c8b89a;
  border-color: #6f6754;
  cursor: default;
}

.filmstrip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filmstrip::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

.filmstrip-item {
  flex: 0 0 auto;
  width: 96px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-dim);
  font-family: var(--sans);
  text-align: left;
}

.filmstrip-item img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  background: var(--wall-raised);
  border: 1px solid var(--line);
  filter: saturate(0.75) brightness(0.85);
  transition: filter 150ms ease, border-color 150ms ease;
}

.filmstrip-item:hover img,
.filmstrip-item:focus-visible img {
  filter: saturate(1) brightness(1);
  border-color: var(--brass-soft);
}

.filmstrip-item .fs-date {
  display: block;
  font-size: 0.7rem;
  margin-top: 6px;
  color: var(--ink-faint);
}

.filmstrip-item[aria-current="true"] .fs-date {
  color: var(--brass);
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px clamp(20px, 5vw, 64px) 32px;
  text-align: center;
}

.site-footer p {
  margin: 0 auto;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-faint);
  max-width: 70ch;
}

/* ---------------------------------------------------------
   Reduced motion / small screens
--------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 760px) {
  .site-header {
    align-items: start;
  }

  .site-nav {
    align-self: start;
    margin-top: 2px;
  }

  .site-nav-link {
    display: none;
  }

  .site-menu {
    display: block;
  }
}

@media (max-width: 480px) {
  .painting-links { flex-direction: column; gap: 8px; }
}
