/* ============================================================
   Mister Wackes d'Alsace — CSS
   Couleurs Alsace : rouge #C8102E, jaune #FFD700, noir #1a1a1a, blanc #fff
   ============================================================ */

/* --- Polices custom --- */
@import url('https://fonts.googleapis.com/css2?family=Devonshire&display=swap');

@font-face {
  font-family: 'webicon';
  src: url('/fonts/webicon.eot');
  src: url('/fonts/webicon.eot?#iefix') format('embedded-opentype'),
       url('/fonts/webicon.woff')        format('woff'),
       url('/fonts/webicon.ttf')         format('truetype'),
       url('/fonts/webicon.svg#webicon') format('svg');
  font-weight: normal;
  font-style: normal;
}

/* --- Reset minimal --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* --- Variables --- */
:root {
  --rouge:        #C8102E;
  --rouge-pale:   #fdeaed;
  --jaune:        #FFD700;
  --noir:         #1a1a1a;
  --blanc:        #ffffff;
  --gris:         #f4f4f4;
  --ombre:        0 3px 12px rgba(0,0,0,0.18);
  --radius:       6px;
  --max-w:        1000px;
  --font:         'Segoe UI', Arial, sans-serif;
  --header-h:     56px;
}

/* --- Corps — image de fond fixe, décalée sous le header --- */
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--noir);
  background:
    url('/images/alsace.jpg') center top no-repeat fixed;
  background-size: cover;
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
}

/* --- Header --- */
.site-header {
  background: var(--rouge);
  color: var(--blanc);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.site-header-inner {
  max-width: var(--max-w);
  margin: auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Titre site : police Devonshire --- */
.site-title a {
  font-family: 'Devonshire', cursive;
  font-size: 1.8rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  color: var(--blanc);
}

/* --- Le "a" de Alsace : police webicon, couleur jaune --- */
.site-title .a-coeur {
  font-family: 'webicon', cursive;
  font-size: 50%;
  color: var(--blanc);
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--blanc);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s;
}

.site-nav a:hover {
  background: rgba(255,255,255,0.2);
}

/* --- Contenu principal --- */
.site-main {
  max-width: var(--max-w);
  margin: 2rem auto;
  padding: 0 1rem;
  padding-top: 0; /* header sticky, pas besoin de padding-top */
}

/* --- Section liste d'articles — fond wavewhite --- */
.posts-section {
  background: #fff url('/images/wavewhite.png');
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--ombre);
}

.section-title {
  font-size: 1.6rem;
  color: var(--rouge);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--jaune);
}

/* --- Grille de cartes --- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.post-card {
  background: var(--blanc);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--ombre);
  transition: transform 0.15s, box-shadow 0.15s;
  border-top: 3px solid var(--rouge);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}

.post-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--gris);
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-card-img img {
  transform: scale(1.04);
}

.post-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--noir);
  line-height: 1.3;
}

.post-card-date {
  font-size: 0.8rem;
  color: var(--rouge);
  font-weight: 600;
}

.post-card-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
}

/* --- Pagination — propre, sans puces, sans bordures --- */
.pagination {
  display: flex;
  list-style: none;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 0;
}

/* Cibler aussi les ul générés par Hugo */
.pagination ul {
  list-style: none;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

.pagination li {
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  background: var(--rouge-pale);
  color: var(--rouge);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  border: none;
}

.pagination a:hover {
  background: var(--rouge);
  color: var(--blanc);
}

/* Page active */
.pagination .active a,
.pagination .active span {
  background: var(--rouge);
  color: var(--blanc);
  cursor: default;
}

/* Désactivé (première/dernière page aux extrêmes) */
.pagination .disabled a,
.pagination .disabled span {
  opacity: 0.4;
  pointer-events: none;
}

/* --- Article single — fond wavewhite --- */
.post-single {
  background: #fff url('/images/wavewhite.png');
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--ombre);
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--jaune);
}

.post-title {
  font-size: 1.8rem;
  color: var(--rouge);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.post-date {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
}

.post-featured {
  margin-top: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.post-featured img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

/* --- Contenu article --- */
.post-content h2 {
  font-size: 1.4rem;
  color: var(--rouge);
  margin: 1.8rem 0 0.7rem;
}

.post-content h3 {
  font-size: 1.15rem;
  color: var(--noir);
  margin: 1.4rem 0 0.5rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--jaune);
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content strong {
  color: var(--rouge);
}

.post-content a {
  color: var(--rouge);
  text-decoration: underline;
}

.post-content ul, .post-content ol {
  margin: 0.8rem 0 1rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.3rem;
}

/* --- Galerie lightbox --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  margin: 1.5rem 0;
}

.gallery-grid a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}

.gallery-grid a:hover {
  border-color: var(--rouge);
  transform: scale(1.03);
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* --- Page statique (à-propos) — fond wavewhite --- */
.page-single {
  background: #fff url('/images/wavewhite.png');
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--ombre);
}

/* --- Footer --- */
.site-footer {
  max-width: var(--max-w);
  margin: 0 auto 2rem;
  padding: 1rem 1.5rem;
  background: var(--noir);
  color: var(--blanc);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--jaune);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  :root { --header-h: 56px; }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
  }

  .site-title a { font-size: 1.3rem; }

  .site-nav {
    gap: 0.2rem;
  }

  .site-nav a {
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
  }

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

  .post-single, .posts-section, .page-single {
    padding: 1.25rem;
  }

  .post-title { font-size: 1.4rem; }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* --- Page à-propos : layout deux colonnes --- */
.apropos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.apropos-col img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
}

.apropos-col h2 {
  font-size: 1.3rem;
  color: var(--rouge);
  margin: 1.2rem 0 0.6rem;
}

.apropos-col h3 {
  font-size: 1.05rem;
  color: var(--noir);
  margin: 1rem 0 0.4rem;
  padding-left: 0.7rem;
  border-left: 4px solid var(--jaune);
}

.apropos-col p {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}

.apropos-col a {
  color: var(--rouge);
  text-decoration: underline;
}

.apropos-encart {
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.apropos-encart h2 {
  margin-top: 0;
}

.apropos-encart--rouge {
  background: var(--rouge);
  color: var(--blanc);
}

.apropos-encart--rouge h2,
.apropos-encart--rouge a {
  color: var(--blanc);
}

.apropos-encart--gris {
  background: #4a4a4a;
  color: var(--blanc);
}

.apropos-encart--gris h2 {
  color: var(--blanc);
}

.apropos-encart--gris blockquote {
  border-left: 3px solid var(--jaune);
  padding-left: 1rem;
  margin: 0;
  font-style: italic;
}

.apropos-encart--gris blockquote p {
  margin-bottom: 0.6rem;
}

@media (max-width: 640px) {
  .apropos-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Bannière slider par page --- */
.page-banner {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.page-banner img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  object-position: center;
  display: block;
}
