/* webapp/public/css/story.css */
.story-page {
  max-width: 1400px;
  margin: 0 auto;
  /* Clear the fixed header, whose height nav.js keeps in --header-h. */
  padding: calc(var(--header-h, 100px) + 32px) 24px 48px;
}

.story-back {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
}

.story-back:hover {
  text-decoration: underline;
}

.story-hero {
  margin-bottom: 40px;
  text-align: center;
}

.story-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 8px;
}

.story-hero-loc {
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.story-narrative {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.6;
}

.story-planner {
  margin-top: 24px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.story-narrative:empty {
  display: none;
}

.story-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1700px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.story-g-row {
  display: flex;
  gap: 16px;
  height: var(--row-h, clamp(220px, 30vw, 480px));
}

.story-photo {
  flex-shrink: 1;
  flex-basis: 0;
  min-width: 0;
  height: 100%;
  display: block;
  position: relative;
  overflow: hidden;
}

.story-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(33, 29, 22, 0);
  transition: background 0.35s ease;
}

.story-photo:hover::before {
  background: rgba(33, 29, 22, 0.14);
}

.story-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(33, 29, 22, 0.95);
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.story-lightbox.open {
  display: flex;
}

.story-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.story-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: 1px solid var(--paper);
  color: var(--paper);
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
}

@media (max-width: 900px) {
  .story-gallery,
  .story-g-row {
    gap: 8px;
  }
  .story-g-row {
    height: auto;
    flex-direction: column;
  }
  .story-photo {
    flex: none;
    height: auto;
    width: 100%;
  }
  .story-photo img {
    height: auto;
    object-fit: initial;
  }
}
