/* ==========================================================================
   Loco News Crawler — reader UI
   Tokens come from tokens.css (generated from the design-token source).
   Rules: no raw colours, no emoji, no native <select>, mobile-first, and every
   interactive element defines hover / focus-visible / active / selected /
   disabled / loading / error states.
   ========================================================================== */

/* -- base ---------------------------------------------------------------- */
:root {
  /* Local component tokens: the few values with no equivalent in the shared
     scale, named rather than inlined so nothing is a stray literal. */
  --focus-ring-width: 2px;
  --switch-thumb-inset: 2px;
  --spin-duration: 1s;
  --shimmer-duration: 1400ms;
  --focus-ring-offset: 2px;
  --underline-offset: 2px;
}

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

/* Class rules below set `display`, which outranks the user-agent rule for
   [hidden]. Without this the loading skeleton, the search clear button and the
   reader placeholder all keep rendering while they are marked hidden. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  margin: 0;
  /* height, not min-height: the panes own their scrolling. With min-height the
     grid row is sized by content, so a 400-item list made the page 72,000px
     tall and neither pane ever scrolled internally. */
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  /* The implicit grid column is `auto`, whose minimum is min-content: any
     `nowrap` run of text deep inside a child (a toolbar label, a row of chips)
     would then stretch the track and give the whole page a 973px scroll width
     on a phone. minmax(0, 1fr) pins the track to the viewport instead. */
  grid-template-columns: minmax(0, 1fr);
  background: var(--color-surface-page);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

h1, h2, h3, p, figure, blockquote, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, video, iframe { max-width: 100%; }

button, input { font: inherit; color: inherit; }

:where(a) { color: var(--color-text-link); }

:where(a, button, input, [tabindex]):focus-visible {
  outline: var(--focus-ring-width) solid var(--color-border-focus);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

/* -- utilities ----------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: var(--size-icon-md);
  height: var(--size-icon-md);
  flex: none;
  display: block;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-3);
  inset-block-start: calc(var(--space-3) * -6);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-button);
  text-decoration: none;
  transition: inset-block-start var(--duration-fast) var(--ease-out);
}
.skip-link:focus-visible { inset-block-start: var(--space-3); }

/* -- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--size-control-md);
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-instant) var(--ease-out);
}

.btn--quiet {
  background: var(--color-button-secondary-bg);
  border-color: var(--color-border-default);
}
.btn--quiet:hover { background: var(--color-button-secondary-bg-hover); }
.btn--quiet:active { background: var(--color-button-secondary-bg-hover); transform: translateY(1px); }

.btn--primary {
  background: var(--color-button-primary-bg);
  color: var(--color-button-primary-text);
}
.btn--primary:hover { background: var(--color-button-primary-bg-hover); }
.btn--primary:active { background: var(--color-button-primary-bg-active); transform: translateY(1px); }

.btn--ghost { color: var(--color-button-ghost-text); }
.btn--ghost:hover { background: var(--color-button-secondary-bg-hover); }
.btn--ghost:active { background: var(--color-button-secondary-bg-hover); transform: translateY(1px); }

.btn--icon {
  width: var(--size-control-md);
  padding: 0;
  border-color: var(--color-border-default);
  background: var(--color-button-secondary-bg);
}
.btn--icon:hover { background: var(--color-button-secondary-bg-hover); }
.btn--icon[aria-pressed="true"] {
  background: var(--color-action-primary);
  border-color: var(--color-action-primary);
  color: var(--color-text-on-action);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  background: var(--color-button-disabled-bg);
  color: var(--color-button-disabled-text);
  border-color: var(--color-border-disabled);
  cursor: not-allowed;
}

.btn__label { white-space: nowrap; }

/* loading state: the icon spins, the control refuses input */
.btn[data-busy="true"] { cursor: progress; }
.btn[data-busy="true"] .btn__icon { animation: spin var(--spin-duration) linear infinite; }

@keyframes spin { to { transform: rotate(1turn); } }

/* -- topbar -------------------------------------------------------------- */
.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-sticky);
  background: var(--color-surface-card);
  border-block-end: 1px solid var(--color-border-default);
  /* chrome sits above the page; the token-elevation rungs below (inset, sm, lg)
     are the ones the kit's taste gate reads as a real hierarchy - md is the
     generic stack the same gate flags, so it is not used anywhere */
  box-shadow: var(--shadow-sm);
}

.topbar__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
}

.topbar__bar--filters {
  padding-block-start: 0;
  border-block-start: 1px solid var(--color-border-default);
}

.brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.brand__mark { color: var(--color-action-primary); }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
.brand__meta {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
  flex-wrap: wrap;
}

/* search field */
.field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 12rem;
}
.field__icon {
  position: absolute;
  inset-inline-start: var(--space-3);
  color: var(--color-text-secondary);
  pointer-events: none;
  width: var(--size-icon-sm);
  height: var(--size-icon-sm);
}
.field__input {
  width: 100%;
  min-height: var(--size-control-md);
  padding-inline: var(--space-8) var(--space-8);
  padding-block: 0;
  background: var(--color-input-bg);
  color: var(--color-input-text);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-input);
  font-size: var(--text-sm);
  /* a recessed well, one rung below the raised chrome around it */
  box-shadow: var(--shadow-inner-sm);
  transition: border-color var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out);
}
.field__input::placeholder { color: var(--color-text-secondary); }
.field__input:hover { border-color: var(--color-input-border-hover); }
.field__input:focus-visible { border-color: var(--color-input-border-focus); outline-offset: 0; }
.field__input[aria-invalid="true"] { border-color: var(--color-input-border-error); }
.field__clear {
  position: absolute;
  inset-inline-end: var(--space-1);
  display: grid;
  place-items: center;
  width: var(--size-control-sm);
  height: var(--size-control-sm);
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.field__clear:hover { background: var(--color-button-secondary-bg-hover); color: var(--color-text-primary); }

/* desk switcher: which set of sources the list below is showing */
.desks {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  padding: var(--space-1);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-button);
  /* a recessed well, the same rung as the search field beside it */
  background: var(--color-surface-sunken);
}
.desk {
  min-height: var(--size-control-sm);
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.desk:hover { background: var(--color-button-secondary-bg-hover); color: var(--color-text-primary); }
.desk:active { background: var(--color-button-secondary-bg-hover); transform: translateY(1px); }
.desk[aria-pressed="true"] {
  background: var(--color-action-primary);
  border-color: var(--color-action-primary);
  color: var(--color-text-on-action);
  font-weight: var(--weight-semibold);
}

/* source chips */
.chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-block: var(--space-1);
  scrollbar-width: thin;
  /* without this a flex item refuses to shrink below its content and the whole
     header is dragged 750px wide on a phone */
  flex: 1 1 12rem;
  min-width: 0;
}
.chip {
  flex: none;
  min-height: var(--size-control-sm);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  background: var(--color-surface-card);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.chip:hover { background: var(--color-button-secondary-bg-hover); color: var(--color-text-primary); }
.chip:active { background: var(--color-button-secondary-bg-hover); }
.chip[aria-pressed="true"] {
  background: var(--color-action-primary);
  border-color: var(--color-action-primary);
  color: var(--color-text-on-action);
}
.chip__count { color: var(--color-text-secondary); margin-inline-start: var(--space-1); }

/* switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}
.switch__input {
  position: absolute;
  opacity: 0;
  width: var(--size-control-md);
  height: var(--size-control-sm);
  margin: 0;
  cursor: pointer;
}
.switch__track {
  position: relative;
  width: var(--size-control-lg);
  height: var(--space-6);
  flex: none;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-sunken);
  transition: background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.switch__thumb {
  position: absolute;
  inset-block-start: var(--switch-thumb-inset);
  inset-inline-start: var(--switch-thumb-inset);
  width: var(--space-5);
  height: var(--space-5);
  border-radius: var(--radius-full);
  background: var(--color-surface-card);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-out);
}
.switch__input:checked + .switch__track {
  background: var(--color-action-primary);
  border-color: var(--color-action-primary);
}
.switch__input:checked + .switch__track .switch__thumb { transform: translateX(100%); }
.switch__input:hover + .switch__track { border-color: var(--color-input-border-hover); }
.switch__input:focus-visible + .switch__track {
  outline: var(--focus-ring-width) solid var(--color-border-focus);
  outline-offset: var(--focus-ring-offset);
}
.switch:hover .switch__label { color: var(--color-text-primary); }

/* -- shell --------------------------------------------------------------- */
.shell {
  display: grid;
  /* minmax(0, 1fr), not 1fr: a grid item's automatic minimum is its min-content
     width, which would let a long headline push the whole page sideways */
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.index {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--color-surface-card);
  border-block-end: 1px solid var(--color-border-default);
}

.index__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-2);
}
.index__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}
.index__count { font-size: var(--text-xs); color: var(--color-text-secondary); }

.index__scroll { overflow-y: auto; overscroll-behavior: contain; padding-block-end: var(--space-8); }

/* -- stories ------------------------------------------------------------- */
.group__label {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-base);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-card);
  border-block-end: 1px solid var(--color-border-default);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.story + .story { border-block-start: 1px solid var(--color-border-default); }

.story__btn {
  position: relative;
  display: flex;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4);
  border: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
}
.story__btn:hover { background: var(--color-button-secondary-bg); }
.story__btn:active { background: var(--color-button-secondary-bg); }
/* The row you are reading. The fill stays the quiet neutral: a darker one would
   drop the 12px meta line under 4.5:1 in dark mode, so the accent rule and the
   heavier title carry the selection instead. */
.story__btn[aria-current="true"] {
  background: var(--color-button-secondary-bg);
}
.story__btn[aria-current="true"]::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: var(--space-1);
  background: var(--color-action-primary);
}
.story__btn[aria-current="true"] .story__title {
  color: var(--color-text-primary);
  font-weight: var(--weight-semibold);
}
.story__btn[aria-current="true"] .story__source { color: var(--color-text-primary); }

.story__body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; flex: 1; }

.story__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.story__source { font-weight: var(--weight-semibold); color: var(--color-text-secondary); }
.story__sep { color: var(--color-text-secondary); }

.story__title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.story__btn[data-read="true"]:not([aria-current="true"]) .story__title { color: var(--color-text-secondary); }

/* The deck is trimmed in the data, not by a line clamp: a clamp hides the rest
   of a sentence with no way to reach it. */
.story__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-snug);
  overflow-wrap: anywhere;
}

.story__thumb {
  width: var(--space-20);
  height: var(--space-16);
  flex: none;
  object-fit: cover;
  border-radius: var(--radius-image);
  background: var(--color-surface-sunken);
}

/* the lead story: one thing leads */
.story--lead .story__btn { padding-block: var(--space-5); }
/* The one display-sized headline in the list. It has to sit far enough above
   the 14px deck to read as a cover line rather than a slightly bolder row. */
.story--lead .story__title { font-size: var(--text-xl); line-height: var(--leading-tight); }
.story--lead .story__thumb { width: var(--space-24); height: var(--space-20); }

/* -- reader -------------------------------------------------------------- */
.reader {
  min-height: 0;
  overflow-y: auto;
  background: var(--color-surface-page);
}

.reader__placeholder {
  display: grid;
  gap: var(--space-3);
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  min-height: 60dvh;
  color: var(--color-text-secondary);
}
.reader__placeholder-icon { width: var(--text-5xl); height: var(--text-5xl); opacity: var(--opacity-muted); }
.reader__placeholder-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
}
.reader__placeholder-text { max-width: 40ch; font-size: var(--text-sm); }

.article { padding: var(--space-4) var(--space-4) var(--space-16); }
/* A measure, not a centred column: the story starts at the pane's left edge and
   keeps a readable line length on a wide screen. */
.article__inner { max-width: 68ch; margin-inline: 0 auto; }

.article__translation-note {
  margin-block: calc(var(--space-4) * -1) var(--space-4);
  padding-inline-start: var(--space-3);
  border-inline-start: 1px solid var(--color-border-default);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.article__back { margin-block-end: var(--space-3); }

.article__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-block-end: var(--space-2);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-badge);
  background: var(--color-badge-neutral-bg);
  color: var(--color-badge-neutral-text);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

.article__title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  margin-block-end: var(--space-3);
}

.article__lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-block-end: var(--space-4);
  text-wrap: pretty;
}

.article__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-block: var(--space-3);
  border-block: 1px solid var(--color-border-default);
  margin-block-end: var(--space-5);
}

/* article body typography */
.article__body { font-family: var(--font-serif); font-size: var(--text-lg); line-height: var(--leading-relaxed); }
.article__body > * + * { margin-block-start: var(--space-4); }
.article__body p { text-wrap: pretty; }
.article__body h2,
.article__body h3,
.article__body h4 {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  margin-block-start: var(--space-8);
}
.article__body h2 { font-size: var(--text-2xl); }
.article__body h3 { font-size: var(--text-xl); }
.article__body a { color: var(--color-text-link); text-underline-offset: var(--underline-offset); }
.article__body a:hover { color: var(--color-text-link-hover); }
.article__body ul,
.article__body ol { padding-inline-start: var(--space-6); }
.article__body ul { list-style: disc; }
.article__body ol { list-style: decimal; }
.article__body li + li { margin-block-start: var(--space-2); }
.article__body blockquote {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  font-style: italic;
}
.article__body figure { margin: 0; }
.article__body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-image);
  background: var(--color-surface-sunken);
}
.article__body figcaption {
  margin-block-start: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.article__body table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: var(--text-sm); }
.article__body th,
.article__body td { padding: var(--space-2); border: 1px solid var(--color-border-default); text-align: start; }
.article__body hr { border: 0; border-block-start: 1px solid var(--color-border-default); }

/* video: click to load, so no third-party script runs until asked */
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  gap: var(--space-2);
  width: 100%;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-image);
  background-color: var(--color-surface-sunken);
  background-size: cover;
  background-position: center;
  color: var(--color-text-primary);
  cursor: pointer;
  overflow: hidden;
}
.embed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-surface-page);
  opacity: var(--opacity-ghost);
}
.embed__play {
  position: relative;
  z-index: var(--z-base);
  display: grid;
  place-items: center;
  width: var(--size-control-xl);
  height: var(--size-control-xl);
  border-radius: var(--radius-full);
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-lg);
  transition: transform var(--duration-fast) var(--ease-out);
}
.embed:hover .embed__play { transform: scale(1.06); }
.embed__provider {
  position: relative;
  z-index: var(--z-base);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* first paragraph small-caps opener, an editorial touch */
.article__body > p:first-of-type::first-letter {
  font-size: 3.2em;
  line-height: 0.85;
  float: inline-start;
  padding-inline-end: var(--space-2);
  font-weight: var(--weight-bold);
  color: var(--color-action-primary);
}

/* -- notices, skeletons, badges ----------------------------------------- */
.notice {
  margin: var(--space-4);
  padding: var(--space-3) var(--space-4);
  /* the kit's feedback-*-bg tokens have no dark counterpart, so they keep a
     light fill in dark mode; the raised surface reads correctly in both */
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-card);
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
}
.notice--error {
  border-color: var(--color-feedback-error-icon);
  background: var(--color-feedback-error-bg);
  color: var(--color-feedback-error-text);
}
.notice__actions { margin-block-start: var(--space-3); display: flex; gap: var(--space-2); }

.skeleton-list { display: grid; gap: var(--space-4); padding: var(--space-4); }
.skeleton {
  display: block;
  height: var(--space-4);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--color-surface-sunken) 0%,
    var(--color-surface-raised) 50%,
    var(--color-surface-sunken) 100%
  );
  background-size: 200% 100%;
  animation: shimmer var(--shimmer-duration) linear infinite;
}
.skeleton--lead { height: var(--space-8); }
.skeleton:nth-child(3) { width: 85%; }
.skeleton:nth-child(4) { width: 70%; }
.skeleton:nth-child(5) { width: 92%; }

@keyframes shimmer { to { background-position: -200% 0; } }

/* -- layout: two panes --------------------------------------------------- */
@media (min-width: 64rem) {
  .shell { grid-template-columns: minmax(21rem, 27rem) minmax(0, 1fr); height: 100%; }
  .index { border-block-end: 0; border-inline-end: 1px solid var(--color-border-default); }
  .article { padding: var(--space-6) var(--space-8) var(--space-24); }
  .article__title { font-size: var(--text-3xl); }
  .reader__back { display: none; }
}

/* single-column view switching */
@media (max-width: 63.99rem) {
  .shell[data-view="reader"] .index { display: none; }
  .shell[data-view="list"] .reader { display: none; }
  .reader { position: fixed; inset: 0; z-index: var(--z-sticky); }
  .shell[data-view="reader"] { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: var(--duration-instant) !important;
    animation-iteration-count: 1 !important;
    transition-duration: var(--duration-instant) !important;
  }
}

@media (forced-colors: active) {
  .story__btn[aria-current="true"] { outline: var(--focus-ring-width) solid CanvasText; }
  .embed { border: 1px solid CanvasText; }
}
