/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Variables */
:root {
  --sidebar-width: 260px;
  --font-nav: 'Jost', sans-serif;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'EB Garamond', serif;
  --color-text: #2a2a2a;
  --color-nav: #707070;
  --color-nav-active: #000;
  --color-muted: #767676;
  --color-border: #e8e8e8;
}

/* Layout */
body {
  font-family: var(--font-body);
  font-size: 21px;
  color: var(--color-text);
  line-height: 1.85;
  background: #fff;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: #fff;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 44px 32px;
  overflow-y: auto;
  z-index: 100;
}

.logo {
  display: block;
  margin-bottom: 52px;
}
.logo img {
  max-width: 110px;
  height: auto;
}

/* Navigation */
nav ul { list-style: none; }
nav li { margin-bottom: 14px; }
nav a {
  font-family: var(--font-nav);
  font-size: 12.5px;
  color: var(--color-nav);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  position: relative;
  display: inline-block;
  transition: color 0.2s;
}
nav a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--color-nav-active);
  transition: width 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
nav a:hover, nav a.active { color: var(--color-nav-active); }
nav a:hover::after, nav a.active::after { width: 100%; }

/* Sidebar social links */
.sidebar-social {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2rem;
}
.sidebar-social a {
  font-family: var(--font-nav);
  font-size: 10.5px;
  color: var(--color-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}
.sidebar-social a:hover { color: var(--color-text); }

/* Main content */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 60px 70px;
}

/* Typography */
h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 2.6rem;
  color: var(--color-text);
  margin-bottom: 1.8rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.75rem;
  color: var(--color-text);
  margin: 2.5rem 0 1rem;
  line-height: 1.2;
}
h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.25rem;
  margin: 1.8rem 0 0.6rem;
}
p { margin-bottom: 1.2rem; }
em { font-style: italic; }
strong { font-weight: 500; }

/* Justified prose with hyphenation — applied to reading areas only */
.post-page .post-content,
.book-resume,
.home-content {
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}

/* Center post page text column, but let header image be full width */
.post-page h1,
.post-page .post-content {
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
a:hover { color: #000; }

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

blockquote {
  border-left: 2px solid var(--color-border);
  margin: 1.5rem 0;
  padding: 0.25rem 1.5rem;
  color: #555;
}
blockquote p { margin-bottom: 0.5rem; }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 14px;
}
table td, table th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
table td:first-child { color: var(--color-muted); width: 40%; }

/* Back link */
.back-link {
  display: inline-block;
  font-family: var(--font-nav);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--color-text); }

/* ── HOMEPAGE ── */
.home-photos {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0 2.5rem;
}
.home-photos img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}
.home-photos br { display: none; }

.home-books-banner {
  margin: 3rem 0 1rem;
  text-align: center;
}
.home-books-banner a { text-decoration: none; }
.home-books-banner img {
  max-width: 100%;
  width: 580px;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  transition: opacity 0.2s;
}
.home-books-banner a:hover img { opacity: 0.88; }

/* ── BOOKS LIST ── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 2rem;
}
.book-card {
  text-decoration: none;
  color: var(--color-text);
  display: block;
}
.book-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  transition: box-shadow 0.25s, transform 0.25s;
}
.book-card:hover img {
  box-shadow: 0 10px 32px rgba(0,0,0,0.2);
  transform: translateY(-3px);
}
.book-card h2 {
  font-size: 1.1rem;
  font-weight: 300;
  margin: 12px 0 4px;
}
.book-card .card-subtitle {
  font-size: 1rem;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 4px;
}
.book-card .card-price {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

/* ── INDIVIDUAL BOOK ── */
.book-page .book-featured {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  margin-bottom: 3rem;
}

.book-intro {
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
  margin-bottom: 3.5rem;
}
.book-cover-main {
  flex: 0 0 240px;
  width: 240px;
  display: block;
  box-shadow: 0 8px 36px rgba(0,0,0,0.18);
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.book-cover-main:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 48px rgba(0,0,0,0.24);
}
.book-intro-text { flex: 1; padding-top: 0.25rem; }
.book-intro-text h1 {
  margin: 0 0 0.35rem;
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.book-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-muted);
  font-style: italic;
  margin: 0 0 1.2rem;
}
.book-price {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid var(--color-text);
  padding: 0.25rem 0.8rem;
  margin-bottom: 1.8rem;
}
.book-resume {
  font-size: 1.15rem;
  line-height: 1.85;
  color: #444;
  margin-bottom: 2rem;
}
.book-resume p { margin: 0 0 0.8rem; }

.book-buy { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-buy {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  background: var(--color-text);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-nav);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-buy:hover { background: #000; transform: translateY(-2px); }
.btn-buy.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid #bbb;
}
.btn-buy.btn-secondary:hover { border-color: var(--color-text); background: var(--color-text); color: #fff; }

/* Gallery */
.book-gallery-section {
  margin: 0 0 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}
.gallery-heading {
  font-family: var(--font-nav);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 1.25rem;
  font-weight: 400;
}
.book-gallery {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
}
.book-gallery img {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  height: 260px;
  object-fit: cover;
  box-shadow: 0 2px 14px rgba(0,0,0,0.12);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.book-gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

/* Lightbox */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}

/* Reviews */
.book-reviews {
  margin-bottom: 3rem;
  border-top: 1px solid var(--color-border);
  padding-top: 3rem;
}
.book-reviews h2 {
  font-family: var(--font-nav);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
  font-weight: 400;
  margin-bottom: 3rem;
  text-align: center;
}
.book-reviews blockquote {
  border: none;
  margin: 0 auto 4rem;
  padding: 0 2rem;
  max-width: 68ch;
  text-align: center;
  position: relative;
}
.book-reviews blockquote::before {
  content: '\201C';
  font-family: var(--font-heading);
  font-size: 6rem;
  line-height: 0;
  color: var(--color-border);
  position: absolute;
  top: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.book-reviews blockquote p {
  margin: 0 0 1rem;
  line-height: 1.85;
  font-style: italic;
  font-size: 1.25rem;
  color: #444;
  position: relative;
  z-index: 1;
}
.book-reviews blockquote p:last-child {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--color-muted);
  letter-spacing: 0.06em;
  margin: 0.5rem 0 0;
}
/* Separator between reviews */
.book-reviews blockquote + blockquote {
  border-top: 1px solid var(--color-border);
  padding-top: 3.5rem;
}
.book-reviews em a { display: none; }

/* Info / details */
.book-info {
  border-top: 1px solid var(--color-border);
  padding-top: 2rem;
  margin-bottom: 2rem;
}
.book-info h2 {
  font-family: var(--font-nav);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 400;
  margin-bottom: 1rem;
}
.book-info table { border-collapse: collapse; }
.book-info td {
  padding: 0.3rem 2rem 0.3rem 0;
  font-size: 0.88rem;
  color: var(--color-muted);
  vertical-align: top;
}
.book-info td:first-child { color: #666; min-width: 120px; }
.book-dispo {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
}
/* Hide markdown images still in content */
.book-page .book-content img { display: none; }

/* ── POSTS LIST ── */
.page-header { margin-bottom: 2.5rem; }
.page-header h1 { margin-bottom: 0.25rem; }
.page-header .post-count {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.posts-grid { display: flex; flex-direction: column; }

.post-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
}
.post-card.reverse { flex-direction: row-reverse; }
.post-card.no-image { display: block; padding: 1.5rem 0; }

.post-card-image {
  flex: 0 0 50%;
  display: block;
  overflow: hidden;
}
.post-card-image img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.post-card-image:hover img { transform: scale(1.03); }

.post-card-text { flex: 1; padding: 2.5rem; }
.post-card-text h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0 0 0.9rem;
}
.post-card-text h2 a {
  color: var(--color-text);
  text-decoration: none;
}
.post-card-text h2 a:hover { color: #000; }
.post-card-text p {
  font-size: 1.15rem;
  color: var(--color-muted);
  line-height: 1.75;
  margin: 0 0 1rem;
}
.read-more {
  font-size: 0.95rem;
  color: var(--color-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.read-more:hover { color: var(--color-text); }

/* ── INDIVIDUAL POST ── */
.post-page h1 { margin-bottom: 2rem; }
.post-date {
  font-size: 0.9rem;
  color: var(--color-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0.5rem 0 1.2rem;
}
.post-card-text .post-date { margin: 0 0 0.4rem; font-size: 0.8rem; }
.post-page .post-header-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  margin-bottom: 2.5rem;
  display: block;
}
.post-page h2 { /* "Contenu" heading — hide it */
  display: none;
}
.post-page img {
  max-width: 100%;
  display: block;
  margin: 1.5rem auto;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .sidebar {
    position: relative;
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 18px 20px;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    min-width: unset;
  }
  .logo { margin-bottom: 0; margin-right: 28px; }
  .logo img { max-width: 70px; }
  nav ul { display: flex; gap: 20px; }
  nav li { margin-bottom: 0; }
  .sidebar-social { display: none; }
  .layout { flex-direction: column; }
  .content { margin-left: 0; padding: 28px 20px; max-width: 100%; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .book-intro { flex-direction: column; gap: 2rem; }
  .book-cover-main { flex: none; width: 100%; max-width: 220px; }
  .book-page .book-gallery { flex-wrap: wrap; }
  .book-page .book-gallery img { flex: none; height: 160px; width: auto; }
  .home-photos { gap: 1rem; }
  .home-photos img { width: 90px; height: 90px; }
  .post-card, .post-card.reverse { flex-direction: column; gap: 1.5rem; }
  .post-card-image { flex: none; width: 100%; }
  .post-card-image img { height: 200px; }
}
