/* Layout that holds together from a 320px phone through tablets and wide desktops. */

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body { overflow-x: clip; }
[id] { scroll-margin-top: 140px; }

img, video, iframe, canvas { max-width: 100%; }
p, li, h1, h2, h3, h4, figcaption, td, th { overflow-wrap: break-word; }

.shell,
body.land-v3 .shell,
.land3-foot-inner,
.land3-next-inner,
.hub-hero-land-grid {
  max-width: 100%;
}

.hub-latest-grid > *,
.hub-subscribe,
.hub-ep-grid,
.cat-grid,
.cat-card,
.cat-body,
.land3-latest-grid,
.land3-latest-grid > *,
.land3-contract-card,
.land3-contract-main,
.land3-benefits,
.land3-topic-grid,
.land3-journey-grid,
.land-topic-grid,
.land-journey-grid,
.land-contract-grid,
.land-next-inner,
.buzz-hero-grid,
.buzz-main {
  min-width: 0;
  max-width: 100%;
}

.land3-topic-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

/* Top bar: keep the tagline visible without covering Visit NTS or the search icon. */
@media (max-width: 1100px) {
  .hub-topbar-inner {
    flex-wrap: wrap;
    justify-content: flex-end;
    min-height: 0;
    padding: 6px 0;
    gap: 2px 12px;
  }
  .hub-topbar-tag {
    display: block;
    position: static;
    transform: none;
    order: 2;
    flex: 1 0 100%;
    max-width: none;
    margin: 0;
    white-space: normal;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.35;
  }
}
@media (min-width: 1101px) {
  .hub-topbar-tag {
    max-width: min(680px, calc(100% - 220px));
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Header menu stays on screen and is easy to tap. */
@media (max-width: 1240px) {
  .hub-nav-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
  }
  .hub-header.is-open .hub-nav {
    max-height: min(70vh, 560px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hub-nav a {
    font-size: 16px;
    padding: 14px 8px;
  }
  .hub-logo img { height: 46px; }
}

@media (max-width: 420px) {
  .shell { width: min(1180px, calc(100% - 28px)); }
  body.land-v3 .shell,
  .land3-foot-inner { width: min(1180px, calc(100% - 28px)); }
  .hub-logo img { height: 40px; }
}

/* Search panel never wider than the screen. */
@media (max-width: 720px) {
  .hub-search {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
  .hub-search input {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }
  input, select, textarea { font-size: 16px; }
}

/* Home hero and catalog. */
@media (max-width: 1100px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cat-grid { grid-template-columns: 1fr; }
  .cat-head { align-items: stretch; }
  .cat-tools { width: 100%; }
  .cat-search { width: 100%; }
  .hub-hero-home h1 { font-size: clamp(32px, 9vw, 44px); }
}
@media (max-width: 520px) {
  .hub-hero-actions .hub-btn {
    width: 100%;
    justify-content: center;
  }
  .hub-hero-copy { padding: 32px 0 28px; }
  .cat-card {
    flex-direction: column;
    min-height: 0;
  }
  .cat-media,
  .cat-media-photo {
    width: 100%;
    flex: none;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    align-self: stretch;
  }
  .hub-subscribe {
    padding: 20px 16px;
    gap: 14px;
  }
  .hub-sub-copy h2 { font-size: 22px; }
  .hub-sub-form { width: 100%; justify-content: stretch; }
  .hub-sub-form input,
  .hub-sub-form .hub-btn { width: 100%; justify-content: center; }
  .hub-footer-links { flex-wrap: wrap; row-gap: 8px; }
  .hub-footer-links a { padding: 4px 12px 4px 0; }
  .hub-legal-inner { align-items: flex-start; gap: 8px; }
  .hub-more h2,
  .cat-head h2 { font-size: 26px; }
}

/* Player: one control row, times on the next, so it never spills sideways. */
@media (max-width: 760px) {
  .player,
  .hub-eq .player {
    grid-template-columns: auto auto auto minmax(0, 1fr);
    gap: 8px;
  }
  .player-skip[data-skip="-15"] { grid-area: 1 / 1; }
  .player-play { grid-area: 1 / 2; width: 44px; height: 44px; }
  .player-skip[data-skip="15"] { grid-area: 1 / 3; }
  .player-track { grid-area: 1 / 4; min-width: 0; }
  .player-time { grid-area: 2 / 1 / auto / 3; }
  .player-duration { grid-area: 2 / 3; justify-self: start; }
  .player-speed { grid-area: 2 / 4; justify-self: end; padding: 6px 10px; }
  .player-skip { min-width: 40px; }
  .player-duration,
  .player-speed { display: inline-block; }
  .clip-btn { padding: 8px 12px; }
}

/* Episode listen page. */
@media (max-width: 760px) {
  .buzz-hero { padding: 20px 0 24px; }
  .buzz-hero-grid { grid-template-columns: 1fr; gap: 16px; }
  .buzz-art { width: min(200px, 64vw); height: auto; aspect-ratio: 1; }
  .buzz-meta-row,
  .buzz-share-start { flex-wrap: wrap; }
  .buzz-main h1 { font-size: clamp(1.45rem, 6vw, 2rem); }
  .episode-head { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
  .episode-art,
  body.single-nts_episode .episode-art { width: 96px; }
  .episode-row { grid-template-columns: 56px minmax(0, 1fr); }
  .episode-row .row-meta,
  .episode-row .listen { grid-column: 2; justify-items: start; }
  .row-art,
  .row-art img,
  .art-fallback { width: 56px; }
}

/* Landing banner stays complete at every width. The copy sits under it. */
@media (max-width: 1200px) {
  .land3-hero-stage { overflow: visible; }
  .land3-hero-photo {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center center;
  }
  .land3-hero-copy,
  .land3-hero-overlay {
    position: static;
    width: auto;
    max-width: none;
    color: var(--l-navy, #013C82);
    text-shadow: none;
    text-align: left;
    padding: 22px 20px 4px;
  }
  .land3-hero h1,
  .land3-hero h1 > span:first-child { white-space: normal; }
  .land3-hero h1 { font-size: clamp(30px, 4vw, 42px); }
  .land3-hero-overlay strong,
  .land3-hero-overlay p,
  .land3-hero-overlay span { color: var(--l-navy, #013C82); }
  .land3-brand { min-width: 0; }
  .land3-latest-grid {
    grid-template-columns: 148px minmax(0, 1fr);
  }
  .land3-covered { grid-column: 1 / -1; }
  .land3-covered ul { grid-template-columns: 1fr 1fr; }
  body.land-v3 .hub-eq { width: min(1180px, calc(100% - 40px)); }
}

@media (min-width: 760px) and (max-width: 1200px) {
  .land3-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .land3-contract-card {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 34%);
  }
}

@media (max-width: 860px) {
  .land3-latest-grid,
  .land3-contract-card,
  .land3-contract-main,
  .land-contract-grid,
  .land-contract-card,
  .land-next-inner,
  .hub-hero-land-grid { grid-template-columns: 1fr; }
  .land3-contract-card { grid-template-areas: "photo" "main" "benefits"; }
  .land3-covered { grid-column: auto; }
  .land3-covered ul { grid-template-columns: 1fr; }
  .land3-contract-photo,
  .land3-contract-photo img { min-height: 200px; }
  .land3-contract-photo img { clip-path: none; }
  .land-topic-grid,
  .land-journey-grid { grid-template-columns: 1fr 1fr; }
  .land-journey-chevron { display: none; }
  .land3-ei-strip .shell { flex-wrap: nowrap; align-items: center; min-height: 0; padding: 12px 0; }
  .land3-ei-strip .shell > span:first-child { flex: 1 1 auto; min-width: 0; }
  .land3-feature article { min-width: 0; }
  .land3-next-inner { padding: 22px 18px; }
  .land3-foot-inner { flex-wrap: wrap; justify-content: center; text-align: center; }
  .land3-foot nav { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 640px) {
  .land3-hero h1 { font-size: clamp(28px, 8vw, 34px); }
  .land3-hero-copy { padding: 18px 16px 0; }
  .land3-brand-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: none;
  }
  .land3-logos .land-shot:has(.land3-logo-ei) {
    width: auto;
    max-width: 210px;
  }
  body.land-v3 .land3-logo-ei {
    height: 64px;
    width: auto;
    max-width: 210px;
    margin-left: 0;
  }
  .land3-lead {
    flex: none;
    max-width: none;
    font-size: 16px;
    line-height: 1.4;
  }
  .land3-points { flex-wrap: wrap; gap: 14px 18px; }
  .land3-points li,
  .land3-points li:first-child { max-width: none; flex: 1 1 96px; }
  .land3-hero-actions { flex-wrap: wrap; align-items: center; }
  .land3-hero-actions .land3-btn { margin-left: 0; }
  body.land-v3 .land3-speak { height: 58px; }
  .land3-episode h2,
  .land3-topics h2,
  .land3-journey h2,
  .land3-next h2,
  .land3-contract h2 { font-size: 28px; }
  .land3-benefits { grid-template-columns: 1fr; }
  .land3-episode-actions,
  .land3-topic-actions,
  .land3-next-actions { flex-wrap: wrap; }
  .land3-journey-head,
  .land-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .land3-journey-head .land3-textlink { white-space: normal; }
  .land3-journey-grid > article { flex: 1 1 100%; min-width: 0; }
  .land-topic-grid,
  .land-journey-grid,
  .land3-journey-grid { grid-template-columns: 1fr; }
  .hub-hero-land .hub-hero-copy { padding: 36px 0 28px; }
  .hub-hero-points { gap: 12px 16px; }
}

@media (max-width: 480px) {
  .land3-hero-actions .land3-btn,
  .land3-episode-actions .land3-btn,
  .land3-next-actions .land3-btn { width: 100%; justify-content: center; }
  .land3-contract-main { padding: 16px; }
  .land3-benefits { padding: 4px 16px 16px; }
  body.land-v3 .hub-eq { width: min(1180px, calc(100% - 28px)); }
}

@media (max-height: 480px) and (orientation: landscape) {
  .land3-hero-photo {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .hub-hero,
  .hub-hero-home,
  .hub-hero-land { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cat-card,
  .hub-ep { transition: none; }
}
