/* zman — feuille de style. Encre, papier, un accent. */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/EBGaramond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/EBGaramond-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Frank Ruhl Libre";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/FrankRuhlLibre-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

:root {
  --paper: #f7f3ea;
  --paper-2: #efe9dc;
  --ink: #1d1a15;
  --ink-2: #5a544a;
  --rule: #d8d0bf;
  --accent: #8d2b1c;
  --serif: "EB Garamond", "Frank Ruhl Libre", Georgia, "Times New Roman", serif;
  --hebrew: "Frank Ruhl Libre", "EB Garamond", "David", "Times New Roman", serif;
  --measure: 40rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f;
    --paper-2: #1f1c15;
    --ink: #e9e2d3;
    --ink-2: #a89f8c;
    --rule: #3a3428;
    --accent: #d8785c;
  }
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html[lang="he"] body { font-family: var(--hebrew); line-height: 1.7; }
[lang="he"] { font-family: var(--hebrew); }
[lang="fr"], [lang="en"] { font-family: var(--serif); }

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.15em; }
a:hover { text-decoration-color: var(--accent); color: var(--accent); }

.masthead {
  max-width: 62rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.3rem 1.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 2rem;
  border-bottom: 1px solid var(--rule);
}
.brand { text-decoration: none; display: inline-flex; align-items: baseline; gap: 0.5rem; }
.brand-he { font-family: var(--hebrew); font-size: 1.5rem; font-weight: 700; }
.brand-latin { font-variant: small-caps; letter-spacing: 0.08em; color: var(--ink-2); }
.nav, .langs { display: flex; gap: 1.2rem; font-variant: small-caps; letter-spacing: 0.06em; }
.nav a, .langs a { text-decoration: none; color: var(--ink-2); }
.nav a[aria-current], .langs a[aria-current] { color: var(--ink); border-bottom: 1.5px solid var(--accent); }
.langs { margin-inline-start: auto; gap: 0.9rem; font-size: 0.9rem; }
.langs a { font-variant: normal; }

.main { flex: 1; width: 100%; max-width: 62rem; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.colophon {
  max-width: 62rem; width: 100%; margin: 0 auto; padding: 1.2rem 1.5rem 2rem;
  border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 0.85rem;
}
.colophon p { margin: 0.2rem 0; }

/* ---- Articles ---- */
.article { max-width: var(--measure); margin: 0 auto; }
.article h1 { font-size: 2.1rem; font-weight: 500; line-height: 1.15; margin: 0.5rem 0 0.4rem; letter-spacing: -0.01em; }
.article .lede { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 2.2rem; font-style: italic; }
html[lang="he"] .article .lede { font-style: normal; }
.article h2 { font-size: 1.35rem; font-weight: 600; margin: 2.6rem 0 0.8rem; line-height: 1.25; }
.article h2::before { content: "§ "; color: var(--accent); font-weight: 400; }
.article h3 { font-size: 1.1rem; font-weight: 600; margin: 1.8rem 0 0.5rem; }
.article p { margin: 0 0 1rem; }
.article p + p { text-indent: 0; }
.article ul, .article ol { padding-inline-start: 1.4rem; }
.article li { margin-bottom: 0.4rem; }
.article blockquote {
  margin: 1.4rem 0; padding-inline-start: 1rem; border-inline-start: 2px solid var(--accent);
  color: var(--ink); font-size: 1.05rem;
}
.article blockquote p { margin-bottom: 0.4rem; }
.article cite { display: block; font-style: normal; color: var(--ink-2); font-size: 0.9rem; }
.article .he { font-family: var(--hebrew); font-size: 1.15em; }
.article .sources { font-size: 0.9rem; color: var(--ink-2); border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1rem; }
.article .sources ol { padding-inline-start: 1.4rem; }
.article .sources li { margin-bottom: 0.3rem; overflow-wrap: anywhere; }
.article hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem auto; width: 30%; }
sup.ref a { text-decoration: none; color: var(--accent); font-size: 0.8em; }

code, pre, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.86em; }
code { background: var(--paper-2); padding: 0.05em 0.3em; border-radius: 2px; }
pre {
  background: var(--paper-2); border: 1px solid var(--rule); padding: 0.8rem 1rem; overflow-x: auto;
  line-height: 1.45; direction: ltr; text-align: left; margin: 0.6rem 0 1.2rem; white-space: pre;
}
pre code { background: none; padding: 0; }
table { border-collapse: collapse; width: 100%; margin: 0.8rem 0 1.4rem; font-size: 0.95rem; }
th, td { text-align: start; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; font-variant: small-caps; letter-spacing: 0.04em; color: var(--ink-2); }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.wide { max-width: none; }
.figure { margin: 1.5rem 0 2rem; }
.figure svg { width: 100%; height: auto; display: block; }
.figure figcaption { font-size: 0.9rem; color: var(--ink-2); margin-top: 0.5rem; }
.diagram text { font-family: var(--serif); fill: var(--ink); font-size: 15px; }
.diagram .label { fill: var(--ink-2); font-size: 12.5px; }
.diagram .accent { fill: var(--accent); }
.diagram .box { fill: var(--paper-2); stroke: var(--rule); stroke-width: 1; }
.diagram .box-accent { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.diagram .arrow { stroke: var(--ink-2); stroke-width: 1.2; fill: none; marker-end: url(#arrowhead); }
.diagram .rule { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 4; }
.diagram .arrowhead { fill: var(--ink-2); }
.diagram .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.endpoint { margin: 2.2rem 0; }
.endpoint h3 code { font-size: 1rem; background: none; padding: 0; }
.badge { display: inline-block; font-size: 0.75rem; font-variant: small-caps; letter-spacing: 0.06em; color: var(--accent); border: 1px solid var(--accent); padding: 0 0.4em; border-radius: 2px; vertical-align: middle; margin-inline-start: 0.4rem; }

/* ---- Horloge ---- */
.clock { text-align: center; padding: 2.5rem 0 1rem; }
.clock-date-he {
  font-family: var(--hebrew); font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 500; line-height: 1.25; margin: 0;
  direction: rtl;
}
.clock-date-translit { font-size: clamp(1.1rem, 2.6vw, 1.5rem); color: var(--ink-2); margin: 0.3rem 0 0; }
.clock-weekday { font-variant: small-caps; letter-spacing: 0.1em; color: var(--accent); font-size: 1.05rem; margin: 0.6rem 0 1.6rem; }
.clock-time {
  font-variant-numeric: tabular-nums lining-nums; font-size: clamp(2.6rem, 9vw, 5.6rem); line-height: 1; letter-spacing: 0.01em;
  margin: 0; direction: ltr; unicode-bidi: isolate; font-weight: 400;
  display: flex; justify-content: center; align-items: flex-start; gap: 0.1em;
}
.clock-time .grp { display: inline-flex; flex-direction: column; align-items: center; }
.clock-time .grp b { font-weight: 400; }
.clock-time .grp small { font-size: 0.85rem; font-variant: small-caps; letter-spacing: 0.14em; color: var(--ink-2); margin-top: 0.5rem; line-height: 1; }
.clock-time .sep { color: var(--rule); padding: 0 0.05em; }
.clock-rega {
  font-variant-numeric: tabular-nums; font-size: 1.05rem; color: var(--ink-2); margin: 2.2rem 0 0; direction: ltr; unicode-bidi: isolate;
}
.clock-rega b { font-weight: 500; color: var(--ink); letter-spacing: 0.04em; }
.clock-rega small { display: block; font-variant: small-caps; letter-spacing: 0.1em; font-size: 0.8rem; margin-top: 0.15rem; }
.clock-quality { font-size: 0.9rem; color: var(--ink-2); margin: 1.6rem 0 0; }
.clock-quality .dot { display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--accent); margin-inline-end: 0.4em; vertical-align: middle; }
.clock-quality[data-state="offline"] .dot { background: var(--ink-2); }
.clock-note { max-width: 32rem; margin: 3rem auto 0; font-size: 0.85rem; color: var(--ink-2); font-style: italic; border-top: 1px solid var(--rule); padding-top: 1rem; }
html[lang="he"] .clock-note { font-style: normal; }
.clock-why { margin-top: 2.2rem; font-size: 1rem; }
.clock-why a { text-decoration-color: var(--accent); }
.clock[data-ready="0"] .clock-time, .clock[data-ready="0"] .clock-rega b { color: var(--rule); }

@media (max-width: 40rem) {
  html { font-size: 100%; }
  .masthead { gap: 0.5rem 1.2rem; }
  .langs { margin-inline-start: 0; }
  .main { padding: 1.4rem 1rem 2rem; }
}
@media print {
  .masthead, .colophon, .clock-why { display: none; }
  body { background: #fff; color: #000; }
}
