/* ============================================================
   KICKERS, LABELS, MARKER HIGHLIGHT
   ============================================================ */

.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.kicker--mute { color: var(--mute); }
a.kicker { transition: color 0.15s var(--ease); }
a.kicker:hover { color: var(--mute); }

.hl {
  background: var(--y);
  color: var(--on-accent, var(--ink));
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.04em 0.14em;
}

/* marker-swipe underline on hover, the house link move */
.mk {
  background-image: linear-gradient(var(--y), var(--y));
  background-repeat: no-repeat;
  background-size: 0% 32%;
  background-position: 0 88%;
  transition: background-size 0.28s var(--ease);
}
a:focus-visible .mk, a.mk:focus-visible { background-size: 100% 32%; }
@media (hover: hover) and (pointer: fine) {
  a:hover .mk, a.mk:hover { background-size: 100% 32%; }
}

/* ============================================================
   TOP BAR + MASTHEAD + NAV
   ============================================================ */

.topbar {
  background: var(--shell-inverse-bg, var(--ink));
  color: var(--shell-inverse-text, var(--paper));
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  gap: 16px;
}
.topbar-date { color: var(--gray-3); text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; }
.topbar-links { display: flex; gap: 4px; }
.topbar-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  min-height: 36px;
  color: var(--gray-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  transition: color 0.15s var(--ease);
}
.topbar-links a:hover { color: var(--y); }
.topbar svg { width: 15px; height: 15px; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
/* Adaptive Premium's skin stylesheet deliberately resets every `header` to
   relative positioning for its former WordPress shell. Keep our native
   masthead sticky even while that campaign stylesheet is present. */
header.header.masthead {
  position: sticky !important;
  top: 0;
}
.masthead.is-condensed {
  background: var(--shell-inverse-bg, var(--ink));
  color: var(--shell-inverse-text, var(--paper));
}
.masthead.is-condensed .iconbtn:hover { background: #262626; }
.masthead .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: clamp(18px, 3.5vw, 30px);
  padding-bottom: clamp(14px, 3vw, 24px);
  gap: 12px;
  transition: padding 0.25s var(--ease);
}
.masthead.is-condensed .wrap { padding-top: 10px; padding-bottom: 10px; }
.masthead-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--mute);
  transition: opacity 0.2s var(--ease);
}
.masthead.is-condensed .masthead-tag { opacity: 0; }
.brand {
  justify-self: center;
  width: clamp(190px, 36vw, 320px);
  min-width: 0;
  line-height: 0;
  transition: width 0.25s var(--ease);
}
.brand .contextus-logo { width: 100%; height: auto; }
.masthead.is-condensed .brand { width: 160px; }
.masthead.is-condensed .contextus-logo,
.overlay .contextus-logo,
.footer .contextus-logo { filter: invert(1); }
.masthead-actions {
  justify-self: end;
  display: flex;
  gap: 4px;
}
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  transition: background-color 0.15s var(--ease), transform 0.1s var(--ease);
}
.iconbtn:hover { background: var(--gray-1); }
.iconbtn:active { transform: scale(0.96); }
.iconbtn svg { width: 22px; height: 22px; }

/* reading progress (article, hugs the masthead's bottom edge) */
.progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--y);
  pointer-events: none;
}

/* ============================================================
   FULLSCREEN MENU + SEARCH OVERLAYS
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--shell-inverse-bg, var(--ink));
  color: var(--shell-inverse-text, var(--paper));
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease), visibility 0s linear 0.22s;
}
.overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.22s var(--ease);
}
.overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  border-bottom: 1px solid #333;
}
.overlay-head .brand { width: 180px; }
.overlay-close { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.overlay-close svg { width: 26px; height: 26px; }
.overlay-close:active { transform: scale(0.96); }
.overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(24px, 6vh, 64px) var(--gutter);
}
.overlay-nav {
  max-width: var(--max);
  margin: 0 auto;
}
.overlay-nav-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.overlay-nav-list .sub-menu { margin: 2px 0 8px clamp(16px, 4vw, 48px); padding: 0; list-style: none; }
.overlay-nav-list .sub-menu a { font-size: clamp(20px, 3.5vw, 34px); }
.overlay-nav .current-menu-item > a .mk,
.overlay-nav .current-menu-ancestor > a .mk,
.overlay-nav a[aria-current="page"] .mk { background-size: 100% 32%; }
.overlay-nav a {
  font-size: clamp(30px, 6vw, 54px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  padding: 6px 0;
  opacity: 0;
  transform: translateY(14px);
}
.overlay.is-open .overlay-nav a {
  animation: rise 0.4s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.overlay-nav a:hover .mk { background-size: 100% 32%; }
.overlay-nav .mk { background-position: 0 92%; }
.overlay-meta {
  max-width: var(--max);
  margin: 48px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--gray-3);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.overlay-meta a { padding: 8px 0; transition: color 0.15s var(--ease); }
.overlay-meta a:hover { color: var(--y); }

.search-form {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.search-form label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gray-3);
  margin-bottom: 14px;
}
.search-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 4px solid var(--y);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  padding: 8px 0 14px;
}
.search-field { position: relative; }
.search-field .search-input { padding-right: 60px; }
.search-submit {
  position: absolute;
  right: 0;
  bottom: 8px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--y);
  border-radius: 50%;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease);
}
.search-submit:hover { background: #ffe232; }
.search-submit:active { transform: scale(0.96); }
.search-submit svg { width: 24px; height: 24px; }
.search-input::placeholder { color: #444; }
.search-input:focus { outline: none; }
.search-hints { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.search-hints a {
  border: 2px solid #3a3a3a;
  color: var(--gray-3);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 9px 14px;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.search-hints a:hover { border-color: var(--y); color: var(--paper); }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   IMAGERY — viewport-position grayscale, yellow on hover
   ============================================================ */

.ph {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--gray-2);
}
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
  pointer-events: none;
}
.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.04);
  transition: transform 0.5s var(--ease);
}
.ph > picture {
  width: 100%;
  height: 100%;
}
a:hover .ph img, a.ph:hover img { transform: scale(1.03); }

/* The stops approximate a Gaussian with sigma = 0.25 viewport heights. The
   center of the view timeline is the viewport center; both off-screen ends are
   intentionally near-full grayscale. */
@keyframes viewport-image-grayscale {
  0%, 100% { filter: grayscale(0.99) contrast(1.04); }
  12.5%, 87.5% { filter: grayscale(0.99) contrast(1.04); }
  25%, 75% { filter: grayscale(0.865) contrast(1.04); }
  31.25%, 68.75% { filter: grayscale(0.675) contrast(1.04); }
  37.5%, 62.5% { filter: grayscale(0.393) contrast(1.04); }
  43.75%, 56.25% { filter: grayscale(0.118) contrast(1.04); }
  50% { filter: grayscale(0) contrast(1.04); }
}

@supports (animation-timeline: view()) and (overflow: clip) {
  /* overflow: hidden would become the image's nearest scroll container, so
     view() would measure the clipping box instead of the document viewport. */
  .ph { overflow: clip; }
  .ph img {
    animation-name: viewport-image-grayscale;
    animation-duration: 1ms;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: view();
    animation-range: cover;
  }
}
.ph--3x2 { aspect-ratio: 3 / 2; }
.ph--16x9 { aspect-ratio: 16 / 9; }
.ph--sq { aspect-ratio: 1; }
