/* yekod.co.il. Light by default, dark via data-theme or the OS setting. No animation. */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --paper: #F7F3EC;
  --text: #111111;
  --muted: #5F5A54;
  --line: #E3DFD8;
  --accent: #B42318;
  --accent-dark: #8E1B12;
  --on-accent: #FFFFFF;
  --font-ui: "Assistant", system-ui, "Segoe UI", Arial, sans-serif;
  --font-serif: "Frank Ruhl Libre", "David", "Times New Roman", serif;
  --gutter: 16px;
  --space: 36px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #15110E;
  --surface: #1D1813;
  --paper: #1D1813;
  --text: #F3ECE4;
  --muted: #B9AEA3;
  --line: #6B5D52;
  --accent: #F28C4A;
  --accent-dark: #F7A56F;
  --on-accent: #15110E;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #15110E;
    --surface: #1D1813;
    --paper: #1D1813;
    --text: #F3ECE4;
    --muted: #B9AEA3;
    --line: #6B5D52;
    --accent: #F28C4A;
    --accent-dark: #F7A56F;
    --on-accent: #15110E;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--accent-dark); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 76rem; margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: var(--gutter); top: 8px; background: var(--surface); color: var(--text); padding: 4px 10px; z-index: 20; }

/* header + footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding-block: 12px; }
.brand { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; color: var(--text); text-decoration: none; line-height: 1.2; }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-header nav { flex: 1; }
.site-header nav a, .site-footer nav a { color: var(--text); text-decoration: none; padding-block: 6px; }
.site-header nav a:hover, .site-footer nav a:hover { color: var(--accent); text-decoration: underline; }
.theme-toggle { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); font-size: 1.25rem; line-height: 1; cursor: pointer; font-family: inherit; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.site-footer { margin-top: 64px; padding-block: 32px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.95rem; }
.site-footer p { margin: 0 0 8px; }
.foot-brand { font-family: var(--font-serif); font-size: 1.3rem; color: var(--text); }

main { padding-block: 24px 0; min-height: 60vh; }

/* type */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; line-height: 1.3; margin: 0 0 12px; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--muted); }
.meta, .en { color: var(--muted); font-size: 0.92rem; }
.en { margin: -6px 0 8px; }
.more-link { margin-top: 16px; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }

.section { margin-top: var(--space); }
.page-head { margin-bottom: 16px; }
.facts { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 20px; color: var(--muted); font-size: 0.95rem; }

.prose { max-width: 42rem; }
.prose h2 { margin-top: 32px; }
.prose p { margin-bottom: 1.1em; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding-block: 6px; border-bottom: 1px solid var(--line); }

.btn { display: inline-block; background: var(--accent); color: var(--on-accent); padding: 10px 22px; border-radius: 4px; text-decoration: none; font-weight: 600; }
.btn:hover, .btn:focus-visible { background: var(--accent-dark); color: var(--on-accent); }
.credit-line { display: block; color: var(--muted); font-size: 0.92rem; margin-bottom: 12px; }
.credit-line a { color: var(--accent); }

/* cards */
.cards, .strip, .poem-cards, .poet-cards { display: grid; gap: 32px 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.strip { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
.card { margin: 0; }
.card-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
figcaption { font-size: 0.9rem; line-height: 1.5; padding-top: 8px; color: var(--muted); }
figcaption .name, figcaption .t { display: block; font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700; color: var(--text); text-decoration: none; }
figcaption .name:hover { color: var(--accent); text-decoration: underline; }
figcaption .cap, figcaption .meta { display: block; }
figcaption .more, figcaption .src { display: inline-block; margin-top: 4px; font-size: 0.88rem; }
.credit { display: none; font-size: 0.85rem; margin-top: 2px; }

/* masonry (home featured + artist gallery) */
.masonry { columns: 2; column-gap: 20px; }
.masonry figure { margin: 0 0 28px; break-inside: avoid; }
.masonry img { width: 100%; height: auto; background: var(--paper); }
.card-link, .lb { display: block; background: var(--paper); }
.lb { cursor: zoom-in; }

/* poem + poet cards */
.poem-card { display: flex; flex-direction: column; gap: 6px; background: var(--paper); color: var(--text); padding: 24px; text-decoration: none; height: 100%; }
.poem-card:hover .t, .poem-card:focus-visible .t { color: var(--accent); text-decoration: underline; }
.poem-card .excerpt { font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.7; }
.poem-card .t { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; margin-top: 8px; }
.poet-card .t { margin-top: 0; font-size: 1.3rem; }
.poet-group h2 { margin-bottom: 8px; }
.poem-cards { margin-top: 16px; }

/* home */
.home { padding-top: 0; }
.home-hero { position: relative; width: 100vw; margin-inline: calc(50% - 50vw); height: min(78vh, 720px); background: #15110E; overflow: hidden; }
.home-hero img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 35%; }
.hero-text { position: absolute; inset-inline: 0; bottom: 0; padding: 120px 0 32px; background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0) 100%); color: #FFFFFF; }
.hero-text h1 { font-size: 2.6rem; color: #FFFFFF; margin-bottom: 4px; }
.hero-line { font-size: 1.25rem; margin: 0 0 8px; color: #FFFFFF; }
.hero-work-line { font-size: 0.95rem; margin: 0; }
.hero-work-line a { color: #FFFFFF; }
.about-strip { max-width: 42rem; }

/* artist + work */
.artist-lead { margin: 0 0 24px; background: var(--paper); }
.artist-lead img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.artist-lead figcaption { padding: 8px var(--gutter); }
.artist-lead figcaption .t { display: inline; font-size: 1.1rem; }

.hero-work { margin: 0 0 16px; background: var(--paper); }
.hero-work img { width: auto; max-width: 100%; max-height: 80vh; margin-inline: auto; }
.hero-work figcaption { text-align: center; padding: 8px var(--gutter) 12px; }
.hero-work figcaption .credit-line { margin: 4px 0 0; }
.work-actions { margin-bottom: 24px; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 4px 20px; max-width: 42rem; margin: 0 0 24px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* poems */
.poem-page { max-width: 38rem; margin-inline: auto; }
.poem-page h1 { font-size: 2.1rem; }
.intro { color: var(--muted); max-width: 38rem; }
.poem { font-family: var(--font-serif); font-size: 1.4rem; line-height: 1.9; margin: 32px 0; padding: 20px; background: var(--paper); }
.poem p { margin: 0 0 1.4em; }
.poem p:last-child { margin-bottom: 0; }
.source { color: var(--muted); font-size: 0.92rem; }

/* lightbox */
.lbx { position: fixed; inset: 0; z-index: 50; background: rgba(20, 18, 15, 0.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 12px 12px; color: #eee; }
.lbx img { max-width: 100%; max-height: calc(100vh - 170px); width: auto; height: auto; object-fit: contain; }
.lbx figcaption { color: #ddd; text-align: center; max-width: 40rem; padding-top: 12px; font-size: 0.95rem; }
.lbx figcaption .t { color: #fff; font-size: 1.1rem; }
.lbx .credit { display: block; color: #ddd; }
.lbx .src { display: none; }
.lbx a { color: #f0c896; }
.lbx button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.2rem; line-height: 1; padding: 10px 16px; cursor: pointer; font-family: inherit; }
.lbx .x { top: 4px; inset-inline-start: 4px; }
.lbx .nx, .lbx .pv { top: 50%; transform: translateY(-50%); }
.lbx .pv { inset-inline-start: 0; }
.lbx .nx { inset-inline-end: 0; }
body.lbx-open { overflow: hidden; }

@media (min-width: 560px) {
  .strip { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 600px) {
  body { font-size: 17px; }
  h1 { font-size: 2.6rem; }
  .poem-page h1 { font-size: 2.6rem; }
  .poem { padding: 32px; }
}

@media (min-width: 900px) {
  :root { --space: 56px; }
  .cards, .poem-cards, .poet-cards { grid-template-columns: repeat(3, 1fr); }
  .masonry { columns: 3; }
  .hero-text h1 { font-size: 3.4rem; }
}

@media (min-width: 560px) and (max-width: 899px) {
  .masonry { columns: 2; }
}

@media (max-width: 559px) {
  .masonry { columns: 1; }
  .cards, .poem-cards, .poet-cards { grid-template-columns: 1fr; }
  .bar .brand { flex: 1; }
  .site-header nav { order: 3; flex: 0 0 100%; }
  .home-hero { height: min(78vh, 560px); }
  .details { grid-template-columns: 1fr; }
  .details dt { margin-top: 8px; }
}
