/*
Theme Name: Guillaume Robin
Description: Thème sur mesure pour le site de Guillaume Robin, essayiste et historien de l'art. Livres et actualités administrables simplement.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.0
Text Domain: guillaume-robin
*/

/* Mise en page : une colonne éditoriale, blanc pur, une étiquette à gauche et le texte à droite. */
:root {
  --paper: #ffffff;
  --ink: #15171c;
  --muted: #5d6068;
  --rule: #e8e6e3;
  --accent: #d24f28;       /* l'orange de la couverture */
  --accent-deep: #a63b1a;  /* version lisible pour du texte sur blanc */
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1180px;
  --measure: 35rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: #f6d9cf; color: var(--ink); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.label {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.screen-reader-text, .skip {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus { position: fixed; top: 12px; left: 12px; width: auto; height: auto; clip: auto; z-index: 99; background: var(--ink); color: var(--paper); padding: 10px 16px; font-family: var(--sans); }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
}
.nav ul { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav a {
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.nav a:hover, .nav .current-menu-item > a { color: var(--ink); }
@media (max-width: 760px) {
  .site-header .wrap { padding-block: 14px 0; min-height: 0; }
  .nav { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav ul { gap: 22px; padding-block: 10px 14px; }
  .nav a { white-space: nowrap; }
}

/* ---------- Boutons et liens ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 2px;
  transition: background .2s;
}
.btn:hover { background: var(--accent-deep); }
.link-arrow {
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule);
  transition: border-color .2s, color .2s;
}
.link-arrow:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ---------- Livre à la une ---------- */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}
.kicker { display: inline-flex; align-items: center; gap: 10px; }
.kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.hero-title {
  font-size: clamp(2.5rem, 5.4vw, 4.4rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.035em;
  margin: 22px 0 0;
  text-wrap: balance;
}
.hero-title .l { display: block; }
.hero-title .slash { color: var(--accent); font-style: italic; font-weight: 300; margin-right: .03em; }
.hero-sub {
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
  font-style: italic;
  font-weight: 300;
  color: var(--muted);
  margin: 10px 0 0;
}
.hero-lede { margin-top: 28px; max-width: 30rem; font-size: 1.125rem; line-height: 1.6; }
.hero-lede p { margin: 0; }
.hero-meta { margin-top: 22px; font-family: var(--sans); font-size: .875rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; margin-top: 28px; }
.cover { margin: 0; justify-self: end; width: 100%; max-width: 340px; }
.cover img {
  width: 100%;
  box-shadow: 0 1px 2px rgba(21, 23, 28, .08), 0 28px 56px -20px rgba(21, 23, 28, .32);
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cover { justify-self: start; max-width: 230px; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 7vw, 96px); border-top: 1px solid var(--rule); }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(20px, 4vw, 64px); }
.split-side .label { position: sticky; top: 104px; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split-side .label { position: static; }
}
.h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.15;
  margin: 0 0 .7em;
  text-wrap: balance;
}
.prose { max-width: var(--measure); min-width: 0; }
.prose p { margin: 0 0 1.1em; }
.prose > p:first-child { font-size: 1.1875rem; line-height: 1.58; }
.prose a { color: var(--accent-deep); }
.prose h2, .prose h3 { font-weight: 400; letter-spacing: -.015em; line-height: 1.2; margin: 1.6em 0 .5em; }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2em; border-left: 2px solid var(--accent); font-style: italic; }
.prose img { margin: 1.5em 0; }

.cast {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 40px;
  margin: 40px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}
.cast dd { margin: 10px 0 0; font-style: italic; font-size: 1.0625rem; line-height: 1.75; }
.cast dd span { display: block; }

.pull { margin: clamp(44px, 6vw, 72px) 0 0; }
.pull p {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -.005em;
  max-width: 26em;
  margin: 0;
  text-wrap: balance;
}
.pull .actions { margin-top: 32px; }

/* ---------- Bibliographie ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 36px; }
.section-head .h2 { margin: 0; }
.books { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.book-row a {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 13rem) 1.25rem;
  gap: 8px 28px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.book-row .y, .book-row .p { font-family: var(--sans); font-size: .875rem; color: var(--muted); }
.book-row .y { font-variant-numeric: tabular-nums; }
.book-row .t { font-size: 1.1875rem; line-height: 1.3; transition: color .2s; }
.book-row .t em { color: var(--muted); font-weight: 300; }
.book-row .arr { color: var(--accent); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; }
.book-row a:hover .t { color: var(--accent-deep); }
.book-row a:hover .arr, .book-row a:focus-visible .arr { opacity: 1; transform: none; }
@media (max-width: 700px) {
  .book-row a { grid-template-columns: 3.5rem minmax(0, 1fr); }
  .book-row .p { grid-column: 2; }
  .book-row .arr { display: none; }
}

/* ---------- Actualités ---------- */
.news { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.news-item { border-top: 1px solid var(--ink); padding-top: 20px; min-width: 0; }
.news-item h3 { font-size: 1.25rem; font-weight: 400; line-height: 1.22; letter-spacing: -.01em; margin: 12px 0; }
.news-item h3 a { text-decoration: none; }
.news-item h3 a:hover { color: var(--accent-deep); }
.news-item p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.news-item .thumb { margin-bottom: 18px; aspect-ratio: 3 / 2; overflow: hidden; max-width: 100%; }
.news-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.empty { color: var(--muted); font-style: italic; }
@media (max-width: 900px) { .news { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Auteur et contact ---------- */
.author { display: flex; gap: clamp(24px, 4vw, 48px); align-items: flex-start; }
.author .prose { flex: 1; }
.portrait { margin: 0; width: 180px; flex: none; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 35%; }
@media (max-width: 620px) { .author { flex-direction: column; gap: 24px; } .portrait { width: 140px; } }

/* ---------- Bibliographie en couvertures ---------- */
.hint { margin: 0; font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.shelf {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 42%), 1fr));
  gap: 36px 28px;
}
.shelf-item { min-width: 0; }
.shelf-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.shelf-cover { display: block; aspect-ratio: 2 / 3; overflow: hidden; background: var(--rule); margin-bottom: 10px; max-width: 100%;
  box-shadow: 0 1px 2px rgba(21,23,28,.08), 0 14px 28px -16px rgba(21,23,28,.35);
  transition: transform .25s ease, box-shadow .25s ease; }
.shelf-cover img { width: 100%; height: 100%; object-fit: cover; }
.shelf-blank { display: flex; height: 100%; align-items: center; justify-content: center; padding: 12px; text-align: center; font-size: .95rem; }
.shelf-title { font-size: 1.0625rem; line-height: 1.3; }
.shelf-meta { font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.shelf-link:hover .shelf-cover, .shelf-link:focus-visible .shelf-cover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(21,23,28,.08), 0 22px 36px -18px rgba(21,23,28,.42); }
.shelf-link:hover .shelf-title { color: var(--accent-deep); }

.book-dialog {
  border: 0; padding: 0; width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(21,23,28,.45);
}
.book-dialog::backdrop { background: rgba(21,23,28,.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.book-dialog-inner { position: relative; display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); padding: clamp(24px, 4vw, 48px); }
.dialog-cover img { width: 100%; box-shadow: 0 14px 28px -16px rgba(21,23,28,.35); }
.dialog-text { min-width: 0; }
.dialog-title { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 400; letter-spacing: -.015em; line-height: 1.12; margin: 12px 0 0; text-wrap: balance; }
.dialog-sub { margin: 6px 0 0; font-style: italic; font-weight: 300; color: var(--muted); font-size: 1.125rem; }
.dialog-prose { margin-top: 22px; }
.dialog-prose > p:first-child { font-size: inherit; }
.dialog-prose p { font-size: 1.0625rem; line-height: 1.65; }
.dialog-meta { font-family: var(--sans); font-size: .8125rem; color: var(--muted); margin: 8px 0 24px; }
.dialog-close {
  position: absolute; top: 10px; right: 12px; width: 40px; height: 40px;
  border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer;
}
.dialog-close:hover { color: var(--ink); }
@media (max-width: 640px) {
  .book-dialog-inner { grid-template-columns: 1fr; }
  .dialog-cover { width: 140px; }
}

/* ---------- Formulaire de contact ---------- */
.contact-form { max-width: 36rem; margin-top: 8px; }
.contact-form p { margin: 0 0 18px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; font-family: var(--sans); font-size: .8125rem; font-weight: 500; margin-bottom: 6px; }
.field label span { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid #d6d3cf; border-radius: 2px; padding: 11px 12px;
  transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.contact-form .btn { border: 0; cursor: pointer; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-family: var(--sans); font-size: .9375rem; padding: 12px 14px; margin: 0 0 20px; max-width: 36rem; border-left: 2px solid; }
.form-note--ok { border-color: #2f7a4b; background: #f1f7f3; }
.form-note--erreur { border-color: var(--accent); background: #fbf1ed; }
.contact-mail {
  display: inline-block;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -.02em;
  line-height: 1.15;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
  transition: border-color .2s;
}
.contact-mail:hover { border-color: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 14px 28px; list-style: none; margin: 32px 0 0; padding: 0; }

/* ---------- Pages intérieures ---------- */
.page-head { padding-block: clamp(56px, 8vw, 96px) clamp(32px, 4vw, 48px); }
.h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 400; letter-spacing: -.03em; line-height: 1.02; margin: 18px 0 0; text-wrap: balance; }
.article { max-width: 44rem; margin: 0 auto; padding-block: clamp(56px, 8vw, 96px); }
.article .h1 { margin-bottom: 36px; }
.article .featured { margin: 0 0 40px; }
.pagination { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; font-family: var(--sans); font-size: .9375rem; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 32px; font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.news-item .thumb { display: block; }

.prose > .h2:first-child { margin-top: 0; }
