/* =========================================================
   CIRA CLUB — cira-shell.css
   Version: 1.6
   Date: 2026-09-27

   v1.6:
   - fixed Working Area Header for every page
   - title left / local selector right
   - stable shell geometry / no-jitter rule
   - scrollbar space reserved
   - legacy Listen classes mapped to the same shared component

   Previous v1.5:
   - 3-item Issue Road Map: Listen / Language / Speaking Engine
   - no orphan labels or overlapping roadmap items
   - MAIN STORY + Audio | Script locked to one top row
   - larger MAIN STORY heading
   - extra spacing before and after persistent audio player
   - Speaking Engine -> Speaking on mobile
   ========================================================= */

:root {
  --cira-bg: #f0f4f7;
  --cira-surface: #ffffff;
  --cira-surface-soft: #f8fafc;
  --cira-primary: #38475a;
  --cira-primary-hover: #2f3c4d;
  --cira-text: #263442;
  --cira-text-muted: #6f7c89;
  --cira-border: #dce4ea;
  --cira-border-strong: #c8d2db;
  --cira-focus: #5e83a6;
  --cira-radius-card: 16px;
  --cira-radius-control: 10px;
  --cira-content-max: 1180px;

  /* Stable shell geometry */
  --cira-issue-identity-min-height: 78px;
  --cira-stop-header-min-height: 106px;
  --cira-working-header-min-height: 48px;
  --cira-working-header-gap: 24px;
  --cira-working-header-margin-bottom: 28px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--cira-bg);
  color: var(--cira-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

audio,
img,
svg {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

/* =========================================================
   HEADER
   ========================================================= */

.cira-header {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  background: var(--cira-surface);
  border-bottom: 1px solid var(--cira-border);
}

.cira-header__inner {
  width: 100%;
  max-width: var(--cira-content-max);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
}

.cira-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--cira-primary);
  text-decoration: none;
  white-space: nowrap;
}

.cira-brand__name {
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.02em;
}

.cira-brand__section {
  padding-left: 14px;
  border-left: 1px solid var(--cira-border-strong);
  color: var(--cira-text-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
}

.cira-brand:hover .cira-brand__name {
  color: var(--cira-primary-hover);
}

.cira-brand:focus-visible {
  outline: 3px solid var(--cira-focus);
  outline-offset: 6px;
  border-radius: 4px;
}

/* =========================================================
   ISSUE ROAD MAP — 3 MAJOR STOPS
   ========================================================= */

.cira-roadmap {
  width: 100%;
  padding: 22px 0 18px;
  background: var(--cira-surface);
  border-bottom: 1px solid var(--cira-border);
}

.cira-roadmap__inner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
}

.cira-roadmap__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  width: 100%;
}

/* One continuous neutral line BEHIND the circles. */
.cira-roadmap__track::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 28px;
  left: 16.666%;
  right: 16.666%;
  height: 2px;
  background: var(--cira-border);
}

.cira-stop {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--cira-text-muted);
  text-align: center;
}

.cira-stop__circle {
  position: relative;
  z-index: 2;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border: 2px solid var(--cira-border-strong);
  border-radius: 50%;
  background: var(--cira-surface);
  color: var(--cira-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.cira-stop__label {
  display: block;
  width: 100%;
  min-width: 0;
  color: currentColor;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.cira-stop__label-mobile {
  display: none;
}

.cira-stop.is-active {
  color: var(--cira-primary);
}

.cira-stop.is-active .cira-stop__circle {
  border-color: var(--cira-primary);
  background: var(--cira-primary);
  color: #ffffff;
}

.cira-stop.is-active .cira-stop__label {
  font-weight: 700;
}

/* =========================================================
   ISSUE
   ========================================================= */

.cira-issue {
  width: 100%;
  max-width: var(--cira-content-max);
  margin: 0 auto;
  padding: 40px 32px 0;
}

.cira-issue__identity {
  max-width: 920px;
  min-height: var(--cira-issue-identity-min-height);
  margin: 0 0 34px;
}

.cira-issue__meta {
  margin: 0 0 10px;
  color: var(--cira-text-muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.cira-issue__title {
  margin: 0;
  color: var(--cira-text);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

/* =========================================================
   STOP HEADER
   ========================================================= */

.cira-stop-header {
  max-width: 860px;
  min-height: var(--cira-stop-header-min-height);
  margin: 0 0 24px;
}

.cira-stop-header__eyebrow {
  margin: 0 0 8px;
  color: var(--cira-text-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.055em;
}

.cira-stop-header__title {
  margin: 0 0 10px;
  color: var(--cira-primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.cira-stop-header__instruction {
  max-width: 760px;
  margin: 0;
  color: var(--cira-text);
  font-size: 17px;
  line-height: 1.6;
}

/* =========================================================
   WORKING AREA
   ========================================================= */

.cira-working-area {
  width: 100%;
  padding: 32px;
  background: var(--cira-surface);
  border: 1px solid var(--cira-border);
  border-radius: var(--cira-radius-card);
  box-shadow: 0 4px 18px rgba(38, 52, 66, 0.06);
}

/* =========================================================
   MAIN STORY TOP BAR
   ========================================================= */

.cira-working-header,
.cira-story-topbar {
  width: 100%;
  min-height: var(--cira-working-header-min-height);
  margin: 0 0 var(--cira-working-header-margin-bottom);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--cira-working-header-gap);
}

.cira-working-title,
.cira-story-title {
  margin: 0;
  color: var(--cira-primary);
  font-size: 28px;
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* =========================================================
   AUDIO | SCRIPT SELECTOR
   ========================================================= */

.cira-view-selector {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  background: var(--cira-surface-soft);
  border: 1px solid var(--cira-border);
  border-radius: 12px;
  white-space: nowrap;
}

.cira-view-selector__button {
  min-width: 104px;
  min-height: 40px;
  margin: 0;
  padding: 8px 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cira-text-muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.cira-view-selector__button:hover {
  color: var(--cira-primary);
}

.cira-view-selector__button.is-active {
  background: var(--cira-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(38, 52, 66, 0.12);
}

.cira-view-selector__button:focus-visible {
  outline: 3px solid var(--cira-focus);
  outline-offset: 2px;
}


/* =========================================================
   GENERIC WORKING AREA HEADER / SELECTOR
   ========================================================= */

.cira-working-header > :first-child,
.cira-story-topbar > :first-child {
  justify-self: start;
}

.cira-working-header > :last-child,
.cira-story-topbar > :last-child {
  justify-self: end;
}

.cira-view-selector__link {
  min-width: 104px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cira-text-muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.cira-view-selector__link:hover,
.cira-view-selector__link:focus-visible {
  color: var(--cira-primary);
  outline: none;
}

.cira-view-selector__link.is-active {
  background: var(--cira-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(38, 52, 66, 0.12);
}

/* =========================================================
   PERSISTENT AUDIO PLAYER
   ========================================================= */

.cira-player-block {
  width: 100%;
  max-width: 820px;
  margin: 0;
}

.cira-player-label {
  margin: 0 0 20px;
  color: var(--cira-text);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
}

.cira-audio {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 0 0 30px;
}

/* =========================================================
   VIEW PANELS
   ========================================================= */

.cira-view-panel {
  width: 100%;
  max-width: 840px;
}

.cira-audio-mode {
  max-width: 760px;
}

.cira-audio-mode__hint {
  margin: 0;
  color: var(--cira-text-muted);
  font-size: 15px;
  line-height: 1.55;
}

/* Explicit vertical breathing room before script. */
.cira-script {
  max-width: 840px;
  padding-top: 4px;
}

.cira-script__text {
  max-width: 800px;
  color: var(--cira-text);
  font-size: 18px;
  line-height: 1.68;
}

.cira-script__text p {
  margin: 0 0 19px;
}

.cira-script__text p:last-child {
  margin-bottom: 0;
}

.cira-script__question {
  margin-top: 26px !important;
  padding: 20px 22px;
  background: var(--cira-surface-soft);
  border-left: 4px solid var(--cira-primary);
  border-radius: 0 10px 10px 0;
  color: var(--cira-primary);
  font-weight: 650;
}

.cira-script__footer {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--cira-border);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.cira-button {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--cira-radius-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.cira-button--secondary {
  border: 1px solid var(--cira-border-strong);
  background: var(--cira-surface);
  color: var(--cira-primary);
}

.cira-button--secondary:hover {
  border-color: var(--cira-primary);
  background: var(--cira-surface-soft);
}

.cira-button:focus-visible {
  outline: 3px solid var(--cira-focus);
  outline-offset: 3px;
}

.cira-download-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   FOOTER
   ========================================================= */

.cira-footer {
  width: 100%;
  margin-top: 64px;
  background: var(--cira-primary);
  color: #ffffff;
}

.cira-footer__inner {
  width: 100%;
  max-width: var(--cira-content-max);
  margin: 0 auto;
  padding: 30px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cira-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cira-footer__name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.cira-footer__tagline {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.45;
}

.cira-footer__meta {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 500;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1023px) {
  .cira-header {
    min-height: 68px;
  }

  .cira-header__inner,
  .cira-roadmap__inner,
  .cira-issue,
  .cira-footer__inner {
    padding-left: 24px;
    padding-right: 24px;
  }

  .cira-brand__name {
    font-size: 22px;
  }

  .cira-story-title {
    font-size: 25px;
  }

  .cira-footer {
    margin-top: 48px;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {
  body {
    font-size: 16px;
  }

  .cira-header {
    min-height: 64px;
  }

  .cira-header__inner,
  .cira-roadmap__inner,
  .cira-issue,
  .cira-footer__inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .cira-brand {
    gap: 10px;
  }

  .cira-brand__name {
    font-size: 20px;
  }

  .cira-brand__section {
    padding-left: 10px;
    font-size: 12px;
  }

  .cira-roadmap {
    padding-top: 18px;
    padding-bottom: 14px;
  }

  .cira-roadmap__track::before {
    top: 23px;
  }

  .cira-stop {
    padding-left: 3px;
    padding-right: 3px;
  }

  .cira-stop__circle {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    font-size: 15px;
  }

  .cira-stop__label {
    font-size: 13px;
  }

  .cira-stop__label-desktop {
    display: none;
  }

  .cira-stop__label-mobile {
    display: inline;
  }

  .cira-issue {
    padding-top: 28px;
  }

  .cira-issue__identity {
    margin-bottom: 28px;
  }

  .cira-issue__meta {
    font-size: 13px;
  }

  .cira-issue__title {
    font-size: 26px;
    line-height: 1.25;
  }

  .cira-stop-header {
    margin-bottom: 20px;
  }

  .cira-stop-header__eyebrow {
    font-size: 13px;
  }

  .cira-stop-header__title {
    font-size: 21px;
  }

  .cira-stop-header__instruction {
    font-size: 16px;
  }

  .cira-working-area {
    padding: 20px 18px;
  }

  .cira-working-header,
  .cira-story-topbar {
    min-height: 44px;
    gap: 10px;
    margin-bottom: 24px;
  }

  .cira-working-title,
  .cira-story-title {
    font-size: 20px;
    white-space: nowrap;
  }

  .cira-view-selector {
    padding: 3px;
  }

  .cira-view-selector__button,
  .cira-view-selector__link {
    min-width: 62px;
    min-height: 38px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .cira-player-label {
    margin-bottom: 18px;
    font-size: 18px;
  }

  .cira-audio {
    margin-bottom: 28px;
  }

  .cira-audio-mode__hint {
    font-size: 14px;
  }

  .cira-script__text {
    font-size: 17px;
    line-height: 1.65;
  }

  .cira-script__question {
    padding: 18px;
  }

  .cira-footer {
    margin-top: 40px;
  }

  .cira-footer__inner {
    padding-top: 26px;
    padding-bottom: 26px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

@media (max-width: 380px) {
  .cira-brand__name {
    font-size: 19px;
  }

  .cira-brand__section {
    font-size: 11px;
  }

  .cira-issue__title {
    font-size: 24px;
  }

  .cira-working-area {
    padding-left: 14px;
    padding-right: 14px;
  }

  .cira-working-title,
  .cira-story-title {
    font-size: 18px;
  }

  .cira-view-selector__button {
    min-width: 56px;
    padding-left: 7px;
    padding-right: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
