/* Four Arabic-first desks. Logical axes also support the English/French previews. */
:is(.theme-mizan, .theme-barq, .theme-diwan, .theme-wasl) {
  --display: var(--sans);
}
:is(.theme-mizan, .theme-barq, .theme-diwan, .theme-wasl) .story-meta {
  font-size: 11px;
}
:is(.theme-mizan, .theme-barq, .theme-diwan, .theme-wasl) .story-meta time,
:is(.theme-mizan, .theme-barq, .theme-diwan, .theme-wasl) .article-byline time {
  direction: ltr;
  unicode-bidi: isolate;
}
:is(.theme-mizan, .theme-barq, .theme-diwan, .theme-wasl) .section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 0;
  padding-top: 0;
  font-size: 16px;
}
:is(.theme-mizan, .theme-barq, .theme-diwan, .theme-wasl) .section-title::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
:is(.mizan-front, .barq-desk, .diwan-cover, .wasl-front) > * { min-width: 0; }
:is(.mizan-front, .barq-desk, .wasl-front):not(:has(> :nth-child(2))) { grid-template-columns: 1fr; }

/* Mizan: sapphire masthead, an editorial digest and a substantial financial lead. */
.theme-mizan {
  --ink: #183348;
  --accent: #166777;
  --line: #ccd8df;
  --wash: #edf3f6;
  --muted: #536774;
}
.theme-mizan .masthead { background: var(--ink); color: white; padding-inline: 26px; }
.theme-mizan .utility { color: #c6d9e3; border-color: #476171; }
.theme-mizan .brand-row { padding: 26px 0; }
.theme-mizan .wordmark { font-size: 58px; }
.theme-mizan .brand-note { color: #c6d9e3; }
.theme-mizan .main-nav { border-top: 1px solid #476171; border-bottom: 0; gap: 28px; }
.theme-mizan .main-nav a[aria-current] { color: white; box-shadow: 0 3px #dfb766; padding-bottom: 5px; }
.theme-mizan main { padding-top: 0; }
.mizan-briefing { background: var(--wash); margin: 0 0 30px; padding: 18px 24px; }
.mizan-briefing > h2 { font: 700 12px/1.5 var(--sans); color: var(--accent); margin-bottom: 14px; }
.mizan-digest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.mizan-digest .brief { margin: 0; padding: 0; border: 0; }
.mizan-digest .brief + .brief { border-inline-start: 1px solid var(--line); padding-inline-start: 24px; }
.mizan-digest .story-kicker { display: none; }
.theme-mizan .mizan-digest h2 { font-size: 17px; line-height: 1.7; font-weight: 600; }
.mizan-front { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 42px; }
.mizan-lead .lead { display: flex; flex-direction: column; }
.mizan-lead .story-copy { order: -1; }
.mizan-lead .story-image { aspect-ratio: 1.9; margin: 22px 0 0; }
.theme-mizan .lead h2 { font-size: 35px; line-height: 1.5; font-weight: 700; }
.mizan-notebook { border-inline-start: 1px solid var(--line); padding-inline-start: 26px; }
.mizan-notebook .row { grid-template-columns: minmax(0, 1fr) 112px; margin-bottom: 22px; }
.mizan-notebook .row .story-copy { grid-column: 1; grid-row: 1; }
.mizan-notebook .story-image { grid-column: 2; grid-row: 1; aspect-ratio: 1; border-radius: 2px; }
.theme-mizan .mizan-notebook h2 { font-size: 20px; line-height: 1.6; }
.mizan-reports { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; border-block: 1px solid var(--line); padding-block: 28px; margin-top: 32px; }
.mizan-reports .story-description { display: none; }
.theme-mizan .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.theme-mizan .article-heading { border-inline-start: 5px solid #b08b40; padding-inline-start: 26px; }
.theme-mizan .article-heading h1 { font-size: 39px; }
.theme-mizan .article-body { padding-inline-start: 31px; }

/* Barq: compact navigation, an assertive opening and a spacious timestamped wire. */
.theme-barq { --ink: #192b39; --accent: #b92732; --line: #dce2e6; --wash: #f4f6f8; --muted: #5a6873; }
.theme-barq .masthead { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 40px; border-bottom: 4px solid var(--accent); }
.theme-barq .masthead > * { min-width: 0; }
.theme-barq .utility { grid-column: 1/-1; }
.theme-barq .brand-row { grid-column: 1; padding: 22px 0; }
.theme-barq .wordmark { color: var(--accent); font-size: 56px; font-weight: 800; white-space: nowrap; }
.theme-barq .brand-note { display: none; }
.theme-barq .main-nav { grid-column: 2; align-self: center; border: 0; gap: 22px; }
.barq-cover { padding: 10px 0 32px; border-bottom: 1px solid var(--line); }
.barq-cover .lead { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 40px; }
.barq-cover .story-copy { grid-column: 1; grid-row: 1; }
.barq-cover .story-image { grid-column: 2; grid-row: 1; aspect-ratio: 1.35; margin: 0; border-radius: 3px; }
.theme-barq .lead h2 { font-size: 37px; line-height: 1.55; font-weight: 800; }
.barq-desk { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 52px; padding-top: 30px; }
.barq-wire .wire { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 24px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.wire-time { display: block; color: var(--accent); font: 700 20px/1.5 var(--sans); padding-top: 1px; font-variant-numeric: tabular-nums; }
.wire-time small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.barq-wire .wire > .story-copy { grid-column: 2; border-inline-start: 2px solid var(--line); padding-inline-start: 22px; }
.barq-wire .story-meta time { display: none; }
.theme-barq .wire h2 { font-size: 23px; line-height: 1.6; }
.barq-wire .story-description { -webkit-line-clamp: 2; }
.barq-reads { padding: 22px; background: var(--wash); align-self: start; border-radius: 4px; }
.theme-barq .barq-reads h2 { font-size: 18px; line-height: 1.6; }
.theme-barq .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.theme-barq .article-heading h1 { font-weight: 800; }
.theme-barq .article-byline { border-top: 3px solid var(--accent); }

/* Diwan: Naskh headlines, a photographic opening and generous reading space. */
.theme-diwan { --paper: #fffdfd; --ink: #3c293b; --accent: #795268; --line: #ded4dc; --wash: #f2ecf1; --muted: #6c5d6b; --display: var(--serif); }
[lang="ar"] .theme-diwan { --serif: "Noto Naskh Arabic", "Noto Sans Arabic", serif; --display: var(--serif); }
.theme-diwan .brand-row { justify-content: center; padding: 24px 0 18px; }
.theme-diwan .wordmark { font: 600 86px/1.25 var(--display); letter-spacing: 0; }
.theme-diwan .brand-note { display: none; }
.theme-diwan .main-nav { justify-content: safe center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); gap: 30px; }
.diwan-cover .lead { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.3fr); align-items: center; gap: 36px; background: var(--wash); }
.diwan-cover .story-image { grid-column: 2; grid-row: 1; aspect-ratio: 1.3; height: 100%; max-height: 570px; margin: 0; }
.diwan-cover .story-copy { grid-column: 1; grid-row: 1; padding: 32px; padding-inline-end: 0; }
.theme-diwan .story-card h2 { font-family: var(--display); font-size: 29px; line-height: 1.55; font-weight: 600; }
.theme-diwan .lead h2 { font-size: 42px; line-height: 1.45; }
.diwan-cover .story-description { font-size: 14px; }
.diwan-index { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 25px; padding-block: 34px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.diwan-index > h2 { font: 600 22px/1.5 var(--display); color: var(--accent); }
.diwan-essays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.diwan-essays .brief { padding: 0; margin: 0; border: 0; }
.theme-diwan .diwan-essays h2 { font-size: 26px; }
.diwan-features { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; }
.diwan-features .story-image { aspect-ratio: 1.8; }
.diwan-features .story-copy { max-width: 90%; margin: auto; }
.diwan-notes { margin-top: 38px; }
.diwan-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 42px; }
.theme-diwan .diwan-notes h2 { font-size: 24px; }
.theme-diwan .more-grid { grid-template-columns: 1fr 1fr; }
.theme-diwan .more-grid h2 { font-size: 23px; }
.theme-diwan .article-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 65px; }
.theme-diwan .article-heading h1 { font: 600 51px/1.5 var(--display); }
.theme-diwan .article-deck { font-family: var(--serif); font-size: 23px; }
.theme-diwan .article-body { font-family: var(--serif); font-size: 23px; line-height: 1.9; }
.theme-diwan .article-related h2 { font-family: var(--display); font-size: 24px; }
.theme-diwan .article-heading { text-align: center; margin-inline: auto; }
.theme-diwan .article-byline { justify-content: center; }
.theme-diwan .article-body { margin-inline: auto; }

/* Wasl: connected regional desks, an image-led front and a four-column window. */
.theme-wasl { --paper: #f5f8fc; --ink: #1b3457; --accent: #2e579b; --line: #d0dceb; --wash: #e9eff8; --muted: #536983; }
.theme-wasl .brand-row { gap: 24px; padding-block: 24px; }
.theme-wasl .wordmark { font-size: 62px; font-weight: 800; }
.theme-wasl .wordmark::after { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #278175; margin-inline-start: 14px; }
.theme-wasl .main-nav { background: white; padding: 12px 18px; border: 1px solid var(--line); border-radius: 6px; gap: 24px; }
.theme-wasl .main-nav a[aria-current] { background: var(--accent); color: white; padding: 5px 12px; border-radius: 4px; }
.wasl-front { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; }
.wasl-main { background: white; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.wasl-main .lead { display: flex; flex-direction: column; }
.wasl-main .story-image { aspect-ratio: 2.15; margin: 0; }
.wasl-main .story-copy { padding: 24px 30px; }
.theme-wasl .lead h2 { font-size: 30px; line-height: 1.6; }
.wasl-main .story-description { -webkit-line-clamp: 2; }
.wasl-side { background: #dfeee9; border-radius: 8px; padding: 24px; --line: #b7d2c8; --accent: #216456; --muted: #45665d; }
.wasl-side > h2 { font: 800 17px/1.5 var(--sans); margin-bottom: 22px; }
.theme-wasl .wasl-side h2 { font-size: 18px; line-height: 1.7; }
.wasl-window { margin-top: 34px; }
.wasl-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.wasl-tiles .story-image { aspect-ratio: 1.4; border-radius: 5px; }
.theme-wasl .wasl-tiles h2 { font-size: 19px; line-height: 1.65; }
.wasl-tiles .story-description { display: none; }
.wasl-river { margin-top: 28px; padding: 25px; background: white; border-block: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.wasl-river .row { border: 0; padding: 0; }
.theme-wasl .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.theme-wasl .article-page { background: white; padding: 28px; border-radius: 6px; }
.theme-wasl .article-heading h1 { font-size: 36px; }
.theme-wasl .article-related { border: 0; padding-inline-start: 0; }

/* Missing and failed images use the same content, without an empty photo column. */
.mizan-notebook .row.text-only,
.barq-cover .lead.text-only,
.diwan-cover .lead.text-only { grid-template-columns: 1fr; }
.mizan-notebook .row.text-only > .story-copy,
.barq-cover .lead.text-only > .story-copy,
.diwan-cover .lead.text-only > .story-copy { grid-column: 1/-1; }
.diwan-cover .lead.text-only > .story-copy { padding: 32px; max-width: 960px; }

/* Gallery miniatures describe the hierarchy before opening the live preview. */
.mini-mizan { background: #f0f5f8; color: #183348; border-top: 30px solid #183348; }
.mini-mizan .mini-brand { text-align: start; font: 700 34px/1.3 var(--sans); }
.mini-mizan .mini-layout { grid-template-columns: 2fr 1fr 1fr; }
.mini-mizan .mini-block:first-child i { height: 82px; background: #a5c4cf; }
.mini-barq { background: white; color: #b92732; }
.mini-barq .mini-brand { text-align: start; font: 800 42px/1.3 var(--sans); }
.mini-barq .mini-nav { border-top: 0; border-bottom: 3px solid currentColor; }
.mini-barq .mini-layout { grid-template-columns: 2fr 1fr; }
.mini-barq .mini-block:first-child i { height: 9px; }
.mini-barq .mini-block:last-child { grid-column: 1; }
.mini-barq .mini-block:last-child i { display: none; }
.mini-diwan { background: #f5eef3; color: #624159; }
.mini-diwan .mini-brand { font: 600 43px/1.25 "Noto Naskh Arabic", var(--serif); }
.mini-diwan .mini-layout { grid-template-columns: 1fr 2fr; }
.mini-diwan .mini-block:nth-child(2) i { height: 100px; background: #c9b4c3; }
.mini-diwan .mini-block:first-child i,.mini-diwan .mini-block:last-child { display: none; }
.mini-wasl { background: #f1f6fc; color: #315ba6; }
.mini-wasl .mini-brand { text-align: start; font: 800 39px/1.3 var(--sans); }
.mini-wasl .mini-layout { grid-template-columns: 2fr 1fr 1fr; }
.mini-wasl .mini-block:first-child i { background: #b4c9e4; height: 80px; border-radius: 4px; }
.mini-wasl .mini-block:nth-child(2) { background: #d3e8e0; padding: 9px; }
.mini-wasl .mini-block:nth-child(2) i { display: none; }
.design-mini .mini-brand[lang="ar"] { letter-spacing: 0; font-family: "Noto Sans Arabic", sans-serif; }
.mini-diwan .mini-brand[lang="ar"] { font-family: "Noto Naskh Arabic", serif; }

@media (max-width: 1050px) {
  .mizan-front { gap: 26px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .mizan-notebook .row { grid-template-columns: minmax(0, 1fr) 80px; gap: 14px; }
  .theme-mizan .lead h2 { font-size: 29px; }
  .barq-desk { grid-template-columns: minmax(0, 1fr) 240px; gap: 30px; }
  .theme-barq .lead h2 { font-size: 30px; }
  .theme-barq .masthead { column-gap: 26px; }
  .theme-barq .wordmark { font-size: 44px; }
  .diwan-cover .lead { gap: 20px; }
  .theme-diwan .lead h2 { font-size: 33px; }
  .diwan-cover .story-copy { padding: 22px; padding-inline-end: 0; }
  .diwan-index { display: block; }
  .diwan-index > h2 { margin-bottom: 20px; }
  .wasl-front { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .wasl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-diwan .article-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 30px; }
}
@media (max-width: 760px) {
  .mizan-digest { grid-template-columns: 1fr; gap: 14px; }
  .mizan-digest .brief + .brief { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .mizan-front,.barq-desk,.wasl-front { grid-template-columns: 1fr; }
  .mizan-notebook { border-inline-start: 0; padding-inline-start: 0; margin-top: 4px; }
  .mizan-notebook .row { grid-template-columns: minmax(0, 1fr) 112px; }
  .mizan-reports { grid-template-columns: 1fr; }
  .mizan-briefing { margin-bottom: 24px; padding: 18px; }
  .theme-mizan .masthead { padding-inline: 16px; }
  .theme-mizan .article-body { padding-inline-start: 0; }
  .theme-mizan .more-grid,.theme-barq .more-grid,.theme-diwan .more-grid,.theme-wasl .more-grid { grid-template-columns: 1fr; }
  .theme-barq .masthead { grid-template-columns: minmax(0, 1fr); }
  .theme-barq .main-nav { grid-column: 1; }
  .theme-barq .brand-row { padding: 16px 0 6px; }
  .barq-cover .lead { display: flex; flex-direction: column; gap: 20px; align-items: stretch; }
  .barq-cover .story-copy { order: -1; }
  .barq-cover .story-image { aspect-ratio: 1.7; }
  .theme-barq .lead h2 { font-size: 29px; }
  .barq-wire .wire { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
  .barq-wire .wire > .story-copy { padding-inline-start: 14px; }
  .theme-barq .wire h2 { font-size: 20px; }
  .wire-time { font-size: 16px; }
  .diwan-cover .lead { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
  .diwan-cover .story-image { aspect-ratio: 1.55; height: auto; }
  .diwan-cover .story-copy { padding: 24px; }
  .diwan-essays { grid-template-columns: 1fr; gap: 20px; }
  .diwan-essays .brief + .brief { border-top: 1px solid var(--line); padding-top: 20px; }
  .diwan-features,.diwan-notes-grid,.wasl-river { grid-template-columns: 1fr; gap: 24px; }
  .diwan-features .story-copy { max-width: 100%; }
  .theme-diwan .article-layout { grid-template-columns: 1fr; }
  .theme-diwan .article-heading h1 { font-size: 36px; }
  .theme-diwan .wordmark { font-size: 70px; }
  .theme-diwan .main-nav { justify-content: flex-start; }
  .theme-wasl .lead h2 { font-size: 27px; }
  .wasl-main .story-copy { padding: 20px; }
  .wasl-tiles { gap: 24px 18px; }
  .theme-wasl .wasl-tiles h2 { font-size: 17px; }
  .wasl-river { padding: 20px; }
  .theme-wasl .article-page { padding: 18px; }
  .theme-wasl .article-heading h1,.theme-mizan .article-heading h1 { font-size: 30px; }
}
@media (max-width: 380px) {
  .wasl-tiles { grid-template-columns: 1fr; }
  .mizan-notebook .row { grid-template-columns: minmax(0, 1fr) 88px; }
  .theme-barq .lead h2,.theme-mizan .lead h2 { font-size: 26px; }
}
