/* ────────────────────────────────────────────────────────────
   Stories — listing + detail page styles.
   ──────────────────────────────────────────────────────────── */

/* ── Listing page ────────────────────────────────────────── */

.stories-page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(140px, 18vh, 200px) clamp(20px, 4vw, 56px) 100px;
}

.stories-page__header {
  margin-bottom: 56px;
  text-align: center;
}

.stories-page__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-top: 18px;
}
.stories-page__title em {
  color: var(--accent);
  font-style: italic;
  font-weight: 300;
}

.stories-page__lede {
  margin-top: 18px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(15px, 1.4vw, 19px);
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

.stories-page__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stories-empty {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-dim);
}

.story-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  text-decoration: none;
  color: inherit;
  transition: border-color 220ms var(--ease-soft), background 220ms var(--ease-soft), transform 220ms var(--ease-soft);
}
.story-card:hover {
  border-color: var(--hairline-2);
  background: rgba(20, 17, 14, 0.7);
  transform: translateY(-2px);
}
.story-card:hover .story-card__title { color: var(--accent); }

.story-card__thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(201, 181, 140, 0.06);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.story-card__thumb img,
.story-card__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-card__thumb--glyph { font-size: 56px; }

.story-card__body { display: flex; flex-direction: column; justify-content: center; }

.story-card__date {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.story-card__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 400;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 8px;
  transition: color 200ms var(--ease-soft);
}

.story-card__excerpt {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 56ch;
}

.story-card__cta {
  margin-top: 18px;
  display: inline-block;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .story-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .story-card__thumb { aspect-ratio: 16 / 10; }
}

/* ── Detail page ─────────────────────────────────────────── */

.story-page {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(120px, 16vh, 180px) clamp(20px, 4vw, 56px) 100px;
}

.story-article { }

/* Two-column desktop layout: article left, exhibits wall right.
   Collapses to single column under 1024px. */
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: start;
}
.story-grid--solo {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
.story-grid__main {
  min-width: 0;
  max-width: 640px;
}
.story-grid--solo .story-grid__main { max-width: 760px; }
.story-grid__gallery { min-width: 0; }

@media (max-width: 1024px) {
  .story-grid {
    grid-template-columns: 1fr;
    gap: clamp(48px, 8vh, 80px);
  }
  .story-grid--solo { grid-template-columns: 1fr; }
  .story-grid__main { max-width: none; }
}

.story-back {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 36px;
}
.story-back:hover { color: var(--accent); }

.story-article__date {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.story-article__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-top: 14px;
}

.story-hero {
  margin: 36px 0;
}

.story-media {
  display: block;
  width: 100%;
  position: relative;
  padding: 0;
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
  cursor: zoom-in;
  transition: transform 280ms var(--ease-soft), border-color 220ms var(--ease-soft);
}
.story-media:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
}
.story-media img,
.story-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-media--cover img,
.story-media--cover video {
  max-height: 520px;
  width: 100%;
}
.story-media:not(.story-media--cover) {
  aspect-ratio: 4 / 3;
}
.story-media__badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.75);
  border: 1px solid var(--hairline-2);
  color: var(--accent);
  font-size: 13px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Exhibits wall (right column, masonry) ──────────────── */

.gallery-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(28px, 4vh, 44px);
  /* Visually align with the date line on the left at the top of the column */
  padding-top: 2px;
}

.gallery-masonry {
  column-count: 2;
  column-gap: 22px;
}

@media (max-width: 1280px) {
  .gallery-masonry { column-gap: 18px; }
}
@media (max-width: 1024px) {
  /* When the gallery moves below the article, give it more space per piece */
  .gallery-masonry { column-count: 3; column-gap: 16px; margin-top: 0; }
}
@media (max-width: 720px) {
  .gallery-masonry { column-count: 2; column-gap: 12px; }
}
@media (max-width: 420px) {
  .gallery-masonry { column-count: 1; }
}

/* A "piece" is one item on the wall: mat-framed media + tiny exhibit label. */
.gallery-piece {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: clamp(22px, 3vh, 34px);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: zoom-in;
  color: inherit;
}

/* The mat (passe-partout): hairline frame with a thin breathing border. */
.gallery-piece__mat {
  display: block;
  position: relative;
  padding: 6px;
  background: rgba(20, 17, 14, 0.55);
  border: 1px solid var(--hairline-2);
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.4),
    0 10px 26px -16px rgba(0, 0, 0, 0.8);
  transition:
    border-color 280ms var(--ease-soft),
    box-shadow 280ms var(--ease-soft),
    transform 280ms var(--ease-soft);
}
.gallery-piece:hover .gallery-piece__mat,
.gallery-piece:focus-visible .gallery-piece__mat {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.4),
    0 18px 42px -18px rgba(0, 0, 0, 0.9),
    0 0 0 1px var(--accent-glow);
}

.gallery-piece__mat img,
.gallery-piece__mat video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
  /* Media keeps its natural aspect ratio inside the mat */
}

/* Optional play badge on video pieces */
.gallery-piece__badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.78);
  border: 1px solid var(--hairline-2);
  color: var(--accent);
  font-size: 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Wall-label number — like the small museum card under each piece */
.gallery-piece__label {
  display: block;
  margin-top: 10px;
  padding-left: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--text-faint);
  transition: color 280ms var(--ease-soft);
}
.gallery-piece:hover .gallery-piece__label,
.gallery-piece:focus-visible .gallery-piece__label {
  color: var(--accent);
}

.story-article__body {
  margin-top: 28px;
}
.story-article__body p,
.story-article__body ul,
.story-article__body ol,
.story-article__body blockquote {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 22px;
  letter-spacing: 0.005em;
}
.story-article__body p:last-child { margin-bottom: 0; }
.story-article__body h2,
.story-article__body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.005em;
  margin-top: 36px;
  margin-bottom: 14px;
}
.story-article__body h2 { font-size: clamp(26px, 3vw, 36px); }
.story-article__body h3 { font-size: clamp(20px, 2.2vw, 26px); color: var(--accent); font-style: italic; font-weight: 300; }
.story-article__body ul,
.story-article__body ol {
  padding-left: 1.4em;
}
.story-article__body li {
  margin-bottom: 6px;
}
.story-article__body blockquote {
  border-left: 2px solid var(--accent-soft);
  padding-left: 18px;
  margin-left: 0;
  font-style: italic;
  color: var(--text-dim);
}
.story-article__body a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
  transition: color 200ms var(--ease-soft);
}
.story-article__body a:hover { color: var(--text); border-color: var(--accent); }
.story-article__body strong { color: var(--text); font-weight: 500; }
.story-article__body em { color: var(--accent); }

.story-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 40px;
  padding: 14px 26px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.04em;
  transition: background 220ms var(--ease-soft), color 220ms var(--ease-soft), border-color 220ms var(--ease-soft);
}
.story-cta:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ── Admin: story row (for The Story So Far admin tab) ── */

.story-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(10, 8, 7, 0.5);
  transition: border-color 180ms var(--ease-soft), background 180ms var(--ease-soft);
}
.story-row:hover {
  border-color: var(--hairline-2);
  background: rgba(20, 17, 14, 0.6);
}
.story-row__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline-2);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(201, 181, 140, 0.08);
  color: var(--accent);
}
.story-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-row__body { flex: 1; min-width: 0; }
.story-row__title {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-row__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
