/* ============================================================================
   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 ──────────────────────────────────────────────────── */
.modes3__title,
.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;
}
.modes3__lede,
.igstrip__lede {
  margin-top: var(--sp-2);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* ── Three modes ──────────────────────────────────────────────────────────── */
.modes3 {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.modes3__inner {
  position: relative;
  z-index: 1;
  padding-block: var(--sp-16);
}
.modes3__intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-10);
  margin-bottom: var(--sp-8);
}
.modes3__lede { max-width: 380px; margin: 0; }

.modes3__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-block: var(--sp-8);
  border-block: 1px solid var(--line-strong);
}

.mode3 {
  --mode-accent: #087E6D;
  --mode-tint: #E6F5F0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-inline: var(--sp-8);
  color: var(--text);
}
.mode3:first-child { padding-left: 0; }
.mode3:last-child { padding-right: 0; }
.mode3 + .mode3 { border-left: 1px solid var(--line-strong); }
.mode3--marine  { --mode-accent: #22719A; --mode-tint: #E6F1F9; }
.mode3--weather { --mode-accent: #8F5D17; --mode-tint: #FBF1DE; }
:root[data-theme='dark'] .mode3          { --mode-accent: #75D6BC; --mode-tint: rgba(117, 214, 188, 0.13); }
:root[data-theme='dark'] .mode3--marine  { --mode-accent: #8CC8E9; --mode-tint: rgba(140, 200, 233, 0.13); }
:root[data-theme='dark'] .mode3--weather { --mode-accent: #ECCA86; --mode-tint: rgba(236, 202, 134, 0.13); }

.mode3__top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  color: var(--mode-accent);
}
.mode3__ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--mode-tint);
}
.mode3__ic svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode3__eyebrow {
  font-size: 0.875rem;   /* one step up from --fs-eyebrow (12 → 14 px) */
  font-weight: var(--fw-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mode3__title {
  margin-bottom: var(--sp-3);
  font-size: 1.5rem;     /* 24 px desktop (was 22); 21 px ≤ 650 px below */
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.mode3__desc {
  min-height: 3.3em;
  margin-bottom: var(--sp-5);
  color: var(--text-secondary);
  font-size: var(--fs-body-lg);   /* 17 px desktop (was 15); 16 px ≤ 650 px */
  line-height: 1.6;
}
.mode3__list {
  flex: 1;
  margin: 0 0 var(--sp-5);
  padding: 0;
  list-style: none;
  font-size: var(--fs-xs);
  line-height: 1.55;
}
.mode3__list li {
  position: relative;
  margin-bottom: var(--sp-2);
  padding-left: 14px;
}
.mode3__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mode-accent);
}
.mode3__cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--sp-3);
  min-height: 36px;
  color: var(--mode-accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-label);
  text-decoration: none;
}
.mode3__cta span {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--mode-tint);
  font-size: 1.05rem;
  transition: transform var(--dur) var(--ease);
}
.mode3__cta:hover span { transform: translate(2px, -2px); }
.mode3__cta:focus-visible { outline: 2px solid var(--mode-accent); outline-offset: 4px; border-radius: 4px; }

@media (max-width: 850px) {
  .mode3 { padding-inline: var(--sp-5); }
  .modes3__intro { gap: var(--sp-6); }
}
@media (max-width: 650px) {
  .modes3__inner { padding-block: var(--sp-12); }
  .modes3__intro { display: block; margin-bottom: var(--sp-4); }
  .modes3__lede { max-width: none; margin-top: var(--sp-3); }
  .modes3__grid { grid-template-columns: 1fr; padding-block: 0; }
  .mode3, .mode3:first-child, .mode3:last-child { padding: var(--sp-6) 0; }
  .mode3 + .mode3 { border-left: 0; border-top: 1px solid var(--line-strong); }
  .mode3__desc { min-height: 0; font-size: var(--fs-body); }
  .mode3__title { font-size: 1.3125rem; }
}

/* ── 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) {
  .mode3__cta span,
  .igstrip__post,
  .igstrip__video,
  .igstrip__play { transition: none; }
  .igstrip__post:hover { transform: none; }
}
