/* ============ PAGE HEADER ============ */
.page-head {
  padding: calc(clamp(96px, 15vh, 170px) + 40px) 0 clamp(48px, 8vh, 90px);
  border-bottom: 1px solid var(--hairline);
}

.page-head .shell { display: grid; gap: 18px; }

.page-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0;
}

.page-head .page-tagline {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin: 0;
}

.page-head .page-blurb {
  color: var(--fg-dim);
  max-width: 54ch;
  margin: 0;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
}

.crumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.crumbs a { text-decoration: none; transition: color 0.3s var(--ease); }
.crumbs a:hover { color: var(--gold); }

/* ============ GALLERY GRID ============ */
.gallery-body { padding: clamp(48px, 8vh, 96px) 0 clamp(90px, 14vh, 160px); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(18px, 2.4vw, 38px);
  align-items: start;
}

.art-card {
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.5s var(--ease), transform 0.6s var(--ease-out),
              box-shadow 0.6s var(--ease-out);
}

.art-card:hover {
  border-color: var(--gold-edge);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.art-frame {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.art-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease-out), filter 0.6s var(--ease);
}

.art-frame:hover img { transform: scale(1.06); filter: brightness(0.72); }

/* This label lands on the artwork itself, which the hover above darkens to
   72% brightness. It followed the page's ink colour, so the relight left it
   near-black on a darkened photograph -- the word was there and unreadable.
   It belongs to the media palette, not the paper one. */
.art-frame-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--on-media);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease), transform 0.5s var(--ease-out);
  pointer-events: none;
}

.art-frame:hover .art-frame-hint,
.art-frame:focus-visible .art-frame-hint { opacity: 1; transform: translateY(0); }

.art-body { padding: 20px 22px 22px; }

.art-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.art-desc {
  color: var(--fg-dim);
  font-size: 0.86rem;
  margin: 8px 0 0;
}

.art-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.like-btn,
.comment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--control);
  border: 1px solid var(--hairline-strong);
  color: var(--fg-dim);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.like-btn:hover:not(:disabled),
.comment-toggle:hover { color: var(--fg); background: var(--control-hover); border-color: var(--gold-edge); }

.like-btn.is-liked {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-soft);
  font-weight: 500;
}

.like-btn:disabled { cursor: default; }
.like-btn .heart { font-size: 0.95rem; line-height: 1; }

.art-error { color: var(--danger); font-size: 0.8rem; margin: 12px 0 0; }

/* ============ COMMENTS ============ */
.comments-panel,
.reader-comments { margin-top: 18px; border-top: 1px solid var(--hairline); padding-top: 16px; }

.comments-list { display: grid; gap: 8px; max-height: 210px; overflow-y: auto; margin-bottom: 14px; }

/* These same rules render on the paper page AND inside the black comic
   reader, so they are written against the surface tokens rather than fixed
   translucent blacks -- a 4.5%-black bubble is invisible on both grounds. */
.comment {
  position: relative;
  background: var(--bg-sunken);
  border-radius: 3px;
  padding: 10px 34px 10px 12px;
  font-size: 0.86rem;
  word-break: break-word;
}

.comment strong { display: block; color: var(--gold); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 4px; }
.comment span { color: var(--fg); }

.comment-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  line-height: 1;
}

.comment-del:hover { background: rgba(157, 51, 45, 0.16); }

.no-comments { color: var(--fg-dim); font-size: 0.84rem; margin: 0; }

.comment-form { display: grid; gap: 8px; }

.comment-form input,
.comment-form textarea {
  background: var(--field);
  border: 1px solid var(--field-edge);
  border-radius: 3px;
  color: var(--fg);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.comment-form textarea { min-height: 76px; }

.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--fg-faint); }

.comment-form .link-btn { justify-self: start; padding: 10px 22px; font-size: 0.68rem; }

.empty-state {
  text-align: center;
  padding: clamp(60px, 12vh, 120px) 20px;
  color: var(--fg-faint);
}

.empty-state h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  color: var(--fg-dim);
  margin: 0 0 10px;
}

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(8px, 2vw, 28px);
  padding: clamp(56px, 9vh, 90px) clamp(12px, 3vw, 46px);
  background: rgba(4, 4, 6, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.lightbox.is-open { opacity: 1; }

.lb-stage {
  margin: 0;
  display: grid;
  gap: 18px;
  justify-items: center;
  min-height: 0;
  height: 100%;
  grid-template-rows: 1fr auto;
}

.lb-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease-out);
}

.lb-image.is-loaded { opacity: 1; transform: scale(1); }

.lb-caption { text-align: center; }

.lb-title {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
}

.lb-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.lb-close,
.lb-arrow {
  background: var(--control);
  border: 1px solid var(--hairline-strong);
  color: var(--fg);
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.lb-close:hover,
.lb-arrow:hover { background: var(--gold-fill); color: var(--on-gold); border-color: var(--gold); }

.lb-arrow { width: 52px; height: 52px; font-size: 1.1rem; }

.lb-close {
  position: absolute;
  top: 20px;
  right: clamp(12px, 3vw, 46px);
  width: 46px;
  height: 46px;
  font-size: 1.6rem;
}

.lb-counter {
  position: absolute;
  top: 28px;
  left: clamp(12px, 3vw, 46px);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--fg-faint);
}

@media (max-width: 700px) {
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding-bottom: 20px; }
  .lb-arrow { position: absolute; bottom: 22px; width: 46px; height: 46px; }
  .lb-prev { left: 20%; }
  .lb-next { right: 20%; }
  .lb-caption { padding-bottom: 56px; }
}

/* ============ GALLERY INDEX ============ */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(18px, 2.2vw, 32px);
}

.index-card {
  position: relative;
  display: block;
  text-decoration: none;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 5 / 6;
  background: var(--bg-raised);
}

.index-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.3s var(--ease-out), filter 0.6s var(--ease);
  filter: brightness(0.62) saturate(0.9);
}

.index-card:hover img { transform: scale(1.07); filter: brightness(0.45) saturate(1); }

.index-card-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px;
  display: grid;
  gap: 8px;
}

.index-card-body h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1;
  margin: 0;
}

.index-card-body p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 0.88rem;
  max-width: 32ch;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s var(--ease-out), opacity 0.5s var(--ease);
}

.index-card:hover .index-card-body p { max-height: 6em; opacity: 1; }

.index-card-body .go {
  font-size: 0.64rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ================= SMALL SCREENS ================= */
@media (max-width: 700px) {
  .page-head {
    padding: calc(clamp(70px, 12vh, 110px) + 28px) 0 clamp(30px, 5vh, 50px);
  }

  .page-head h1 { font-size: clamp(2.3rem, 12vw, 3.4rem); }
  .page-head .page-blurb { font-size: 0.95rem; }

  .crumbs { font-size: 0.6rem; letter-spacing: 0.14em; flex-wrap: wrap; }

  .gallery-body { padding: 34px 0 64px; }

  .gallery-grid { gap: 16px; }

  .art-body { padding: 16px 16px 18px; }
  .art-title { font-size: 1.1rem; }

  .art-actions { gap: 8px; }
  .like-btn, .comment-toggle { padding: 9px 14px; font-size: 0.66rem; }

  .comments-list { max-height: 200px; }

  /* Index cards can't rely on hover, so the description is always shown. */
  .index-card { aspect-ratio: 4 / 3; }
  .index-card-body { padding: 20px; }
  .index-card-body p { max-height: 6em; opacity: 1; }
  .index-card img { filter: brightness(0.5) saturate(0.95); }
}

@media (max-width: 380px) {
  .art-body { padding: 14px; }
  .lb-close { top: 12px; width: 42px; height: 42px; }
  .lb-counter { top: 22px; font-size: 0.62rem; }
}
