/* ==========================================================================
   Micro Doc Reel — vertical "reel" photo showcase for gallery.html
   New, self-contained stylesheet. Does not modify styles.css; reuses its
   design tokens (colors, spacing, radius, shadows, fonts) via var(--hv-*).
   ========================================================================== */

.doc-reel {
  background: linear-gradient(135deg, var(--hv-deep), #0e211d);
  padding: var(--space-xl) 0;
  overflow: hidden;
}

.doc-reel-head {
  max-width: 640px;
  margin: 0 auto var(--space-lg);
  padding: 0 var(--space-md);
  text-align: center;
}
.doc-reel-head .eyebrow { color: rgba(255, 255, 255, 0.85); }
.doc-reel-head h2 { color: var(--hv-white); }
.doc-reel-sub { color: rgba(255, 255, 255, 0.72); margin: 0; }

.doc-reel-viewport {
  position: relative;
  padding: 0 var(--space-md);
}

.doc-reel-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding: var(--space-xs) 0 var(--space-sm);
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.doc-reel-track::-webkit-scrollbar { display: none; }
.doc-reel-track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.doc-reel-track:focus-visible { outline: 2px solid var(--hv-brass); outline-offset: 6px; border-radius: var(--radius-lg); }

.doc-reel-card {
  position: relative;
  flex: 0 0 auto;
  width: 230px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: var(--shadow-lift);
  background: var(--hv-ink);
}

.doc-reel-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.doc-reel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: 55% 45%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  animation: doc-reel-kenburns-a 20s ease-in-out infinite alternate;
  will-change: transform;
}
.doc-reel-card:nth-child(4n+2) .doc-reel-media img { animation-name: doc-reel-kenburns-b; animation-duration: 24s; }
.doc-reel-card:nth-child(4n+3) .doc-reel-media img { animation-name: doc-reel-kenburns-c; animation-duration: 18s; }
.doc-reel-card:nth-child(4n+4) .doc-reel-media img { animation-name: doc-reel-kenburns-d; animation-duration: 26s; }

@keyframes doc-reel-kenburns-a {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.16) translate(-2.5%, -3%); }
}
@keyframes doc-reel-kenburns-b {
  from { transform: scale(1.08) translate(1.5%, 2%); }
  to   { transform: scale(1.2) translate(-3%, -1%); }
}
@keyframes doc-reel-kenburns-c {
  from { transform: scale(1) translate(0, 1.5%); }
  to   { transform: scale(1.15) translate(2.5%, -2%); }
}
@keyframes doc-reel-kenburns-d {
  from { transform: scale(1.06) translate(-1.5%, 0); }
  to   { transform: scale(1.18) translate(1.5%, 3%); }
}

/* Reduced motion: JS adds .is-static to .doc-reel (checked via matchMedia,
   not a CSS media query, per site convention) — freeze Ken Burns and swap
   smooth scrolling for instant jumps. */
.doc-reel.is-static .doc-reel-media img { animation: none; transform: none; }
.doc-reel.is-static .doc-reel-track { scroll-behavior: auto; }

.doc-reel-caption-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: var(--space-lg) var(--space-sm) var(--space-sm);
  background: linear-gradient(to top, rgba(10, 16, 14, 0.82), rgba(10, 16, 14, 0));
}
.doc-reel-caption-index {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  flex: none;
}
.doc-reel-caption {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--hv-white);
  margin: 0;
}

.doc-reel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(247, 241, 230, 0.94);
  color: var(--hv-teal);
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  z-index: 2;
  transition: background 0.2s ease, transform 0.2s ease;
}
.doc-reel-nav:hover { background: var(--hv-white); transform: translateY(-50%) scale(1.06); }
.doc-reel-nav:focus-visible { outline: 2px solid var(--hv-brass); outline-offset: 2px; }
.doc-reel-prev { left: 0; }
.doc-reel-next { right: 0; }
@media (max-width: 640px) { .doc-reel-nav { display: none; } }

.doc-reel-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  padding: 0 var(--space-md);
}
.doc-reel-progress {
  display: flex;
  gap: 6px;
}
.doc-reel-progress-seg {
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.3s ease;
}
.doc-reel-progress-seg.is-active { background: var(--hv-brass); }

.doc-reel-hint {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  margin: 0;
}

.doc-reel-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .doc-reel { padding: var(--space-xl) 0; }
  .doc-reel-card { width: 66vw; }
}
