/* ============================================================================
   ARTICLE "SIDEBAR" LAYOUT VARIANT — public website (Style N)
   Additive, shared-layer file. Loaded on every public page (harmless: rules only
   apply to markup the Sidebar variant emits). The Standard single-column layout
   does NOT emit .pub-article-layout / .pub-aside, so it is unaffected.

   Token-driven ONLY — semantic --pub-* + brand tokens from public.css /
   shared/tokens.brand.css, so it flips light/dark and re-themes with G5 presets
   from one source. No hardcoded colours.
   Layer: page-type (sits after public.css / components.css).
   ============================================================================ */

/* ---------- 2-COLUMN GRID (article left ~2fr, sidebar right ~1fr) ---------- */
.pub-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* The article column already carries .pub-article (max-width:820px from
   components.css). Inside the grid the column governs width, so release the cap
   and the auto-centering margins that Standard uses. */
.pub-article-layout .pub-article,
.pub-article-layout__main {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  min-width: 0; /* let long words / <pre> shrink instead of blowing out the grid */
}

/* ---------- SIDEBAR (aside) ---------- */
.pub-aside {
  position: sticky;
  /* clear the fixed brand row + header, plus breathing room */
  top: calc(var(--pub-brandrow-h, 66px) + var(--pub-header-h) + 20px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 28px;
  font-size: 0.92rem;
}

.pub-aside__block {
  background: var(--pub-card);
  border: 1px solid var(--pub-line);
  border-radius: var(--pub-radius);
  padding: 18px 18px 20px;
}

/* small section subhead (NOT a kicker eyebrow) */
.pub-aside__h {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pub-accent-ink);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--pub-line);
}

/* ---------- LISTS (Other news / Newsletters) ---------- */
.pub-aside__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.pub-aside__item + .pub-aside__item {
  border-top: 1px solid var(--pub-line);
}

.pub-aside__link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  color: var(--pub-ink);
}
.pub-aside__item:first-child .pub-aside__link { padding-top: 2px; }

.pub-aside__thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--pub-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pub-aside__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-aside__thumbph { color: var(--pub-mut); display: inline-flex; }
.pub-aside__thumbph svg { width: 22px; height: 22px; }

.pub-aside__nlicon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  background: var(--pub-soft);
  color: var(--pub-accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pub-aside__nlicon svg { width: 18px; height: 18px; }

.pub-aside__itembody { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pub-aside__itemtitle {
  font-weight: 700;
  line-height: 1.3;
  color: var(--pub-ink);
  transition: color var(--motion-fast) ease;
}
.pub-aside__itemmeta {
  font-size: 0.78rem;
  color: var(--pub-mut);
  line-height: 1.3;
}

@media (hover: hover) {
  .pub-aside__link:hover .pub-aside__itemtitle { color: var(--pub-red-ink); }
}

/* ---------- "Browse newsletters ->" more link ---------- */
.pub-aside__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--pub-accent-ink);
}
.pub-aside__more svg { width: 1em; height: 1em; transition: transform var(--motion-fast) ease; }
@media (hover: hover) {
  .pub-aside__more:hover { color: var(--pub-red-ink); }
  .pub-aside__more:hover svg { transform: translateX(3px); }
}

/* ---------- BROWSE nav block ---------- */
.pub-aside__nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pub-aside__navlink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  font-weight: 600;
  color: var(--pub-ink);
}
.pub-aside__nav li + li .pub-aside__navlink { border-top: 1px solid var(--pub-line); }
.pub-aside__navlink svg { width: 0.95em; height: 0.95em; color: var(--pub-mut); transition: transform var(--motion-fast) ease, color var(--motion-fast) ease; }
@media (hover: hover) {
  .pub-aside__navlink:hover { color: var(--pub-red-ink); }
  .pub-aside__navlink:hover svg { color: var(--pub-red-ink); transform: translateX(3px); }
}

/* ---------- FOCUS (a11y) ---------- */
.pub-aside a:focus-visible {
  outline: 2px solid var(--pub-accent-ink);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- RESPONSIVE: stack sidebar below the article ---------- */
@media (max-width: 860px) {
  .pub-article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .pub-aside {
    position: static; /* no sticky when stacked */
    top: auto;
  }
}

@media (max-width: 375px) {
  .pub-article-layout { gap: 32px; }
  .pub-aside__block { padding: 16px 14px 18px; }
  .pub-aside__thumb { width: 48px; height: 48px; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .pub-aside__itemtitle,
  .pub-aside__more svg,
  .pub-aside__navlink svg,
  .pub-aside__navlink {
    transition: none;
  }
  .pub-aside__more:hover svg,
  .pub-aside__navlink:hover svg { transform: none; }
}
