/* Articles: a reading page in the same dark room as the case studies. Loaded after site.css
   (and after ar.css on Arabic pages). Uses logical properties, so the same rules serve both directions. */
.post-head { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.post-head h1 { max-width: 17ch; font-size: clamp(38px, 6.2vw, 90px); font-weight: 500; letter-spacing: -.05em; line-height: .98; text-wrap: balance; }
.post-head .mono { display: block; margin-top: 22px; }
.post-grid { display: grid; grid-template-columns: minmax(0, .62fr) minmax(0, 1.6fr); gap: 32px clamp(32px, 6vw, 96px); padding-top: 34px; align-items: start; }
.toc { position: sticky; top: 24px; }
.toc ol { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); counter-reset: t; }
.toc li { counter-increment: t; border-bottom: 1px solid var(--line); }
.toc a { display: grid; grid-template-columns: 30px 1fr; padding: 11px 4px; font-size: 14px; line-height: 1.35; text-decoration: none; }
.toc a::before { content: counter(t, decimal-leading-zero); font-family: "Geist Mono", monospace; font-size: 12px; color: var(--muted); padding-top: 1px; }
.toc a:hover { color: var(--accent); }

.post-body { max-width: 66ch; font-size: 17px; line-height: 1.7; color: #c9c5bf; }   /* lighter than --muted: this is long reading text */
.post-body .lead { color: var(--text); font-size: clamp(20px, 2vw, 25px); font-weight: 500; letter-spacing: -.02em; line-height: 1.35; }
.post-body h2 { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text); font-size: clamp(26px, 2.8vw, 38px); font-weight: 500; letter-spacing: -.035em; line-height: 1.12; scroll-margin-top: 24px; }
.post-body p { margin-top: 16px; }
.post-body strong { color: var(--text); font-weight: 500; }
.post-body a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 4px; }
.post-body a:hover { color: var(--accent); }
.post-body ul, .post-body ol.num { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.post-body ul li { position: relative; padding-inline-start: 22px; }
.post-body ul li::before { content: ""; position: absolute; inset-inline-start: 0; top: .85em; width: 10px; height: 1px; background: var(--accent); }
.post-body ol.num { counter-reset: n; gap: 0; border-top: 1px solid var(--line); }
.post-body ol.num li { counter-increment: n; position: relative; padding-block: 14px; padding-inline-start: 36px; border-bottom: 1px solid var(--line); }
.post-body ol.num li::before { content: counter(n, decimal-leading-zero); position: absolute; inset-inline-start: 2px; top: 19px; font-family: "Geist Mono", monospace; font-size: 12px; line-height: 1.6; color: var(--accent); }
.post-body ol.num strong { display: block; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
.pair figure { margin: 0; min-width: 0; }
.pair img { width: 100%; aspect-ratio: 7 / 5; object-fit: cover; background: var(--raise); }
.pair figcaption { margin-top: 8px; font-family: var(--mono); font-size: 12px; line-height: 1.4; color: var(--muted); }

/* A palette: the design on one side, its colours with their codes and jobs on the other */
.pal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 26px; align-items: start; }
.pal figure { margin: 0; min-width: 0; }
.pal img { width: 100%; height: auto; background: var(--raise); }
.sw { display: grid; border-top: 1px solid var(--line); }
.sw div { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 2px 14px; align-items: center; padding-block: 13px; border-bottom: 1px solid var(--line); }
.sw i { grid-row: span 2; width: 46px; height: 46px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }   /* the ring keeps near-black colours visible on the dark page */
.sw b { align-self: end; font-family: var(--mono); font-size: 14px; font-weight: 400; letter-spacing: .04em; line-height: 1.3; color: var(--text); }
.sw span { align-self: start; font-size: 13px; line-height: 1.4; color: var(--muted); }

.tbl { margin-top: 24px; overflow-x: auto; }
.tbl table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.tbl th, .tbl td { text-align: start; vertical-align: top; padding-block: 13px; padding-inline-end: 18px; border-bottom: 1px solid var(--line); }
.tbl thead th { color: var(--text); font-size: 18px; font-weight: 500; letter-spacing: -.02em; border-bottom-color: #55514c; }
.tbl thead td { border-bottom-color: #55514c; }
.tbl tbody th { width: 24%; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 16px; }

.faq { margin: 8px 0 0; }
.faq dt { margin-top: 26px; color: var(--text); font-size: 19px; font-weight: 500; letter-spacing: -.015em; line-height: 1.35; }
.faq dd { margin: 8px 0 0; }
.post-close { margin-top: 48px; padding: 22px 24px; border: 1px solid var(--accent); color: var(--text); font-size: 18px; font-weight: 500; line-height: 1.5; }
.post-close p { margin: 0; }

/* Articles index */
.post-list { list-style: none; margin: clamp(28px, 4vw, 48px) 0 0; padding: 0; border-top: 1px solid var(--line); }
.post-list a { display: grid; grid-template-columns: minmax(0, .5fr) minmax(0, 1.6fr) auto; gap: 12px clamp(20px, 4vw, 64px); align-items: baseline; padding-block: 26px; border-bottom: 1px solid var(--line); text-decoration: none; }
.post-list h2 { font-size: clamp(26px, 3.4vw, 46px); font-weight: 500; letter-spacing: -.04em; line-height: 1.05; }
.post-list p { margin-top: 10px; max-width: 58ch; color: var(--muted); font-size: 15px; }
.post-list a:hover h2 { color: var(--accent); }
.post-list .go { font-family: var(--mono); font-size: 12px; color: var(--accent); white-space: nowrap; }

[dir="rtl"] .post-head h1 { line-height: 1.3; }
[dir="rtl"] .post-body { line-height: 1.95; }
[dir="rtl"] .post-body .lead { line-height: 1.75; }
[dir="rtl"] .post-body h2, [dir="rtl"] .post-list h2 { line-height: 1.4; }
[dir="rtl"] .tbl table { line-height: 1.75; }
[dir="rtl"] .faq dt { line-height: 1.6; }
[dir="rtl"] .toc a::before { padding-top: 6px; }
[dir="rtl"] .post-body ol.num li::before { top: 24px; }

@media (max-width: 900px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .post-list a { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 560px) {
  .pair, .pal { grid-template-columns: minmax(0, 1fr); }
  .post-body { font-size: 16px; }
  .tbl table { min-width: 0; font-size: 14px; }
  .tbl th, .tbl td { padding-inline-end: 10px; }
  .tbl thead th { font-size: 16px; }
  .tbl tbody th { width: 21%; font-size: 10px; letter-spacing: 0; }
}
