/* ==========================================================================
   Open Shelf (מדף פתוח) — main stylesheet. RTL-first, logical properties.
   Motif: a home bookshelf — category spines on a wooden plank, 2:3 cover
   cards with a binding edge, shelf-talker notes, an ex-libris author plate.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(../fonts/opensans-hebrew.woff2) format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(../fonts/opensans-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: "Cardo"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/cardo-hebrew-400.woff2) format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Cardo"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/cardo-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Cardo"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/cardo-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Bellefair"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/bellefair-hebrew.woff2) format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Bellefair"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/bellefair-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

/* ---------- Tokens ---------- */
:root {
  --mdf-oxblood: #7B2D26;
  --mdf-oxblood-deep: #5A1F1A;
  --mdf-oxblood-soft: #9C4A3F;
  --mdf-gold: #E8C07D;
  --mdf-gold-deep: #B8873F;
  --mdf-paper: #FBF6EC;
  --mdf-paper-2: #F3E8D3;
  --mdf-card: #FFFCF5;
  --mdf-linen: #EADBC0;
  --mdf-line: #E0CFAF;
  --mdf-ink: #2A1D19;
  --mdf-ink-2: #5E4B42;
  --mdf-wood: #6E4630;
  --mdf-wood-dark: #4A2A1E;
  --mdf-wood-light: #A3714F;
  --mdf-night: #2B1B16;

  --mdf-font-body: "Open Sans", "Segoe UI", Arial, sans-serif;
  --mdf-font-title: "Cardo", "David Libre", "Frank Ruhl Libre", Georgia, serif;
  --mdf-font-logo: "Bellefair", "Cardo", Georgia, serif;

  --mdf-radius: 6px;
  --mdf-shadow: 0 1px 0 rgba(74, 42, 30, .06), 0 14px 28px -18px rgba(74, 42, 30, .55);
  --mdf-plank: linear-gradient(180deg, var(--mdf-wood-light) 0 2px, #84553A 2px, var(--mdf-wood) 55%, var(--mdf-wood-dark));
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--mdf-paper);
  color: var(--mdf-ink);
  font-family: var(--mdf-font-body);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--mdf-oxblood); }
a:hover { color: var(--mdf-oxblood-deep); }
h1, h2, h3, h4 { font-family: var(--mdf-font-title); font-weight: 400; font-synthesis: none; line-height: 1.25; color: var(--mdf-ink); margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--mdf-oxblood-deep); outline-offset: 3px; border-radius: 2px; }
.mdf-main:focus { outline: none; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.mdf-skip {
  position: absolute; inset-inline-start: 16px; top: -100px; z-index: 100;
  background: var(--mdf-oxblood-deep); color: #FFF6E5; padding: .7rem 1.1rem; border-radius: var(--mdf-radius);
  font-weight: 700; text-decoration: none;
}
.mdf-skip:focus { top: 12px; color: #FFF6E5; outline-color: var(--mdf-gold); }

.mdf-container { width: 100%; max-width: 1220px; margin-inline: auto; padding-inline: 24px; }
.mdf-container--mid { max-width: 960px; }
.mdf-container--prose { max-width: 820px; }

.mdf-ico { flex: none; vertical-align: middle; }

/* ---------- Buttons, kickers, tags ---------- */
.mdf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .65rem 1.3rem; border-radius: 4px;
  font: 700 1rem/1.3 var(--mdf-font-body); text-decoration: none; cursor: pointer;
  border: 2px solid var(--mdf-oxblood); transition: background-color .2s, color .2s, transform .2s;
}
.mdf-btn--solid { background: var(--mdf-oxblood); color: #FFF6E5; }
.mdf-btn--solid:hover { background: var(--mdf-oxblood-deep); border-color: var(--mdf-oxblood-deep); color: #FFF6E5; }
.mdf-btn--ghost { background: transparent; color: var(--mdf-oxblood); }
.mdf-btn--ghost:hover { background: var(--mdf-oxblood); color: #FFF6E5; }

.mdf-kicker {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .82rem; font-weight: 700; letter-spacing: .04em; color: var(--mdf-oxblood);
}
.mdf-kicker::before { content: ""; inline-size: 22px; block-size: 3px; background: var(--mdf-gold-deep); border-radius: 2px; }

.mdf-tag {
  display: inline-block; padding: .2rem .8rem .25rem; border-radius: 2px;
  background: var(--sp-bg, var(--mdf-oxblood)); color: var(--sp-fg, #FFF6E5);
  font-size: .85rem; font-weight: 700; text-decoration: none;
  box-shadow: inset 0 3px 0 -1px var(--sp-band, var(--mdf-gold)), inset 0 -3px 0 -1px var(--sp-band, var(--mdf-gold));
}
.mdf-tag:hover { color: var(--sp-fg, #FFF6E5); filter: brightness(1.08); }

.mdf-more {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; text-decoration: none;
  min-height: 44px; color: var(--mdf-oxblood);
}
.mdf-more:hover { text-decoration: underline; text-decoration-color: var(--mdf-gold-deep); text-underline-offset: 4px; }

/* ---------- Header ---------- */
.mdf-header { position: relative; z-index: 20; background: var(--mdf-paper); }
.mdf-header__bar { display: flex; align-items: center; gap: 28px; min-height: 84px; }
.mdf-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--mdf-oxblood); flex: none; }
.mdf-brand .mdf-mark { width: 46px; height: 46px; }
.mdf-brand__text { display: flex; flex-direction: column; line-height: 1; }
.mdf-brand__name { font-family: var(--mdf-font-logo); font-size: 2.05rem; line-height: 1; color: var(--mdf-oxblood); white-space: nowrap; }
.mdf-brand__tag { font-size: .78rem; color: var(--mdf-ink-2); margin-top: 6px; white-space: nowrap; }
.mdf-brand:hover .mdf-brand__name { color: var(--mdf-oxblood-deep); }

.mdf-nav { margin-inline-start: auto; }
.mdf-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.mdf-nav__list a {
  display: flex; align-items: center; min-height: 44px; padding: 0 .7rem;
  color: var(--mdf-ink); text-decoration: none; font-weight: 600; font-size: .95rem; position: relative;
}
.mdf-nav__list a::after {
  content: ""; position: absolute; inset-inline: .7rem; bottom: 6px; height: 3px; border-radius: 2px;
  background: var(--mdf-gold-deep); transform: scaleX(0); transition: transform .2s;
}
.mdf-nav__list a:hover, .mdf-nav__list .current-menu-item > a, .mdf-nav__list .current-post-ancestor > a { color: var(--mdf-oxblood); }
.mdf-nav__list a:hover::after, .mdf-nav__list .current-menu-item > a::after, .mdf-nav__list .current-post-ancestor > a::after { transform: scaleX(1); }

.mdf-header__tools { display: flex; align-items: center; gap: 4px; }
.mdf-iconbtn {
  display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0;
  background: transparent; border: 0; border-radius: 50%; color: var(--mdf-oxblood); cursor: pointer;
}
.mdf-iconbtn:hover, .mdf-iconbtn[aria-expanded="true"] { background: var(--mdf-paper-2); }
.mdf-menu-toggle { display: none; }
.mdf-menu-toggle__close { display: none; }
.mdf-menu-toggle[aria-expanded="true"] .mdf-menu-toggle__open { display: none; }
.mdf-menu-toggle[aria-expanded="true"] .mdf-menu-toggle__close { display: inline; }

.mdf-header__edge { height: 12px; background: var(--mdf-plank); box-shadow: 0 8px 14px -8px rgba(74, 42, 30, .55); }

.mdf-searchpanel { background: var(--mdf-paper-2); border-top: 1px solid var(--mdf-line); padding-block: 18px; }
.mdf-searchpanel .mdf-searchform { max-width: 680px; margin-inline: auto; }

.mdf-searchform { display: flex; gap: 8px; }
.mdf-searchform__input {
  flex: 1; min-width: 0; min-height: 48px; padding: .6rem 1rem;
  font: inherit; color: var(--mdf-ink); background: var(--mdf-card);
  border: 2px solid #8C7056; border-radius: 4px;
}
.mdf-searchform__input::placeholder { color: #7A675D; }
.mdf-searchform__input:focus { outline: 3px solid var(--mdf-oxblood-deep); outline-offset: 1px; border-color: var(--mdf-oxblood); }

@media (max-width: 1179px) {
  .mdf-menu-toggle { display: inline-grid; }
  .mdf-header__tools { margin-inline-start: auto; }
  .mdf-nav {
    display: none; position: absolute; top: 100%; inset-inline: 0; margin: 0;
    background: var(--mdf-paper); border-top: 1px solid var(--mdf-line);
    box-shadow: 0 18px 30px -18px rgba(74, 42, 30, .6); padding: 8px 16px 18px;
  }
  .mdf-nav.is-open { display: block; }
  .mdf-nav__list { flex-direction: column; gap: 0; max-width: 1220px; margin-inline: auto; }
  .mdf-nav__list a { min-height: 50px; font-size: 1.05rem; border-bottom: 1px solid var(--mdf-line); padding-inline: 4px; }
  .mdf-nav__list a::after { display: none; }
}

/* ---------- Sections ---------- */
.mdf-main { display: block; }
.mdf-section { padding-block: 64px; }
.mdf-section--tight { padding-block: 36px; }
.mdf-section--paper { background: var(--mdf-paper-2); }
.mdf-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.mdf-section__title { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.35rem); margin-top: 6px; color: var(--mdf-oxblood-deep); }
.mdf-empty { font-size: 1.1rem; color: var(--mdf-ink-2); }

/* ---------- The bookshelf (category spines) ---------- */
.mdf-shelf { --row-h: 300px; --plank: 16px; position: relative; }
.mdf-shelf__row {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-end; height: calc(var(--row-h) + var(--plank));
}
.mdf-spine-wrap {
  flex: 1 1 0; min-width: 0; max-width: 66px; height: 100%;
  display: flex; align-items: flex-end;
  padding: 0 2px var(--plank);
}
.mdf-spine {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  width: 100%; height: var(--sp-h); padding: 22% 0 10px;
  color: var(--sp-fg); text-decoration: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(255, 255, 255, .10) 22%, rgba(255, 255, 255, 0) 48%, rgba(0, 0, 0, .08) 78%, rgba(0, 0, 0, .26)),
    var(--sp-bg);
  border-radius: 3px 3px 1px 1px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  transition: transform .22s ease, box-shadow .22s ease;
}
/* Head band + foot double rule on every spine. */
.mdf-spine::before, .mdf-spine::after { content: ""; position: absolute; inset-inline: 0; pointer-events: none; }
.mdf-spine::before { top: 9%; height: 5px; background: var(--sp-band); }
.mdf-spine::after { bottom: 46px; height: 8px; border-block: 2px solid var(--sp-band); opacity: .9; }
.mdf-spine--ribbed::before { box-shadow: 0 9px 0 -2px var(--sp-band); }
.mdf-spine__title {
  writing-mode: vertical-rl; font-family: var(--mdf-font-title); font-weight: 400; font-synthesis: none;
  font-size: 1.2rem; line-height: 1.05; letter-spacing: .02em; text-align: center;
  flex: 1 1 auto; min-height: 0; overflow: hidden; padding-block-end: 6px;
}
.mdf-spine__count {
  display: grid; place-items: center; min-width: 26px; height: 26px; padding-inline: 4px; border-radius: 50%;
  background: var(--sp-fg); color: var(--sp-bg); font-size: .8rem; font-weight: 800; line-height: 1;
}
.mdf-spine:hover { transform: translateY(-12px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 16px 18px -14px rgba(0, 0, 0, .5); color: var(--sp-fg); }
.mdf-spine:focus-visible { transform: translateY(-12px); outline-offset: 2px; }
.mdf-spine[aria-current="page"] { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--mdf-paper), 0 0 0 5px var(--mdf-oxblood-deep); }

/* The plank under the books, and one book leaning in at the end: room on the shelf. */
.mdf-shelf__plank {
  position: absolute; inset-inline: -14px; bottom: 0; height: var(--plank); border-radius: 2px;
  background: var(--mdf-plank); box-shadow: 0 12px 16px -10px rgba(74, 42, 30, .6);
}
.mdf-shelf__row::after {
  content: ""; flex: none; align-self: flex-end; width: 34px; height: calc(var(--row-h) * .78);
  margin: 0 38px var(--plank) 0; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .25), rgba(255, 255, 255, .08) 30%, rgba(0, 0, 0, .2)), var(--mdf-oxblood-soft);
  transform: rotate(11deg); transform-origin: bottom right;
  box-shadow: inset 0 22px 0 -16px var(--mdf-gold), inset 0 -40px 0 -36px var(--mdf-gold);
}
.mdf-shelf--compact { --row-h: 190px; --plank: 12px; margin-top: 22px; }
.mdf-shelf--compact .mdf-spine-wrap { max-width: 58px; }
.mdf-shelf--compact .mdf-spine { padding-top: 16%; }
.mdf-shelf--compact .mdf-spine::after { bottom: 40px; }
.mdf-shelf--compact .mdf-spine__title { font-size: .98rem; }
.mdf-shelf--compact .mdf-shelf__row::after { width: 26px; }

@media (max-width: 719px) {
  .mdf-shelf, .mdf-shelf--compact { --row-h: 210px; --plank: 13px; }
  .mdf-shelf__row { display: grid; grid-template-columns: repeat(5, 1fr); height: auto; row-gap: 26px; }
  .mdf-shelf__row::after { display: none; }
  .mdf-spine-wrap {
    max-width: none; height: calc(var(--row-h) + var(--plank)); padding-inline: 3px; margin-inline-end: -1px;
    background: var(--mdf-plank) bottom / 100% var(--plank) no-repeat;
  }
  .mdf-shelf--compact .mdf-spine-wrap { max-width: none; }
  .mdf-shelf__plank { display: none; }
  .mdf-spine__title { font-size: 1rem; }
}

/* ---------- Hero ---------- */
.mdf-hero {
  padding-block: 56px 40px;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(232, 192, 125, .28), transparent 55%),
    var(--mdf-paper);
}
.mdf-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: end; }
.mdf-hero__title { text-wrap: balance; font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.3rem); line-height: 1.12; margin-top: 14px; color: var(--mdf-oxblood-deep); }
.mdf-hero__sub { display: block; margin-top: 12px; font-size: .52em; line-height: 1.4; color: var(--mdf-ink); }
.mdf-hero__lead { margin-top: 18px; font-size: 1.12rem; color: var(--mdf-ink-2); max-width: 46ch; }
.mdf-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.mdf-hero__shelf { padding-inline: 14px; }
.mdf-hero__hint { margin-top: 26px; font-size: .85rem; color: var(--mdf-ink-2); text-align: center; }

@media (max-width: 959px) {
  .mdf-hero { padding-block: 32px 36px; }
  .mdf-hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .mdf-hero__shelf { padding-inline: 0; }
}

/* ---------- Cover cards ---------- */
.mdf-grid { display: grid; gap: 34px 26px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .mdf-grid--six, .mdf-grid--four { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .mdf-grid--six { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 34px 22px; }
  .mdf-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mdf-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mdf-card__link { display: block; }
.mdf-cover {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  background: var(--sp-bg, var(--mdf-oxblood));
  border-start-start-radius: 2px; border-end-start-radius: 2px;
  border-start-end-radius: 8px; border-end-end-radius: 8px;
  box-shadow: var(--mdf-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.mdf-cover img { width: 100%; height: 100%; object-fit: cover; }
/* Binding hinge on the spine side (the right edge of a Hebrew book). */
.mdf-cover::before {
  content: ""; position: absolute; inset-block: 0; right: 0; width: 16px; z-index: 1;
  background: linear-gradient(to left, rgba(0, 0, 0, .34), rgba(255, 255, 255, .22) 35%, rgba(0, 0, 0, .12) 55%, rgba(0, 0, 0, 0));
}
/* A thin gilt frame, as on a cloth cover. */
.mdf-cover::after {
  content: ""; position: absolute; inset: 10px 10px 10px 24px; z-index: 1;
  border: 1px solid rgba(255, 236, 196, .55); border-radius: 2px; pointer-events: none;
}
.mdf-cover__blank { display: grid; place-items: center; height: 100%; }
.mdf-card:hover .mdf-cover { transform: translateY(-5px); box-shadow: 0 1px 0 rgba(74, 42, 30, .06), 0 22px 30px -18px rgba(74, 42, 30, .7); }
.mdf-card__body { display: flex; flex-direction: column; gap: 6px; }
.mdf-card__shelf { font-size: .8rem; font-weight: 700; color: var(--mdf-oxblood); letter-spacing: .02em; }
.mdf-card__title { font-size: 1.24rem; line-height: 1.32; }
.mdf-card--small .mdf-card__title { font-size: 1.16rem; }
.mdf-card__title a { color: var(--mdf-ink); text-decoration: none; }
.mdf-card__title a:hover { color: var(--mdf-oxblood); text-decoration: underline; text-decoration-color: var(--mdf-gold-deep); text-underline-offset: 4px; }
.mdf-card__excerpt { font-size: .93rem; color: var(--mdf-ink-2); line-height: 1.6; }
.mdf-card__meta { font-size: .8rem; color: var(--mdf-ink-2); }
@media (max-width: 519px) {
  .mdf-grid { gap: 28px 16px; }
  .mdf-card__excerpt { display: none; }
  .mdf-card__title, .mdf-card--small .mdf-card__title { font-size: 1.02rem; }
  .mdf-cover::after { inset: 7px 7px 7px 18px; }
}

/* ---------- Prose ---------- */
.mdf-prose { font-size: 1.07rem; line-height: 1.85; max-width: 70ch; }
.mdf-prose > * + * { margin-top: 1.1em; }
.mdf-prose h2 {
  font-size: clamp(1.5rem, 1.25rem + .9vw, 1.9rem); color: var(--mdf-oxblood-deep);
  margin-top: 2em; padding-bottom: .35em; position: relative; scroll-margin-top: 24px;
}
.mdf-prose h2::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 56px; height: 3px; background: var(--mdf-gold-deep); border-radius: 2px; }
.mdf-prose h3 { font-size: 1.28rem; margin-top: 1.7em; }
.mdf-prose h4 { font-size: 1.1rem; margin-top: 1.4em; }
.mdf-prose h2 + *, .mdf-prose h3 + *, .mdf-prose h4 + * { margin-top: .6em; }
.mdf-prose a { color: var(--mdf-oxblood); text-decoration: underline; text-decoration-color: var(--mdf-gold-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.mdf-prose a:hover { color: var(--mdf-oxblood-deep); text-decoration-color: var(--mdf-oxblood); }
.mdf-prose ul, .mdf-prose ol { padding-inline-start: 1.4em; }
.mdf-prose li + li { margin-top: .45em; }
.mdf-prose li::marker { color: var(--mdf-oxblood); font-weight: 700; }
.mdf-prose li > strong:first-child { color: var(--mdf-oxblood-deep); }
.mdf-prose u { text-decoration-color: var(--mdf-gold-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.mdf-prose blockquote {
  margin-inline: 0; padding: .4em 1.2em; border-inline-start: 4px solid var(--mdf-gold-deep);
  font-family: var(--mdf-font-title); font-size: 1.15em; color: var(--mdf-oxblood-deep);
}
.mdf-prose img { border-radius: var(--mdf-radius); }
.mdf-prose hr { border: 0; height: 1px; background: var(--mdf-line); margin-block: 2em; }

/* Tables: a library card catalogue. */
.mdf-table { overflow-x: auto; border: 1px solid var(--mdf-line); border-radius: var(--mdf-radius); background: var(--mdf-card); }
.mdf-table:focus-visible { outline-offset: 2px; }
.mdf-prose table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.55; min-width: 520px; }
.mdf-prose th { background: var(--mdf-oxblood); color: #FFF6E5; text-align: start; padding: .75em 1em; font-weight: 700; }
.mdf-prose td { padding: .75em 1em; border-top: 1px solid var(--mdf-line); vertical-align: top; }
.mdf-prose tbody tr:nth-child(even) td { background: #FAF1E1; }
.mdf-prose td:first-child { font-weight: 700; color: var(--mdf-oxblood-deep); }

/* Shelf-talker: the little card that hangs from a bookshop shelf. */
.mdf-talker {
  position: relative; margin-block: 2em 1.6em; padding: 1.5em 1.3em 1.1em;
  background: var(--mdf-card); border: 1px solid var(--mdf-line); border-top: 0;
  border-radius: 0 0 var(--mdf-radius) var(--mdf-radius);
  box-shadow: 0 10px 22px -16px rgba(74, 42, 30, .5);
}
.mdf-talker::before { content: ""; position: absolute; inset-inline: -6px; top: -6px; height: 10px; border-radius: 2px; background: var(--mdf-plank); }
.mdf-talker__label {
  display: inline-block; margin: 0 0 .5em !important; padding: .1em .7em;
  background: var(--mdf-oxblood); color: #FFF6E5; font-size: .85rem; font-weight: 700;
  border-radius: 2px; transform: rotate(-1.5deg);
}
.mdf-talker p + p { margin-top: 0; }

.mdf-readalso { padding: 1em 1.2em; background: var(--mdf-paper-2); border-inline-start: 4px solid var(--mdf-oxblood); border-radius: 0 var(--mdf-radius) var(--mdf-radius) 0; }

/* ---------- Front page text + reader questions ---------- */
.mdf-prose--front { max-width: none; }
.mdf-prose--front > p:first-child { font-size: 1.2rem; line-height: 1.8; color: var(--mdf-ink); }
.mdf-asks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 26px; margin-top: 1.6em; }
.mdf-ask {
  position: relative; padding: 1.6em 1.3em 1.2em; background: var(--mdf-card);
  border: 1px solid var(--mdf-line); border-top: 0; border-radius: 0 0 var(--mdf-radius) var(--mdf-radius);
  box-shadow: 0 12px 24px -18px rgba(74, 42, 30, .55);
}
.mdf-ask::before { content: ""; position: absolute; inset-inline: -6px; top: -5px; height: 10px; border-radius: 2px; background: var(--mdf-plank); }
.mdf-ask::after {
  content: ""; position: absolute; top: -9px; inset-inline-start: 22px; width: 14px; height: 22px;
  background: var(--mdf-gold); border-radius: 2px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12);
}
.mdf-prose .mdf-ask h3 { margin-top: 0; font-size: 1.2rem; color: var(--mdf-oxblood-deep); }
.mdf-ask p { margin-top: .6em; font-size: 1rem; line-height: 1.75; }
@media (max-width: 719px) { .mdf-asks { grid-template-columns: 1fr; } }

/* ---------- Shelves directory ---------- */
.mdf-dir { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.mdf-dir__item {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; padding: 18px;
  background: var(--mdf-card); border: 1px solid var(--mdf-line); border-radius: var(--mdf-radius);
  border-inline-start: 10px solid var(--sp-bg); box-shadow: inset -2px 0 0 0 var(--sp-band);
}
.mdf-dir__thumb { aspect-ratio: 2 / 3; overflow: hidden; border-radius: 2px 6px 6px 2px; background: var(--sp-bg); box-shadow: var(--mdf-shadow); }
.mdf-dir__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mdf-dir__name { font-size: 1.35rem; }
.mdf-dir__name a { color: var(--mdf-oxblood-deep); text-decoration: none; }
.mdf-dir__name a:hover { text-decoration: underline; text-decoration-color: var(--mdf-gold-deep); text-underline-offset: 4px; }
.mdf-dir__count { font-size: .82rem; font-weight: 700; color: var(--mdf-ink-2); margin-top: 2px; }
.mdf-dir__lead { font-size: .93rem; color: var(--mdf-ink-2); margin-top: 8px; line-height: 1.6; }
.mdf-dir__recent { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px dashed var(--mdf-line); }
.mdf-dir__recent li { border-bottom: 1px dashed var(--mdf-line); }
.mdf-dir__recent a { display: flex; align-items: center; min-height: 40px; font-size: .93rem; font-weight: 600; color: var(--mdf-ink); text-decoration: none; }
.mdf-dir__recent a::before { content: ""; flex: none; width: 6px; height: 14px; margin-inline-end: 10px; background: var(--sp-bg); border-radius: 1px; }
.mdf-dir__recent a:hover { color: var(--mdf-oxblood); }
@media (max-width: 899px) { .mdf-dir { grid-template-columns: 1fr; } }
@media (max-width: 479px) { .mdf-dir__item { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 14px; } }

/* ---------- Writers / bookplates ---------- */
.mdf-avatar {
  display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--mdf-oxblood); color: var(--mdf-gold); font-family: var(--mdf-font-title); font-weight: 400; font-size: 1.05rem;
  box-shadow: 0 0 0 2px var(--mdf-paper), 0 0 0 3px var(--mdf-gold-deep);
}
.mdf-avatar--lg { width: 68px; height: 68px; font-size: 1.5rem; }
.mdf-writers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.mdf-plate {
  display: flex; gap: 20px; align-items: flex-start; padding: 26px;
  background: var(--mdf-card); border: 3px double var(--mdf-gold-deep); border-radius: 4px;
}
.mdf-plate__name { font-size: 1.4rem; color: var(--mdf-oxblood-deep); }
.mdf-plate__count { font-size: .82rem; font-weight: 700; color: var(--mdf-ink-2); margin-top: 4px; }
.mdf-plate__bio { margin-top: 10px; color: var(--mdf-ink); font-size: .97rem; }
@media (max-width: 799px) { .mdf-writers { grid-template-columns: 1fr; } .mdf-plate { padding: 20px; } }

/* ---------- Breadcrumbs, page heads ---------- */
.mdf-crumbs { font-size: .86rem; color: var(--mdf-ink-2); margin-bottom: 14px; }
.mdf-crumbs a { color: var(--mdf-ink-2); text-decoration: underline; text-decoration-color: var(--mdf-line); text-underline-offset: 3px; }
.mdf-crumbs a:hover { color: var(--mdf-oxblood); }

.mdf-page-head { padding-block: 44px 34px; border-bottom: 1px solid var(--mdf-line); }
.mdf-page-head__title { font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem); color: var(--mdf-oxblood-deep); margin-top: 8px; }
.mdf-page-head--narrow .mdf-page-head__title { margin-top: 0; }
.mdf-page-head__lead { margin-top: 12px; font-size: 1.08rem; color: var(--mdf-ink-2); max-width: 60ch; }
.mdf-page-head__search { margin-top: 22px; max-width: 640px; }
.mdf-page__body { padding-block: 40px 72px; }
.mdf-pagelist { list-style: none; padding: 0; margin: 36px 0 0; border-top: 1px solid var(--mdf-line); }
.mdf-pagelist a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--mdf-line); font-weight: 600; }

/* Archive head: the shelf's own spine, pulled forward. */
.mdf-archive-head { padding-block: 40px; border-bottom: 1px solid var(--mdf-line); background: radial-gradient(ellipse at 10% 0%, rgba(232, 192, 125, .22), transparent 60%), var(--mdf-paper); }
.mdf-archive-head__inner { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 32px; align-items: stretch; }
.mdf-archive-head__spine {
  position: relative; min-height: 240px; display: grid; place-items: center; padding-block: 34px;
  border-radius: 4px 4px 2px 2px; color: var(--sp-fg); box-shadow: var(--mdf-shadow);
  background: linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(255, 255, 255, .1) 22%, rgba(255, 255, 255, 0) 48%, rgba(0, 0, 0, .26)), var(--sp-bg);
}
.mdf-archive-head__spine::before, .mdf-archive-head__spine::after { content: ""; position: absolute; inset-inline: 0; height: 9px; border-block: 2px solid var(--sp-band); }
.mdf-archive-head__spine::before { top: 14px; }
.mdf-archive-head__spine::after { bottom: 14px; }
.mdf-archive-head__spine span { writing-mode: vertical-rl; font-family: var(--mdf-font-title); font-weight: 400; font-synthesis: none; font-size: 1.3rem; }
.mdf-archive-head__title { font-size: clamp(2.1rem, 1.5rem + 2vw, 3rem); color: var(--mdf-oxblood-deep); margin-top: 8px; }
.mdf-archive-head__lead { margin-top: 14px; font-size: 1.1rem; line-height: 1.8; max-width: 68ch; }
@media (max-width: 639px) {
  .mdf-archive-head { border-top: 10px solid var(--sp-bg, var(--mdf-oxblood)); }
  .mdf-archive-head__inner { grid-template-columns: 1fr; }
  .mdf-archive-head__spine { display: none; }
}

/* Pagination */
.mdf-pagination { margin-top: 48px; }
.mdf-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mdf-pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 46px; min-height: 46px; padding-inline: 12px;
  border: 1px solid var(--mdf-line); border-radius: 4px; background: var(--mdf-card);
  color: var(--mdf-ink); text-decoration: none; font-weight: 700;
}
.mdf-pagination .page-numbers.current { background: var(--mdf-oxblood); border-color: var(--mdf-oxblood); color: #FFF6E5; }
.mdf-pagination a.page-numbers:hover { border-color: var(--mdf-oxblood); color: var(--mdf-oxblood); }

/* ---------- Single ---------- */
.mdf-article__head { padding-block: 40px 30px; }
.mdf-article__title { font-size: clamp(2rem, 1.35rem + 2.4vw, 3.05rem); line-height: 1.15; margin-top: 16px; color: var(--mdf-oxblood-deep); }
.mdf-article__lead { margin-top: 14px; font-size: 1.18rem; color: var(--mdf-ink-2); }
.mdf-byline { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.mdf-byline__text { display: flex; flex-direction: column; gap: 2px; }
.mdf-byline__name { font-weight: 700; color: var(--mdf-ink); }
.mdf-byline__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; color: var(--mdf-ink-2); }
.mdf-byline__meta > span { display: inline-flex; align-items: center; gap: 5px; }

.mdf-article__media { margin-block: 0 8px; }
.mdf-article__media img {
  width: 100%; height: auto; max-height: 620px; object-fit: cover; border-radius: 4px;
  box-shadow: 0 0 0 8px var(--mdf-card), 0 0 0 9px var(--mdf-line), 0 24px 36px -26px rgba(74, 42, 30, .7);
}

.mdf-article__layout { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 40px; padding-block: 44px 64px; }
.mdf-article__layout.has-toc { grid-template-columns: 260px minmax(0, 1fr); justify-items: stretch; max-width: 1140px; }
.mdf-article__main { min-width: 0; max-width: 72ch; width: 100%; }
.mdf-article__layout.has-toc .mdf-article__main { justify-self: start; }

.mdf-toc { position: relative; }
.mdf-toc__box {
  position: sticky; top: 24px; padding: 18px 18px 14px; background: var(--mdf-card);
  border: 1px solid var(--mdf-line); border-radius: var(--mdf-radius);
}
.mdf-toc__box::before {
  /* Ribbon bookmark hanging from the top edge. */
  content: ""; position: absolute; top: -1px; inset-inline-end: 18px; width: 16px; height: 34px;
  background: var(--mdf-oxblood); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.mdf-toc summary { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 700; color: var(--mdf-oxblood-deep); cursor: pointer; list-style: none; }
.mdf-toc summary::-webkit-details-marker { display: none; }
.mdf-toc ol { margin: 8px 0 0; padding: 0; list-style: none; counter-reset: toc; }
.mdf-toc li { counter-increment: toc; border-top: 1px dashed var(--mdf-line); }
.mdf-toc a {
  display: flex; gap: 8px; padding: 8px 0; min-height: 40px; align-items: baseline;
  font-size: .9rem; line-height: 1.45; color: var(--mdf-ink); text-decoration: none;
}
.mdf-toc a::before { content: counter(toc) "."; flex: none; font-weight: 700; color: var(--mdf-oxblood); }
.mdf-toc a:hover, .mdf-toc a.is-current { color: var(--mdf-oxblood); }
.mdf-toc a.is-current { font-weight: 700; }

@media (max-width: 1023px) {
  .mdf-article__layout.has-toc { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .mdf-toc { width: 100%; max-width: 72ch; }
  .mdf-toc__box { position: static; }
}

.mdf-endnote {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 2.6em; padding: 1.1em 1.2em;
  background: var(--mdf-paper-2); border-top: 3px double var(--mdf-gold-deep); border-radius: 0 0 4px 4px;
  font-size: .95rem; line-height: 1.7; color: var(--mdf-ink);
}
.mdf-endnote .mdf-ico { color: var(--mdf-oxblood); margin-top: 3px; }

.mdf-bookplate {
  margin-top: 36px; padding: 28px 26px; text-align: center;
  background: var(--mdf-card); border: 3px double var(--mdf-gold-deep); border-radius: 4px;
  outline: 1px solid var(--mdf-line); outline-offset: 5px;
}
.mdf-bookplate__label { font-family: var(--mdf-font-logo); font-size: 1.15rem; color: var(--mdf-oxblood); margin-bottom: 12px; letter-spacing: .03em; }
.mdf-bookplate__name { font-size: 1.45rem; margin-top: 12px; color: var(--mdf-oxblood-deep); }
.mdf-bookplate__bio { margin-top: 10px; max-width: 58ch; margin-inline: auto; font-size: .97rem; color: var(--mdf-ink); }

/* ---------- Contact form (ADX plugin) ---------- */
.mdf .adxc {
  --adxc-accent: var(--mdf-oxblood); --adxc-input-bg: var(--mdf-card); --adxc-input-fg: var(--mdf-ink);
  --adxc-border: #8C7056; --adxc-btn-fg: #FFF6E5; --adxc-radius: 6px; --adxc-bg: var(--mdf-card);
}
.mdf .adxc .adxc-form { box-shadow: var(--mdf-shadow); border-top: 6px solid var(--mdf-oxblood); }
.mdf .adxc .adxc-field label { font-size: .95rem; }
.mdf .adxc .adxc-field input:focus, .mdf .adxc .adxc-field textarea:focus { outline: 3px solid var(--mdf-oxblood-deep); outline-offset: 1px; }
.mdf .adxc .adxc-submit { min-height: 46px; }
.mdf .adxc .adxc-submit:focus-visible { outline: 3px solid var(--mdf-oxblood-deep); outline-offset: 3px; }
.mdf .adxc.adxc-state-ok .adxc-msg { color: #2D6A3E; }
.mdf .adxc.adxc-state-err .adxc-msg { color: #A3222F; }

/* ---------- Footer ---------- */
.mdf-footer { background: var(--mdf-night); color: #EADBC0; margin-top: 0; }
.mdf-footer::before { content: ""; display: block; height: 14px; background: var(--mdf-plank); }
.mdf-footer__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; padding-block: 52px 40px; }
.mdf-brand--footer .mdf-brand__name { color: #F6E3BE; font-size: 2rem; }
.mdf-brand--footer:hover .mdf-brand__name { color: #FFFFFF; }
.mdf-footer .mdf-mark rect:first-child { fill: var(--mdf-gold-deep); }
.mdf-footer__tagline { margin-top: 14px; font-size: .95rem; color: #EADBC0; }
.mdf-footer__note { margin-top: 12px; font-size: .85rem; line-height: 1.65; color: #CDB99A; max-width: 52ch; }
.mdf-footer__title { font-family: var(--mdf-font-title); font-size: 1.15rem; color: var(--mdf-gold); margin-bottom: 10px; }
.mdf-footer__list { list-style: none; margin: 0; padding: 0; }
.mdf-footer__list--2col { columns: 2; column-gap: 24px; }
.mdf-footer__list li { break-inside: avoid; }
.mdf-footer__list a { display: flex; align-items: center; min-height: 40px; color: #F3E3C3; text-decoration: none; font-size: .95rem; }
.mdf-footer__list a:hover { color: #FFFFFF; text-decoration: underline; text-decoration-color: var(--mdf-gold); text-underline-offset: 4px; }
.mdf-footer :focus-visible { outline-color: var(--mdf-gold); }
.mdf-footer__base { border-top: 1px solid rgba(234, 219, 192, .16); padding-block: 16px; font-size: .85rem; color: #CDB99A; }
@media (max-width: 899px) {
  .mdf-footer__grid { grid-template-columns: 1fr 1fr; }
  .mdf-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 519px) {
  .mdf-footer__grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Small screens ---------- */
@media (max-width: 639px) {
  .mdf-container { padding-inline: 16px; }
  .mdf-header__bar { min-height: 70px; gap: 10px; }
  .mdf-brand .mdf-mark { width: 40px; height: 40px; }
  .mdf-brand__name { font-size: 1.75rem; }
  .mdf-brand__tag { display: none; }
  .mdf-section { padding-block: 44px; }
  .mdf-prose { font-size: 1.03rem; }
  .mdf-article__media img { box-shadow: 0 0 0 5px var(--mdf-card), 0 0 0 6px var(--mdf-line); }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .mdf-spine:hover, .mdf-spine:focus-visible, .mdf-card:hover .mdf-cover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .mdf-header, .mdf-footer, .mdf-toc, .mdf-section--paper, .mdf-skip { display: none !important; }
  body { background: #fff; }
}
