/*
 Theme Name:  Andando
 Theme URI:   https://jarillero.info
 Author:      Luis Ferrari
 Description: Thème magazine éditorial sobre — jarillero.info
 Version:     2.0.0
 License:     GNU General Public License v2
 Text Domain: andando
*/

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=DM+Mono:wght@400&display=swap');

/* =============================================
   VARIABLES
   ============================================= */

:root {
  --vert:       #1C3A1C;
  --vert-mid:   #2E5C2E;
  --vert-pale:  #EBF2EB;
  --ivoire:     #F5F2EB;
  --ivoire-mid: #EDE9E0;
  --encre:      #1A1A18;
  --border:     #D4CFC4;
  --muted:      #6B6860;
  --accent:     #8B1A1A;

  --f-titre: 'Playfair Display', Georgia, serif;
  --f-corps: 'Source Serif 4', Georgia, serif;
  --f-mono:  'DM Mono', 'Courier New', monospace;

  --max-w:   860px;
  --col-w:   620px;
}

/* =============================================
   RESET & BASE
   ============================================= */

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

html { font-size: 18px; }

body {
  background: var(--ivoire);
  color: var(--encre);
  font-family: var(--f-corps);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

/* =============================================
   BANDEAU DATE
   ============================================= */

.andando-datebar {
  background: var(--encre);
  color: rgba(245,242,235,0.5);
  text-align: center;
  padding: 7px 20px;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
}

.andando-datebar em { color: rgba(245,242,235,0.8); font-style: italic; }

/* =============================================
   HEADER
   ============================================= */

#masthead {
  background: var(--vert);
  border-bottom: 3px solid var(--vert-mid);
  overflow: hidden;
}

.header-inner {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 120px;
}

.site-branding {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 28px;
}

.site-title {
  font-family: var(--f-titre);
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ivoire);
}

.site-title a { color: var(--ivoire); text-decoration: none; }
.site-title a:hover { color: rgba(245,242,235,0.85); }

.site-description {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,242,235,0.55);
  margin-top: 8px;
}

.header-image {
  flex: 1;
  overflow: hidden;
}

.header-image img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  object-position: center 38%;
  display: block;
  opacity: 0.9;
}

@media (max-width: 640px) {
  .header-inner { height: auto; }
  .site-branding { flex: 1; text-align: center; padding: 20px 16px; }
  .header-image { display: none; }
}

/* =============================================
   NAVIGATION
   ============================================= */

#site-navigation {
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.08);
}

#site-navigation ul {
  display: flex;
  justify-content: center;
  list-style: none;
  flex-wrap: wrap;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0;
}

#site-navigation ul li a {
  display: block;
  padding: 11px 18px;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,242,235,0.7);
  transition: color 0.2s, background 0.2s;
}

#site-navigation ul li a:hover,
#site-navigation ul li.current-menu-item > a,
#site-navigation ul li.current_page_item > a {
  color: var(--ivoire);
  background: rgba(255,255,255,0.07);
}

/* =============================================
   BANDEAU HERO — homepage
   ============================================= */

.andando-hero {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  position: relative;
  border-bottom: 2px solid var(--vert);
}

.andando-hero img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.andando-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--ivoire));
}

/* =============================================
   CONTENU PRINCIPAL
   ============================================= */

#content {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

/* =============================================
   ARTICLE — PREMIER (MIS EN VALEUR)
   ============================================= */

article.post:first-of-type {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 2px solid var(--vert);
}

article.post:first-of-type .andando-thumb {
  width: 100%;
  aspect-ratio: 16/7;
  overflow: hidden;
  margin-bottom: 24px;
  border-radius: 2px;
}

article.post:first-of-type .andando-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

article.post:first-of-type .andando-thumb img:hover {
  transform: scale(1.02);
}

article.post:first-of-type .entry-title {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}

article.post:first-of-type .entry-title::before {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--vert);
  margin-bottom: 16px;
}

/* =============================================
   ARTICLES — LISTE
   ============================================= */

article.post {
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

article.post:last-of-type {
  border-bottom: none;
}

/* Thumbnail dans la liste */
.andando-thumb {
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 2px;
}

.andando-thumb img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.andando-thumb img:hover { transform: scale(1.02); }

/* Catégorie */
.entry-cats {
  margin-bottom: 10px;
}

.entry-cats a {
  font-family: var(--f-mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vert-mid);
  border: 1px solid var(--vert-mid);
  border-radius: 2px;
  padding: 2px 7px;
  margin-right: 5px;
  display: inline-block;
  line-height: 1.7;
}

.entry-cats a:hover {
  background: var(--vert-pale);
  color: var(--vert);
}

/* Titre */
.entry-title {
  font-family: var(--f-titre);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.22;
  color: var(--encre);
  margin-bottom: 12px;
}

.entry-title a { color: var(--encre); }
.entry-title a:hover { color: var(--vert); }

/* Méta */
.entry-meta {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin: 10px 0 14px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Extrait */
.entry-summary {
  font-size: 0.95rem;
  color: #3A3A38;
  line-height: 1.75;
  margin-bottom: 14px;
}

/* Lire la suite */
.lire-suite {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vert);
  border-bottom: 1px solid var(--vert);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.lire-suite:hover { color: var(--accent); border-color: var(--accent); }

/* =============================================
   PAGE ARTICLE INDIVIDUEL
   ============================================= */

.single-post .andando-thumb {
  max-width: var(--col-w);
  max-height: 360px;
  overflow: hidden;
  margin: 0 auto 32px;
  border-radius: 2px;
}

.single-post .andando-thumb img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.single-post .entry-header {
  max-width: var(--col-w);
  margin: 0 auto 32px;
}

.single-post .entry-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.18;
  margin-bottom: 18px;
}

.single-post .entry-title::before {
  content: '';
  display: block;
  width: 28px;
  height: 3px;
  background: var(--vert);
  margin-bottom: 16px;
}

.single-post .entry-content {
  max-width: var(--col-w);
  margin: 0 auto;
}

.entry-content p {
  margin-bottom: 1.4em;
  font-size: 1rem;
  line-height: 1.82;
}

.entry-content h2 {
  font-family: var(--f-titre);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.4em 0 0.8em;
}

.entry-content h3 {
  font-family: var(--f-titre);
  font-size: 1.1rem;
  font-style: italic;
  margin: 2em 0 0.7em;
  color: var(--vert-mid);
}

.entry-content blockquote {
  margin: 2em 0;
  padding: 16px 22px 16px 26px;
  border-left: 3px solid var(--vert);
  background: var(--vert-pale);
  font-style: italic;
  font-size: 1.05rem;
  color: #2A2A28;
  border-radius: 0 3px 3px 0;
}

.entry-content blockquote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.entry-content a {
  color: var(--vert);
  text-decoration: underline;
  text-decoration-color: rgba(44,92,44,0.3);
  text-underline-offset: 3px;
}

.entry-content a:hover { text-decoration-color: var(--vert); }

.entry-content figure { margin: 2em 0; }

.entry-content figcaption {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.06em;
}

/* Navigation article suivant/précédent */
.post-navigation {
  max-width: var(--col-w);
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
}

.post-navigation .nav-label {
  font-family: var(--f-mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.post-navigation a {
  font-family: var(--f-titre);
  font-size: 1rem;
  color: var(--encre);
  line-height: 1.3;
}

.post-navigation a:hover { color: var(--vert); }

/* =============================================
   PAGINATION
   ============================================= */

.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 48px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 2px;
  transition: all 0.2s;
}

.page-numbers.current,
.page-numbers:hover {
  background: var(--vert);
  color: var(--ivoire);
  border-color: var(--vert);
}

/* =============================================
   COMMENTAIRES
   ============================================= */

.comments-area {
  max-width: var(--col-w);
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

.comment-body {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.comment-author .fn {
  font-family: var(--f-titre);
  font-size: 1rem;
  font-weight: 700;
}

.comment-metadata {
  font-family: var(--f-mono);
  font-size: 0.63rem;
  color: var(--muted);
  margin-top: 4px;
}

.comment-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 12px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  border: 1px solid var(--border);
  background: white;
  border-radius: 2px;
  padding: 10px 14px;
  font-family: var(--f-corps);
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--vert);
}

.comment-form input[type="submit"] {
  background: var(--vert);
  color: var(--ivoire);
  border: none;
  padding: 11px 28px;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
}

.comment-form input[type="submit"]:hover { background: var(--vert-mid); }

/* =============================================
   FOOTER
   ============================================= */

#colophon {
  background: var(--encre);
  color: rgba(245,242,235,0.5);
  padding: 28px 20px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#colophon a { color: rgba(245,242,235,0.7); }
#colophon a:hover { color: var(--ivoire); }

/* =============================================
   PAGE 404 / ARCHIVES
   ============================================= */

.page-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--vert);
}

.page-title {
  font-family: var(--f-titre);
  font-size: 2rem;
  font-weight: 400;
}

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

@media (max-width: 640px) {
  html { font-size: 16px; }
  #content { padding: 28px 16px 48px; }
  .site-branding { padding: 20px 16px 14px; }
  .post-navigation { grid-template-columns: 1fr; }
  article.post:first-of-type .entry-title::before { display: none; }
}

/* =============================================
   ACCESSIBILITÉ
   ============================================= */

:focus-visible { outline: 2px solid var(--vert); outline-offset: 3px; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* =============================================
   PREMIER ARTICLE — FEATURED PLEINE LARGEUR
   ============================================= */

.post-featured {
  padding-bottom: 52px;
  margin-bottom: 52px;
}

.featured-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 36px;
  align-items: center;
}

.post-featured .andando-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 0;
}

.post-featured .andando-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transition: transform 0.4s ease;
}

.post-featured .andando-thumb img:hover { transform: scale(1.03); }

.featured-text { display: flex; flex-direction: column; gap: 12px; }

.post-featured .entry-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
}

.post-featured .entry-title::before {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  background: var(--vert);
  margin-bottom: 12px;
}

/* Quand pas d'image : featured texte seul centré */
.post-featured .featured-inner:has(.featured-text:only-child),
.post-featured .featured-inner:not(:has(.andando-thumb)) {
  grid-template-columns: 1fr;
  max-width: var(--col-w);
  margin: 0 auto;
}

/* =============================================
   GRILLE 3 PAR 3
   ============================================= */

.posts-grid {
  width: 100%;
  margin-top: 0;
}

.grid-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 28px;
  margin-bottom: 48px;
  width: 100%;
  box-sizing: border-box;
}

.post-card--empty {
  visibility: hidden;
}

.grid-row--2,
.grid-row--3 {
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.post-card {
  display: flex;
  flex-direction: column;
  border: none;
  padding: 0;
  margin: 0;
}

.card-thumb-link { display: block; text-decoration: none; }

.card-thumb {
  aspect-ratio: 3/2;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 14px;
  background: var(--ivoire-mid);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.4s ease;
}

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

/* Placeholder quand pas d'image */
.card-thumb--empty {
  aspect-ratio: 3/2;
  background: var(--ivoire-mid);
  border-radius: 2px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.post-card .entry-title {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem) !important;
  line-height: 1.28 !important;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .entry-title::before {
  display: none !important;
}

.post-card .entry-meta {
  font-size: 0.62rem;
  margin: 0;
}

/* Résumé 3 lignes max */
.card-excerpt {
  font-family: var(--f-corps);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #4A4A48;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* Séparateur entre rangées */
.posts-grid .post-card {
  padding-bottom: 0;
  border-bottom: none;
}

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

@media (max-width: 860px) {
  .featured-inner {
    grid-template-columns: 1fr;
  }
  .post-featured .andando-thumb {
    aspect-ratio: 16/7;
  }
}

@media (max-width: 640px) {
  .grid-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* =============================================
   BOUTONS DE PARTAGE
   ============================================= */

.share-buttons {
  max-width: var(--col-w);
  margin: 40px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-label {
  font-family: var(--f-mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 2px;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--encre);
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}

.share-btn:hover { border-color: var(--vert); color: var(--vert); background: var(--vert-pale); }
.share-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.share-btn--facebook:hover { border-color: #1877F2; color: #1877F2; background: #f0f5ff; }
.share-btn--twitter:hover  { border-color: #000; color: #000; background: #f5f5f5; }
.share-btn--linkedin:hover { border-color: #0A66C2; color: #0A66C2; background: #f0f5ff; }
.share-btn--whatsapp:hover { border-color: #25D366; color: #25D366; background: #f0fff5; }
.share-btn--copy.copied    { border-color: var(--vert); color: var(--vert); background: var(--vert-pale); }

/* Pas de lire-suite ni de trait résiduel dans les cartes grille */
.post-card .lire-suite { display: none; }

/* Lien voir tous les articles */
.grid-footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.voir-tous {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vert);
  border: 1px solid var(--vert);
  padding: 10px 24px;
  border-radius: 2px;
  transition: all 0.2s;
}

.voir-tous:hover {
  background: var(--vert);
  color: var(--ivoire);
}



.site-url {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  margin-top: 5px;
}

.site-url a {
  color: rgba(245,242,235,0.35);
  text-decoration: none;
}

.site-url a:hover {
  color: rgba(245,242,235,0.7);
}

/* =============================================
   MENTIONS LÉGALES
   ============================================= */

.mentions-content {
  max-width: var(--col-w);
  margin: 0 auto;
}

.mentions-section {
  margin-bottom: 2.5em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--border);
}

.mentions-section:last-of-type {
  border-bottom: none;
}

.mentions-section h2 {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 400;
}

.mentions-section p {
  font-size: 0.95rem;
  line-height: 1.75;
}

.mentions-date {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 2em;
  text-align: right;
}

.footer-legal {
  margin-top: 6px;
}

.footer-legal a {
  color: rgba(245,242,235,0.45);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-legal a:hover {
  color: rgba(245,242,235,0.8);
}
