/* Unisystem News · navigation materials and progressive selection.
 * Load after navigation.css and visual-foundation.css.
 * Editorial surfaces remain opaque; blur is limited to the sticky bar/dialogs.
 */
:root {
  --un-nav-height: 64px;
  --un-control: 180ms;
  --un-motion: 260ms;
  --un-glass-solid: #fff;
  --un-glass-surface: rgba(255, 255, 255, .92);
  --un-glass-panel: rgba(255, 255, 255, .97);
  --un-glass-border: rgba(116, 117, 112, .2);
  --un-glass-highlight: rgba(255, 255, 255, .96);
  --un-glass-depth: 0 10px 32px rgba(31, 34, 32, .08);
  --un-selected-surface: #faeeec;
  --un-selected-border: #dcb5b4;
}

/* Fixed geometry keeps reading position stable as the header becomes sticky. */
.un-header {
  background: var(--un-glass-surface);
  border-top: 2px solid var(--un-red);
  border-bottom: 1px solid var(--un-glass-border);
  box-shadow: 0 3px 18px rgba(31, 34, 32, .035), inset 0 1px 0 var(--un-glass-highlight);
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  transition: box-shadow var(--un-control) ease, background-color var(--un-control) ease;
}
.un-header.is-reading {
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--un-glass-depth), inset 0 1px 0 var(--un-glass-highlight);
}
.un-header > .un-shell,
.un-header .un-header-inner {
  min-height: var(--un-nav-height);
  gap: 18px;
}
.un-global-brand {
  flex: 0 0 48px;
  min-width: 48px;
  min-height: 52px;
  justify-content: center;
}
.un-global-brand img {
  width: 48px;
  height: 48px;
  aspect-ratio: 1;
  object-fit: contain;
}
.un-home-label {
  min-width: 0;
  margin-right: auto;
  padding: 10px 0 10px 18px;
  color: var(--un-muted);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.un-home-label:hover,
.un-home-label[aria-current] { color: var(--un-red); }
.un-header-actions { gap: 8px; min-width: 0; }
.un-header-actions .un-button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--un-glass-border);
  background: rgba(255, 255, 255, .68);
  box-shadow: inset 0 1px 0 var(--un-glass-highlight), 0 2px 5px rgba(31, 34, 32, .025);
  font-weight: 600;
  transition: background-color var(--un-control) ease, border-color var(--un-control) ease,
    color var(--un-control) ease, transform var(--un-control) var(--un-ease);
}
.un-header .un-search-trigger { min-width: 112px; background: #f2f2f0; }
.un-header-actions .un-button:hover { background: #fff; border-color: #b8bbb6; }
.un-header-actions .un-button[aria-expanded="true"] {
  background: var(--un-selected-surface);
  border-color: var(--un-selected-border);
  color: var(--un-red);
}
.un-header-actions .un-button:active { transform: scale(.97); }

/* The approved sans serif editorial name keeps its original brand relationship. */
.un-masthead {
  padding-block: 20px 18px;
  gap: 24px;
}
.un-masthead .un-masthead-name {
  font-family: var(--un-sans);
  font-size: clamp(42px, 4.25vw, 60px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.055em;
  white-space: normal;
  overflow-wrap: normal;
}
.un-masthead .un-masthead-name a { max-width: 100%; }
.un-masthead .un-masthead-name span { font-weight: 400; }
.un-masthead-line { margin-top: 8px; font-size: 11px; line-height: 1.55; }
.un-masthead-edition { padding-left: 14px; font-size: 9px; line-height: 1.8; }

/* Six real categories: rounded selection, visible text and wrapping without a page rail. */
.un-section-bar {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 7px;
  padding-block: 7px;
  background: var(--un-bg);
}
.un-section-bar a {
  min-width: 0;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .015em;
  color: var(--un-ink);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color var(--un-control) ease, color var(--un-control) ease,
    border-color var(--un-control) ease, box-shadow var(--un-control) ease;
}
.un-section-bar a:hover {
  color: var(--un-red);
  background: #fff;
  border-color: var(--un-line);
  text-decoration: none;
}
.un-section-bar a[aria-current] {
  color: var(--un-red);
  background: var(--un-selected-surface);
  border-color: var(--un-selected-border);
  box-shadow: inset 0 1px 0 #fff;
  text-decoration: none;
}
.un-section-bar a:active { background: #f1e1de; }

/* Existing dialog controllers own focus and both directions of the 260 ms transition. */
dialog.un-dialog {
  --un-motion: 260ms;
  width: min(720px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: clamp(22px, 3.4vw, 36px);
  border: 1px solid rgba(255, 255, 255, .98);
  border-radius: 26px;
  background: var(--un-glass-panel);
  box-shadow: 0 24px 74px rgba(31, 34, 32, .2), inset 0 1px 0 #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
}
dialog.un-dialog::backdrop { background: rgba(32, 34, 34, .28); }
.un-dialog-head { align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.un-dialog-head > div { min-width: 0; }
.un-dialog-head .un-kicker { margin-bottom: 10px; letter-spacing: .11em; }
.un-dialog-head h2 { font-size: clamp(28px, 3vw, 39px); line-height: 1.08; text-wrap: balance; }
.un-close {
  border-color: var(--un-glass-border);
  background: #fff;
  box-shadow: inset 0 1px 0 #fff;
}
.un-close:hover { background: var(--un-selected-surface); color: var(--un-red); }
.un-search-form { gap: 10px; min-width: 0; }
.un-search-form input {
  min-width: 0;
  min-height: 54px;
  background: #fff;
  border: 1px solid #b9beb9;
  border-radius: 15px;
  box-shadow: inset 0 1px 3px rgba(31, 34, 32, .025);
}
.un-search-form > button { border-radius: 15px; padding-inline: 22px; }
.un-search-form .un-button-primary { background: var(--un-red); border-color: var(--un-red); color: #fff; }
.un-search-form .un-button-primary:hover { background: #97070e; border-color: #97070e; color: #fff; }
.un-search-hint { font-size: 12px; line-height: 1.65; }
.un-search-status { padding-block: 16px 8px; margin: 0; font-size: 13px; }
.un-search-status:empty { display: none; }
.un-search-results { margin-top: 12px; min-height: 0; }
.un-search-results > a {
  display: block;
  min-width: 0;
  padding: 18px 10px;
  border-top: 1px solid var(--un-line);
  border-radius: 8px;
  transition: background-color var(--un-control) ease;
}
.un-search-results > a:hover { background: #f4f4f1; }
.un-search-results .un-kicker { margin-bottom: 6px; font-size: 9px; }
.un-search-results h3 { font-size: clamp(22px, 2.3vw, 27px); line-height: 1.2; }
.un-search-topics { gap: 8px; margin-top: 22px; }
.un-search-topics a {
  min-height: 44px;
  padding: 9px 14px;
  border-color: #d8dcd6;
  background: #fff;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color var(--un-control) ease, color var(--un-control) ease,
    border-color var(--un-control) ease;
}
.un-search-topics a[aria-current],
.un-search-topics a:hover { color: var(--un-red); background: var(--un-selected-surface); border-color: var(--un-selected-border); }
.un-mobile-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.un-mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  min-height: 54px;
  padding: 13px 16px;
  border: 1px solid #dfe2dc;
  border-radius: 14px;
  background: #fff;
  color: var(--un-ink);
  font-size: 15px;
  font-weight: 600;
}
.un-mobile-nav a::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
  flex-shrink: 0;
  opacity: .65;
}
.un-mobile-nav a[aria-current],
.un-mobile-nav a:hover {
  color: var(--un-red);
  background: var(--un-selected-surface);
  border-color: var(--un-selected-border);
}

/* A selection keeps all headlines and article links available at every width. */
[data-news-selection] .un-selection-panel { min-width: 0; }
[data-news-selection] .un-selection-toggle[hidden] { display: none; }
.un-selection-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  margin-top: 18px;
  padding: 10px 15px;
  border: 1px solid #cbd0c8;
  border-radius: 999px;
  background: #fff;
  color: var(--un-ink);
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(31, 34, 32, .04);
  font: 600 12px/1.5 var(--un-sans);
  text-align: left;
  overflow-wrap: anywhere;
  transition: background-color var(--un-control) ease, border-color var(--un-control) ease,
    color var(--un-control) ease, transform var(--un-control) var(--un-ease);
}
.un-selection-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 2px 3px 0;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform var(--un-control) var(--un-ease);
}
/* The renderer's decorative arrow is replaced by the animated CSS chevron. */
.un-selection-toggle > span[aria-hidden="true"] { display: none; }
.un-selection-topline .un-selection-toggle { min-width: 44px; margin-top: 0; padding: 10px; justify-content: center; }
.un-selection-toggle:hover { background: #f3f3ef; border-color: #a7aea2; }
.un-selection-toggle[aria-expanded="true"] {
  background: var(--un-selected-surface);
  border-color: var(--un-selected-border);
  color: var(--un-red);
}
.un-selection-toggle[aria-expanded="true"]::after { transform: rotate(225deg); margin-bottom: -3px; }
.un-selection-toggle:active { transform: scale(.98); }
[data-news-selection].is-enhanced [data-selection-excerpt] {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 260ms var(--un-ease), opacity 180ms ease, visibility 0s 260ms;
}
[data-news-selection].is-enhanced [data-selection-excerpt] > div { min-height: 0; overflow: hidden; }
[data-news-selection].is-enhanced .is-selected [data-selection-excerpt] {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 260ms var(--un-ease), opacity 180ms ease, visibility 0s;
}

.un-header a:focus-visible,
.un-header-actions .un-button:focus-visible,
.un-section-bar a:focus-visible,
.un-search-results a:focus-visible,
.un-selection-toggle:focus-visible {
  outline: 3px solid var(--un-red);
  outline-offset: 3px;
}

@media (min-width: 560px) {
  .un-mobile-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .un-mobile-nav a:first-child { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  /* Match the module base selector's specificity so the enhanced layout wins. */
  [data-news-selection].un-ed-module .un-selection-items { display: flex; align-items: stretch; }
  [data-news-selection].un-ed-module .un-selection-panel { flex: 1 1 0%; }
  [data-news-selection].un-ed-module.is-enhanced .un-selection-panel {
    transition: flex-grow 260ms var(--un-ease), background-color 180ms ease, border-color 180ms ease;
  }
  [data-news-selection].un-ed-module.is-enhanced .un-selection-panel.is-selected { flex-grow: 2.2; }
  /* The module's <=900px image rule must not resize one image at this boundary. */
  [data-news-selection].un-ed-module .un-selection-panel .un-ed-media img { height: 240px; aspect-ratio: auto; }
}
@media (max-width: 899px) {
  .un-header .un-search-trigger { min-width: 44px; width: 44px; padding: 10px; }
  .un-header .un-menu-trigger { width: auto; padding: 10px 15px; }
  .un-header .un-menu-trigger > span { display: inline; }
  [data-news-selection].un-ed-module .un-selection-items { display: grid; grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .un-section-bar { display: none; }
  .un-masthead { padding-block: 18px 17px; }
  .un-masthead .un-masthead-name { font-size: clamp(34px, 7.5vw, 54px); }
  .un-masthead-line { margin-top: 7px; }
}
@media (max-width: 480px) {
  :root { --un-nav-height: 60px; }
  .un-header > .un-shell,
  .un-header .un-header-inner { gap: 10px; }
  .un-global-brand { flex-basis: 48px; min-width: 48px; min-height: 52px; }
  .un-global-brand img { width: 48px; height: 48px; }
  .un-home-label { padding-left: 10px; font-size: 11px; }
  .un-header-actions { gap: 6px; }
  .un-header .un-menu-trigger { width: 44px; padding: 10px; border-radius: 50%; }
  .un-header .un-menu-trigger > span { display: none; }
  .un-masthead .un-masthead-name { font-size: clamp(34px, 9vw, 42px); }
  .un-masthead-line { font-size: 10px; line-height: 1.5; }
  .un-masthead-line span { display: inline; }
  dialog.un-dialog {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 22px 18px;
    border-radius: 22px;
  }
  .un-dialog-head { gap: 12px; margin-bottom: 20px; }
  .un-dialog-head h2 { font-size: 28px; }
  .un-dialog-head .un-kicker { font-size: 9px; letter-spacing: .07em; }
  .un-search-form { flex-wrap: wrap; }
  .un-search-form input { flex-basis: 100%; }
  .un-search-form > button { width: 100%; min-height: 46px; }
  .un-search-topics { gap: 7px; }
  .un-search-topics a { padding-inline: 12px; font-size: 11px; }
  .un-mobile-nav a { min-height: 52px; font-size: 15px; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .un-header,
  .un-header.is-reading,
  dialog.un-dialog { background: var(--un-glass-solid); }
}
@supports not (grid-template-rows: 0fr) {
  [data-news-selection].is-enhanced [data-selection-excerpt] { display: none; }
  [data-news-selection].is-enhanced .is-selected [data-selection-excerpt] { display: block; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .un-header,
  .un-header.is-reading,
  dialog.un-dialog {
    background: var(--un-glass-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .un-header-actions .un-button { background: #fff; }
  .un-header-actions .un-button[aria-expanded="true"] { background: var(--un-selected-surface); }
}
@media (prefers-reduced-motion: reduce) {
  .un-header,
  .un-header *,
  .un-section-bar a,
  dialog.un-dialog,
  dialog.un-dialog::backdrop,
  [data-news-selection] *,
  [data-news-selection] *::after { transition: none !important; animation: none !important; }
  .un-header-actions .un-button:active,
  .un-selection-toggle:active { transform: none; }
}
@media (forced-colors: active) {
  .un-header,
  .un-header.is-reading,
  dialog.un-dialog { background: Canvas; border-color: CanvasText; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .un-header-actions .un-button,
  .un-section-bar a,
  .un-mobile-nav a,
  .un-search-topics a,
  .un-selection-toggle { background: Canvas; color: CanvasText; border-color: ButtonText; box-shadow: none; }
  .un-header-actions .un-button[aria-expanded="true"],
  .un-section-bar a[aria-current],
  .un-mobile-nav a[aria-current],
  .un-search-topics a[aria-current],
  .un-selection-toggle[aria-expanded="true"] { border: 2px solid Highlight; color: Highlight; }
  .un-selection-panel.is-selected { outline: 1px solid Highlight; outline-offset: -1px; }
}
@media print {
  .un-selection-toggle { display: none !important; }
  [data-news-selection].is-enhanced [data-selection-excerpt] { display: block; opacity: 1; visibility: visible; }
}
