/* =========================================================
   CAREHUB SHELL – FLATTENED FOUNDATION
   Fonts • Tokens • Cards • Subpage • Shared chrome
   Homepage column scaling lives in homepage <style>
   ========================================================= */

/* ---------- FONTS ---------- */
@font-face {
  font-family: 'Julius Sans One';
  src: url('/fonts/julius-sans-one/julius-sans-one-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/montserrat/montserrat-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- RESET ---------- */
:root { color-scheme: dark; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #141f2c;
  color: #fff;
  font-family: 'Montserrat', Arial, sans-serif;
}

/* ---------- TOKENS ---------- */
.page-shell {
  /* Colours */
  --bg-top: #203448;
  --bg-bottom: #141f2c;
  --panel: rgba(84, 112, 166, 0.18);
  --panel-border: rgba(196, 220, 241, 0.28);
  --panel-bg: rgba(10, 69, 121, 0.6);
  --text-primary: #ffffff;
  --text-secondary: #ffffff;
  --text-muted: #ffffff;
  --radius: 18px;
  --title-font: 'Julius Sans One', sans-serif;

  /* Scale (homepage overrides this; subpage can use its own) */
  --desktop-content-scale: 1;
  --desktop-track-scale: 1;
  --desktop-stage-scale: 1;

  /* Cards */
  --desktop-card-size-base: 100px;
  --grid-card-size: calc(var(--desktop-card-size-base) * var(--desktop-track-scale));
  --grid-card-blue: rgb(64 114 170);
  --grid-card-surface-top: color-mix(in srgb, rgb(0 92 145 / 31%) 70%, white 30%);
  --grid-card-surface-mid: color-mix(in srgb, rgb(35 92 152 / 79%) 80%, rgb(38 52 81) 20%);
  --grid-card-surface-bottom: color-mix(in srgb, rgb(41 98 158) 64%, rgb(10 18 31) 36%);
  --grid-card-border: color-mix(in srgb, var(--grid-card-blue) 68%, white 32%);
  --grid-card-shadow-stack:
    inset 0 0 0 color-mix(in srgb, white 23.6%, rgb(63 113 168) 77.4%),
    inset 0 -8px 48px rgb(64 114 170),
    0 10px 15px rgb(16 35 58 / 21%),
    0 0 36px color-mix(in srgb, color-mix(in srgb, var(--grid-card-blue) 82%, black 18%) 8.4%, #00000059 91.6%);

  /* Labels */
  --grid-label-size: calc(14px * var(--desktop-track-scale));
  --grid-label-line-height: 1.16;
  --grid-label-block-height: calc(var(--grid-label-size) * var(--grid-label-line-height) * 2);
  --grid-item-gap: calc(10px * var(--desktop-track-scale));

  /* Action bar */
  --actionbar-height: calc(78px * var(--desktop-track-scale));
  --actionbar-hover-stroke: #e1e0bd;
  --actionbar-hover-border: var(--actionbar-hover-stroke);

  /* Podcast flags */
  --rhs-podcast-flag-width: calc(64px * var(--desktop-content-scale));
  --rhs-podcast-flag-height: calc(48px * var(--desktop-content-scale));
  --rhs-podcast-grid-gap-y: calc(12px * var(--desktop-content-scale));

  /* Podcast helper */
  --podcast-helper-width: calc(294px * var(--desktop-content-scale));
  --podcast-helper-card-radius: calc(16px * var(--desktop-content-scale));
  --podcast-helper-card-pad-top: calc(10px * var(--desktop-content-scale));
  --podcast-helper-card-pad-inline: calc(14px * var(--desktop-content-scale));
  --podcast-helper-card-pad-bottom: calc(12px * var(--desktop-content-scale));
  --podcast-helper-label-size: calc(12px * var(--desktop-content-scale));
  --podcast-helper-arrow-outer-width: calc(30px * var(--desktop-content-scale));
  --podcast-helper-arrow-outer-height: calc(20px * var(--desktop-content-scale));
  --podcast-helper-arrow-inner-width: calc(20px * var(--desktop-content-scale));
  --podcast-helper-arrow-inner-height: calc(12px * var(--desktop-content-scale));
  --podcast-helper-arrow-tip-height: calc(14px * var(--desktop-content-scale));

  /* Shell background */
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(9, 18, 29, 0.06) 0%, rgba(9, 18, 29, 0.08) 100%),
    var(--shell-bg-image, url('images/homepage-bg-blue-16x9-1920-q95.webp')) center / cover no-repeat,
    radial-gradient(circle at top left, rgba(156, 204, 250, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(251, 196, 119, 0.1), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

/* ---------- TITLES ---------- */
.brand-top-title,
.panel-title,
.grid-dropdown-title {
  margin: 0;
  font-family: var(--title-font);
  font-size: calc(22px * var(--desktop-content-scale));
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* ---------- PANEL CHROME (shared) ---------- */
.information-center-panel,
.rhs-grid-rail {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.information-center-panel-header,
.podcast-language-panel-header,
.homepage-video-panel-header {
  min-height: var(--actionbar-height);
  background: linear-gradient(180deg, rgba(40, 120, 178, 0.87), rgb(14, 17, 55));
}

.information-center-panel-header .brand-top-panel-content,
.podcast-language-panel-header .brand-top-panel-content,
.homepage-video-panel-header .brand-top-panel-content {
  min-height: var(--actionbar-height);
  display: grid;
  place-items: center;
  text-align: center;
}

/* ---------- CARDS ---------- */
.grid-card,
.grid-action-surface {
  width: var(--grid-card-size);
  height: var(--grid-card-size);
  border-radius: calc(20px * var(--desktop-content-scale));
  border: 2px solid var(--grid-card-border);
  background: linear-gradient(
    180deg,
    var(--grid-card-surface-top) 0%,
    var(--grid-card-surface-mid) 48%,
    var(--grid-card-surface-bottom) 100%
  );
  box-shadow: var(--grid-card-shadow-stack);
}

.grid-card--careapp-cta {
  border-color: rgba(176, 235, 150, 0.86);
  background: linear-gradient(180deg, rgba(107, 187, 112, 0.98), rgba(76, 156, 82, 0.98));
  box-shadow:
    inset 0 0 0 rgba(255, 255, 255, 0.24),
    inset 0 -8px 36px rgba(58, 129, 63, 0.58),
    0 10px 18px rgba(14, 44, 18, 0.28);
}

.grid-item-control,
.grid-action-slot,
.utility-link,
.static-card,
.icon-link {
  display: grid;
  grid-template-rows: var(--grid-card-size) var(--grid-label-block-height);
  justify-items: center;
  align-content: start;
  row-gap: var(--grid-item-gap);
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.grid-item-control:hover .grid-card,
.grid-item-control:focus-visible .grid-card,
.icon-link:hover .grid-action-surface,
.icon-link:focus-visible .grid-action-surface,
.utility-link:hover .grid-card,
.utility-link:focus-visible .grid-card {
  border-color: var(--actionbar-hover-border);
  transform: translateY(-1px);
}

.grid-item-control.selected .grid-card,
.grid-item-control.active .grid-card,
.icon-link.selected .grid-action-surface,
.icon-link.active .grid-action-surface {
  border-color: var(--actionbar-hover-border);
  transform: translateY(-1px);
  box-shadow: var(--grid-card-shadow-stack), 0 0 0 3px rgba(225, 224, 189, 0.4);
}

.grid-item-control:focus-visible,
.icon-link:focus-visible,
.utility-link:focus-visible {
  outline: 2px solid var(--actionbar-hover-stroke);
  outline-offset: 4px;
  border-radius: 12px;
}

/* ---------- LABELS ---------- */
.grid-card-label,
.utility-label {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--grid-label-size);
  line-height: var(--grid-label-line-height);
  font-weight: 500;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: var(--grid-label-block-height);
  transform: none;
}

.grid-card-label--two-line span,
.utility-label--two-line span {
  display: block;
}

/* ---------- PODCAST FLAGS ---------- */
.podcast-language-grid {
  display: grid;
  grid-template-columns: repeat(3, var(--rhs-podcast-flag-width));
  column-gap: 18px;
  row-gap: var(--rhs-podcast-grid-gap-y);
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}

.podcast-language-tile {
  display: grid;
  justify-items: center;
  align-content: start;
  row-gap: calc(6px * var(--desktop-content-scale));
}

.podcast-language-button {
  display: grid;
  justify-items: center;
  align-content: start;
  row-gap: calc(6px * var(--desktop-content-scale));
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  position: relative;
}

.podcast-language-flag {
  width: var(--rhs-podcast-flag-width);
  height: var(--rhs-podcast-flag-height);
  border-radius: calc(10px * var(--desktop-content-scale));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 18px rgba(7, 15, 27, 0.28);
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.podcast-language-button:hover .podcast-language-flag,
.podcast-language-button:focus-visible .podcast-language-flag,
.podcast-language-button[aria-expanded='true'] .podcast-language-flag {
  border-color: var(--actionbar-hover-border);
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(7, 15, 27, 0.34);
}

.podcast-language-button:focus-visible {
  outline: 2px solid var(--actionbar-hover-stroke);
  outline-offset: 4px;
  border-radius: 12px;
}

.podcast-language-button[data-podcast-unavailable='true']::after {
  content: 'Soon';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translate(-50%, 4px);
  padding: 2px 6px;
  border: 1px solid rgba(196, 220, 241, 0.42);
  border-radius: 999px;
  background: rgba(13, 20, 34, 0.88);
  color: rgba(245, 237, 228, 0.88);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
  z-index: 5;
}

.podcast-language-button[data-podcast-unavailable='true']:hover::after,
.podcast-language-button[data-podcast-unavailable='true']:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}



/* ---------- UTILITY STRIP (shared structure) ---------- */
.portrait-utility-strip-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 63px 85px;
  width: 100%;
  padding-top: 30px;
  box-sizing: border-box;
}

.portrait-utility-strip-panel .rupert-avatar,
.portrait-utility-strip-panel .icon-avatar {
  width: 105px;
  height: 105px;
  border: 2px solid var(--panel-border);
  border-radius: 20px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.portrait-utility-strip-panel .home-icon {
  width: 80px;
  height: 85px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.portrait-utility-strip-panel .icon-link[aria-label="Home"] .grid-card {
  background: transparent;
  border: none;
  box-shadow: none;
  display: grid;
  place-items: center;
}

/* ---------- SUBPAGE ---------- */
.page-shell.subpage-shell {
  --subpage-left-panel-width: 400px;
  --subpage-shell-card-size: 100px;
  --subpage-shell-label-block-height: var(--grid-label-block-height);
  --subpage-shell-item-gap: 12px;
  --subpage-shell-row-gap: 50px;
  --subpage-stage-frame-stroke: rgba(196, 220, 241, 0.22);
  --subpage-inline-frame-width: calc(962px * var(--desktop-stage-scale));
  --subpage-inline-hero-height: calc(285px * var(--desktop-stage-scale));
}

.page-shell.subpage-shell .grid-hero-row {
  display: flex;
  flex-direction: row;
  gap: 52px;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}

.page-shell.subpage-shell .grid-shell-frame,
.page-shell.subpage-shell .information-center-panel {
  flex: 0 0 var(--subpage-left-panel-width);
  width: var(--subpage-left-panel-width);
  min-width: var(--subpage-left-panel-width);
  max-width: var(--subpage-left-panel-width);
}

.page-shell.subpage-shell .grid-media-stack,
.page-shell.subpage-shell .subpage-stage-panel {
  flex: 1 1 auto;
  min-width: 0;
}

.page-shell.subpage-shell .rhs-grid-rail {
  flex: 0 0 400px;
  width: 400px;
  min-width: 400px;
  max-width: 400px;
}

.page-shell.subpage-shell .grid-shell {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: var(--subpage-shell-row-gap);
  column-gap: 20px;
  padding: 0 0px;
  justify-content: center;
}

.page-shell.subpage-shell .grid-shell .grid-item-control,
.page-shell.subpage-shell .grid-shell .static-card {
  grid-template-rows: var(--subpage-shell-card-size) var(--subpage-shell-label-block-height);
  row-gap: var(--subpage-shell-item-gap);
  max-width: 175px;
  margin: 0 auto;
  padding: 0;
}

.page-shell.subpage-shell .grid-card {
  width: var(--subpage-shell-card-size);
  height: var(--subpage-shell-card-size);
}

.page-shell.subpage-shell .subpage-stage-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: hidden;
}

.page-shell.subpage-shell .subpage-stage-header {
  min-height: var(--actionbar-height);
  height: var(--actionbar-height);
  background: linear-gradient(180deg, rgba(40, 120, 178, 0.87), rgb(14, 17, 55));
  overflow: hidden;
}

.page-shell.subpage-shell .subpage-stage-brand--header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 8px 20px;
}

.page-shell.subpage-shell .subpage-stage-brand--header img {
  max-width: 225px;
  max-height: calc(var(--actionbar-height) - 14px);
  width: auto;
  height: auto;
  display: block;
}

.page-shell.subpage-shell .iframe-panel-inline {
  width: min(100%, var(--subpage-inline-frame-width));
  display: grid;
  grid-template-rows: var(--subpage-inline-hero-height) auto;
  overflow: hidden;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: transparent;
}

.page-shell.subpage-shell .iframe-hero {
  height: var(--subpage-inline-hero-height);
  overflow: hidden;
}

.page-shell.subpage-shell .iframe-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.page-shell.subpage-shell .iframe-content-frame {
  display: block;
  width: 100%;
  min-height: 500px;
  background: #0a4579;
  border: 0;
  border-radius: 0 0 18px 18px;
}

.page-shell.subpage-shell .subpage-mobile-panel-brand,
.page-shell.subpage-shell .chronic-mobile-panel-brand {
  display: none;
}

.page-shell.subpage-shell .podcast-language-grid {
  grid-template-columns: repeat(3, 64px);
  column-gap: 16px;
  row-gap: 12px;
  justify-content: center;
  padding: 0 8px;
}

.page-shell.subpage-shell .grid-item-control--subpage.is-active .grid-card {
  border-color: var(--actionbar-hover-border);
  transform: translateY(-1px);
  box-shadow: var(--grid-card-shadow-stack), 0 0 0 3px rgba(225, 224, 189, 0.4);
}
