/* keseftov.amsterdamski.com — print-magazine plates.
   Palette (all text pairs verified ≥4.5:1):
     paper #F6EFE0 · ink #2B2620 · ink-soft #5A5044 (6.9:1 on paper)
     ochre #E5AC4C (ink 7.4:1) · sky #B8E5FA (ink 11.2:1, from the final teen cover)
     green #1F6B54 (paper 5.6:1) · brick #A64B45 (paper 4.9:1)
   Frank Ruhl Libre 400/700/900 — display + body.
   David Libre 400/500 — taglines, subtitles, quotes, captions, stamps. */

@font-face {
  font-family: "Frank Ruhl Libre";
  src: url("./fonts/frank-ruhl-libre-hebrew-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Frank Ruhl Libre";
  src: url("./fonts/frank-ruhl-libre-hebrew-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Frank Ruhl Libre";
  src: url("./fonts/frank-ruhl-libre-hebrew-900-normal.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "David Libre";
  src: url("./fonts/david-libre-hebrew-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "David Libre";
  src: url("./fonts/david-libre-hebrew-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #f6efe0;
  --ink: #2b2620;
  --ink-soft: #5a5044;
  --ochre: #e5ac4c;
  --sky: #b8e5fa;
  --green: #1f6b54;
  --brick: #a64b45;
  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --accent-face: "David Libre", "Frank Ruhl Libre", serif;
  --hairline: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  --frame: 0.5rem; /* the ink board showing between plates */
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

[hidden] {
  /* author display values below must never defeat the hidden attribute */
  display: none !important;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.75;
  text-align: start;
}

img {
  max-inline-size: 100%;
  block-size: auto;
  display: block;
}

/* ---- plates: each region is a color plate mounted on the ink board ---- */

.hero,
.book {
  margin: var(--frame);
}

.hero {
  background: var(--ochre);
  box-sizing: border-box;
  min-block-size: calc(100svh - 2 * var(--frame));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-block: 2rem;
  padding-inline: 1.25rem;
  text-align: center;
}

.masthead {
  margin: 0 0 1.25rem;
  font-family: var(--accent-face);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding-block: 0.4rem;
  border-block-start: var(--hairline);
  border-block-end: var(--hairline);
}

.hero h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(3.25rem, 10vw, 5.75rem);
  line-height: 1.05;
}

.tagline {
  margin-block: 0.75rem 2.25rem;
  font-family: var(--accent-face);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  max-inline-size: 34rem;
  text-wrap: balance;
}

.hero-covers {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 3rem);
  flex-wrap: wrap;
}

.hero-cover {
  margin: 0;
  position: relative;
  inline-size: min(15rem, 42vw, 34svh);
}

.hero-cover a {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-cover a img {
    transition: translate 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.hero-cover a:hover img,
.hero-cover a:focus-visible img {
  translate: 0 -0.35rem;
  box-shadow: 0.5rem 0.9rem 1.6rem rgb(43 38 32 / 0.36);
}

/* paper mat + hairline: the print-mounted frame */
.hero-cover img,
.book-cover img {
  border: 0.5rem solid var(--paper);
  outline: 1px solid var(--ink);
  box-shadow: 0.35rem 0.5rem 1.1rem rgb(43 38 32 / 0.28);
}

/* ---- share ---- */

.share {
  margin-block-start: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--accent-face);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding-block: 0.45rem;
  padding-inline: 1rem;
  cursor: pointer;
}

.share:hover {
  background: var(--ink);
  color: var(--ochre);
}

/* ---- stamps (בקרוב / award / copies) ---- */

.badge-soon,
.badge-award,
.badge-copies {
  position: absolute;
  z-index: 1;
  font-family: var(--accent-face);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.3;
  padding-block: 0.3rem;
  padding-inline: 0.7rem;
  border-radius: 2px;
  box-shadow: 2px 3px 8px rgb(43 38 32 / 0.3);
  white-space: nowrap;
}

.badge-soon {
  inset-block-start: -0.7rem;
  inset-inline-start: -0.7rem;
  rotate: 4deg;
  background: var(--green);
  color: var(--paper);
}

.badge-award {
  inset-block-start: -0.7rem;
  inset-inline-start: -0.7rem;
  rotate: -4deg;
  background: var(--brick);
  color: var(--paper);
}

.badge-copies {
  inset-block-end: -0.7rem;
  inset-inline-end: -0.7rem;
  rotate: 3deg;
  background: var(--ink);
  color: var(--paper);
}

/* ---- book plates ---- */

.book {
  padding-block: clamp(3rem, 8vw, 5.5rem);
  padding-inline: 1.25rem;
}

.book-beginners {
  background: var(--sky);
}

.book-original {
  background: var(--brick);
  color: var(--paper);
}

.book-inner {
  max-inline-size: 62rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.book-cover {
  margin: 0;
  inline-size: 100%;
  max-inline-size: 17rem;
  position: sticky;
  inset-block-start: 2rem;
}

.book-text h2 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.1;
}

.book-subtitle {
  margin-block: 0.5rem 1.75rem;
  padding-block-end: 1.1rem;
  border-block-end: var(--hairline);
  font-family: var(--accent-face);
  font-size: 1.05rem;
}

.book-text > p {
  max-inline-size: 34rem;
}

.book-text h3 {
  margin-block: 2.25rem 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.book-text ul {
  margin: 0;
  padding-inline-start: 1.2rem;
  max-inline-size: 34rem;
}

.book-text li {
  margin-block: 0.35rem;
}

.book-text li::marker {
  content: "- ";
  font-family: var(--accent-face);
}

/* ---- pull quotes (2022 plate) ---- */

.quotes {
  margin-block: 2.5rem;
  max-inline-size: 34rem;
}

.quotes blockquote {
  margin: 0;
  padding-block: 1.4rem 1.1rem;
  border-block-start: var(--hairline);
  text-align: center;
}

.quotes blockquote:last-child {
  border-block-end: var(--hairline);
}

.quotes p {
  margin: 0;
  font-family: var(--accent-face);
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  line-height: 1.45;
}

.quotes footer {
  margin-block-start: 0.4rem;
  font-family: var(--accent-face);
  font-size: 0.95rem;
}

/* ---- prologue: a paper page laid on the plate ---- */

.excerpt {
  margin-block: 2.5rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  /* 34rem: the card's outer edges line up with the text column and quotes */
  max-inline-size: 34rem;
  box-shadow: 0.35rem 0.5rem 1.1rem rgb(43 38 32 / 0.28);
}

.excerpt h3.excerpt-title {
  margin: 0 0 1.4rem;
  padding-block-end: 0.9rem;
  border-block-end: var(--hairline);
  font-family: var(--accent-face);
  font-weight: 500;
  font-size: 1.1rem;
  text-align: center;
}

.excerpt p {
  margin-block: 0 1em;
  max-inline-size: 34rem;
}

.excerpt-more {
  display: block;
}

.excerpt-more[open] {
  display: flex;
  flex-direction: column;
}

.excerpt-more summary {
  cursor: pointer;
  list-style: none;
  text-align: center;
  font-family: var(--accent-face);
  font-weight: 500;
  color: var(--green);
  padding-block: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* rule — label — rule */
.excerpt-more summary::before,
.excerpt-more summary::after {
  content: "";
  flex: 1;
  border-block-start: var(--hairline);
}

.excerpt-more summary::-webkit-details-marker {
  display: none;
}

.excerpt-more[open] summary {
  order: 99;
}

.summary-less {
  display: none;
}

.excerpt-more[open] .summary-more {
  display: none;
}

.excerpt-more[open] .summary-less {
  display: inline;
}

/* ---- actions ---- */

.book-actions {
  margin-block: 2.25rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  padding-block: 0.7rem;
  padding-inline: 1.6rem;
  border-radius: 2px;
  display: inline-block;
}

.book-beginners .cta-buy,
.book-beginners .cta-sample {
  color: var(--ink);
  border: 2px solid var(--ink);
}

.book-beginners .cta-buy:hover,
.book-beginners .cta-sample:hover {
  background: var(--ink);
  color: var(--sky);
}

.book-original .cta-buy,
.book-original .cta-sample {
  color: var(--paper);
  border: 2px solid var(--paper);
}

.book-original .cta-buy:hover,
.book-original .cta-sample:hover {
  background: var(--paper);
  color: var(--brick);
}

.cta-soon {
  /* dashed border alone signals dormancy; opacity would sink paper-on-brick
     below the 4.5:1 floor */
  border: 2px dashed currentColor;
  cursor: default;
}

/* ---- coupon: a paper ticket ---- */

.coupon {
  margin-block-start: 1.5rem;
  background: var(--paper);
  color: var(--ink);
  border: 2px dashed var(--ink);
  border-radius: 2px;
  padding-block: 0.8rem;
  padding-inline: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  max-inline-size: 34rem;
}

.coupon-code {
  unicode-bidi: isolate;
  font-weight: 700;
}

.coupon-copy {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  padding-block: 0.45rem;
  padding-inline: 1.1rem;
  cursor: pointer;
}

.coupon-copy:hover {
  background: var(--green);
}

/* ---- footer ---- */

/* body > footer only — a bare footer selector also catches blockquote
   attributions, a bug this page has already had once */
body > footer {
  padding-block: 2.5rem;
  padding-inline: 1.25rem;
  text-align: center;
}

body > footer a {
  color: var(--paper);
  font-family: var(--accent-face);
  font-size: 1rem;
  text-decoration: none;
  border-block-end: var(--hairline);
  padding-block-end: 0.2rem;
}

body > footer a:hover {
  color: var(--ochre);
}

/* ---- focus ---- */

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* ---- the one authored moment: the hero settles like a laid-down spread ---- */

@media (prefers-reduced-motion: no-preference) {
  .masthead,
  .hero h1,
  .tagline {
    animation: settle 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }

  .hero-cover {
    animation: settle 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }

  .hero h1 { animation-delay: 0.05s; }
  .tagline { animation-delay: 0.12s; }
  .hero-cover:first-child { animation-delay: 0.2s; }
  .hero-cover:last-child { animation-delay: 0.28s; }

  @keyframes settle {
    from {
      opacity: 0;
      translate: 0 0.9rem;
    }
  }
}

/* ---- narrow screens ---- */

@media (max-width: 45rem) {
  /* both covers must share the opener screen: tighter gap, narrower covers */
  .hero-covers {
    gap: 1rem;
  }

  .hero-cover {
    inline-size: min(15rem, 40vw, 34svh);
  }

  .book-inner {
    grid-template-columns: 1fr;
  }

  .book-cover {
    /* relative, not static: the stamps must keep positioning against the
       cover, and sticky is pointless in a one-column layout */
    position: relative;
    inset-block-start: 0;
    margin-inline: auto;
    max-inline-size: min(15rem, 60vw);
  }

  .book-text h2,
  .book-subtitle {
    text-align: center;
  }

  .book-subtitle {
    border-block-end: none;
    padding-block-end: 0;
  }

  .book-actions {
    justify-content: center;
  }
}
