/* ============================================================================
   Verity Gulf - components.
   Buttons, chips, meta rows, the card system, widgets, forms, and the small
   primitives everything else is built from. BEM naming throughout.
   ========================================================================= */

/* ============================================================ ICONS */

.ui {
  display: inline-block;
  inline-size: 1em;
  block-size: 1em;
  flex: none;
  font-size: 16px;
  vertical-align: -0.125em;
}

.ui--xs { font-size: 14px; }
.ui--sm { font-size: 16px; }
.ui--md { font-size: 18px; }
.ui--lg { font-size: 20px; }
.ui--xl { font-size: 24px; }
.ui--2xl { font-size: 32px; }

/* ============================================================ BUTTONS */

.btn {
  --btn-fill: transparent;
  --btn-text: var(--fg-heading);
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-block-size: var(--btn-h);
  padding-inline: 22px;
  background: var(--btn-fill);
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease),
              transform var(--t-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.btn--primary   { --btn-fill: var(--brand); --btn-text: var(--on-brand); }
.btn--secondary { --btn-text: var(--brand); --btn-border: var(--brand); border-width: 1.5px; }
.btn--soft      { --btn-fill: var(--brand-soft); --btn-text: var(--brand); }
.btn--gold      { --btn-fill: var(--accent); --btn-text: var(--on-accent); font-weight: 700; }
.btn--ghost     { --btn-text: var(--fg-muted); min-block-size: 40px; padding-inline: var(--s-4); font-weight: 500; }

/* Used on the solid promo cards: white pill, label in the card's own fill. */
.btn--onsolid {
  --btn-fill: #FFFFFF;
  --btn-text: var(--promo-fill, var(--brand));
  min-block-size: 40px;
  padding-inline: var(--s-5);
  font-size: 13px;
  font-weight: 700;
}

.btn--sm { min-block-size: var(--btn-h-sm); padding-inline: var(--s-4); font-size: 13px; }
.btn--lg { min-block-size: var(--btn-h-lg); padding-inline: 28px; font-size: 15px; }
.btn--block { display: flex; inline-size: 100%; }

.btn--icon {
  inline-size: 40px;
  min-block-size: 40px;
  padding-inline: 0;
  --btn-text: var(--fg-muted);
}

@media (hover: hover) {
  .btn--primary:hover   { --btn-fill: var(--brand-hover); box-shadow: var(--sh-brand); transform: translateY(-1px); }
  .btn--secondary:hover { --btn-fill: var(--brand); --btn-text: var(--on-brand); }
  .btn--soft:hover      { --btn-fill: var(--brand-soft-2); }
  .btn--gold:hover      { --btn-fill: var(--c-gold-600); }
  .btn--ghost:hover     { --btn-fill: var(--bg-surface-2); --btn-text: var(--fg-heading); }
  .btn--onsolid:hover   { --btn-fill: var(--bg-canvas); }
  .btn--icon:hover      { --btn-fill: var(--bg-surface-2); --btn-text: var(--brand); }

  /* The trailing icon nudges forward, which reads as "this goes somewhere". */
  .btn:hover .ui--nudge { transform: translateX(3px); }
}

.ui--nudge { transition: transform var(--t-base) var(--ease); }

/* A text link that behaves like a button label. */
.btn--link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--brand);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}

/* Loading state: the label is replaced by a spinner without the button
   changing size, so the row does not reflow mid-submit. */
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }

.btn.is-loading::after {
  content: "";
  position: absolute;
  inline-size: 18px;
  block-size: 18px;
  border: 2px solid currentColor;
  border-block-start-color: transparent;
  border-radius: 50%;
  color: var(--btn-text);
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ CHIPS & LABELS */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  block-size: 32px;
  padding-inline: var(--s-4);
  background: var(--bg-surface);
  color: var(--fg-body);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color var(--t-base) var(--ease), color var(--t-base) var(--ease),
              background var(--t-base) var(--ease);
}

@media (hover: hover) {
  .chip:hover { border-color: var(--brand); color: var(--brand); }
}

.chip.is-active,
.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.chip--tag {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand);
}

.chip--sm { block-size: 26px; padding-inline: var(--s-3); font-size: var(--fs-2xs); }

/* A removable applied-filter chip. */
.chip--applied { padding-inline-end: var(--s-2); }
.chip__remove {
  display: grid;
  place-items: center;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  color: inherit;
}
.chip__remove:hover { background: rgba(0, 0, 0, .12); }

/* The section label. Bare text in a card body, a pill over media. */
.cat-label {
  display: inline-flex;
  align-items: center;
  color: var(--cat-label, var(--brand));
  font-family: var(--font-display);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tr-2xs);
  text-transform: uppercase;
  text-decoration: none;
}

.cat-label--pill {
  block-size: 24px;
  padding-inline: 10px;
  background: var(--cat-plinth, var(--brand-soft));
  border-radius: var(--r-pill);
}

/* Live badge. The dot pulses; reduced motion stops it without hiding it. */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  block-size: 22px;
  padding-inline: 10px;
  background: var(--live);
  color: #FFFFFF;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.live-badge__dot {
  inline-size: 6px;
  block-size: 6px;
  background: #FFFFFF;
  border-radius: 50%;
  animation: pulse 1.6s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.7); }
}

/* ============================================================ META ROW */

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--fg-meta);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.meta__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.meta__item .ui { font-size: 14px; }

/* ============================================================ AVATAR */

.avatar {
  position: relative;
  display: block;
  flex: none;
  inline-size: var(--avatar-size, 28px);
  block-size: var(--avatar-size, 28px);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; }

.avatar--24 { --avatar-size: 24px; }
.avatar--32 { --avatar-size: 32px; }
.avatar--40 { --avatar-size: 40px; }
.avatar--56 { --avatar-size: 56px; }
.avatar--88 { --avatar-size: 88px; }
.avatar--120 { --avatar-size: 120px; }

/* Initials stand in when a reporter has no portrait, rather than a grey blank. */
.avatar__initials {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-display);
  font-size: calc(var(--avatar-size, 28px) * 0.4);
  font-weight: 700;
}

.byline {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-inline-size: 0;
}

.byline__name {
  color: var(--fg-heading);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * The verified mark. It was a loose tick, which reads as a list item rather
 * than a badge; this is the seal shape a reader already knows from elsewhere.
 * Two tones, so it needs both a mask on the element (the seal) and one on
 * ::after (the check inside it). It takes the primary button's pair - the
 * brand fill with --on-brand on top, which is white in the light theme and
 * the dark teal that stays readable on the lighter brand of the dark one.
 * The element's own mask clips ::after, which is harmless: the check sits
 * well inside the seal.
 *
 * It lives here rather than in uicons.css because that file maps one class to
 * one single-colour icon, and this is two. The shape is Lucide's badge-check
 * (ISC), filled instead of stroked, for the licensing reason set out at the
 * top of that file.
 */
.byline__verified {
  position: relative;
  display: inline-block;
  flex: none;

  /* Sized from its own font-size, not the text it follows, so the box and the
     baseline offset stay in step. Setting the size alone left the badge
     hanging well below the line beside a heading, where an inherited em is
     more than twice as long. */
  font-size: 14px;
  inline-size: 1em;
  block-size: 1em;
  vertical-align: -0.16em;
  background-color: var(--brand);
  -webkit-mask: var(--seal) center / contain no-repeat;
          mask: var(--seal) center / contain no-repeat;

  --seal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8.75 12 2.25 2.25 4.25-4.5'/%3E%3C/svg%3E");
}

.byline__verified::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--on-brand);
  -webkit-mask: var(--check) center / contain no-repeat;
          mask: var(--check) center / contain no-repeat;
}

/* Beside a name set at heading size - the author page masthead. */
.byline__verified--lg { font-size: 24px; }

/* ============================================================ MEDIA */

/*
 * One media component, three modes. The plinth is the section tint and only
 * shows behind an illustration - a photograph fills the box, so the colour
 * would never be seen.
 */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--bg-surface-2);
  aspect-ratio: var(--media-ratio, 16 / 10);
}

.media img,
.media video {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: transform var(--t-media) var(--ease);
}

.media--illustration {
  background: var(--cat-plinth, var(--brand-soft));
  display: grid;
  place-items: center;
}

/*
 * The centring has to happen on the <picture> too, not only on the .media box.
 * place-items here centres whatever the grid item is, and since responsive
 * images were wrapped in <picture> that item is the picture - which already
 * fills the box, so centring it does nothing, and the 78% image inside it sat
 * against the top-left with the plinth showing down two sides. It read as a
 * badly cropped photograph rather than an inset illustration.
 */
.media--illustration picture {
  display: grid;
  place-items: center;
}

/*
 * Sized by width and left to keep its own proportions, so contain has nothing
 * to letterbox. Fixing both dimensions at 78% gave the box an aspect the
 * picture did not share, and the bands that opened up were filled by the
 * global img background - the one base.css sets to reserve space while a file
 * loads. Correct where object-fit is cover and the picture covers it; here it
 * drew a pale frame inside the section tint, which read as a badly cropped
 * photograph. The cap keeps a tall illustration inside the box, and with no
 * background on the image the plinth shows through if it ever does letterbox.
 */
.media--illustration img {
  inline-size: 78%;
  block-size: auto;
  max-block-size: 78%;
  object-fit: contain;
  background: none;
}

.media--16-9 { --media-ratio: 16 / 9; }
.media--4-3  { --media-ratio: 4 / 3; }
.media--3-4  { --media-ratio: 3 / 4; }
.media--1-1  { --media-ratio: 1 / 1; }

/* Media that has not loaded yet fades in rather than snapping. */
.media img { opacity: 0; transition: opacity 400ms var(--ease), transform var(--t-media) var(--ease); }
.media img.is-loaded,
.no-js .media img { opacity: 1; }

.media__badge {
  position: absolute;
  inset-block-end: var(--s-2);
  inset-inline-end: var(--s-2);
  padding: 3px 8px;
  background: rgba(6, 47, 53, .82);
  color: #FFFFFF;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 600;
}

.media__label {
  position: absolute;
  inset-block-start: var(--s-2);
  inset-inline-start: var(--s-2);
}

/* The centred play affordance on a video card. */
.media__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #FFFFFF;
}

.media__play::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 47, 53, .1), rgba(6, 47, 53, .45));
}

.media__play .ui {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  background: rgba(255, 255, 255, .92);
  color: var(--brand);
  border-radius: 50%;
  font-size: 18px;
  transition: transform var(--t-base) var(--ease);
}

/* ============================================================ CARDS */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: var(--hairline) solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease);
}

@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--line-strong); }
  .card:hover .media img { transform: scale(1.04); }
  .card:hover .media__play .ui { transform: scale(1.08); }
}

/* The whole card is clickable through the headline's stretched link. Anything
   that must stay separately clickable - save, share - lifts above it. */
.card__link { text-decoration: none; color: inherit; }
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 0; }

.card__media { padding: 6px; padding-block-end: 0; }
.card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: var(--s-4);
}

.card__title {
  color: var(--fg-heading);
  font-family: var(--font-display);
  font-size: var(--fs-h5);
  font-weight: 700;
  line-height: var(--lh-h5);
}

.card__excerpt {
  color: var(--fg-muted);
  font-size: var(--fs-body);
  line-height: 1.6;
}

.card__divider {
  block-size: var(--hairline);
  margin-block-start: auto;
  background: var(--line-soft);
}

.card__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.card__actions {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

/* ---- A: the standard story card ---- */
.card--story { min-block-size: 380px; }
.card--story .card__title { font-size: var(--fs-h5); }
.card--story.card--lead .card__title { font-size: var(--fs-h4); }

/* ---- B: the hero story card ---- */
.card--hero .card__body { padding: var(--s-5); gap: var(--s-3); }

/*
 * The headline is not clamped: in a column this narrow a three-line clamp cut
 * most headlines mid-word, and a front page that hides the end of its own
 * second story is worse than one that sets it a size smaller. Fluid between
 * h4 and h3 so it holds a long headline at 300px and still reads as the
 * second-largest thing on the page.
 */
.card--hero .card__title--hero {
  font-size: clamp(19px, 1.5vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* The picture sits under the standfirst here, not above the text. */
.card--hero .media {
  margin-block-start: var(--s-2);
  border-radius: var(--r-md);
}

/*
 * Byline over meta rather than beside it. In a 300px column the two side by
 * side left the reporter's name about eight characters wide, and a byline
 * that reads "Layla ..." is worse than no byline.
 */
.card--hero .card__foot {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
}

/*
 * The card's stretched link is lifted over the picture inside the body. The
 * .media span is positioned, so it painted above an ::after sitting at z-index
 * 0 - which made the largest and most obvious click target on the card the one
 * part of it that did nothing. The foot goes above the link again so the
 * reporter's name stays its own link rather than the card's.
 */
.card--hero .card__link::after { z-index: 2; }
.card--hero .card__foot { z-index: 3; }

/* ---- C: the list row ---- */
.card--row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s-3);
  padding-block: var(--s-3);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.card--row + .card--row { border-block-start: var(--hairline) solid var(--line-soft); }

.card--row .media {
  inline-size: 72px;
  block-size: 72px;
  flex: none;
  aspect-ratio: 1;
  align-self: flex-start;
}

.card--row.card--dense .media { inline-size: 56px; block-size: 56px; }

.card--row .card__body { padding: 0; gap: 6px; }
.card--row .card__title { font-size: var(--fs-h5); }

@media (hover: hover) {
  .card--row:hover { transform: none; box-shadow: none; }
  .card--row:hover .card__title { color: var(--brand); }
}

/* ---- D: the circle row ---- */
.card--circle {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s-3);
  background: none;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.card--circle .media {
  inline-size: 44px;
  block-size: 44px;
  flex: none;
  aspect-ratio: 1;
  border-radius: 50%;
}

.card--circle .card__title { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.card--circle .card__body { padding: 0; gap: var(--s-2); }

@media (hover: hover) {
  .card--circle:hover { transform: none; box-shadow: none; }
}

/* ---- E: the solid promo card ---- */
.card--promo {
  min-block-size: 132px;
  padding: 18px;
  background: var(--promo-fill, var(--brand));
  border-color: transparent;
  color: #FFFFFF;
  gap: var(--s-3);
}

.card--promo .card__title { color: #FFFFFF; font-size: 13.5px; font-weight: 600; line-height: 1.45; }

.card__eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tr-2xs);
  text-transform: uppercase;
}

.card--promo .card__eyebrow { color: rgba(255, 255, 255, .82); }

@media (hover: hover) {
  .card--promo:hover { border-color: transparent; }
}

/* ---- F: the feature block ---- */
.feature {
  display: grid;
  grid-template-columns: 58fr 42fr;
  gap: var(--s-6);
  align-items: center;
}

.feature__text { display: flex; flex-direction: column; gap: var(--s-4); align-items: flex-start; }

/* ============================================================ RAIL HEAD */

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-block-end: var(--s-5);
}

.rail-head__title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--fg-heading);
  font-family: var(--font-display);
  font-size: var(--fs-rail);
  font-weight: 700;
  line-height: 1.3;
}

/* The gold marker before a section title. */
.rail-head__title::before {
  content: "";
  inline-size: 3px;
  block-size: 18px;
  flex: none;
  background: var(--accent);
  border-radius: var(--r-pill);
}

.rail-head--plain .rail-head__title::before { display: none; }

.rail-head__more {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  color: var(--fg-meta);
  font-family: var(--font-display);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tr-2xs);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-base) var(--ease);
}

@media (hover: hover) {
  .rail-head__more:hover { color: var(--brand); }
  .rail-head__more:hover .ui--nudge { transform: translateX(3px); }
}

/* ============================================================ WIDGETS */

.widget {
  padding: var(--s-5);
  background: var(--bg-surface);
  border: var(--hairline) solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
}

.widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-block-end: var(--s-4);
}

.widget__title {
  color: var(--fg-heading);
  font-family: var(--font-display);
  font-size: var(--fs-rail);
  font-weight: 700;
}

.widget__divider {
  block-size: var(--hairline);
  margin-block: var(--s-4);
  background: var(--line-soft);
}

.widget__note {
  margin-block-start: var(--s-3);
  color: var(--fg-meta);
  font-size: var(--fs-2xs);
}

/* ---- 1: news channels ---- */
/*
 * Two columns of rows rather than one row of circles. Eight sections in a
 * single row would be unreadably small, and four circles across left the card
 * two thirds empty next to its neighbours; four rows deep matches the markets
 * table beside it without anything being padded to fit.
 */
.channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3) var(--s-4);
  align-content: space-between;
  block-size: 100%;
}

.channel {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-inline-size: 0;
  text-decoration: none;
}

.channel__thumb {
  position: relative;
  display: block;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  overflow: hidden;
  background: var(--cat-plinth, var(--brand-soft));
  border-radius: var(--r-md);
}

.channel__thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }

.channel__mark {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  color: var(--cat-label, var(--brand));
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

.channel__name {
  color: var(--fg-heading);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  transition: color var(--t-base) var(--ease);
}

@media (hover: hover) {
  .channel:hover .channel__name { color: var(--brand); }
  .channel:hover .channel__thumb img { transform: scale(1.06); }
}

.channel__thumb img { transition: transform var(--t-base) var(--ease); }

/* ---- 2: trending categories ---- */

/*
 * The tiles stretch to whatever height the row settles on. They are the
 * shortest of the three widgets by content, so rather than pick a number,
 * the pictures take the space the tallest neighbour leaves.
 */
.cat-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  block-size: 100%;
}

.cat-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.cat-tile .media {
  --media-ratio: 3 / 4;
  flex: 1;
  min-block-size: 150px;
  margin-block-end: var(--s-2);
}

.cat-tile__name { color: var(--fg-heading); font-family: var(--font-display); font-size: 12.5px; font-weight: 600; }

/* ---- 3: weather and prayer times ---- */
.weather__now { display: flex; align-items: center; gap: var(--s-3); }

.weather__temp {
  color: var(--fg-heading);
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1;
}

.weather__place { color: var(--fg-meta); font-size: 12px; font-weight: 500; }

.weather__row { display: grid; gap: 4px; margin-block-start: var(--s-3); }

.weather__row-head {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: 12.5px;
  font-weight: 500;
}

.weather__track {
  block-size: 4px;
  background: var(--brand-soft-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.weather__fill { block-size: 100%; background: var(--brand); border-radius: inherit; }

.prayer-times { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-1); text-align: center; }

.prayer {
  padding: var(--s-2) 2px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
}

.prayer__name { color: var(--fg-meta); font-weight: 500; }
.prayer__time { color: var(--fg-heading); font-family: var(--font-display); font-weight: 700; }
.prayer.is-next { background: var(--brand-soft); }
.prayer.is-next .prayer__name { color: var(--brand); }

/* ---- 4: markets ---- */
.markets { inline-size: 100%; font-size: var(--fs-xs); }
.markets th, .markets td { padding: var(--s-2) 0; border-block-end: var(--hairline) solid var(--line-soft); }
.markets tr:last-child td { border-block-end: 0; }
.markets__value { color: var(--fg-heading); font-family: var(--font-display); font-size: 14px; font-weight: 700; text-align: end; }
.markets__change { display: inline-flex; align-items: center; gap: 3px; justify-content: flex-end; font-weight: 600; }
.markets__change--up { color: var(--success); }
.markets__change--down { color: var(--live); }

/* ---- 5: quick poll ---- */
.poll__question { margin-block: var(--s-2) var(--s-4); font-size: var(--fs-h4); }
.poll__options { display: grid; gap: var(--s-3); }

.poll__option { display: grid; gap: 6px; }

.poll__label { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); cursor: pointer; }

.poll__track {
  position: relative;
  display: flex;
  align-items: center;
  block-size: 28px;
  background: var(--bg-surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.poll__bar {
  block-size: 100%;
  inline-size: 0;
  background: var(--brand);
  border-radius: inherit;
  transition: inline-size 700ms var(--ease);
}

.poll__pct {
  position: absolute;
  inset-inline-end: var(--s-3);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-heading);
}

/* Once the bar is wide enough the figure sits inside it, in white. */
.poll__option--wide .poll__pct { inset-inline-end: auto; inset-inline-start: var(--s-3); color: var(--on-brand); }

.poll__total { margin-block-start: var(--s-3); color: var(--fg-meta); font-size: var(--fs-xs); }

/* ---- 6: newsletter ---- */
.widget--newsletter {
  background: var(--brand);
  border-color: transparent;
  color: rgba(255, 255, 255, .86);
}

.widget--newsletter .widget__title { color: #FFFFFF; font-size: var(--fs-h4); }

/* ---- 7: ad slot ---- */
.widget--ad {
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: none;
  color: var(--fg-meta);
  font-size: 12px;
  font-weight: 500;
  /* Reserved exactly, so an unfilled slot never shifts the page. */
  aspect-ratio: var(--ad-ratio, 300 / 250);
}

.widget--ad--leaderboard { --ad-ratio: 728 / 90; }

/* ============================================================ FORMS */

.field { display: block; margin-block-end: var(--s-4); }

.field__label {
  display: block;
  margin-block-end: 6px;
  color: var(--fg-heading);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
}

.input,
.select,
.textarea {
  inline-size: 100%;
  min-block-size: var(--field-h);
  padding-inline: var(--s-4);
  padding-block: 10px;
  background: var(--bg-surface);
  color: var(--fg-heading);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-size: 14.5px;
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

.textarea { min-block-size: 132px; line-height: 1.6; }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea,
[aria-invalid="true"] { border-color: var(--live); }

.field__error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-block-start: 6px;
  color: var(--live);
  font-size: 12.5px;
  font-weight: 500;
}

.field__hint { margin-block-start: 6px; color: var(--fg-meta); font-size: 12.5px; }

/* Checkboxes and radios keep the native control for accessibility and paint
   over it, rather than hiding it behind a div. */
.check { display: flex; align-items: flex-start; gap: var(--s-3); font-size: var(--fs-sm); cursor: pointer; }

.check input[type="checkbox"],
.check input[type="radio"] {
  inline-size: 18px;
  block-size: 18px;
  flex: none;
  margin-block-start: 2px;
  accent-color: var(--brand);
}

/* The header search field. */
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  inline-size: 320px;
  max-inline-size: 100%;
}

.search-field__input {
  inline-size: 100%;
  block-size: 40px;
  padding-inline: var(--s-9) var(--s-4);
  background: var(--bg-surface-2);
  color: var(--fg-heading);
  border: 0;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  transition: inline-size var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

.search-field__input:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.search-field__icon {
  position: absolute;
  inset-inline-start: 14px;
  color: var(--fg-meta);
  font-size: 18px;
  pointer-events: none;
}

/* The spam honeypot.
   Hidden from sight, from screen readers and from the tab order - but NOT with
   display:none or type=hidden, either of which a bot recognises and skips. It
   has to look fillable to a script and be unreachable for a person. */
.hp {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* ============================================================ NAV */

.nav { display: flex; align-items: center; gap: var(--s-7); }

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-block: var(--s-2);
  color: var(--fg-heading);
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: none;
  transition: color var(--t-base) var(--ease);
}

/* The gold underline grows from the centre. */
.nav__link::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  block-size: 3px;
  background: var(--accent);
  border-radius: var(--r-pill);
  transform: scaleX(0);
  transition: transform var(--t-base) var(--ease);
}

@media (hover: hover) {
  .nav__link:hover::after { transform: scaleX(1); }
}

.nav__link[aria-current] { color: var(--brand); font-weight: 700; }
.nav__link[aria-current]::after { transform: scaleX(1); }

/* ============================================================ TICKER */

.ticker {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  block-size: 44px;
  margin-block: var(--s-4);
  padding-inline: 5px;
  padding-inline-end: var(--s-5);
  background: var(--brand);
  border-radius: var(--r-pill);
  color: #FFFFFF;
  overflow: hidden;
}

.ticker__badge {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  flex: none;
  background: #FFFFFF;
  color: var(--brand);
  border-radius: 50%;
  font-size: 16px;
}

.ticker__viewport {
  display: flex;
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
}

.ticker__track {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  inline-size: max-content;
  will-change: transform;
}

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-6);
  color: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

/* The gold dot between headlines. */
.ticker__item::after {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  background: var(--accent);
  border-radius: 50%;
}

@media (hover: hover) {
  .ticker__item:hover { text-decoration: underline; }
}

/*
 * Reduced motion turns the marquee into an ordinary horizontally scrollable
 * list. It stays readable and keyboard-navigable; it just stops moving.
 */
@media (prefers-reduced-motion: reduce) {
  .ticker__viewport { overflow-x: auto; scrollbar-width: none; }
  .ticker__viewport::-webkit-scrollbar { display: none; }
  .ticker__track { transform: none !important; }
}

/* ============================================================ SCROLLERS */

/* A horizontal scroll-snap rail with the scrollbar hidden and the edges faded,
   so it reads as "there is more this way" without a visible control. */
.scroller {
  display: flex;
  gap: var(--grid-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
}

.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; flex: none; }

/* ============================================================ PAGINATION */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.pagination__item {
  display: grid;
  place-items: center;
  min-inline-size: 40px;
  block-size: 40px;
  padding-inline: var(--s-2);
  background: var(--bg-surface);
  color: var(--fg-heading);
  border: var(--hairline) solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease);
}

@media (hover: hover) {
  .pagination__item:hover { border-color: var(--brand); color: var(--brand); }
}

.pagination__item[aria-current] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.pagination__gap { color: var(--fg-meta); padding-inline: var(--s-1); }

/* ============================================================ BREADCRUMB */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  color: var(--fg-meta);
  font-size: 12.5px;
  font-weight: 500;
}

.breadcrumb a { text-decoration: none; }
.breadcrumb [aria-current] { color: var(--fg-heading); font-weight: 600; }

@media (hover: hover) {
  .breadcrumb a:hover { color: var(--brand); }
}

/* ============================================================ OVERLAYS */

.modal {
  inline-size: min(100% - var(--s-8), var(--modal-w, 480px));
  max-block-size: 88vh;
  padding: var(--s-7);
  background: var(--bg-surface);
  color: var(--fg-body);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-modal);
  overflow-y: auto;
}

.modal--filters { --modal-w: 720px; }
.modal--media   { --modal-w: 960px; }

.modal[open] { animation: modal-in var(--t-base) var(--ease); }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: var(--z-drawer);
  inline-size: min(320px, 100%);
  padding: var(--s-5);
  background: var(--bg-surface);
  box-shadow: var(--sh-lg);
  overflow-y: auto;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform var(--t-base) var(--ease), visibility var(--t-base);
}

.drawer.is-open { transform: translateX(0); visibility: visible; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(6, 47, 53, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility var(--t-base);
}

.drawer-overlay.is-open { opacity: 1; visibility: visible; }

.dropdown {
  position: absolute;
  z-index: var(--z-dropdown);
  min-inline-size: 200px;
  padding: 6px;
  background: var(--bg-surface);
  border: var(--hairline) solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-block-size: 38px;
  padding-inline: var(--s-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  text-decoration: none;
  inline-size: 100%;
  text-align: start;
}

@media (hover: hover) {
  .dropdown__item:hover { background: var(--brand-soft); }
}

.toast {
  position: fixed;
  inset-block-end: calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
  inset-inline-end: var(--s-6);
  z-index: var(--z-toast);
  padding: var(--s-3) var(--s-5);
  background: var(--c-ink-900);
  color: #FFFFFF;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--sh-lg);
}

/* ============================================================ STATES */

.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--s-4);
  padding-block: var(--s-12);
  text-align: center;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  inline-size: 88px;
  block-size: 88px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 50%;
  font-size: 32px;
}

.empty-state__title { font-size: var(--fs-h4); }
.empty-state__text { max-inline-size: 400px; color: var(--fg-muted); font-size: var(--fs-sm); }

/* Skeletons shimmer rather than pulse, which reads as loading rather than
   broken. The sweep is a gradient in motion, not an opacity flash. */
.skeleton {
  position: relative;
  background: var(--bg-surface-2);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: shimmer 1.4s infinite;
}

:root[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
}

@keyframes shimmer { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* ============================================================ THEME SWITCH */

/*
 * The theme switch. Two icons sit in the same grid cell and CSS shows the one
 * that is not the theme being painted - a moon on a light page, a sun on a
 * dark one - so the button always offers the other theme and one click gets
 * there. Switching is a class change rather than a DOM rewrite: no layout
 * shift, and the button keeps focus.
 *
 * Which icon shows is decided by the same three-branch cascade the colour
 * tokens use, not by JavaScript, so the correct one is painted in the first
 * frame even before the module has loaded.
 *
 * With JS off nothing can change the theme, so the no-js branch hides the
 * control rather than leaving a dead button in the header.
 */
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: var(--tap);
  block-size: var(--tap);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background var(--t-base) var(--ease),
              color var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease);
}

.no-js .theme-toggle { display: none; }

@media (hover: hover) {
  .theme-toggle:hover {
    background: var(--bg-surface-2);
    border-color: var(--line);
    color: var(--brand);
  }
}

.theme-toggle:active { transform: scale(.94); }

.theme-toggle__icon {
  grid-area: 1 / 1;
  font-size: 18px;
  opacity: 0;
  transform: scale(.7) rotate(-30deg);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-base) var(--ease);
}

/* Light page: offer the dark one. This is also the state with no attribute
   set and a light device, which is what a first-time reader gets. */
.theme-toggle__icon--to-dark { opacity: 1; transform: none; }

/* A dark device, until the reader pins something. Mirrors the guard the
   tokens use, so the icon and the palette can never disagree. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__icon--to-dark { opacity: 0; transform: scale(.7) rotate(-30deg); }
  :root:not([data-theme="light"]) .theme-toggle__icon--to-light { opacity: 1; transform: none; }
}

/* A pinned choice wins over the device in both directions. */
:root[data-theme="dark"] .theme-toggle__icon--to-dark { opacity: 0; transform: scale(.7) rotate(-30deg); }
:root[data-theme="dark"] .theme-toggle__icon--to-light { opacity: 1; transform: none; }

:root[data-theme="light"] .theme-toggle__icon--to-dark { opacity: 1; transform: none; }
:root[data-theme="light"] .theme-toggle__icon--to-light { opacity: 0; transform: scale(.7) rotate(-30deg); }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle__icon { transform: none; }
  .theme-toggle:active { transform: none; }
}

/* On the dark utility bar the control inherits that strip's palette. */
.utility-bar .theme-toggle { color: rgba(255, 255, 255, .82); }

@media (hover: hover) {
  .utility-bar .theme-toggle:hover {
    background: rgba(255, 255, 255, .12);
    border-color: transparent;
    color: #FFFFFF;
  }
}

/* ============================================================ BURGER */

.burger {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: var(--tap);
  block-size: var(--tap);
  color: var(--fg-heading);
}

.burger__bars,
.burger__bars::before,
.burger__bars::after {
  content: "";
  display: block;
  inline-size: 20px;
  block-size: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--t-base) var(--ease), background var(--t-fast) var(--ease);
}

.burger__bars::before { position: absolute; transform: translateY(-6px); }
.burger__bars::after  { position: absolute; transform: translateY(6px); }

.burger[aria-expanded="true"] .burger__bars { background: transparent; }
.burger[aria-expanded="true"] .burger__bars::before { transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger__bars::after  { transform: rotate(-45deg); }

/* ============================================================ LOGO */

/* The wordmark takes its colours from the theme, so one SVG serves both. */
/* The generated wordmark. Known aspect, so a height is all it needs. */
.logo { block-size: 34px; inline-size: auto; }

/*
 * An uploaded logo is whatever shape the newsroom gives us - a wide wordmark,
 * a square lockup, a tall badge - at whatever pixel size was to hand. Capping
 * only the height lets a wide one run off the end of the masthead; capping
 * only the width lets a tall one push the header open. Both are capped, the
 * image keeps its own proportions inside that box, and the file's own size
 * stops mattering.
 */
.logo--img {
  block-size: auto;
  inline-size: auto;
  max-block-size: 46px;
  max-inline-size: 210px;
  object-fit: contain;
  object-position: left center;

  /* base.css puts a placeholder background on every image to reserve its box
     while it loads. Behind a transparent logo that is a grey rectangle. */
  background: none;
}

/*
 * <picture> is told to fill its parent globally, which is right for an image
 * cropped into a fixed box and wrong for a logo, where the parent is a header
 * cell with no size of its own to give. Left alone it stretched the wrapper to
 * the full width of the masthead and took the logo with it.
 */
/* flex, not inline-block: an inline box reserves room under the baseline for
   descenders, which left the wrapper eight pixels taller than the logo in it
   and pushed the masthead open by that much. */
picture:has(> .logo--img) {
  display: flex;
  inline-size: auto;
  block-size: auto;
  max-inline-size: 210px;
}

/* The compact mark: the drawer head and the stuck section nav. */
.logo--sm { block-size: 26px; }

.logo--sm.logo--img,
picture:has(> .logo--sm) { max-block-size: 32px; max-inline-size: 150px; }

.logo__type { fill: currentColor; font-family: var(--font-display); }
.logo__type--brand { fill: var(--brand); }
.logo__rule { fill: var(--accent); }

/* On the dark footer and utility bar the brand teal is too dark to read, so
   the second word takes the gold instead. */
.site-footer .logo__type--brand,
.on-solid .logo__type--brand { fill: var(--c-gold-500); }

.site-footer .logo,
.on-solid .logo { color: #FFFFFF; }

/* ============================================================ PROGRESS */

.reading-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: calc(var(--z-header) + 1);
  block-size: 3px;
  inline-size: 0;
  background: var(--accent);
  transition: inline-size 80ms linear;
}

/* A story with no picture yet: the section colour and its initial, which reads
   as deliberate where an empty grey box reads as broken. */
.media__fallback {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  background: var(--cat-plinth, var(--brand-soft));
  color: var(--cat-label, var(--brand));
  font-family: var(--font-display);
  font-size: clamp(28px, 22cqi, 64px);
  font-weight: 700;
  opacity: .55;
}

/* Sized against the media box rather than the viewport, so the initial is
   proportionate in a 56px row thumbnail and in a full-width hero alike. */
.media { container-type: inline-size; }

/* ============================================================ DEMO NOTICE

   Deliberately loud. It sits above the masthead and is not dismissible: a
   notice a reader can close is a notice they will not see on the page that
   matters. It disappears for good when demo_mode is turned off. */

.demo-banner {
  position: relative;
  z-index: calc(var(--z-header) + 1);
  background: var(--c-gold-500);
  color: var(--c-ink-900);
  font-size: var(--fs-xs);
}

.demo-banner__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-block-size: 36px;
  padding-block: 6px;
  text-align: center;
}

.demo-banner strong { font-family: var(--font-display); font-weight: 700; }

@media print {
  .demo-banner { display: none; }
}

/* ---------------------------------------------------------------- select

   The sort control on a category page sits in a row of chips, and inherited
   the full-width 46px form-field styling of .select - a text input's shape
   among pills. .select--pill gives it the chips' proportions instead.

   The caret is drawn here because appearance:none removes the browser's own,
   and the browser's own is the OS arrow: it does not follow the theme and
   changes shape between platforms. */

.select--pill {
  appearance: none;
  -webkit-appearance: none;
  inline-size: auto;
  min-block-size: 32px;
  block-size: 32px;
  padding-block: 0;
  padding-inline: var(--s-4) 30px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--fg-body);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-size: 5px 5px, 5px 5px;
  background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px;
  background-repeat: no-repeat;
}

/* ---------------------------------------------------------------- vselect

   The enhanced select: our own list in place of the browser's popup, which is
   OS chrome drawn outside the page and cannot be themed at all. select.js adds
   this markup; the rules below never apply to a plain <select>. */

.vselect { position: relative; display: inline-flex; }

/*
 * The native control is still in the form and still in the accessibility
 * tree - it is what posts, and what a screen reader may prefer to drive.
 * clip rather than display:none, which would take it out of both.
 */
.vselect__native {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
}

.vselect__button {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  block-size: 32px;
  padding-inline: var(--s-4);
  background: var(--bg-surface);
  color: var(--fg-body);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

@media (hover: hover) {
  .vselect__button:hover { border-color: var(--brand); color: var(--brand); }
}

.vselect__button[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }

.vselect__button:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.vselect__caret {
  inline-size: 7px;
  block-size: 7px;
  margin-inline-start: 2px;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t-base) var(--ease);
}

.vselect__button[aria-expanded="true"] .vselect__caret { transform: translateY(1px) rotate(-135deg); }

.vselect__list {
  position: absolute;
  z-index: var(--z-dropdown);
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  min-inline-size: 100%;
  padding: 6px;
  display: grid;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
}

.vselect--above .vselect__list { inset-block-start: auto; inset-block-end: calc(100% + 6px); }

.vselect__list[hidden] { display: none; }

.vselect__option {
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-body);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 500;
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
}

@media (hover: hover) {
  .vselect__option:hover { background: var(--brand-soft); color: var(--fg-heading); }
}

.vselect__option:focus-visible {
  outline: none;
  background: var(--brand-soft);
  color: var(--fg-heading);
  box-shadow: inset 0 0 0 2px var(--brand-glow);
}

/* The chosen row carries the brand rather than the system highlight, which is
   the whole reason this list exists. */
.vselect__option.is-selected {
  background: var(--brand);
  color: var(--on-brand);
}

/* ---------------------------------------------------------------- ad slots

   A paid placement on a news page has to be told apart from the reporting
   around it - AdSense's own policy asks for it, and on a site where an ad sits
   between two story cards it is not a formality. Hence the label and the rule
   above it rather than a bare rectangle.

   Nothing here reserves a height. An empty slot renders no element at all
   (see views/partials/ad-slot.php), so there is no box to leave a hole; when a
   unit does arrive it is AdSense that decides how tall it is. */

.ad {
  display: block;
  margin-block: var(--s-6);
  padding-block-start: var(--s-2);
  border-block-start: var(--hairline) solid var(--line);
  text-align: center;
}

.ad__label {
  display: block;
  margin-block-end: var(--s-2);
  color: var(--fg-meta);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--tr-2xs);
  text-transform: uppercase;
}

/* AdSense writes its own ins element; keep it inside the column on a phone. */
.ad__unit { max-inline-size: 100%; overflow: hidden; }
.ad__unit ins { max-inline-size: 100%; }

/* The header and footer units span the page rather than the reading column. */
.ad--header,
.ad--footer {
  inline-size: min(100% - (var(--gutter) * 2), var(--container-wide));
  margin-inline: auto;
}

/* In a card grid the unit is a grid child, so it takes a card's width. */
.ad--listing { margin-block: 0; align-self: start; }
