/* ==========================================================================
   On a Low Flame (על אש קטנה) — kitchen-notebook theme
   Warm paper, notebook pages with a spine margin, handwritten Amatic labels,
   taped polaroids, a gingham towel strip and a cast-iron footer. RTL-first.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Noto Sans Hebrew"; src: url(../fonts/noto-sans-hebrew-hebrew.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Noto Sans Hebrew"; src: url(../fonts/noto-sans-hebrew-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; 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: "David Libre"; src: url(../fonts/david-libre-hebrew-400.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "David Libre"; src: url(../fonts/david-libre-latin-400.woff2) format("woff2"); font-weight: 400; font-display: swap; 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: "David Libre"; src: url(../fonts/david-libre-hebrew-700.woff2) format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "David Libre"; src: url(../fonts/david-libre-latin-700.woff2) format("woff2"); font-weight: 700; font-display: swap; 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: "Amatic SC"; src: url(../fonts/amatic-sc-hebrew-700.woff2) format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Amatic SC"; src: url(../fonts/amatic-sc-latin-700.woff2) format("woff2"); font-weight: 700; font-display: swap; 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: "Amatic SC"; src: url(../fonts/amatic-sc-hebrew-400.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }

/* ---------- Tokens ---------- */
:root {
  --ek-paper: #F7F0E2;
  --ek-sheet: #FFFCF6;
  --ek-ink: #2C1D13;
  --ek-muted: #67513F;
  --ek-brown: #7A3E1D;
  --ek-brown-d: #5E2E14;
  --ek-brown-t: #F0DDCB;
  --ek-olive: #6E8B3D;
  --ek-olive-d: #4B6522;
  --ek-olive-t: #E4EAD2;
  --ek-ember: #D9822B;
  --ek-ember-t: #F6E1C4;
  --ek-rule: #E3D3B8;
  --ek-iron: #2B170C;
  --ek-iron-ink: #EADBC4;

  --ek-f-body: "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --ek-f-title: "David Libre", "Times New Roman", serif;
  --ek-f-hand: "Amatic SC", "Noto Sans Hebrew", sans-serif;

  --ek-max: 1180px;
  --ek-gutter: clamp(16px, 4vw, 32px);
  --ek-radius: 4px;
  --ek-shadow: 0 1px 2px rgba(60, 30, 10, .12), 0 14px 28px -16px rgba(60, 30, 10, .45);
  --ek-tape: rgba(110, 139, 61, .34);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background-color: var(--ek-paper);
  /* faint paper fibre: two soft radial washes */
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(217, 130, 43, .07), transparent 60%),
    radial-gradient(900px 700px at 0% 110%, rgba(110, 139, 61, .06), transparent 60%);
  color: var(--ek-ink);
  font-family: var(--ek-f-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ek-brown); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ek-olive-d); }
:focus-visible { outline: 3px solid var(--ek-ember); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--ek-f-title); font-weight: 700; line-height: 1.2; color: var(--ek-ink); margin: 0; }
p { margin: 0; }
button { font: inherit; }

.ek-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ek-skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--ek-brown); color: #fff; padding: 10px 18px; border-radius: var(--ek-radius); text-decoration: none; }
.ek-skip:focus { top: 12px; color: #fff; }
.ek-wrap { width: 100%; max-width: var(--ek-max); margin-inline: auto; padding-inline: var(--ek-gutter); }
.ek-main { display: block; outline: none; padding-bottom: 72px; }

/* Handwritten voice */
.ek-hand { font-family: var(--ek-f-hand); font-weight: 700; letter-spacing: .01em; line-height: 1.1; }
.ek-kicker { display: inline-block; font-size: 1.75rem; color: var(--ek-olive-d); margin-bottom: .35rem; text-decoration: none; }
.ek-kicker--link:hover { color: var(--ek-brown); }
.ek-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--ek-brown); min-height: 40px; }
.ek-link:hover { text-decoration: underline; }
.ek-link .ek-icon { transition: transform .2s; }
.ek-link:hover .ek-icon { transform: translateX(-3px); }
.ek-btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px;
  background: var(--ek-brown); color: #FFF8EE; border-radius: var(--ek-radius);
  font-weight: 600; text-decoration: none; box-shadow: 0 3px 0 var(--ek-brown-d);
}
.ek-btn:hover { background: var(--ek-brown-d); color: #FFF8EE; }
.ek-empty { color: var(--ek-muted); padding: 24px 0; }

/* ---------- Notebook page ---------- */
.ek-page {
  position: relative;
  background: var(--ek-sheet);
  border-radius: 3px;
  box-shadow: var(--ek-shadow);
  padding-block: clamp(28px, 4vw, 48px);
  padding-inline-start: clamp(44px, 7vw, 88px);  /* spine side: holes + margin line */
  padding-inline-end: clamp(20px, 4vw, 56px);
}
/* margin line (double, brown) */
.ek-page::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: clamp(30px, 5vw, 64px);
  width: 4px; border-inline: 1px solid rgba(122, 62, 29, .35);
  pointer-events: none;
}
/* punched holes along the spine */
.ek-page::after {
  content: ""; position: absolute; inset-block: 18px; inset-inline-start: clamp(8px, 1.6vw, 20px);
  width: 13px;
  background: radial-gradient(circle at 50% 50%, var(--ek-paper) 0 5px, rgba(60, 30, 10, .18) 5.5px 6.5px, transparent 7px) 0 0 / 13px 96px repeat-y;
  pointer-events: none;
}
/* top of a notebook page: a double header rule */
.ek-page--ruled { background-image: linear-gradient(to bottom, transparent 0 18px, rgba(122, 62, 29, .16) 18px 19px, transparent 19px 22px, rgba(122, 62, 29, .16) 22px 23px, transparent 23px); }
.ek-page--ruled > * { position: relative; }

/* ---------- Header ---------- */
.ek-head { position: relative; z-index: 20; background: var(--ek-sheet); border-bottom: 1px solid var(--ek-rule); }
.ek-head__bar { display: flex; align-items: center; gap: 24px; min-height: 78px; }
.ek-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.ek-brand .ek-mark { flex-shrink: 0; }
.ek-brand__name { font-family: var(--ek-f-hand); font-weight: 700; font-size: 2.55rem; line-height: 1; color: var(--ek-brown); white-space: nowrap; padding-top: 4px; }
.ek-brand:hover .ek-brand__name { color: var(--ek-brown-d); }
.ek-nav { margin-inline-start: auto; }
.ek-nav__list { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0; padding: 0; }
.ek-nav__list a {
  display: flex; align-items: center; min-height: 44px; padding: 0 10px;
  color: var(--ek-ink); text-decoration: none; font-weight: 500; font-size: .97rem;
}
.ek-nav__list a:hover { color: var(--ek-brown); text-decoration: underline; text-decoration-color: var(--ek-ember); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.ek-nav__list .current-menu-item > a, .ek-nav__list .current-menu-parent > a, .ek-nav__list .current-post-ancestor > a { color: var(--ek-brown); text-decoration: underline wavy var(--ek-olive); text-underline-offset: 8px; }
.ek-head__tools { display: flex; gap: 4px; }
.ek-nav + .ek-head__tools { margin-inline-start: 0; }
.ek-iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: var(--ek-brown); cursor: pointer;
}
.ek-iconbtn:hover, .ek-iconbtn[aria-expanded="true"] { background: var(--ek-brown-t); }
.ek-menubtn { display: none; }
.ek-search { border-top: 1px dashed var(--ek-rule); background: var(--ek-sheet); padding-block: 14px; }

/* gingham towel strip under the header */
.ek-head::after {
  content: ""; display: block; height: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(122, 62, 29, .28) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(0deg, rgba(122, 62, 29, .28) 0 4px, transparent 4px 8px),
    var(--ek-sheet);
}

/* ---------- Search form ---------- */
.ek-sform { display: flex; gap: 8px; max-width: 640px; }
.ek-sform__input {
  flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; font: inherit; font-size: 1rem; color: var(--ek-ink);
  background: #fff; border: 1.5px solid var(--ek-rule); border-radius: var(--ek-radius);
}
.ek-sform__input:focus { outline: none; border-color: var(--ek-brown); box-shadow: 0 0 0 3px rgba(217, 130, 43, .3); }
.ek-sform__btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 18px; border: 0; border-radius: var(--ek-radius);
  background: var(--ek-brown); color: #FFF8EE; font-weight: 600; cursor: pointer;
}
.ek-sform__btn:hover { background: var(--ek-brown-d); }

/* ---------- Breadcrumbs ---------- */
.ek-crumbs { font-size: .88rem; color: var(--ek-muted); padding-block: 22px 6px; }
.ek-crumbs a { color: var(--ek-muted); text-decoration: none; }
.ek-crumbs a:hover { color: var(--ek-brown); text-decoration: underline; }
.ek-crumbs .breadcrumb_last { color: var(--ek-ink); }

/* ---------- Section heads ---------- */
.ek-sechead { margin-bottom: 28px; }
.ek-sechead--row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ek-sechead__title { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.ek-sechead .ek-kicker { margin-bottom: 0; }

/* ---------- Homepage: opening page + pinned polaroids ---------- */
.ek-opening { padding-top: clamp(28px, 5vw, 56px); }
.ek-opening__page { max-width: 980px; margin-inline: auto; padding-bottom: clamp(120px, 14vw, 170px); }
.ek-opening__title { font-size: clamp(2.3rem, 5.4vw, 4rem); line-height: 1.08; max-width: 18ch; letter-spacing: -.005em; }
.ek-opening__lede { font-size: clamp(1.08rem, 1.7vw, 1.22rem); line-height: 1.8; color: var(--ek-ink); max-width: 60ch; margin-top: 18px; }
.ek-tally { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 6px 26px; font-family: var(--ek-f-hand); font-weight: 700; font-size: 1.7rem; color: var(--ek-muted); line-height: 1.2; }
.ek-tally strong { color: var(--ek-brown); font-size: 2.1rem; }
.ek-opening__deco { position: absolute; inset-inline-end: clamp(28px, 5vw, 64px); top: clamp(28px, 4vw, 52px); opacity: .13; transform: rotate(-8deg); pointer-events: none; }
.ek-opening__deco .ek-mark { width: clamp(150px, 20vw, 230px); height: auto; }
.ek-opening__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 24px; }

.ek-pinned {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 30px);
  max-width: 1120px; margin: calc(-1 * clamp(96px, 11vw, 140px)) auto 0; padding-inline: clamp(0px, 2vw, 24px);
}
.ek-pinned .ek-pol { transform: rotate(-3deg); }
.ek-pinned .ek-pol:nth-child(2) { transform: rotate(2.4deg) translateY(14px); }
.ek-pinned .ek-pol:nth-child(3) { transform: rotate(-1.4deg) translateY(4px); }
.ek-pinned .ek-pol:nth-child(4) { transform: rotate(3deg) translateY(18px); }
.ek-pinned .ek-pol:hover { transform: rotate(0) translateY(-4px); }
.ek-pinned .ek-pol__title { font-size: 1.08rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Polaroid card ---------- */
.ek-pol {
  position: relative; background: #FFFDF8; padding: 12px 12px 0; box-shadow: var(--ek-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.ek-pol::before { /* washi tape */
  content: ""; position: absolute; top: -11px; left: 50%; width: 96px; height: 24px; transform: translateX(-50%) rotate(-3deg);
  background: var(--ek-tape);
  clip-path: polygon(0 8%, 6% 0, 12% 10%, 18% 0, 82% 0, 88% 8%, 94% 0, 100% 10%, 100% 90%, 94% 100%, 88% 92%, 82% 100%, 18% 100%, 12% 90%, 6% 100%, 0 92%);
}
.ek-pol:nth-child(3n+2)::before { background: rgba(217, 130, 43, .30); transform: translateX(-50%) rotate(2deg); }
.ek-pol:nth-child(3n)::before { background: rgba(122, 62, 29, .22); transform: translateX(-50%) rotate(-1deg); }
.ek-pol__photo { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--ek-rule); }
.ek-pol__photo img, .ek-pol__photo .ek-noimg { width: 100%; height: 100%; object-fit: cover; }
.ek-pol__body { padding: 12px 4px 18px; }
.ek-pol__cat { font-size: 1.55rem; color: var(--ek-olive-d); text-decoration: none; }
.ek-pol__cat:hover { color: var(--ek-brown); }
.ek-pol__title { font-size: 1.28rem; line-height: 1.3; margin-top: 2px; }
.ek-pol__title a { color: var(--ek-ink); text-decoration: none; }
.ek-pol__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.ek-pol__cat { position: relative; z-index: 1; }
.ek-pol__title a:hover { color: var(--ek-brown); }
.ek-pol:focus-within { box-shadow: 0 0 0 3px var(--ek-ember), var(--ek-shadow); }
.ek-pol__title a:focus-visible { outline: none; }
.ek-pol__ex { font-size: .95rem; line-height: 1.65; color: var(--ek-muted); margin-top: 8px; }
.ek-pol__meta { font-size: .84rem; color: var(--ek-muted); margin-top: 10px; }
.ek-noimg { display: grid; place-items: center; background: var(--ek-brown-t); }

.ek-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 36px; padding-top: 14px; }
.ek-grid .ek-pol:nth-child(3n+1) { transform: rotate(-1.1deg); }
.ek-grid .ek-pol:nth-child(3n+2) { transform: rotate(.8deg); }
.ek-grid .ek-pol:nth-child(3n) { transform: rotate(-.35deg); }
.ek-grid .ek-pol:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 2px 4px rgba(60, 30, 10, .12), 0 22px 36px -18px rgba(60, 30, 10, .5); }
.ek-grid .ek-pol__photo { aspect-ratio: 4 / 3; }

/* ---------- Homepage: recipe index ---------- */
.ek-index { padding-top: clamp(64px, 8vw, 104px); }
.ek-index__book { display: grid; gap: 26px; }
.ek-divider {
  display: grid; grid-template-columns: 190px minmax(0, 1fr);
  background: var(--ek-sheet); box-shadow: var(--ek-shadow); border-radius: 3px; overflow: hidden;
}
.ek-divider__tab {
  position: relative; display: flex; align-items: flex-start; padding: 26px 22px; font-size: 2.3rem; color: var(--ek-brown-d);
  background: var(--ek-brown-t); border-inline-end: 1px dashed rgba(122, 62, 29, .35);
}
.ek-divider:nth-child(2) .ek-divider__tab { background: var(--ek-olive-t); color: var(--ek-olive-d); }
.ek-divider:nth-child(3) .ek-divider__tab { background: var(--ek-ember-t); color: var(--ek-brown-d); }
.ek-divider__tab::after { /* little flame under the label */
  content: ""; position: absolute; inset-inline-start: 24px; top: 76px; width: 54px; height: 3px; border-radius: 3px; background: currentColor; opacity: .5;
}
.ek-divider__rows { list-style: none; margin: 0; padding: 6px clamp(16px, 2.6vw, 34px); counter-reset: ek-row; }
.ek-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 18px; align-items: start; padding-block: 18px; border-bottom: 1px solid var(--ek-rule); }
.ek-row:last-child { border-bottom: 0; }
.ek-row__thumb { display: block; width: 84px; height: 84px; padding: 4px 4px 10px; background: #fff; box-shadow: 0 1px 2px rgba(60,30,10,.15), 0 6px 12px -8px rgba(60,30,10,.5); transform: rotate(-2.5deg); }
.ek-row:nth-child(even) .ek-row__thumb { transform: rotate(2deg); }
.ek-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ek-row__line { display: flex; align-items: baseline; gap: 10px; }
.ek-row__name { font-size: 2.05rem; color: var(--ek-brown); text-decoration: none; white-space: nowrap; }
.ek-row__name:hover { color: var(--ek-olive-d); text-decoration: underline; text-decoration-thickness: 2px; }
.ek-row__dots { flex: 1; min-width: 24px; border-bottom: 2px dotted rgba(122, 62, 29, .35); transform: translateY(-6px); }
.ek-row__count { font-size: .88rem; color: var(--ek-muted); white-space: nowrap; font-weight: 600; }
.ek-row__lede { font-size: .97rem; color: var(--ek-ink); line-height: 1.65; margin-top: 2px; }
.ek-row__new { font-size: .9rem; color: var(--ek-muted); margin-top: 6px; }
.ek-row__new span { font-weight: 600; color: var(--ek-olive-d); }
.ek-row__new a { color: var(--ek-ink); }
.ek-row__new a:hover { color: var(--ek-brown); }

/* ---------- Homepage: latest, about text, writers ---------- */
.ek-latest { padding-top: clamp(64px, 8vw, 104px); }
.ek-about { padding-top: clamp(64px, 8vw, 104px); }
.ek-about__page { max-width: 900px; margin-inline: auto; }
.ek-team { padding-top: clamp(56px, 7vw, 96px); }
.ek-team__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.ek-writer {
  display: flex; gap: 18px; align-items: flex-start; padding: 26px; background: var(--ek-sheet); box-shadow: var(--ek-shadow); border-radius: 3px;
  border-top: 5px solid var(--ek-olive);
}
.ek-writer__name { font-size: 1.5rem; }
.ek-writer__count { font-size: 1.5rem; color: var(--ek-olive-d); margin-top: 2px; }
.ek-writer__bio { margin-top: 8px; color: var(--ek-ink); line-height: 1.7; }

.ek-avatar {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ek-brown); color: #FFF8EE; font-family: var(--ek-f-title); font-weight: 700; font-size: 1.05rem; line-height: 1;
  box-shadow: inset 0 0 0 3px var(--ek-brown), inset 0 0 0 4px rgba(255, 248, 238, .55);
}
.ek-avatar--lg { width: 64px; height: 64px; font-size: 1.45rem; }

/* ---------- Lists: posts page, archive ---------- */
.ek-listhead { padding-block: 10px 26px; }
.ek-listhead__title { font-size: clamp(2.1rem, 4.6vw, 3.3rem); line-height: 1.1; }
.ek-listhead__sub { color: var(--ek-muted); margin-top: 8px; }
.ek-listhead .ek-sform { margin-top: 18px; }
.ek-termpage { max-width: 980px; }
.ek-termpage__desc { margin-top: 16px; max-width: 70ch; }
.ek-termpage__desc p { margin-bottom: .8em; }
.ek-q { color: var(--ek-brown); }

.ek-tabs { margin: 8px 0 34px; border-bottom: 2px solid var(--ek-brown); }
.ek-tabs ul { list-style: none; display: flex; gap: 6px 4px; margin: 0; padding: 0; flex-wrap: wrap; align-items: flex-end; }
.ek-tabs a {
  display: flex; align-items: center; min-height: 44px; padding: 6px 14px 2px; white-space: nowrap; text-decoration: none;
  font-size: 1.55rem; color: var(--ek-brown-d); background: var(--ek-sheet); border: 1px solid var(--ek-rule); border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.ek-tabs a:hover { background: var(--ek-brown-t); }
.ek-tabs a.is-current { background: var(--ek-brown); color: #FFF8EE; border-color: var(--ek-brown); }
.ek-noresult .ek-tabs { margin-bottom: 0; }

.ek-pager { margin-top: 56px; }
.ek-pager ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; }
.ek-pager a, .ek-pager span {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: var(--ek-radius);
  background: var(--ek-sheet); border: 1px solid var(--ek-rule); text-decoration: none; color: var(--ek-ink); font-weight: 600;
}
.ek-pager a:hover { border-color: var(--ek-brown); color: var(--ek-brown); }
.ek-pager .current { background: var(--ek-brown); border-color: var(--ek-brown); color: #FFF8EE; }

/* ---------- Search results ---------- */
.ek-searchpage { padding-top: 26px; }
.ek-results { list-style: none; margin: 0; padding: 0; max-width: 860px; background: var(--ek-sheet); box-shadow: var(--ek-shadow); border-radius: 3px; }
.ek-result { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; padding: 22px clamp(16px, 3vw, 30px); border-bottom: 1px solid var(--ek-rule); }
.ek-result:last-child { border-bottom: 0; }
.ek-result__thumb { display: grid; place-items: center; width: 96px; height: 96px; padding: 4px 4px 10px; background: #fff; box-shadow: 0 1px 2px rgba(60,30,10,.15), 0 6px 12px -8px rgba(60,30,10,.5); }
.ek-result__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ek-result__cat { font-size: 1.45rem; color: var(--ek-olive-d); }
.ek-result__title { font-size: 1.35rem; }
.ek-result__title a { color: var(--ek-ink); text-decoration: none; }
.ek-result__title a:hover { color: var(--ek-brown); text-decoration: underline; }
.ek-result__ex { color: var(--ek-muted); font-size: .96rem; margin-top: 6px; }
.ek-noresult { max-width: 860px; }
.ek-noresult p { margin-bottom: 16px; }

/* ---------- Single post ---------- */
.ek-single__head { max-width: 860px; margin: 12px auto 0; text-align: center; }
.ek-single__title { font-size: clamp(2rem, 4.4vw, 3.15rem); line-height: 1.14; }
.ek-byline { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; text-align: start; }
.ek-byline__who { font-weight: 600; }
.ek-byline__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; color: var(--ek-muted); }
.ek-byline__meta span { display: inline-flex; align-items: center; gap: 5px; }
.ek-single__photo { position: relative; max-width: 820px; margin: 38px auto 0; padding: 14px 14px 44px; background: #FFFDF8; box-shadow: var(--ek-shadow); transform: rotate(-.6deg); }
.ek-single__photo::before, .ek-single__photo::after { content: ""; position: absolute; top: -12px; width: 110px; height: 26px; background: var(--ek-tape); }
.ek-single__photo::before { inset-inline-start: -24px; transform: rotate(-32deg); }
.ek-single__photo::after { inset-inline-end: -24px; transform: rotate(32deg); background: rgba(217, 130, 43, .3); }
.ek-single__photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.ek-single__layout { max-width: 760px; margin: 44px auto 0; }

.ek-toc { background: var(--ek-sheet); box-shadow: var(--ek-shadow); border-radius: 3px; border-top: 5px solid var(--ek-olive); margin-bottom: 36px; }
.ek-toc summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; cursor: pointer; padding: 14px 24px; list-style: none; min-height: 44px; }
.ek-toc summary::-webkit-details-marker { display: none; }
.ek-toc summary .ek-hand { font-size: 1.9rem; color: var(--ek-brown); }
.ek-toc summary .ek-toc__n { font-size: .85rem; color: var(--ek-muted); }
.ek-toc summary::after { content: "+"; font-size: 1.4rem; color: var(--ek-brown); line-height: 1; }
.ek-toc[open] summary::after { content: "−"; }
.ek-toc ol { list-style: none; counter-reset: ek-toc; margin: 0; padding: 0 24px 18px; columns: 2 280px; column-gap: 32px; }
.ek-toc li { counter-increment: ek-toc; break-inside: avoid; display: flex; gap: 10px; padding-block: 5px; border-bottom: 1px dashed var(--ek-rule); font-size: .95rem; line-height: 1.5; }
.ek-toc li::before { content: counter(ek-toc); font-family: var(--ek-f-hand); font-weight: 700; font-size: 1.35rem; line-height: 1.1; color: var(--ek-olive-d); min-width: 1.2em; }
.ek-toc a { color: var(--ek-ink); text-decoration: none; }
.ek-toc a:hover { color: var(--ek-brown); text-decoration: underline; }

.ek-authorcard {
  position: relative; display: flex; gap: 18px; align-items: flex-start; margin-top: 56px; padding: 26px 28px;
  background: var(--ek-sheet);
  box-shadow: var(--ek-shadow); border-radius: 3px; border-inline-start: 5px solid var(--ek-brown);
}
.ek-authorcard__label { font-size: 1.5rem; color: var(--ek-olive-d); }
.ek-authorcard__name { font-family: var(--ek-f-title); font-size: 1.5rem; font-weight: 700; }
.ek-authorcard__bio { margin-top: 6px; line-height: 1.7; }
.ek-authorcard__dates { margin-top: 10px; font-size: .86rem; color: var(--ek-muted); }

.ek-related { padding-top: clamp(64px, 8vw, 96px); }

/* ---------- Prose ---------- */
.ek-prose { font-size: 1.075rem; line-height: 1.85; overflow-wrap: break-word; }
.ek-prose > * + * { margin-top: 1.05em; }
.ek-prose h2 {
  font-size: clamp(1.55rem, 2.6vw, 1.95rem); margin-top: 2.1em; padding-top: .7em; border-top: 1px dashed rgba(122, 62, 29, .35);
  scroll-margin-top: 24px;
}
.ek-prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ek-prose h3 { font-family: var(--ek-f-body); font-size: 1.17rem; font-weight: 700; color: var(--ek-brown-d); margin-top: 1.6em; }
.ek-prose h2 + *, .ek-prose h3 + * { margin-top: .6em; }
.ek-prose ul, .ek-prose ol { padding-inline-start: 1.4em; }
.ek-prose li + li { margin-top: .4em; }
.ek-prose ul li::marker { color: var(--ek-ember); font-size: 1.1em; }
.ek-prose ol li::marker { color: var(--ek-brown); font-weight: 700; }
.ek-prose strong { color: #1E130B; font-weight: 700; }
.ek-prose u { text-decoration: none; background: linear-gradient(to top, rgba(110, 139, 61, .28) 0 42%, transparent 42%); padding-inline: 2px; }
.ek-prose img { border-radius: 2px; }
.ek-prose blockquote { margin-inline: 0; padding: 14px 22px; border-inline-start: 4px solid var(--ek-olive); background: var(--ek-olive-t); }

/* notebook checklist */
.ek-prose .ek-check { list-style: none; padding: 18px 22px; background: var(--ek-sheet); box-shadow: var(--ek-shadow); border-radius: 3px; }
.ek-prose .ek-check li { display: flex; gap: 12px; align-items: flex-start; padding-block: 4px; border-bottom: 1px solid rgba(122, 62, 29, .09); }
.ek-prose .ek-check li:last-child { border-bottom: 0; }
.ek-check__box { flex-shrink: 0; width: 20px; height: 20px; margin-top: .45em; border: 2px solid var(--ek-brown); border-radius: 4px; background: #fff; transform: rotate(-2deg); }

/* sticky note: read also */
.ek-prose .ek-readalso {
  position: relative; margin-top: 2.4em; padding: 26px 24px 20px; background: #F4EFCB; box-shadow: var(--ek-shadow);
  transform: rotate(-.5deg); line-height: 1.7;
}
.ek-prose .ek-readalso::before { content: ""; position: absolute; top: -11px; inset-inline-start: 28px; width: 90px; height: 22px; background: var(--ek-tape); transform: rotate(-4deg); }
.ek-prose .ek-readalso strong:first-child { display: block; font-family: var(--ek-f-hand); font-size: 1.75rem; line-height: 1; color: var(--ek-brown); margin-bottom: 6px; }

.ek-note { display: block; padding: 16px 22px; background: var(--ek-olive-t); border-inline-start: 4px solid var(--ek-olive); border-radius: 0 3px 3px 0; }
.ek-note__label { display: block; font-size: 1.55rem; color: var(--ek-olive-d); }
.ek-note p { font-size: .97rem; }

.ek-table { overflow-x: auto; }
.ek-table table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--ek-sheet); }
.ek-table th, .ek-table td { padding: 10px 12px; border-bottom: 1px solid var(--ek-rule); text-align: start; }
.ek-table th { background: var(--ek-brown-t); }

/* static pages */
.ek-pagewrap { padding-bottom: 8px; }
.ek-staticpage { max-width: 900px; margin: 6px auto 0; }
.ek-staticpage__head { margin-bottom: 26px; }
.ek-staticpage__title { font-size: clamp(2.1rem, 4.4vw, 3.1rem); }
/* contact form plugin, tuned to the paper */
.ek-prose .adxc { --adxc-accent: #7A3E1D; --adxc-bg: #FFFFFF; --adxc-radius: 4px; }
.ek-prose .adxc .adxc-submit { min-height: 46px; }

/* 404 */
.ek-lost { max-width: 860px; margin: 36px auto 0; }
.ek-lost__title { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 12px; }
.ek-lost > p { margin-bottom: 18px; }
.ek-lost .ek-sform { margin-bottom: 10px; }

/* ---------- Footer ---------- */
.ek-foot { position: relative; background: var(--ek-iron); color: var(--ek-iron-ink); margin-top: 24px; }
.ek-foot::before {
  content: ""; display: block; height: 16px;
  background:
    repeating-linear-gradient(90deg, rgba(122, 62, 29, .45) 0 10px, transparent 10px 20px),
    repeating-linear-gradient(0deg, rgba(122, 62, 29, .45) 0 8px, transparent 8px 16px),
    #F3E6D2;
}
.ek-foot__grid { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr; gap: 40px; padding-block: 52px 36px; }
.ek-brand--iron .ek-brand__name { color: #F6EBD6; font-size: 2.6rem; }
.ek-foot__tag { margin-top: 12px; color: var(--ek-iron-ink); max-width: 34ch; line-height: 1.7; }
.ek-foot__title { font-size: 1.85rem; color: #C9DB9E; margin-bottom: 10px; }
.ek-foot__list { list-style: none; margin: 0; padding: 0; }
.ek-foot__list--cols { columns: 2; column-gap: 28px; }
.ek-foot__list a { display: inline-flex; align-items: center; min-height: 36px; color: #F6EBD6; text-decoration: none; font-size: .95rem; }
.ek-foot__list a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--ek-ember); }
.ek-foot__base { border-top: 1px solid rgba(234, 219, 196, .18); padding-block: 18px 26px; font-size: .86rem; color: #CDB89B; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .ek-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ek-foot__grid { grid-template-columns: 1fr 1fr; }
  .ek-foot__brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .ek-opening__deco { display: none; }
  .ek-menubtn { display: inline-grid; }
  .ek-head__bar { flex-wrap: wrap; gap: 8px; min-height: 68px; }
  .ek-head__tools { margin-inline-start: auto; }
  .ek-nav { order: 3; flex-basis: 100%; display: none; }
  .ek-nav.is-open { display: block; border-top: 1px dashed var(--ek-rule); padding-block: 6px 12px; }
  .ek-nav__list { flex-direction: column; }
  .ek-nav__list a { min-height: 46px; font-size: 1.05rem; }
  .ek-pinned { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 34px; }
  .ek-divider { grid-template-columns: 1fr; }
  .ek-divider__tab { padding: 14px 20px 10px; border-inline-end: 0; border-bottom: 1px dashed rgba(122, 62, 29, .35); font-size: 2.1rem; }
  .ek-divider__tab::after { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .ek-brand__name { font-size: 2.15rem; }
  .ek-brand .ek-mark { width: 38px; height: 38px; }
  .ek-grid { grid-template-columns: 1fr; gap: 40px; }
  .ek-grid .ek-pol:nth-child(n) { transform: rotate(-.6deg); }
  .ek-grid .ek-pol:nth-child(even) { transform: rotate(.6deg); }
  .ek-page { padding-inline-start: 40px; padding-inline-end: 18px; }
  .ek-page::before { inset-inline-start: 28px; }
  .ek-page::after { inset-inline-start: 7px; }
  .ek-opening__page { padding-bottom: 110px; }
  .ek-pinned { margin-top: -84px; gap: 16px; row-gap: 30px; }
  .ek-pinned .ek-pol { padding: 8px 8px 0; }
  .ek-pinned .ek-pol__cat { font-size: 1.3rem; }
  .ek-pinned .ek-pol__title { font-size: .98rem; }
  .ek-row { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
  .ek-row__thumb { width: 64px; height: 64px; }
  .ek-row__name { font-size: 1.8rem; white-space: normal; }
  .ek-row__dots { display: none; }
  .ek-row__line { justify-content: space-between; }
  .ek-writer { flex-direction: column; }
  .ek-team__cards { grid-template-columns: 1fr; }
  .ek-result { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  .ek-result__thumb { width: 72px; height: 72px; }
  .ek-single__photo { padding: 8px 8px 26px; }
  .ek-single__photo::before, .ek-single__photo::after { width: 70px; height: 20px; inset-inline-start: -10px; }
  .ek-single__photo::after { inset-inline-start: auto; inset-inline-end: -10px; }
  .ek-authorcard { flex-direction: column; padding: 22px 20px; }
  .ek-toc summary { padding: 12px 18px; }
  .ek-toc ol { padding: 0 18px 14px; }
  .ek-foot__grid { grid-template-columns: 1fr; gap: 28px; }
  .ek-sform__btn span { display: none; }
  .ek-tabs { overflow-x: auto; scrollbar-width: thin; }
  .ek-tabs ul { flex-wrap: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .ek-head, .ek-foot, .ek-related, .ek-toc, .ek-crumbs { display: none; }
  body { background: #fff; }
  .ek-page, .ek-pol, .ek-single__photo { box-shadow: none; }
}
