/* Interim design for review, pending the Claude Design directions.
   Layout: one quiet reading column, like a university press author page;
   the green accent is taken from the maple leaves in Kay's portrait. */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("../fonts/amiri-arabic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-opsz-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #fcfbf8;
  --ink: #1d1f1c;
  --muted: #565b54;
  --rule: #dcdcd3;
  --accent: #2e5a3c;
  --accent-strong: #1f4029;
  --field: #ffffff;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 38rem;
  --step--1: 0.95rem;
  --step-0: 1.1875rem;
  --step-1: 1.4rem;
  --step-2: 1.9rem;
  --step-3: clamp(2.2rem, 6vw, 3rem);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 16px; top: 16px; background: var(--paper); padding: 0.5rem 0.75rem; z-index: 1; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-block: 1.25rem;
}
.site-name { margin: 0; font-size: var(--step-0); font-weight: 600; letter-spacing: 0.01em; }
.site-name a { color: var(--ink); text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: var(--step--1); }
.site-nav a { color: var(--muted); text-decoration: none; padding-block: 0.25rem; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }

main { padding-block: 3rem 4rem; }

.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--step--1); }
.site-footer .wrap { padding-block: 1.5rem 2.5rem; }
.site-footer p { margin: 0; }

/* Type */
h1, h2 { font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
h2 { font-size: var(--step-1); }
p { margin: 0; }
.prose { display: grid; gap: 1.1rem; }
.label {
  font-size: var(--step--1); color: var(--muted);
  font-variant-caps: all-small-caps; letter-spacing: 0.08em;
}

/* Home: name across the top, then portrait and intro side by side.
   The intro is set so its height roughly matches the portrait's. */
.intro { display: grid; gap: 1.75rem; }
.intro-head { display: grid; gap: 0.5rem; }
.intro-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.portrait { display: block; width: 100%; max-width: 16rem; height: auto; border-radius: 2px; }
.lede { font-size: var(--step-0); line-height: 1.6; min-width: 0; }
@media (min-width: 44rem) {
  .intro-body { grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; }
  .portrait { max-width: 100%; }
  /* Pull the first line up so its cap height sits level with the top of the photo. */
  .lede { margin-top: -0.4em; }
}

.pull {
  margin: 3rem 0; padding: 0;
  font-style: italic; font-size: var(--step-2); line-height: 1.3; text-wrap: balance;
  color: var(--accent-strong);
}
.pull { max-width: 14em; }
.pull blockquote { margin: 0; }
.pull p::before { content: "\201C"; }
.pull p::after { content: "\201D"; }
.pull figcaption {
  margin-top: 0.75rem; text-align: end; font-style: normal; font-size: var(--step--1); line-height: 1.5; color: var(--muted);
}
.pull figcaption::before { content: "\2014\2009"; }

.about { display: grid; gap: 1.25rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); }
.more { margin-top: 2.5rem; }

/* Translations */
.page-head { display: grid; gap: 0.75rem; margin-bottom: 2.5rem; }
.page-head p { color: var(--muted); }
.books { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.book {
  display: flex; gap: 1.25rem; align-items: flex-start;
  padding-block: 1.5rem; border-top: 1px solid var(--rule);
}
.book:last-child { border-bottom: 1px solid var(--rule); }
.book-cover { width: 6.5rem; height: auto; flex: none; box-shadow: 0 1px 3px rgb(0 0 0 / 0.15); }
.book-text { display: grid; gap: 0.2rem; min-width: 0; }
.book-title { font-size: var(--step-1); line-height: 1.3; }
.book-title cite { font-style: italic; }
.book-title a { text-decoration: none; }
.book-title a:hover { text-decoration: underline; }
.book-author { }
.book-original {
  justify-self: start; color: var(--muted); font-size: 1.3rem; line-height: 1.55;
  font-family: "Amiri", "Noto Naskh Arabic", "Geeza Pro", "Arabic Typesetting", serif;
}
.book-pub { color: var(--muted); font-size: var(--step--1); font-variant-numeric: lining-nums; }
.book-awards { color: var(--accent-strong); font-size: var(--step--1); margin-top: 0.25rem; }
.book-notes { color: var(--muted); font-size: var(--step--1); font-style: italic; margin-top: 0.25rem; }

.book-buy { font-size: var(--step--1); margin-top: 0.4rem; }
.book-buy .label { margin-right: 0.35rem; }

.book-section { display: grid; gap: 0.75rem; }
.book-section + .book-section { margin-top: 3rem; }

/* Press */
.press-group { display: grid; gap: 0.75rem; }
.press-group + .press-group { margin-top: 2.75rem; }
.press-list { list-style: none; margin: 0; padding: 0; }
.press-item { display: grid; gap: 0.15rem; padding-block: 1rem; border-top: 1px solid var(--rule); }
.press-item:last-child { border-bottom: 1px solid var(--rule); }
.press-title { line-height: 1.4; }
.press-title a { text-decoration: none; }
.press-title a:hover { text-decoration: underline; }
.press-meta { color: var(--muted); font-size: var(--step--1); }
.press-status {
  justify-self: start; margin-top: 0.3rem; font-size: 0.8rem; letter-spacing: 0.02em;
  color: #6b4e00; background: #fbf1d6; padding: 0.1rem 0.45rem; border-radius: 2px;
}

/* Contact */
.contact-form { display: grid; gap: 1.25rem; margin-top: 2rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: var(--step--1); font-weight: 600; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--field); border: 1px solid #b9bab0; border-radius: 3px;
  padding: 0.6rem 0.75rem;
}
.field textarea { min-height: 10rem; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.hp { position: absolute; left: -9999px; }
.button {
  justify-self: start; font: inherit; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.02em;
  color: var(--paper); background: var(--accent); border: 0; border-radius: 3px;
  padding: 0.7rem 1.4rem; cursor: pointer;
}
.button:hover { background: var(--accent-strong); }

/* Preview banner (added only by `build.py --preview`) */
.preview-note {
  background: #eef2ec; color: var(--ink); font-size: var(--step--1); text-align: center;
  padding-block: 0.5rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

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