/* ============================================================================
   home-sections.css — the Home sections around Recommended forecast:
   Three Modes and the Instagram strip (web redesign, Stage 1; the map
   showcase was removed 2026-10-03).

   Every colour is a token from css/tokens.css / css/theme-tokens.css, so dark
   theme is the token swap and nothing else. The three mode accents are the
   one local palette; each carries its own dark value below.
   ========================================================================== */

/* ── shared section head ──────────────────────────────────────────────────── */
.igstrip__title {
  margin-top: var(--sp-2);
  font-size: var(--fs-h2);
  font-weight: var(--fw-display);
  letter-spacing: var(--tracking-tight);
  line-height: 1.12;
}
.igstrip__lede {
  margin-top: var(--sp-2);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* ── Three modes ──────────────────────────────────────────────────────────── */

/* ── Instagram strip ──────────────────────────────────────────────────────── */
.igstrip {
  padding-block: var(--sp-12) var(--sp-10);
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bf-top) 0%, var(--bg) 100%);
}
.igstrip[hidden] { display: none; }
.igstrip__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
}
.igstrip__profile {
  flex: none;
  padding-block: var(--sp-3);
  color: var(--accent-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-label);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}
.igstrip__profile:hover { border-color: var(--accent); }

.igstrip__viewport {
  margin-block: var(--sp-8) var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.igstrip__viewport::-webkit-scrollbar { display: none; }
.igstrip__viewport:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.igstrip__track {
  display: flex;
  gap: var(--sp-5);
  width: max-content;
  margin: 0;
  padding: var(--sp-3) var(--sp-5);
  list-style: none;
}
/* Portrait, at the Swell Stories frame's proportions (280 x 338). */
.igstrip__post {
  position: relative;
  display: block;
  flex: none;
  width: 280px;
  aspect-ratio: 280 / 338;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-sunken);
  transition: transform var(--dur) var(--ease);
}
.igstrip__post:hover { transform: translateY(-5px); }
.igstrip__post:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.igstrip__post img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* video cards: the same card as a button, the thumbnail under a play mark;
   the inline video covers it only while playing (muted, looping) */
button.igstrip__post {
  padding: 0; border: 0; margin: 0;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
.igstrip__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.igstrip__post[data-playing] .igstrip__video { opacity: 1; }
.igstrip__play {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(8, 18, 32, 0.55);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: opacity var(--dur) var(--ease);
}
.igstrip__play svg { width: 24px; height: 24px; margin-left: 3px; }
.igstrip__post[data-playing] .igstrip__play,
.igstrip__post[data-failed] .igstrip__play { opacity: 0; }

/* the lightbox: sound + controls + the post */
.iglb {
  width: min(92vw, 520px);
  max-height: 92vh;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-md);
}
.iglb::backdrop { background: rgba(4, 10, 20, 0.72); }
.iglb__stage { display: grid; place-items: center; margin-top: var(--sp-6); }
.iglb__video, .iglb__poster {
  display: block;
  width: 100%;
  max-height: 72vh;
  border-radius: 8px;
  background: #000;
  object-fit: contain;
}
.iglb__note { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.iglb__x {
  position: absolute; top: var(--sp-3); right: var(--sp-3);
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg); color: var(--text); cursor: pointer;
}
.iglb__x svg { width: 18px; height: 18px; }
.iglb__x:hover { border-color: var(--accent); }
.iglb__x:focus-visible, .iglb__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.iglb__link {
  display: inline-block;
  margin-top: var(--sp-3);
  font-weight: var(--fw-label);
  color: var(--accent-text);
}

.igstrip__controls {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
}
.igstrip__btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.igstrip__btn--pause {
  width: auto;
  padding-inline: var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-label);
}
.igstrip__btn svg { width: 18px; height: 18px; }
.igstrip__btn:hover { border-color: var(--accent); color: var(--accent-text); }
.igstrip__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 650px) {
  .igstrip__head { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .igstrip__post { width: 235px; }
}

@media (prefers-reduced-motion: reduce) {
  .igstrip__post,
.igstrip__video,
.igstrip__play { transition: none; }
  .igstrip__post:hover { transform: none; }
}
