/**
 * NIA Ecology responsive system
 * Shared containment, rhythm and breakpoint rules for public templates.
 */
:root {
  --nia-gutter: clamp(16px, 3vw, 32px);
  --nia-section-gap: clamp(20px, 3.5vw, 42px);
  --nia-card-gap: clamp(12px, 2vw, 20px);
  --nia-touch: 44px;
  --nia-fluid-section-title: clamp(24px, 2.4vw, 34px);
  --nia-fluid-card-title: clamp(17px, 1.5vw, 22px);
}

html {
  max-width: 100%;
  overflow-x: clip;
}

body {
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
}

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

body :where(main, section, article, aside, nav, header, footer, div, ul, ol, li) {
  min-width: 0;
}

body :where(img, video, iframe, embed, object, svg, canvas) {
  max-width: 100%;
}

body :where(h1, h2, h3, h4, p, li, a, span, strong, small, time) {
  overflow-wrap: break-word;
}

body :where(.container, .footer-container) {
  width: min(100%, 1320px);
  margin-inline: auto;
  padding-inline: var(--nia-gutter);
}

body :where(.section-title) {
  font-size: var(--nia-fluid-section-title);
  line-height: 1.08;
  text-wrap: balance;
}

body :where(button, [role="button"], input, select, textarea) {
  max-width: 100%;
}

body :where(.section-more, .nia-header-search, .nia-menu-toggle, .premium-btn, .subscribe-block__btn, .subscribe-block__tg) {
  min-height: var(--nia-touch);
}

body :where(.section-more) {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding-inline: 8px;
  white-space: nowrap;
}

/* Rich/editor content must shrink without losing intentional table scrolling. */
body :where(.entry-content, .post-content, .article-content, .nn-content, .nr-content, .na-content, .interview-content) {
  min-width: 0;
  max-width: 100%;
}

body :where(.entry-content, .post-content, .article-content, .nn-content, .nr-content, .na-content, .interview-content) > :where(img, figure, video, iframe, embed, object) {
  max-width: 100%;
}

body :where(.entry-content, .post-content, .article-content, .nn-content, .nr-content, .na-content, .interview-content) :where(table, pre) {
  max-width: 100%;
}

body :where(.entry-content, .post-content, .article-content, .nn-content, .nr-content, .na-content, .interview-content) :where(pre) {
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body :where(.entry-content, .post-content, .article-content, .nn-content, .nr-content, .na-content, .interview-content) :where(table) {
  display: block;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

/* Off-canvas navigation has no off-screen geometry while closed. */
@media (max-width: 1199px) {
  .nia-primary-nav .nia-nav-panel {
    display: none;
    position: fixed !important;
    z-index: 1100 !important;
    inset: 0 0 0 auto !important;
    width: min(100%, 420px);
    max-width: 100vw;
    height: 100vh !important;
    height: 100dvh !important;
    transform: none;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .nia-primary-nav.is-open .nia-nav-panel {
    display: block;
  }

  .nia-primary-nav.is-open .nia-menu-toggle {
    position: fixed !important;
    z-index: 1200 !important;
    top: max(12px, env(safe-area-inset-top)) !important;
    right: max(var(--nia-gutter), env(safe-area-inset-right)) !important;
    border-color: #c7d8ce !important;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(3, 35, 22, .14);
  }

  .nia-primary-nav.is-open .nia-menu-toggle span:first-child {
    background: transparent !important;
  }

  .nia-primary-nav.is-open .nia-menu-toggle span:first-child::before {
    transform: translateY(0) rotate(45deg) !important;
  }

  .nia-primary-nav.is-open .nia-menu-toggle span:first-child::after {
    transform: translateY(-2px) rotate(-45deg) !important;
  }

  .nia-primary-nav .nia-nav-panel > .nav-menu {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  .nia-primary-nav .nia-nav-panel > .nav-menu > li {
    display: block !important;
    width: 100% !important;
  }

  .nia-primary-nav .nia-nav-panel > .nav-menu > li > a {
    display: flex !important;
    width: 100% !important;
    min-height: 48px;
    color: #173126 !important;
    white-space: normal !important;
  }

  .nia-primary-nav .nia-nav-panel > .nav-menu > li:first-child > a {
    color: var(--nia-brand) !important;
    font-weight: 750;
  }

  body.nia-menu-open {
    overflow: hidden;
    touch-action: none;
  }

  .nia-menu-toggle,
  .nia-header-search {
    flex: 0 0 var(--nia-touch);
    width: var(--nia-touch);
    height: var(--nia-touch);
  }
}

/* Tablet: use real intermediate layouts, never compressed desktop grids. */
@media (min-width: 768px) and (max-width: 1199px) {
  :root { --nia-gutter: clamp(24px, 3vw, 32px); }

  .premium-home :where(.premium-hero-grid, .home-main-grid, .lower-grid, .service-calendar-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body .premium-home .premium-hero-grid,
  html body .premium-home .home-main-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .premium-home .side-split,
  .premium-home .topic-columns-grid,
  .premium-home .opinion-light-grid,
  .premium-home .opinion-light-side {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .premium-home .topic-columns-grid > *,
  .premium-home .topic-columns-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  html body .premium-home .main-news-panel .premium-news-grid--manual {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
  }

  html body .premium-home .main-news-panel .premium-news-card--lead {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }

  html body .premium-home .main-news-panel .premium-news-card:not(.premium-news-card--lead) {
    grid-column: auto !important;
    grid-row: auto !important;
    display: grid !important;
    grid-template-columns: minmax(120px, 34%) minmax(0, 1fr) !important;
    width: 100% !important;
    height: auto !important;
    min-height: 132px !important;
  }

  html body .premium-home .main-news-panel .premium-news-card:not(.premium-news-card--lead) .premium-news-imglink {
    width: 100% !important;
    height: 100% !important;
    min-height: 132px !important;
  }

  .premium-home .premium-hero-card {
    width: 100% !important;
    min-height: clamp(400px, 54vw, 620px) !important;
  }

  .premium-home .premium-hero-body {
    width: min(100%, 680px) !important;
    max-width: 100% !important;
  }

  .premium-home .premium-hero-title {
    max-width: 100% !important;
    font-size: clamp(36px, 5.2vw, 54px) !important;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .premium-home .monitor-card {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 22px 26px !important;
  }

  .premium-home .monitor-lines {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 18px !important;
  }

  .premium-home .monitor-lines .monitor-line {
    grid-template-columns: 34px minmax(46px, auto) minmax(0, 1fr) !important;
    gap: 10px !important;
    min-height: 54px !important;
  }

  .premium-home .monitor-lines .monitor-svg-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .premium-home :where(.incident-panel, .dejure-panel, .side-gov-banner) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  .premium-home .side-gov-banner img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-height: 260px;
    object-fit: contain !important;
  }

  .premium-home .opinion-light-link,
  .premium-home .opinion-light-card > a {
    display: grid !important;
    grid-template-columns: minmax(0, 1.7fr) minmax(230px, .8fr) !important;
    min-height: 280px !important;
    height: auto !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-grid,
  html body.home .premium-home section.opinion-showcase .opinion-light-side {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-primary {
    display: grid !important;
    grid-column: 1 !important;
    grid-row: auto !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 425px auto !important;
    gap: 12px !important;
    width: 100% !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-lead {
    display: block !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 425px !important;
    min-height: 425px !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-lead .opinion-light-link {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-lead .opinion-light-image {
    position: absolute !important;
    z-index: 0 !important;
    inset: 0 !important;
    order: initial !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-lead .opinion-light-text {
    position: relative !important;
    z-index: 3 !important;
    width: min(64%, 560px) !important;
    height: 100% !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-side {
    grid-column: 1 !important;
    grid-row: auto !important;
    height: auto !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-card > a {
    display: grid !important;
    grid-template-columns: minmax(0, 1.7fr) minmax(230px, .8fr) !important;
    grid-template-rows: none !important;
    width: 100% !important;
    min-height: 280px !important;
    height: auto !important;
  }

  .premium-home .opinion-light-side {
    grid-template-rows: none !important;
  }

  .premium-home :where(.opinion-light-image, .opinion-light-card__image) {
    position: relative !important;
    inset: auto !important;
    order: initial !important;
    width: 100% !important;
    height: auto !important;
    min-height: 280px !important;
    aspect-ratio: 3 / 4;
    overflow: hidden !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-card__image {
    position: relative !important;
    inset: auto !important;
    order: initial !important;
    width: 100% !important;
    height: auto !important;
    min-height: 280px !important;
    aspect-ratio: 3 / 4 !important;
  }

  .premium-home :where(.opinion-light-image, .opinion-light-card__image) img {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
  }

  .premium-home .special-projects-layout,
  .premium-home .special-directions-grid--news {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    gap: var(--nia-card-gap) !important;
    overflow: visible !important;
  }

  .premium-home .special-projects-layout > .special-direction-news-card,
  .premium-home .special-directions-grid--news > .special-direction-news-card {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: 280px !important;
    height: auto !important;
  }

  .premium-home .special-projects-layout > .sp-arctic,
  .premium-home .special-projects-layout > .sp-national {
    grid-column: 1 / -1 !important;
  }

  .footer-top {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Phones and small tablets: one stable editorial column. */
@media (max-width: 767px) {
  :root {
    --nia-gutter: clamp(16px, 4.65vw, 20px);
    --nia-section-gap: clamp(20px, 7vw, 30px);
    --nia-card-gap: clamp(12px, 4vw, 16px);
    --nia-fluid-section-title: clamp(23px, 7vw, 29px);
    --nia-fluid-card-title: clamp(17px, 5vw, 21px);
  }

  .site-head-frame {
    width: 100%;
    max-width: 100% !important;
    padding-top: env(safe-area-inset-top);
  }

  .site-head-frame .container {
    padding-inline: var(--nia-gutter) !important;
  }

  .nia-header-row {
    min-height: 64px;
    gap: 8px;
  }

  .site-logo,
  .site-logo img {
    min-width: 0;
    max-width: min(145px, calc(100vw - 124px)) !important;
    max-height: 58px;
    object-fit: contain;
  }

  .premium-home :where(.premium-hero-grid, .home-main-grid, .side-split, .topic-columns-grid, .opinion-light-grid, .lower-grid, .service-calendar-grid) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: var(--nia-card-gap) !important;
  }

  html body .premium-home .premium-hero-grid,
  html body .premium-home .home-main-grid,
  html body .premium-home .side-split,
  html body .premium-home .topic-columns-grid,
  html body .premium-home .opinion-light-grid,
  html body .premium-home .lower-grid,
  html body .premium-home .service-calendar-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: var(--nia-card-gap) !important;
  }

  .premium-home > .container > :where(.home-main-grid, .topic-columns-grid, .opinion-showcase, .special-projects-block, .service-calendar-grid),
  .premium-home > :where(.subscribe-wrap) {
    margin-top: var(--nia-section-gap) !important;
  }

  .premium-home :where(.premium-panel, .topic-column, .opinion-showcase, .special-projects-block, .calendar-panel) {
    width: 100%;
    max-width: 100%;
  }

  .premium-home .section-head {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }

  .premium-home .section-head > :first-child {
    min-width: 0;
  }

  .premium-home .premium-hero-card {
    min-height: clamp(360px, 118vw, 470px) !important;
    max-height: 560px;
  }

  .premium-home .premium-hero-body {
    width: 100%;
    max-width: 100%;
    padding: clamp(18px, 5vw, 24px) !important;
  }

  .premium-home .premium-hero-title {
    max-width: 100% !important;
    font-size: clamp(26px, 8vw, 34px) !important;
    line-height: 1.04 !important;
    text-wrap: balance;
  }

  .premium-home .premium-hero-excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    font-size: clamp(13px, 3.7vw, 15px) !important;
  }

  .premium-home .premium-meta {
    flex-wrap: wrap;
    gap: 5px 8px;
    max-width: 100%;
  }

  .premium-home .monitor-card {
    width: 100% !important;
    padding: clamp(18px, 5vw, 24px) !important;
  }

  .premium-home .monitor-line {
    grid-template-columns: 32px minmax(48px, auto) minmax(0, 1fr) !important;
  }

  .ticker-line-wrap .container {
    padding-inline: 0;
  }

  .ticker-line {
    max-width: 100%;
    overflow: hidden !important;
    border-radius: 0 !important;
  }

  .ticker-marquee {
    min-width: 0;
    overflow: hidden;
  }

  .premium-home .premium-news-grid,
  .premium-home .news-rows {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body .premium-home .premium-news-grid,
  html body .premium-home .news-rows {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
  }

  html body .premium-home .main-news-panel .premium-news-grid--manual {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    gap: 12px !important;
  }

  html body .premium-home .main-news-panel .premium-news-grid--manual > .premium-news-card,
  html body .premium-home .main-news-panel .premium-news-grid--manual > .premium-news-card--lead,
  html body .premium-home .main-news-panel .premium-news-grid--manual > .premium-news-card:not(.premium-news-card--lead) {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }

  html body .premium-home .main-news-panel .premium-news-grid--manual > .premium-news-card:not(.premium-news-card--lead):not(.premium-news-card--banner) {
    display: grid !important;
    grid-template-columns: clamp(88px, 28vw, 112px) minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  html body .premium-home .main-news-panel .premium-news-grid--manual .premium-news-card--lead .premium-news-imglink {
    height: clamp(180px, 56vw, 240px) !important;
  }

  .premium-home .premium-news-card,
  .premium-home .premium-news-card--lead {
    grid-column: auto !important;
    width: 100%;
  }

  .premium-home .premium-news-card h3,
  .premium-home .topic-lead__title {
    font-size: var(--nia-fluid-card-title) !important;
    line-height: 1.2 !important;
  }

  .premium-home .news-row {
    grid-template-columns: clamp(76px, 23vw, 96px) minmax(0, 1fr) !important;
  }

  .premium-home .side-split {
    overflow: visible !important;
  }

  .premium-home :where(.incident-panel, .dejure-panel) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    overflow: hidden;
    padding: clamp(18px, 5vw, 22px) !important;
  }

  .premium-home :where(.incident-panel, .dejure-panel)::before {
    inset: 0 auto 0 0 !important;
  }

  .premium-home :where(.incident-panel, .dejure-panel) .thin-list {
    min-width: 0;
    padding-left: 0 !important;
  }

  .premium-home :where(.incident-panel, .dejure-panel) .thin-list a {
    display: grid !important;
    grid-template-columns: clamp(52px, 16vw, 64px) minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100%;
    padding-block: 12px !important;
  }

  .premium-home :where(.incident-panel, .dejure-panel) .thin-list span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .premium-home .side-gov-banner {
    width: 100%;
  }

  .premium-home .opinion-light-link,
  .premium-home .opinion-light-card > a {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0 !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-link,
  html body.home .premium-home section.opinion-showcase .opinion-light-card > a {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .premium-home :where(.opinion-light-image, .opinion-light-card__image) {
    position: relative !important;
    inset: auto !important;
    order: -1;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 7;
    overflow: hidden !important;
  }

  html body.home .premium-home section.opinion-showcase :where(.opinion-light-image, .opinion-light-card__image) {
    position: relative !important;
    inset: auto !important;
    order: -1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 7 !important;
    overflow: hidden !important;
  }

  .premium-home :where(.opinion-light-image, .opinion-light-card__image) img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: var(--person-x, 50%) var(--person-y, 35%) !important;
  }

  .premium-home :where(.opinion-light-text, .opinion-light-card__text) {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: none !important;
  }

  /* Accents are the only intentional mobile horizontal rail. */
  .premium-home .special-projects-block.special-projects-mockup {
    padding: clamp(18px, 5vw, 24px) !important;
    overflow: hidden;
  }

  .premium-home .special-projects-layout,
  .premium-home .special-directions-grid--news {
    display: grid !important;
    grid-template-columns: none !important;
    grid-template-rows: minmax(300px, auto) !important;
    grid-auto-flow: column !important;
    grid-auto-columns: min(86%, 330px) !important;
    gap: 14px !important;
    width: 100%;
    max-width: 100%;
    padding: 0 0 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .premium-home .special-projects-layout::-webkit-scrollbar,
  .premium-home .special-directions-grid--news::-webkit-scrollbar {
    display: none;
  }

  .premium-home .special-projects-layout > .special-direction-news-card,
  .premium-home .special-directions-grid--news > .special-direction-news-card {
    grid-column: auto !important;
    grid-row: auto !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 300px !important;
    height: auto !important;
    scroll-snap-align: start;
  }

  .premium-home .service-calendar-grid--calendar-only,
  .premium-home .service-calendar-grid--calendar-only .calendar-panel {
    min-width: 0 !important;
    max-width: 100%;
  }

  .premium-home .calendar-strip--light {
    display: grid !important;
    grid-template-columns: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: min(86%, 310px) !important;
    gap: 12px !important;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .premium-home .calendar-strip--light::-webkit-scrollbar {
    display: none;
  }

  .premium-home .calendar-item {
    min-width: 0;
    min-height: 168px !important;
    scroll-snap-align: start;
  }

  .subscribe-block,
  .subscribe-block__form,
  .footer-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .subscribe-block__left,
  .subscribe-block__form {
    width: 100%;
    min-width: 0;
  }

  .footer-top {
    gap: 20px !important;
  }

  .footer-brand,
  .footer-col {
    min-width: 0;
  }

  /* Shared article/archive stack transition. */
  body :where(.nn-layout, .nr-layout, .na-layout, .interview-layout, .column-layout, .archive-layout, .news-archive-layout, .content-sidebar-grid) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    max-width: 100%;
  }

  body :where(.nn-title, .nr-title, .na-title, .interview-title, .column-title, .page-title, .archive-title, .entry-title) {
    max-width: 100%;
    font-size: clamp(30px, 9vw, 46px) !important;
    line-height: 1.03 !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  body :where(.nn-sidebar, .nr-sidebar, .na-sidebar, .interview-sidebar, .column-sidebar, .article-sidebar) {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100%;
  }

  body :where(.wp-block-image, figure, .gallery, .wp-caption) {
    max-width: 100% !important;
  }

  body.single .nn-author-rail,
  body.single .nn-rail-share,
  body.single .nn-rail-share .nia-unified-share {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.single .nn-author-rail {
    justify-self: stretch !important;
    margin: 0 0 24px !important;
    transform: none !important;
  }

  body.single .nn-rail-share {
    justify-content: center !important;
    margin-inline: 0 !important;
  }

  body.single .nn-rail-share .nia-unified-share {
    align-items: center !important;
  }

  body.single .nn-rail-share .nia-unified-share__actions {
    display: grid !important;
    grid-template-columns: repeat(4, 42px) !important;
    width: auto !important;
    max-width: 100% !important;
    align-self: center !important;
    justify-content: center !important;
    gap: 9px !important;
  }
}

@media (max-width: 430px) {
  .premium-home .premium-panel,
  .premium-home .topic-column,
  .premium-home .calendar-panel,
  .premium-home .opinion-showcase {
    border-radius: 14px !important;
  }
}

@media (max-width: 359px) {
  :root { --nia-gutter: 16px; }

  .site-logo,
  .site-logo img {
    max-width: 128px !important;
  }

  .nia-header-row {
    gap: 5px;
  }

  .premium-home .premium-hero-title {
    font-size: 25px !important;
  }

  .premium-home :where(.incident-panel, .dejure-panel) .thin-list a {
    grid-template-columns: 1fr !important;
    gap: 5px !important;
  }

  .premium-home .news-row {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1023px) {
  .nia-primary-nav .nia-nav-panel {
    padding-top: 64px;
  }

  .premium-home .premium-hero-card {
    min-height: 320px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   CONTAINER-DRIVEN HORIZONTAL MODULES AND OPINION MEDIA
   ========================================================= */

.premium-home .special-projects-block {
  container: nia-accents / inline-size;
}

/*
 * Keep Accents on the same content guides as the other homepage modules.
 * Legacy component styles give this panel its own 40/48px horizontal inset;
 * the shared site gutter is the canonical homepage container spacing.
 */
html body.home .premium-home .special-projects-block.special-projects-mockup {
  padding-inline: var(--nia-gutter) !important;
}

.premium-home .eco-calendar {
  container: nia-calendar / inline-size;
}

.premium-home .opinion-showcase {
  container: nia-opinions / inline-size;
}

.premium-home :where(.special-projects-layout, .eco-calendar__viewport, .eco-calendar__months, .eco-calendar__years, .eco-calendar__tabs)[data-nia-mouse-rail="true"] {
  cursor: grab;
}

.premium-home :where(.special-projects-layout, .eco-calendar__viewport, .eco-calendar__months, .eco-calendar__years, .eco-calendar__tabs).is-pointer-dragging {
  cursor: grabbing;
  user-select: none;
  scroll-snap-type: none !important;
}

/*
 * Accents keep the editorial mosaic while three useful columns still fit.
 * Below 1050px the component switches directly to a controlled rail; there is
 * deliberately no intermediate two-column / oversized-card state.
 */
@container nia-accents (min-width: 1050px) {
  html body.home .premium-home .special-projects-block .special-projects-layout,
  html body.home .premium-home .special-projects-block .special-directions-grid--news {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    grid-template-areas: none !important;
    grid-auto-flow: row !important;
    grid-auto-columns: auto !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  html body.home .premium-home .special-projects-block .special-projects-layout > .special-direction-news-card,
  html body.home .premium-home .special-projects-block .special-directions-grid--news > .special-direction-news-card {
    flex: initial !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 290px !important;
    grid-area: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
    scroll-snap-align: none !important;
  }

  html body.home .premium-home .special-projects-block .special-projects-layout > .sp-arctic {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  html body.home .premium-home .special-projects-block .special-projects-layout > .sp-baikal {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  html body.home .premium-home .special-projects-block .special-projects-layout > .sp-digest {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  html body.home .premium-home .special-projects-block .special-projects-layout > .sp-pain {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  html body.home .premium-home .special-projects-block .special-projects-layout > .sp-national {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  html body.home .premium-home .special-projects-block .special-projects-layout > .sp-conflict {
    grid-column: 3 !important;
    grid-row: 2 !important;
  }
}

@container nia-accents (max-width: 1049px) {
  html body.home .premium-home .special-projects-block .special-projects-layout,
  html body.home .premium-home .special-projects-block .special-directions-grid--news {
    display: flex !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-template-areas: none !important;
    grid-auto-flow: initial !important;
    grid-auto-columns: initial !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: clamp(12px, 2cqi, 18px) !important;
    padding: 0 0 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity !important;
    scroll-padding-inline: 0 !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(21, 91, 69, .32) transparent;
    touch-action: pan-x pan-y;
  }

  html body.home .premium-home .special-projects-block .special-projects-layout > .special-direction-news-card,
  html body.home .premium-home .special-projects-block .special-directions-grid--news > .special-direction-news-card {
    flex: 0 0 clamp(300px, 78cqi, 520px) !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: clamp(300px, 58cqi, 390px) !important;
    grid-column: auto !important;
    grid-row: auto !important;
    grid-area: auto !important;
    scroll-snap-align: start !important;
    scroll-snap-stop: normal;
  }
}

/* Accents headlines keep normal word boundaries in both component states. */
.premium-home .special-projects-block :where(.special-lead-title, .special-direction-head strong, .special-direction-news-list a) {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: auto;
}

/* Shared legal layer below the primary footer navigation. */
.site-footer .site-footer-legal {
  margin-top: 28px;
  border-top: 1px solid rgba(173, 203, 189, .18);
  background: rgba(0, 0, 0, .12);
}

.site-footer-legal__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 32px;
  align-items: center;
  padding-block: 18px;
}

.site-footer-legal__links,
.site-footer-legal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
}

.site-footer-legal__meta {
  justify-content: flex-end;
}

.site-footer-legal p {
  margin: 0;
  color: rgba(235, 243, 239, .72) !important;
  font: 400 12px/1.5 Arial, sans-serif;
}

.site-footer-legal a {
  color: rgba(242, 248, 245, .82) !important;
  font: 500 12px/1.5 Arial, sans-serif;
  text-decoration: none;
  text-underline-offset: 3px;
}

.site-footer-legal a:hover {
  color: #fff !important;
  text-decoration: underline;
}

@media (max-width: 767px) {
  .site-footer .site-footer-legal {
    margin-top: 22px;
  }

  .site-footer-legal__inner,
  .site-footer-legal__links,
  .site-footer-legal__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    gap: 9px;
  }

  .site-footer-legal__inner {
    gap: 15px;
    padding-block: 18px 22px;
  }
}

/* Calendar controls and event cards own their overflow at component level. */
@container nia-calendar (max-width: 1099px) {
  .premium-home .eco-calendar__tabs,
  .premium-home .eco-calendar__months,
  .premium-home .eco-calendar__years,
  .premium-home .eco-calendar__viewport {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .premium-home .eco-calendar__months {
    display: flex !important;
    grid-template-columns: none !important;
  }

  .premium-home .eco-calendar__tabs > *,
  .premium-home .eco-calendar__months > *,
  .premium-home .eco-calendar__years > * {
    flex: 0 0 auto !important;
    scroll-snap-align: start;
  }

  .premium-home .eco-calendar__viewport-wrap,
  .premium-home .eco-calendar__viewport {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .premium-home .eco-calendar-card {
    flex: 0 0 clamp(225px, 36cqi, 300px) !important;
    min-width: 0 !important;
    scroll-snap-align: start;
  }
}

@container nia-calendar (max-width: 599px) {
  .premium-home .eco-calendar-card {
    flex-basis: min(86cqi, 320px) !important;
  }
}

/* One author card per row; media state follows card space, not viewport/UA. */
@container nia-opinions (min-width: 700px) and (max-width: 1099px) {
  html body.home .premium-home section.opinion-showcase .opinion-light-grid,
  html body.home .premium-home section.opinion-showcase .opinion-light-side {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    height: auto !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-side {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-card > a {
    display: grid !important;
    grid-template-columns: minmax(0, 1.65fr) minmax(220px, .75fr) !important;
    grid-template-rows: none !important;
    min-height: 280px !important;
    height: auto !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-card__image {
    position: relative !important;
    inset: auto !important;
    order: initial !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 280px !important;
    aspect-ratio: 3 / 4 !important;
    overflow: hidden !important;
  }
}

@container nia-opinions (max-width: 699px) {
  html body.home .premium-home section.opinion-showcase .opinion-light-grid,
  html body.home .premium-home section.opinion-showcase .opinion-light-primary,
  html body.home .premium-home section.opinion-showcase .opinion-light-side {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-lead,
  html body.home .premium-home section.opinion-showcase .opinion-light-card {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-link,
  html body.home .premium-home section.opinion-showcase .opinion-light-card > a {
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    flex-direction: column !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-image,
  html body.home .premium-home section.opinion-showcase .opinion-light-card__image {
    position: relative !important;
    inset: auto !important;
    order: -1 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 7 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-image img,
  html body.home .premium-home section.opinion-showcase .opinion-light-card__image img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: var(--person-x, 50%) var(--person-y, 35%) !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-text,
  html body.home .premium-home section.opinion-showcase .opinion-light-card__text {
    position: relative !important;
    inset: auto !important;
    order: initial !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: none !important;
  }

  html body.home .premium-home section.opinion-showcase .opinion-light-link::before,
  html body.home .premium-home section.opinion-showcase .opinion-light-link::after {
    pointer-events: none;
  }
}

/* Main navigation: active means readable text plus a green marker. */
.nia-primary-nav .nav-menu > li:is(
  .current-menu-item,
  .current_page_item,
  .current-menu-ancestor,
  .current_page_ancestor,
  .active
) > a,
.nia-primary-nav .nav-menu > li:is(
  .current-menu-item,
  .current_page_item,
  .current-menu-ancestor,
  .current_page_ancestor,
  .active
) > a:hover {
  color: #233a30 !important;
  font-weight: 650 !important;
  opacity: 1 !important;
  border-bottom-color: var(--nia-brand-bright, #2aa66f) !important;
}

.nia-primary-nav .nia-more.is-active > .nia-more__toggle,
.nia-primary-nav .nia-more.is-active > .nia-more__toggle:hover {
  color: #233a30 !important;
  opacity: 1 !important;
  border-bottom-color: var(--nia-brand-bright, #2aa66f) !important;
}

.nia-primary-nav .nia-more__menu > li:is(
  .current-menu-item,
  .current_page_item,
  .current-menu-ancestor,
  .current_page_ancestor,
  .active
) > a {
  color: #233a30 !important;
  opacity: 1 !important;
  box-shadow: inset 3px 0 var(--nia-brand-bright, #2aa66f);
}

@media (max-width: 1199px) {
  .nia-primary-nav .nav-menu > li:is(
    .current-menu-item,
    .current_page_item,
    .current-menu-ancestor,
    .current_page_ancestor,
    .active
  ) > a {
    color: #233a30 !important;
    opacity: 1 !important;
    box-shadow: inset 3px 0 var(--nia-brand-bright, #2aa66f);
  }
}
