/*
 * main.css
 * Variables globales, reset, layout principal, sidebar, responsive
 * Chargé en dernier — écrase si besoin
 */

/* ── Variables globales ── */
:root {
  --bg        : #FFFFFF;
  --bg-alt    : #F5F5F3;
  --ink       : #1A1917;
  --ink-soft  : #7A7770;
  --accent    : #C8581A;
  --accent-dk : #9E4313;
  --border    : #D0CCC5;
  --sidebar-w : 200px;
  --main-pad  : 3rem 3.5rem 5rem 3rem;
}

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

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

/* ── Layout global ── */
.site-wrapper {
  min-height: 100vh;
  position: relative;
}

/* ════════════════════════════════════════
   MAIN CONTENT — centré sur la page
   Le main est le centre de gravité visuel.
   La sidebar se greffe à sa gauche,
   sans perturber l'équilibre de lecture.
════════════════════════════════════════ */
.site-main {
  max-width: 760px;
  margin-inline: auto;
  padding: var(--main-pad);
}

/* ════════════════════════════════════════
   SIDEBAR
   Positionnée en fixed, alignée à droite
   de son propre espace, à gauche du main.
   calc() : moitié écran - moitié main - sidebar
════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: calc(50% - 380px - var(--sidebar-w) - 1rem);
  width: var(--sidebar-w);
  height: 100vh;
  padding: 2.8rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.site-title {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.0;
  display: block;
  margin-bottom: 0.3rem;
  transition: color 0.2s;
}

.site-title span { color: var(--accent); }
.site-title:hover { color: var(--accent); }

.site-tagline {
  font-size: 0.63rem;
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 3rem;
}

/* Nav sidebar */
.site-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.site-nav .nav-link {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.28rem 0;
  /* surligneur orange au hover */
  background-image: linear-gradient(
    102deg,
    transparent 0%, transparent 4%,
    rgba(200, 88, 26, 0.22) 4%,
    rgba(200, 88, 26, 0.22) 96%,
    transparent 96%
  );
  background-size: 0% 82%;
  background-repeat: no-repeat;
  background-position: right center;
  transition: background-size 0.22s ease-out, color 0.15s;
}

.site-nav .nav-link:hover {
  color: var(--ink);
  background-size: 100% 82%;
}

.site-nav .nav-link.active {
  color: var(--accent);
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.58rem;
  color: var(--ink-soft);
  opacity: 0.45;
}

/* .site-main défini dans le bloc layout ci-dessus */

/* ════════════════════════════════════════
   HERO (accueil — dernière publication)
════════════════════════════════════════ */
.hero {
  padding: 1.5rem 0 3rem;
}

.hero-eyebrow {
  font-size: var(--f-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.hero__title {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin-bottom: 1.1rem;
}

.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}

.hero__meta a {
  color: var(--ink-soft);
  text-decoration: none;
  background-image: linear-gradient(102deg, transparent 4%, rgba(200,88,26,0.22) 4%, rgba(200,88,26,0.22) 96%, transparent 96%);
  background-size: 0% 80%;
  background-repeat: no-repeat;
  background-position: left center;
  padding: 0 2px;
  transition: background-size 0.2s ease-out;
}

.hero__meta a:hover { background-size: 100% 80%; color: var(--ink); }

.hero__excerpt {
  font-size: 0.94rem;
  line-height: var(--lh-loose);
  margin-bottom: 1.6rem;
  max-width: 48ch;
}

.hero__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}

/* Lire la suite */
.btn-read {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(102deg, transparent 4%, rgba(200,88,26,0.22) 4%, rgba(200,88,26,0.22) 96%, transparent 96%);
  background-size: 0% 85%;
  background-repeat: no-repeat;
  background-position: left center;
  padding: 0 3px;
  transition: background-size 0.22s ease-out, color 0.15s;
}

.btn-read:hover {
  background-size: 100% 85%;
  color: var(--accent-dk);
}

/* ════════════════════════════════════════
   SINGLE POST
════════════════════════════════════════ */
.post-header {
  padding: 1rem 0 0;
}

.post-header .post-type {
  font-size: var(--f-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--accent);
  margin-bottom: 1rem;
}

.post-header h1 {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-weight: 900;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin-bottom: 0.8rem;
}

.post-meta {
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-bottom: 0;
}

.post-body {
  padding-bottom: 4rem;
}

.post-body p {
  font-size: 0.96rem;
  line-height: var(--lh-loose);
  max-width: 64ch;
}

.post-body h2 {
  font-size: var(--f-lg);
  margin: 2.5rem 0 1rem;
}

.post-image {
  margin: 2.5rem 0;
}

.post-image img {
  width: 100%;
  border: 1px solid var(--border);
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hub-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  :root {
    --main-pad: 1.5rem 1.5rem 4rem;
  }

  /* Sidebar passe en header horizontal */
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    text-align: left;
    padding: 1.2rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    left: auto;
  }

  .site-tagline { display: none; }

  .site-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .sidebar-footer { display: none; }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }
}
