/* ── A guide as a card ──────────────────────────────────────────
   The guide's own hero photograph, its two-line headline and the line
   under it, with the words at the foot on a scrim. Markup from
   tools/guide-hub.js; used by the homepage reel (css/home.css places it in
   the row) and by guides.html (css/hub.css lays out the grid). Inks are
   literal, because the card is a photograph and stays dark on any ground.
   Since 30.10.2026. */
.gcard {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  color: #EFEBE4;
}
.gcard:focus-visible { outline: 2px solid #E8321E; outline-offset: 4px; }

.gcard-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}
.gcard:hover .gcard-img { transform: scale(1.03); }

/* The words sit at the foot, where the scrim makes every photograph dark
   enough to read on, whichever side its own shadow falls. */
.gcard::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 12, 12, 0.94) 0%, rgba(12, 12, 12, 0.6) 38%, rgba(12, 12, 12, 0) 72%);
}
/* The ink is set on the body, not only on the card: the homepage resets
   every link to its panel's colour, and on a bone panel that put void
   lettering on the photograph. */
.gcard-body {
  color: #EFEBE4;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(8px, 1.2vh, 12px);
  padding: clamp(20px, 3vw, 44px);
  text-align: left;
}
.gcard-topic {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #E8321E;
}
.gcard-title {
  font-family: 'Anton', 'Arial Narrow', Impact, sans-serif;
  font-size: clamp(26px, 3.6vw, 54px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.gcard-sub {
  max-width: 46ch;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 1.4;
  opacity: 0.86;
}
.gcard-go {
  margin-top: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #E8321E;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .gcard-title { font-size: clamp(26px, 8vw, 38px); }
}

@media (prefers-reduced-motion: reduce) {
  .gcard-img { transition: none; }
}

/* ── The guide reel ─────────────────────────────────────────────
   One guide in the middle at full strength, the one before and the one
   after dimmed at the edges. --card-w is the middle card: never wider than
   1040px or two thirds of the window, and never so tall at 16:9 that the
   title, the dots and the link under it leave the screen. The track is
   padded by half of what is left on each side, so the first and the last
   card can both sit in the middle. Markup from tools/guide-hub.js reel(),
   script js/guide-reel.js; on the homepage and the Books page, each on a
   bone panel of its own. Moved here from css/home.css on 30.10.2026. */
.gr {
  --card-w: min(1040px, 68vw, calc((var(--h) - 300px) * 16 / 9));
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(16px, 3vh, 32px) 0 36px;
}

/* Positioned so the cards' offsetLeft is measured from the track, which is
   what the script scrolls by. */
.gr-track {
  position: relative;
  display: flex;
  gap: clamp(14px, 1.6vw, 24px);
  padding: 0 calc((100% - var(--card-w)) / 2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gr-track::-webkit-scrollbar { display: none; }
.gr-track:focus-visible { outline: none; }

.gr .gcard {
  flex: 0 0 var(--card-w);
  scroll-snap-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
/* Dimmed only once the script has said which card is the middle one, so a
   reader without script sees every card at full strength. */
.gr.is-live .gcard:not(.is-current) { opacity: 0.45; transform: scale(0.94); }
/* The arrows sit on the edges of the middle card, over the dimmed ones.
   Centred on the track, which is the box minus the dots' strip under it.
   Two classes, or the pages' button resets outrank them. */
.gr .gr-btn {
  position: absolute;
  top: calc(50% - 18px + clamp(8px, 1.5vh, 16px));
  z-index: 2;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  border: 1px solid rgba(239, 235, 228, 0.3);
  border-radius: 50%;
  background: rgba(12, 12, 12, 0.7);
  color: #EFEBE4;
  font-family: var(--mono);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.gr .gr-btn:hover { background: var(--signal); border-color: var(--signal); }
.gr .gr-btn:disabled { opacity: 0; pointer-events: none; }
.gr-prev { left: calc((100% - var(--card-w)) / 2 - 24px); }
.gr-next { right: calc((100% - var(--card-w)) / 2 - 24px); }

/* A dot per guide, the middle one a red bar. Each is a 24px target with the
   dot drawn inside it, so it can be hit with a thumb. */
.gr-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 2px;
}
.gr-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.gr-dot::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  margin: 0 auto;
  border-radius: 4px;
  background: rgba(var(--rgb-void), 0.22);
  transition: width 0.3s ease, background 0.3s ease;
}
.gr-dot[aria-current]::before { width: 22px; background: var(--signal); }

.gr-foot {
  display: flex;
  justify-content: center;
  padding: clamp(14px, 2.4vh, 28px) var(--gutter) clamp(28px, 5vh, 56px);
}
/* Two classes for the same reason: the homepage resets every link's ink. */
.gr-foot .gr-all {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--signal);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--void);
  transition: color 0.2s;
}
.gr-foot .gr-all:hover { color: var(--signal); }

@media (max-width: 860px) {
  /* Narrow enough that the next guide shows at the right edge, which is
     what says the row swipes. */
  .gr { --card-w: 80vw; flex: none; }
  .gr .gcard { aspect-ratio: 4 / 5; }
  /* A step down from the card's phone size, so the longest headline still
     breaks only at its turn in the narrower card. */
  .gr .gcard-title { font-size: clamp(22px, 6.8vw, 34px); }
  .gr .gr-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gr .gcard,
  .gr-dot::before { transition: none; }
}
