/* Native color-scheme also responds to system changes with JavaScript disabled. */
html:root {color-scheme:light dark}
html:root[data-appearance=light] {color-scheme:light}
html:root[data-appearance=dark] {color-scheme:dark}
/* An appearance switch that uses the same surfaces and focus treatment as the site. */
.appearance-control {
  position:relative;
  z-index:2;
  flex:none;
  line-height:1.3;
}
.appearance-control button {
  font:inherit;
  color:var(--interactive-ink);
  cursor:pointer;
}
.appearance-control svg {display:block;width:17px;height:17px;flex:none;pointer-events:none}
.appearance-control button.appearance-trigger {
  display:grid;place-items:center;
  width:40px;height:40px;padding:0;
  border:0;border-radius:50%;
  background:transparent;
}
.appearance-symbol {display:grid;place-items:center}
.appearance-trigger .appearance-symbol svg {width:20px;height:20px}
.appearance-control .appearance-options {
  position:absolute;z-index:3;inset-block-start:calc(100% + 9px);inset-inline-end:0;
  width:164px;padding:5px;display:grid;gap:2px;
  border:1px solid var(--interactive-line);border-radius:14px;
  background:var(--interactive-surface);
  box-shadow:0 12px 32px light-dark(#1f42322b,#070d0a80);
}
.appearance-control .appearance-options[hidden] {display:none}
.appearance-options button {
  display:grid;grid-template-columns:18px 1fr 16px;align-items:center;gap:9px;
  min-height:38px;padding:5px 8px;border:0;border-radius:8px;
  background:transparent;font-size:14px;text-align:start;
}
.appearance-options button svg:last-child {width:15px;height:15px;visibility:hidden}
.appearance-options button[aria-pressed=true] {
  color:var(--interactive-ink);background:var(--interactive-tint);font-weight:680;
}
.appearance-options button[aria-pressed=true] svg:last-child {visibility:visible}
.appearance-control :is(.appearance-trigger,.appearance-options button):hover,
.appearance-control .appearance-trigger[aria-expanded=true] {background:var(--interactive-tint)}
.appearance-control button:focus-visible {outline:2px solid var(--interactive-focus);outline-offset:2px}
@media(max-width:680px) {
  .appearance-control button.appearance-trigger {width:44px;height:44px}
}
.site-header .top>nav {margin-left:auto}
.auth-page header {display:flex;align-items:center;justify-content:space-between}
body>.appearance-control {position:fixed;right:16px;top:12px}
.th-feature-photo,.media-card {position:relative}
.th-feature-photo .th-enter::after,.media-card:not([data-player]) .media-title::after {content:"";position:absolute;inset:0}
.media-card .media-open {position:relative}
@media(max-width:680px){
 .site-header .top {display:grid;grid-template-columns:1fr auto;gap:0;padding-block:6px 0;height:auto}
 .site-header .brand {grid-column:1;grid-row:1;justify-self:start}
 .site-header .appearance-control {grid-column:2;grid-row:1}
 .site-header .top nav {grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(5,1fr);width:100%;height:40px;min-height:40px;gap:0}
 .site-header .top nav a {justify-content:center;min-width:0}
}
html:root {
 --site-muted:light-dark(#52685d,#b0c1b8);
 --site-ink:light-dark(#263831,#e1ebe5);
 --site-accent:light-dark(#356e5b,#9fd4b9);
}
/* These labels sit on photographs in both appearances. */
.th-feature-photo,.th-feature-photo .th-spot-copy h2,.leadstory .leadinfo {color:#fff}
.th-feature-photo :is(.th-kicker,.th-spot-copy p,.th-spot-end>span),.leadinfo small {color:#e3f1e8}
.th-feature-photo::after {background:linear-gradient(90deg,#12211bea 0%,#12211bc4 42%,#12211b20 100%)}
.auth-feature:before {background:linear-gradient(0deg,light-dark(#eaf2eb,#111c16) 0%,light-dark(#eaf2ebb8,#111c16c0) 18%,transparent 50%)}

/* Shared controls retain their role and adapt to both palettes. */
html:root {
  --interactive-ink:light-dark(#214e3d,#d5e9dd);
  --interactive-surface:light-dark(#fbfdf9,#304039);
  --interactive-line:light-dark(#c7d9ce,#496257);
  --interactive-tint:light-dark(#dcebe0,#354b40);
  --interactive-focus:light-dark(#327357,#a4d0b8);
  --interactive-highlight:
    radial-gradient(ellipse at 18% 0%,light-dark(#f7fff1ed,#92c4a449),transparent 65%),
    linear-gradient(112deg,light-dark(#d5e6cf,#31483a),light-dark(#cae1d8,#284940) 52%,light-dark(#dce8f1,#334255));
  --interactive-glow:
    inset 0 0 0 1px light-dark(#74aa8b60,#a1d9b861),
    0 2px 14px light-dark(#4b9d6d3d,#80d3ab33);
  --interactive-radius:11px;
  --page-top:clamp(25px,3.8vw,54px);
}
body[data-page] :is(.mag.home,.bj-page,.th-page,.rd-page) {padding-block-start:var(--page-top)}
body[data-page] :is(.bj-mast h1,.th-head h1,.rd-titleline h1) {
  font-weight:730;line-height:1.16;letter-spacing:-.035em;
}
body[data-page] :is(.rd-search,.bj-search,.th-search) {
  border-color:var(--interactive-line);border-radius:var(--interactive-radius);
  background:var(--interactive-surface);
}
body[data-page] :is(.rd-search,.bj-search,.th-search):focus-within {
  outline:2px solid var(--interactive-focus);outline-offset:1px;
}
body[data-page] :is(.primary,.soft,.th-enter,.rd-action,.jump-primary,.cms-act,.cms-btn) {
  border-radius:var(--interactive-radius);
}
body[data-page] :is(.primary,.soft,.rd-action,.jump-primary) {
  min-height:44px;line-height:1.35;
}
body[data-page] :is(.soft,.rd-reset,.cms-btn) {border-color:var(--interactive-line)}
body[data-page] :is(.soft,.rd-reset,.cms-btn):not([disabled]):hover {background-color:var(--interactive-tint)}
body[data-page] :is(button,a,input,select,textarea):focus-visible {outline-color:var(--interactive-focus)}
body[data-page] :is(.site-back-top,.rd-search button) {border-radius:var(--interactive-radius)}
.site-header .top {column-gap:clamp(12px,2vw,24px)}
.site-header .top nav a {font-weight:570}
.site-header .top nav a.chosen {font-weight:690}
body[data-page] > .site-header nav a.chosen::after {border-radius:4px 4px 0 0}
.home-list-more {margin-top:clamp(16px,2vw,26px)}
.home-list-more a {
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  min-height:44px;padding:9px 15px;border:1px solid var(--interactive-line);
  border-radius:var(--interactive-radius);background:var(--interactive-surface);
  color:var(--interactive-ink);font-size:15px;font-weight:650;
}
.home-list-more a:hover {background:var(--interactive-tint);border-color:var(--interactive-focus)}
.home-list-more .ic {width:16px;height:16px}
.workbench :is(.cms-tools,.cms-panel,.cms-rel-controls,#editor,.st-filters) select {
  appearance:none;
  min-height:42px;padding-inline:11px 30px;
  border-color:var(--interactive-line);border-radius:9px;
  background-color:var(--interactive-surface);
  background-image:linear-gradient(45deg,transparent 50%,var(--interactive-ink) 50%),
                   linear-gradient(135deg,var(--interactive-ink) 50%,transparent 50%);
  background-size:5px 5px;background-repeat:no-repeat;
  background-position:right 15px center,right 10px center;
}
@media(max-width:680px) {
  .site-header .top {column-gap:0}
  body[data-page] :is(.rd-search,.bj-search,.th-search) input {font-size:16px}
}
@media(prefers-reduced-motion:no-preference) {
  .appearance-control button,.home-list-more a {transition:background-color .16s ease,border-color .16s ease}
}

/* Card hover stays within the grid and preserves the reading order. */
body[data-page] :is(.bj-row,.rd-entry,.rd-relation,a.reading-card,.entry.story,.topicgrid>a) {
  border-radius:12px;
}
body[data-page] :is(.bj-row,.rd-entry,.rd-relation,a.reading-card,.entry.story,.topicgrid>a,#th-index .th-project,.pd-card):is(:hover,:focus-visible) {
  background-color:var(--interactive-tint);
  background-image:var(--interactive-highlight);
  border-color:var(--interactive-line);
  box-shadow:var(--interactive-glow);
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  body[data-page] :is(.bj-row,.rd-entry,.rd-relation,a.reading-card,.entry.story,.topicgrid>a,#th-index .th-project,.pd-card) {
    transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease,translate .18s ease;
  }
  body[data-page] :is(.bj-row,.rd-entry,.rd-relation,a.reading-card,.entry.story,.topicgrid>a,#th-index .th-project,.pd-card):hover {
    translate:0 -2px;
  }
}
