/*
Theme Name: Salon du Livre
Theme URI: https://example.com/salon-du-livre
Author: Compilation
Author URI: https://example.com
Description: Thème minimaliste pour présenter un salon du livre : ses auteurs invités et son programme. Deux rubriques principales (Auteurs, Programme) plus un fil d'actualités.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: salon-du-livre
*/

/* ==========================================================================
   0. Variables & reset
   ========================================================================== */
:root {
  --sdl-ink: #1c1a17;
  --sdl-grey: #6b6660;
  --sdl-line: #e4ddd0;
  --sdl-bg: #fdfcfa;
  --sdl-accent: #8a3b2e;
  --sdl-max: 760px;
  --sdl-max-wide: 1080px;
  --sdl-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sdl-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--sdl-bg);
  color: var(--sdl-ink);
  font-family: var(--sdl-sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
}

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

a { color: var(--sdl-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--sdl-serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--sdl-ink);
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.1em; }

ul, ol { padding-left: 1.2em; }

hr {
  border: none;
  border-top: 1px solid var(--sdl-line);
  margin: 2.5em 0;
}

/* ==========================================================================
   1. Layout helpers
   ========================================================================== */
.sdl-container {
  max-width: var(--sdl-max);
  margin: 0 auto;
  padding: 0 24px;
}
.sdl-container--wide {
  max-width: var(--sdl-max-wide);
}
.sdl-section {
  padding: 56px 0;
}
.sdl-section + .sdl-section {
  border-top: 1px solid var(--sdl-line);
}
.sdl-eyebrow {
  font-family: var(--sdl-sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sdl-accent);
  margin: 0 0 0.6em;
  display: block;
}

/* ==========================================================================
   1bis. Bandeau (image d'en-tête)
   ========================================================================== */
.sdl-site-banner {
  width: 100%;
  height: 300px;
  overflow: hidden;
  line-height: 0;
  background: #156773;
}
.sdl-site-banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* ==========================================================================
   2. Header
   ========================================================================== */
.sdl-header {
  border-bottom: 1px solid var(--sdl-line);
  padding: 22px 0;
}
.sdl-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.sdl-logo {
  font-family: var(--sdl-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--sdl-ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.sdl-logo:hover { text-decoration: none; opacity: 0.8; }
.sdl-logo img { max-height: 46px; width: auto; }

.sdl-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.sdl-nav a {
  color: var(--sdl-ink);
  font-size: 0.95rem;
  font-weight: 500;
}
.sdl-nav a:hover { color: var(--sdl-accent); text-decoration: none; }
.sdl-nav .current-menu-item > a { color: var(--sdl-accent); }

/* Sous-menus (menu déroulant) */
.sdl-nav li { position: relative; }
.sdl-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  display: none;
  flex-direction: column;
  gap: 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--sdl-line);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  z-index: 30;
}
.sdl-nav li:hover > .sub-menu,
.sdl-nav li:focus-within > .sub-menu {
  display: flex;
}
.sdl-nav .sub-menu a {
  display: block;
  padding: 8px 16px;
  white-space: nowrap;
}
.sdl-nav .menu-item-has-children > a::after {
  content: "▾";
  font-size: 0.7em;
  margin-left: 5px;
  opacity: 0.6;
}

.sdl-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--sdl-line);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ==========================================================================
   3. Hero (front page)
   ========================================================================== */
.sdl-hero {
  padding: 32px 0 40px;
  text-align: center;
}
.sdl-hero h1 { font-size: 2.5rem; margin-bottom: 0.4em; }
.sdl-hero__lead {
  max-width: 620px;
  margin: 0 auto;
  color: var(--sdl-grey);
  font-size: 1.05rem;
}
.sdl-hero__row {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  align-items: start;
  gap: 48px;
  margin: 8px 0 0;
}
.sdl-hero__intro {
  text-align: left;
}
.sdl-hero__intro p {
  color: var(--sdl-ink);
  font-size: 1.25rem;
  line-height: 1.7;
  margin: 0 0 1em;
}
.sdl-hero__intro p:last-child {
  margin-bottom: 0;
}
.sdl-hero__photo {
  margin: 0;
}
.sdl-hero__photo img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(28, 26, 23, 0.16);
}
.sdl-hero__photo figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--sdl-grey);
}
@media (max-width: 860px) {
  .sdl-hero__row {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .sdl-hero__photo {
    max-width: 380px;
    margin: 0 auto;
  }
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */
.sdl-btn {
  display: inline-block;
  padding: 11px 22px;
  border: 1px solid var(--sdl-ink);
  border-radius: 2px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--sdl-ink);
}
.sdl-btn:hover { background: var(--sdl-ink); color: #fff; text-decoration: none; }
.sdl-btn--accent { border-color: var(--sdl-accent); color: var(--sdl-accent); }
.sdl-btn--accent:hover { background: var(--sdl-accent); color: #fff; }

/* ==========================================================================
   5. Section headers
   ========================================================================== */
.sdl-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.sdl-section__head h2 { margin: 0; }
.sdl-more { font-size: 0.9rem; white-space: nowrap; }

/* ==========================================================================
   6. Auteurs — grille & fiche
   ========================================================================== */
.sdl-auteurs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 32px 28px;
}
.sdl-auteur-card { text-align: left; }
.sdl-auteur-card__photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--sdl-line);
  margin-bottom: 14px;
  border-radius: 2px;
}
.sdl-auteur-card__photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: var(--sdl-line);
}
.sdl-auteur-card__photo--placeholder span {
  font-family: var(--sdl-serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--sdl-ink);
  word-break: break-word;
}
.sdl-auteur-card h3 { font-size: 1.05rem; margin-bottom: 0.2em; }
.sdl-auteur-card__meta {
  color: var(--sdl-grey);
  font-size: 0.86rem;
  margin-bottom: 0.4em;
}
.sdl-auteur-card__excerpt {
  color: var(--sdl-grey);
  font-size: 0.92rem;
}

.sdl-auteur-single__header {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}
.sdl-auteur-single__photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 2px;
  background: var(--sdl-line);
}
.sdl-auteur-single__meta {
  color: var(--sdl-grey);
  font-size: 0.95rem;
  margin-bottom: 1em;
}
.sdl-auteur-single__genres a {
  display: inline-block;
  font-size: 0.8rem;
  padding: 3px 10px;
  border: 1px solid var(--sdl-line);
  border-radius: 20px;
  color: var(--sdl-ink);
  margin: 0 6px 6px 0;
}
.sdl-auteur-single__genres a:hover { border-color: var(--sdl-accent); color: var(--sdl-accent); text-decoration: none; }

.sdl-block-title {
  font-family: var(--sdl-serif);
  font-size: 1.05rem;
  margin: 2.2em 0 0.7em;
  padding-top: 1.4em;
  border-top: 1px solid var(--sdl-line);
}
.sdl-distinctions { padding-left: 1.1em; }
.sdl-distinctions li { margin-bottom: 0.4em; }

.sdl-bibliographie .sdl-biblio-item {
  margin-bottom: 1.1em;
}
.sdl-bibliographie .sdl-biblio-item__titre {
  font-weight: 600;
}
.sdl-bibliographie .sdl-biblio-item__meta {
  display: block;
  color: var(--sdl-grey);
  font-size: 0.86rem;
  font-style: italic;
}

.sdl-liens { list-style: none; padding: 0; }
.sdl-liens li { margin-bottom: 0.4em; }

@media (max-width: 620px) {
  .sdl-site-banner {
    height: 190px;
  }
  .sdl-auteur-single__header {
    grid-template-columns: 1fr;
  }
  .sdl-auteur-single__photo { max-width: 220px; }
}

/* ==========================================================================
   7. Programme
   ========================================================================== */
.sdl-programme-jour + .sdl-programme-jour { margin-top: 40px; }
.sdl-programme-jour__date {
  font-family: var(--sdl-serif);
  font-size: 1.2rem;
  margin-bottom: 18px;
}
.sdl-programme-list { list-style: none; margin: 0; padding: 0; }
.sdl-programme-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--sdl-line);
}
.sdl-programme-item:last-child { border-bottom: 1px solid var(--sdl-line); }
.sdl-programme-item__heure {
  font-weight: 600;
  color: var(--sdl-accent);
}
.sdl-programme-item__titre { margin: 0 0 0.2em; font-size: 1.02rem; font-family: var(--sdl-serif); font-weight: 600; }
.sdl-programme-item__infos {
  color: var(--sdl-grey);
  font-size: 0.9rem;
}

/* ==========================================================================
   8. Blog / articles
   ========================================================================== */
.sdl-post-list { max-width: var(--sdl-max); margin: 0 auto; }
.sdl-post-item { padding: 26px 0; border-top: 1px solid var(--sdl-line); }
.sdl-post-item:last-child { border-bottom: 1px solid var(--sdl-line); }
.sdl-post-item__date { color: var(--sdl-grey); font-size: 0.85rem; margin-bottom: 0.3em; }
.sdl-post-item h2, .sdl-post-item h3 { margin-bottom: 0.3em; font-size: 1.2rem; }
.sdl-post-item__excerpt { color: var(--sdl-grey); }

.sdl-single-article header { margin-bottom: 28px; }
.sdl-single-article .sdl-post-item__date { margin-bottom: 0.6em; }
.sdl-single-article__thumb { margin-bottom: 32px; border-radius: 2px; }
.sdl-content { font-size: 1.02rem; }
.sdl-content img { border-radius: 2px; margin: 1.2em 0; }
.sdl-content blockquote {
  margin: 1.6em 0;
  padding-left: 18px;
  border-left: 2px solid var(--sdl-accent);
  font-style: italic;
  color: var(--sdl-grey);
}

/* ==========================================================================
   9. Page générique
   ========================================================================== */
.sdl-page { padding: 56px 0 72px; }
.sdl-page h1 { margin-bottom: 0.8em; }

/* ==========================================================================
   10. Footer
   ========================================================================== */
.sdl-footer {
  border-top: 1px solid var(--sdl-line);
  padding: 40px 0;
  margin-top: 40px;
}
.sdl-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.sdl-footer nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}
.sdl-footer nav a { color: var(--sdl-grey); font-size: 0.88rem; }
.sdl-footer nav a:hover { color: var(--sdl-accent); }
.sdl-footer__credit { color: var(--sdl-grey); font-size: 0.85rem; }

/* ==========================================================================
   10bis. Recherche & commentaires
   ========================================================================== */
.sdl-search-form { display: flex; gap: 10px; max-width: 420px; }
.sdl-search-form__input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--sdl-line);
  border-radius: 2px;
  font-family: var(--sdl-sans);
  font-size: 0.95rem;
  background: #fff;
  color: var(--sdl-ink);
}

.sdl-comments { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--sdl-line); }
.sdl-comments h2 { margin-bottom: 24px; }
.sdl-comments ol.comment-list { list-style: none; margin: 0; padding: 0; }
.sdl-comments .comment-body { padding: 18px 0; border-top: 1px solid var(--sdl-line); }
.sdl-comments .comment-author { font-weight: 600; font-size: 0.92rem; }
.sdl-comments .comment-metadata { color: var(--sdl-grey); font-size: 0.82rem; margin-bottom: 0.5em; }
.sdl-comments .comment-metadata a { color: inherit; }
.sdl-comments textarea, .sdl-comments input[type="text"], .sdl-comments input[type="email"], .sdl-comments input[type="url"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sdl-line);
  border-radius: 2px;
  font-family: var(--sdl-sans);
  margin-bottom: 12px;
}
.sdl-comments .comment-reply-title { font-family: var(--sdl-serif); }

/* ==========================================================================
   11. 404 / vide
   ========================================================================== */
.sdl-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--sdl-grey);
}

/* ==========================================================================
   12. Responsive nav
   ========================================================================== */
@media (max-width: 720px) {
  .sdl-menu-toggle { display: inline-block; }
  .sdl-nav { display: none; width: 100%; order: 3; }
  .sdl-nav.is-open { display: block; }
  .sdl-nav ul { flex-direction: column; gap: 6px; padding-top: 16px; }
  .sdl-nav .sub-menu {
    display: flex;
    position: static;
    border: none;
    box-shadow: none;
    padding: 4px 0 4px 16px;
    min-width: 0;
  }
  .sdl-nav .menu-item-has-children > a::after { content: none; }
}

/* ==========================================================================
   13. WP core alignment classes (minimum viable support)
   ========================================================================== */
.alignleft { float: left; margin: 0.4em 1.6em 1em 0; }
.alignright { float: right; margin: 0.4em 0 1em 1.6em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--sdl-grey); font-size: 0.85rem; text-align: center; margin-top: 0.4em; }
.screen-reader-text {
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px; height: 1px; overflow: hidden;
}

/* ==========================================================================
   6bis. Tourniquet des auteurs (page d'accueil)
   ========================================================================== */
.sdl-carousel {
  position: relative;
}
.sdl-carousel__viewport {
  overflow: hidden;
}
.sdl-carousel__track {
  display: grid;
}
.sdl-carousel__slide {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr;
  gap: 36px;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.sdl-carousel__slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.sdl-carousel__slide-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 2px;
  background: var(--sdl-line);
}
.sdl-carousel__slide-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-family: var(--sdl-serif);
  color: var(--sdl-grey);
}
.sdl-carousel__slide-body h3 {
  margin: 0 0 0.3em;
  font-size: 1.5rem;
}
.sdl-carousel__slide-body h3 a {
  color: inherit;
  text-decoration: none;
}
.sdl-carousel__slide-meta {
  color: var(--sdl-grey);
  font-size: 0.86rem;
  margin-bottom: 0.6em;
}
.sdl-carousel__slide-excerpt {
  color: var(--sdl-grey);
  margin-bottom: 1.3em;
}
.sdl-carousel__arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--sdl-line);
  background: var(--sdl-bg);
  color: var(--sdl-ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sdl-carousel__arrow:hover {
  background: var(--sdl-line);
}
.sdl-carousel__arrow--prev { left: -14px; }
.sdl-carousel__arrow--next { right: -14px; }
.sdl-carousel__dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 28px;
}
.sdl-carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--sdl-line);
  cursor: pointer;
}
.sdl-carousel__dot.is-active {
  background: var(--sdl-accent);
}
@media (max-width: 620px) {
  .sdl-carousel__slide {
    grid-template-columns: 1fr;
  }
  .sdl-carousel__slide-media {
    max-width: 220px;
    margin: 0 auto;
  }
  .sdl-carousel__arrow {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }
  .sdl-carousel__arrow--prev { left: 0; }
  .sdl-carousel__arrow--next { right: 0; }
}


/* ==========================================================================
   14. Éditeurs — grille & fiche
   ========================================================================== */
.sdl-editeurs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 32px 28px;
}
.sdl-editeur-card { text-align: center; }
.sdl-editeur-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--sdl-line);
  border-radius: 2px;
  margin-bottom: 14px;
}
.sdl-editeur-card__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.sdl-editeur-card__logo span {
  font-family: var(--sdl-serif);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--sdl-ink);
  word-break: break-word;
}
.sdl-editeur-card h3 { font-size: 1.02rem; margin-bottom: 0; }

.sdl-editeur-single__header {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}
.sdl-editeur-single__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--sdl-line);
  border-radius: 2px;
}
.sdl-editeur-single__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.sdl-editeur-single__meta {
  color: var(--sdl-grey);
  font-size: 0.95rem;
  margin-bottom: 1em;
}
@media (max-width: 620px) {
  .sdl-editeur-single__header {
    grid-template-columns: 1fr;
  }
  .sdl-editeur-single__logo { max-width: 220px; }
}
