/* The Greeks & Gamma Exposure chapter's shell (showcase/chapters/_greeks.html, greeks.js) on
   /how-it-works/ (#greeks): the tab bar, the tabpanels and the CTAs. Each panel inside a tabpanel has its
   own stylesheet (greek-heatmap.css, greek-gex.css, greek-gexmap.css, greek-intraday.css, greek-dist.css,
   greek-spot.css); nothing here styles a panel. Same pattern as the Market Regimes shell (regimes.css),
   with six tabs instead of three: on wide screens they wrap onto two rows, below 900px they stay on one
   row that scrolls sideways inside the gutters (greeks.js keeps the active tab in sight). Everything is
   gk-* and scoped under .gk so it beats landing.css's element reset. Only transform and opacity animate,
   and nothing does under reduced motion. */

.gk-sample {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--lp-sp-2);
  color: var(--lp-muted); font-size: var(--lp-fs-xs);
}

/* ---- tabs: hidden until greeks.js runs (without it the six panels show stacked) ---- */
.gk-tabs-wrap { display: none; }
.gk.is-ready .gk-tabs-wrap { display: flex; justify-content: center; min-width: 0; margin: 0 0 var(--lp-sp-4); }
.gk-tabs {
  position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--lp-sp-2);
  padding: var(--lp-sp-1); width: fit-content; max-width: 100%; min-width: 0;
  border: 1px solid var(--lp-border); border-radius: var(--lp-r); background: var(--lp-surface-2);
}
.gk .gk-tab {
  position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: var(--lp-sp-2);
  min-height: 40px; padding: 0 var(--lp-sp-4); overflow: hidden;
  border: 1px solid transparent; border-radius: var(--lp-r-pill); background: none; cursor: pointer;
  color: var(--lp-muted); font: 600 var(--lp-fs-sm)/1.2 var(--lp-font); white-space: nowrap;
}
.gk .gk-tab:hover { color: var(--lp-text); }
.gk .gk-tab[aria-selected="true"] {
  color: var(--lp-text); border-color: var(--lp-primary);
  background: color-mix(in srgb, var(--lp-primary) 24%, transparent);
}
.gk .gk-tab:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: -2px; }
.gk-tab-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--lp-g-analytics); }
.gk-tab-dot--heatmap { background: var(--lp-g-analytics); }                       /* cyan */
.gk-tab-dot--gex { background: var(--lp-green); }                                 /* green */
.gk-tab-dot--gexmap { background: var(--lp-g-flow); }                             /* violet */
.gk-tab-dot--intraday { background: var(--lp-tv-yellow); }                        /* yellow */
.gk-tab-dot--dist { background: var(--lp-g-investing); }                          /* blue */
.gk-tab-dot--spot { background: color-mix(in srgb, var(--lp-g-analytics) 60%, var(--lp-text)); } /* sky */

/* The auto-rotation cue: a thin bar along the bottom of the active tab, shown only while the tabs
   will move on by themselves (.is-rotating, set by greeks.js). The bar's length is not a timer:
   panels say when they are done, so it sweeps instead of filling. */
.gk-tab-prog {
  position: absolute; left: var(--lp-sp-4); right: var(--lp-sp-4); bottom: 4px; height: 2px;
  overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--lp-accent) 18%, transparent);
  opacity: 0; transition: opacity .2s var(--lp-ease);
  pointer-events: none;
}
.gk-tab-prog i {
  position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--lp-accent);
  transform: translateX(-100%);
}
.gk.is-rotating .gk-tab[aria-selected="true"] .gk-tab-prog { opacity: 1; }
.gk.is-rotating .gk-tab[aria-selected="true"] .gk-tab-prog i { animation: gk-sweep 1.8s var(--lp-ease) infinite; }
@keyframes gk-sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---- panels ---- */
.gk-panels { display: flex; flex-direction: column; gap: var(--lp-sp-7); }
.gk.is-ready .gk-panels { display: block; }
.gk .gk-panel { min-width: 0; }
.gk .gk-panel[hidden] { display: none !important; }
.gk .gk-panel-label {
  display: flex; align-items: center; gap: var(--lp-sp-2); margin: 0 0 var(--lp-sp-3);
  color: var(--lp-text); font: 700 var(--lp-fs-md)/1.3 var(--lp-font);
}
.gk.is-ready .gk-panel-label { display: none; }
.gk-panel.is-in { animation: gk-in .35s var(--lp-ease) both; }
@keyframes gk-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- CTAs and the guide link ---- */
.gk-foot { display: flex; flex-direction: column; align-items: center; gap: var(--lp-sp-4); margin-top: var(--lp-sp-6); text-align: center; }
.gk-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--lp-sp-3); }
.gk .gk-foot-note { max-width: 62ch; margin: 0; color: var(--lp-muted); font-size: var(--lp-fs-sm); }
.gk .gk-guide { color: var(--lp-accent); font-weight: 600; }
.gk .gk-guide:hover { color: var(--lp-text); text-decoration: underline; }

/* ---- reduced motion: no fade, no sweep (greeks.js does not rotate either) ---- */
@media (prefers-reduced-motion: reduce) {
  .gk-panel.is-in { animation: none !important; }
  .gk-tab-prog { display: none !important; }
  .gk-tab-prog, .gk .gk-tab { transition: none !important; }
}

/* ---- below 900px: one row that scrolls sideways inside the 16px gutters, never the page ---- */
@media (max-width: 899.98px) {
  .gk.is-ready .gk-tabs-wrap { justify-content: flex-start; }
  .gk-tabs {
    flex-wrap: nowrap; justify-content: flex-start; width: auto;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .gk-tabs::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .gk .gk-tab { padding: 0 var(--lp-sp-3); }
  .gk-tab-prog { left: var(--lp-sp-3); right: var(--lp-sp-3); }
}
@media (max-width: 479.98px) {
  .gk-ctas, .gk-ctas .lp-btn { width: 100%; }
}
