/* ============================================================
   Bresse & Revermont — Thème Magazine Gastronomique & Terroir
   CSS Grid + Flexbox pur — Archétype F (Sidebar)
   ============================================================ */

/* --- Variables & Reset --- */
:root {
  --primary:    #5C3D1E;
  --secondary:  #F2E8D5;
  --accent:     #B5472A;
  --text:       #2C2118;
  --text-light: #6B5744;
  --text-muted: #9C8472;
  --border:     #D9CAB3;
  --white:      #FFFFFF;
  --cream:      #FAF6EF;
  --dark-nav:   #3A2410;

  --ff-title: 'Playfair Display', Georgia, serif;
  --ff-body:  'Source Serif 4', 'Times New Roman', serif;

  --shadow-sm: 0 2px 8px rgba(44,33,24,.10);
  --shadow-md: 0 4px 20px rgba(44,33,24,.15);
  --shadow-lg: 0 8px 40px rgba(44,33,24,.20);

  --radius: 4px;
  --transition: .25s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  font-size: 1.0625rem;
  color: var(--text);
  background: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-title);
  color: var(--primary);
  line-height: 1.2;
}

/* --- Layout Containers --- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}
.container--narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  background: var(--dark-nav);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.nav-logo img {
  height: 72px;
  width: auto;
  display: block;
}

/* Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}

.nav-menu a {
  display: block;
  padding: 0.55rem 1.1rem;
  color: var(--secondary);
  font-family: var(--ff-body);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-menu a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: .5rem;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================================
   TOPBAR — Fil décoratif
   ============================================================ */
.site-topbar {
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: .35rem 1rem;
  font-family: var(--ff-body);
  font-size: .8rem;
  color: var(--text-light);
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ============================================================
   INDEX — ARCHÉTYPE F : SIDEBAR LAYOUT
   ============================================================ */
.index-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-rows: auto auto;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem;
  align-items: start;
}

/* Colonne principale */
.index-main {
  padding-right: 3.5rem;
  border-right: 1px solid var(--border);
}

/* Titre éditorial */
.index-main .page-h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-style: italic;
  color: var(--primary);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 1.25rem;
}
.index-main .page-h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 72px;
  height: 3px;
  background: var(--accent);
}

/* Contenu présentation */
.index-content {
  font-size: 1.0625rem;
  color: var(--text-light);
  line-height: 1.85;
  margin-bottom: 2.5rem;
  max-width: 100%;
}
.index-content p { margin-bottom: 1.1rem; }

/* Séparateur showcase */
.showcase-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.showcase-label span {
  font-family: var(--ff-title);
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .14em;
  white-space: nowrap;
}
.showcase-label::before, .showcase-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Showcase grid dans la colonne principale */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* Sidebar */
.index-sidebar {
  padding-left: 2.5rem;
  position: sticky;
  top: 120px;
}

.sidebar-thumbnail {
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.sidebar-thumbnail img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform .4s ease;
}
.sidebar-thumbnail:hover img { transform: scale(1.03); }

.sidebar-meta {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.sidebar-meta .site-baseline {
  font-family: var(--ff-title);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--primary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-meta .meta-date {
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .4rem;
}
.sidebar-meta .meta-label {
  font-family: var(--ff-body);
  font-size: .85rem;
  color: var(--text-light);
  line-height: 1.6;
}
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}
.sidebar-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: 2px;
  margin-bottom: .75rem;
}

/* ============================================================
   POST LOOP — Carte Verticale Terroir
   ============================================================ */
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.post-card__thumb {
  overflow: hidden;
  height: 200px;
  flex-shrink: 0;
}
.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .post-card__thumb img { transform: scale(1.05); }

.post-card__body {
  padding: 1.25rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card__cat {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: .5rem;
}
.post-card__cat a { color: inherit; }
.post-card__cat a:hover { color: var(--primary); }

.post-card__title {
  font-family: var(--ff-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
  margin-bottom: .75rem;
}
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--accent); }

.post-card__excerpt {
  font-size: .88rem;
  color: var(--text-light);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1rem;
}

.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.post-card__date {
  font-size: .75rem;
  color: var(--text-muted);
  letter-spacing: .06em;
}
.post-card__read {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.post-card__read:hover { color: var(--primary); }
.post-card__read::after { content: '→'; }

/* ============================================================
   POST LIST PAGE
   ============================================================ */
.postlist-header {
  background: var(--primary);
  padding: 3.5rem 2rem;
  border-bottom: 4px solid var(--accent);
}
.postlist-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}
.postlist-header h1 {
  font-family: var(--ff-title);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-style: italic;
  color: var(--secondary);
  margin: 0;
}
.postlist-header .breadcrumb-wrap {
  font-size: .82rem;
  color: var(--border);
}
.postlist-header .breadcrumb-wrap a { color: var(--secondary); opacity: .75; }
.postlist-header .breadcrumb-wrap a:hover { opacity: 1; }

.postlist-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.postlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 2rem 0;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: .88rem;
  color: var(--text);
  transition: all var(--transition);
}
.pagination a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.pagination .active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  font-weight: 700;
}

/* ============================================================
   POST DETAIL PAGE
   ============================================================ */
.post-header {
  background: var(--secondary);
  border-bottom: 3px solid var(--border);
  padding: 2.5rem 2rem 2rem;
}
.post-header-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.post-breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.post-breadcrumb a { color: var(--primary); }
.post-breadcrumb a:hover { color: var(--accent); }

.post-category-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--white);
  background: var(--accent);
  padding: .25rem .7rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}
.post-category-tag a { color: inherit; }

.post-header h1 {
  font-family: var(--ff-title);
  font-size: clamp(2rem, 4vw, 3rem);
  font-style: italic;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 840px;
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.post-meta-item {
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.post-meta-item strong { color: var(--text-light); font-weight: 600; }

/* Article body */
.post-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  padding: 3rem 0;
  align-items: start;
}

.post-featured-img {
  margin-bottom: 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.post-featured-img img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.post-content {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--text);
}
.post-content h2 {
  font-family: var(--ff-title);
  font-size: 1.6rem;
  font-style: italic;
  margin: 2.5rem 0 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--border);
  color: var(--primary);
}
.post-content h3 {
  font-family: var(--ff-title);
  font-size: 1.25rem;
  margin: 2rem 0 .75rem;
  color: var(--primary);
}
.post-content p { margin-bottom: 1.35rem; }
.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.35rem;
}
.post-content li { margin-bottom: .4rem; }
.post-content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--secondary);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-content a { color: var(--accent); text-decoration: underline; }
.post-content a:hover { color: var(--primary); }
.post-content img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}

/* Post Sidebar */
.post-sidebar {
  position: sticky;
  top: 120px;
}
.post-sidebar-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.post-sidebar-box h4 {
  font-family: var(--ff-title);
  font-size: .95rem;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--accent);
  letter-spacing: .04em;
}

/* TOC */
.toc-list { list-style: none; }
.toc-list li {
  padding: .35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-light);
}
.toc-list li:last-child { border-bottom: none; }
.toc-list a { color: var(--text-light); }
.toc-list a:hover { color: var(--accent); }

/* Signatory */
.post-signatory {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-top: 3rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.post-signatory__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--accent);
}
.post-signatory__avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-signatory__info { flex: 1; }
.post-signatory__name {
  font-family: var(--ff-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .25rem;
}
.post-signatory__bio {
  font-size: .85rem;
  color: var(--text-light);
  line-height: 1.55;
}

/* Related articles */
.related-section {
  padding: 3rem 0 2rem;
  border-top: 2px solid var(--border);
  margin-top: 2rem;
}
.related-section h3 {
  font-family: var(--ff-title);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--primary);
  margin-bottom: 1.75rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--dark-nav);
  color: var(--secondary);
  padding: 2.5rem 2rem;
  margin-top: 5rem;
  border-top: 4px solid var(--accent);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.footer-copy {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-copy strong { color: var(--secondary); }
.footer-legal {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-legal a {
  font-size: .78rem;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.footer-legal a:hover { color: var(--accent); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border); }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.ornament {
  text-align: center;
  color: var(--accent);
  font-size: 1.2rem;
  letter-spacing: .5em;
  margin: 2rem 0;
  opacity: .6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablette */
@media (max-width: 1024px) {
  .index-layout {
    grid-template-columns: 1fr 280px;
    gap: 0;
  }
  .showcase-grid { grid-template-columns: 1fr 1fr; }
  .postlist-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .post-layout { grid-template-columns: 1fr; gap: 2rem; }
  .post-sidebar { position: static; }
}

/* Mobile large */
@media (max-width: 768px) {
  .container, .container--narrow { padding: 0 1.25rem; }

  .nav-inner { padding: .75rem 1.25rem; }
  .nav-logo img { height: 52px; }
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dark-nav);
    flex-direction: column;
    padding: 1rem 0;
    border-top: 2px solid var(--accent);
    box-shadow: var(--shadow-md);
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a {
    padding: .75rem 1.5rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .nav-menu a:hover { border-left-color: var(--accent); }

  .index-layout {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem;
  }
  .index-main { padding-right: 0; border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 2rem; margin-bottom: 2rem; }
  .index-sidebar { padding-left: 0; position: static; }
  .showcase-grid { grid-template-columns: 1fr; }

  .postlist-header-inner { flex-direction: column; align-items: flex-start; }
  .postlist-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }

  .post-signatory { flex-direction: column; text-align: center; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* Mobile petit */
@media (max-width: 480px) {
  .nav-logo img { height: 48px; }
  .index-main .page-h1 { font-size: 1.8rem; }
  .post-header h1 { font-size: 1.6rem; }
}

/* Nav sticky offset pour mobile */
@media (max-width: 768px) {
  .site-nav { position: sticky; top: 0; }
}

/* Masquer menu ouvert quand resize */
@media (min-width: 769px) {
  .nav-menu { display: flex !important; }
}
