/* transform-2030-tabs — mobile (max-width: 767px)
   Checked against the actual mobile frame (Figma node 2245:245): this is
   NOT a scaled-down tab row, it's an accordion - each goal is a
   collapsible row (+/- round button) that expands in place to reveal its
   own heading+cards directly beneath it; the bottom Previous/Next pager
   doesn't exist here at all. Reuses the shared accordion markup/CSS (see
   transform-2030-tabs.css) - only the per-item order/width and visibility
   of the toggle icon change here. */

.transform-2030-tabs {
  /* Figma: uniform 24px padding (not two different per-axis values).
     Literal, not var(--sp7): --sp7 itself drops to 16px at this
     breakpoint (base/spacing/spacing-max-767.css) - its desktop value
     (25px) was only "closest token" reasoning for the unshrunk case,
     never actually checked against its own mobile override. */
  padding: 24px;
  gap: var(--sp4);
  border-radius: var(--radius-xs);
}

.transform-2030-tabs__heading {
  margin-top: calc(var(--sp4) - var(--sp2));
  margin-bottom: var(--sp8);
  flex-direction: column;
}

.transform-2030-tabs__heading-chip {
  display: none;
}

/* Source order already IS the accordion order (tab1, panel1, tab2, panel2,
   ...) - resetting both to the same order value (instead of the desktop
   rule's tab:1/panel:2 split) lets them fall back to that source order
   instead of regrouping into "all tabs, then one panel". */
.transform-2030-tabs__tab,
.transform-2030-tabs__panel {
  order: 0;
  flex: 0 0 100%;
  width: 100%;
}

.transform-2030-tabs .transform-2030-tabs__tab {
  /* The real theme's global mobile button rule
     (`body button:not(.navbar-toggle)`, (0,1,2) specificity) forces
     height:30px/line-height:30px on every <button> at <=767px, beating this
     component's own plain `.tab{height:auto}` fix ((0,1,0) - too low to
     win). Doubled up the selector (0,2,0) to win on class count regardless
     of the global rule's extra type selectors. */
  height: auto;
  line-height: normal;
  /* Figma keeps full tab font-sizes here too (layout_5bfc6328 /
     style_349c75ab / style_966774f0 / style_2569a562 are the exact same
     text styles as desktop) - space-between (not center) is what actually
     changes, to push the new +/- toggle to the row's far edge WHEN there's
     no title/range wrapper to do it instead (Foundation's collapsed row -
     chip + toggle only, nothing in between to grow). */
  justify-content: space-between;
  /* Literal 20px, not var(--sp6): same shrink-at-767 issue as the roof's
     padding-bottom above - Figma keeps this tab's horizontal padding at a
     constant 20px, --sp6 itself drops to 12px at this width. */
  padding-left: 20px;
  padding-right: 20px;
  /* Same fixed-header-clearance pattern already used by the sibling
     transform-2030-focus-areas component (.focus-areas__group's own
     scroll-margin-top) - scrollIntoView() (triggered on tab click, see the
     JS) automatically respects this, so the tapped tab lands below the
     fixed header instead of underneath it. Collapses to just the landing
     gap once the header itself is scrolled out of view. */
  scroll-margin-top: calc(var(--header-height) + var(--sp10));
}

body.page-scroll-down .transform-2030-tabs__tab {
  scroll-margin-top: var(--sp10);
}

/* Figma gives tab1/tab2's title+range wrapper sizing:fill at mobile (unlike
   desktop/tablet, where it's hug/fixed) - it grows to consume the row's
   remaining space itself, keeping it snug against the chip. Without this,
   the row's own justify-content:space-between (needed for Foundation's
   chip-only case just above) instead spreads EXTRA space between chip and
   wrapper too, pushing the title text away from its chip incorrectly. */
.transform-2030-tabs__tab-text {
  flex: 1 1 auto;
}

.transform-2030-tabs__tab-toggle {
  display: flex;
}

/* No Previous/Next pager on mobile - the accordion's own expand/collapse
   replaces it (confirmed absent from the Figma mobile frame entirely, not
   just visually hidden). */
.transform-2030-tabs__pager {
  display: none;
}

/* Slide down/up on expand/collapse via the grid-template-rows 0fr<->1fr
   trick - animates smoothly without knowing the content's pixel height up
   front (unlike max-height, which needs a guessed ceiling) and without JS
   measuring anything. The [hidden] attribute itself is still set by JS for
   the collapsed state (kept for accessibility - it's genuinely not
   interactive/exposed while closed), but its default display:none
   (base stylesheet) would skip the transition entirely, so it's
   overridden back to display:grid here and the 0fr row height takes over
   as the actual "closed" visual state instead. */
.transform-2030-tabs__panel,
.transform-2030-tabs__panel[hidden] {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.transform-2030-tabs__panel.is-active {
  grid-template-rows: 1fr;
}

.transform-2030-tabs__panel-inner {
  min-height: 0;
  overflow: hidden;
}

/* Same as the sibling transform-2030-focus-areas component's own <=767px
   sub-group override. */
.transform-2030-tabs__sub-group {
  margin-top: var(--sp7);
  padding: 20px 0 0 0;
  border: none;
  border-radius: 0;
}

.transform-2030-tabs__sub-group-heading {
  flex-direction: column;
}

/* Below 420px specifically (narrow phones) - the tab row's own chip + title
   + range text was crowding/wrapping at this width with the normal mobile
   sizes (12px gap vs. --sp4's 12px, fs-14/17/14 for chip/title/range), on
   request. No Figma frame exists this narrow (its own mobile frame is a
   standard ~390px device) - tightened by request/judgment, not a spec
   value. */
@media (max-width: 420px) {
  .transform-2030-tabs__tab {
    gap: 5px;
  }

  .transform-2030-tabs__tab-chip {
    font-size: 12px;
  }

  .transform-2030-tabs__tab-title {
    font-size: 14px;
  }

  .transform-2030-tabs__tab-range {
    font-size: 12px;
  }
}
