/*
Theme Name: Discover Child
Template: astra
Description: Thème enfant Astra pour média Google Discover : accueil en cartes, lecture confortable, signaux E-E-A-T.
Version: 1.0.0
License: GPL v2 or later
Text Domain: discover-child
*/

:root {
  --dc-accent: #8a5a2b;     /* brun patrimoine, accordé au logo */
  --dc-ink: #1f1b16;
  --dc-mut: #6b6154;
  --dc-line: #e5ded3;
  --dc-bg: #f4f1ec;
  --mag-accent: var(--dc-accent);
}

/* Lecture : typographie système (aucune police externe, meilleur LCP) */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--dc-ink); }
.single .entry-content { font-size: 1.1rem; line-height: 1.7; }
.single .entry-content > p:first-of-type { font-size: 1.18rem; font-weight: 500; }
.single .entry-title { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; letter-spacing: -.01em; }
.single .entry-content h2 { margin-top: 1.8em; font-size: 1.45rem; line-height: 1.3; }
.single .post-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }

/* Fil d'Ariane et ligne auteur */
.dc-crumbs { font-size: .82rem; color: var(--dc-mut); margin-bottom: 10px; }
.dc-crumbs a { color: var(--dc-mut); }
.dc-byline { display: flex; align-items: center; gap: 12px; margin: 14px 0 18px; }
.dc-byline-avatar { border-radius: 50%; }
.dc-byline-name { font-weight: 700; color: var(--dc-ink); text-decoration: none; }
.dc-byline-meta { font-size: .85rem; color: var(--dc-mut); }

/* Encadré auteur */
.dc-author { display: flex; gap: 16px; margin: 32px 0; padding: 18px; border: 1px solid var(--dc-line); border-radius: 14px; background: #fff; }
.dc-author-avatar { border-radius: 50%; flex: 0 0 72px; }
.dc-author-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--dc-accent); }
.dc-author-name { font-weight: 800; font-size: 1.05rem; color: var(--dc-ink); text-decoration: none; }
.dc-author-bio { margin: 6px 0 0; font-size: .92rem; color: var(--dc-mut); }

/* Suivi de l'histoire (mu-plugin Socle Discover) */
.socle-story { margin: 28px 0; padding: 14px 16px; border: 1px solid var(--dc-line); border-radius: 12px; }
.socle-story-title { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dc-accent); margin-bottom: 8px; }
.socle-story-list { margin: 0; padding-left: 1.1em; }
.socle-story-item { margin: 8px 0; }
.socle-story-item.is-current { font-weight: 700; }
.socle-story-date { display: block; font-size: .78rem; color: var(--dc-mut); }

/* Accueil et archives en cartes */
body.home, body.archive { background: var(--dc-bg); }
.home .ast-article-post, .archive .ast-article-post { padding: 0 10px !important; }
.home .ast-article-inner, .archive .ast-article-inner { background: #fff; border: 1px solid var(--dc-line); border-radius: 14px; overflow: hidden; height: 100%; box-shadow: 0 2px 6px rgba(0,0,0,.05); transition: box-shadow .2s, transform .2s; }
.home .ast-article-post:hover .ast-article-inner, .archive .ast-article-post:hover .ast-article-inner { box-shadow: 0 12px 30px rgba(0,0,0,.12); transform: translateY(-3px); }
.home .post-thumb, .archive .post-thumb { margin: 0 !important; overflow: hidden; }
.home .post-thumb img, .archive .post-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.home .post-content > *, .archive .post-content > * { padding-left: 18px; padding-right: 18px; }
.home .cat-links a, .archive .cat-links a { display: inline-block; background: #f0e6d8; color: var(--dc-accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; text-decoration: none; }
.home .entry-title, .archive .entry-title { font-size: 1.12rem; line-height: 1.32; margin: 10px 0 6px; }
.home .entry-title a, .archive .entry-title a { color: var(--dc-ink); }
@media (min-width: 922px) {
  /* Premier article de l'accueil en « une » sur toute la largeur */
  .home .ast-row > article.ast-article-post:first-child { flex: 0 0 100%; max-width: 100%; }
  .home article:first-child .post-content { display: grid; grid-template-columns: 1.25fr 1fr; column-gap: 28px; align-content: center; }
  .home article:first-child .post-thumb { grid-column: 1; grid-row: 1 / 20; }
  .home article:first-child .entry-title { font-size: 1.7rem; }
}

/* Avatars : jamais déformés */
.dc-byline-avatar { width: 44px !important; height: 44px !important; flex: 0 0 44px; object-fit: cover; aspect-ratio: 1 / 1; border-radius: 50%; }
.dc-author-avatar { width: 80px !important; height: 80px !important; flex: 0 0 80px; object-fit: cover; aspect-ratio: 1 / 1; border-radius: 50%; }
.dc-author { align-items: flex-start; }
.dc-author-liens { margin: 8px 0 0; font-size: .85rem; }
.dc-author-liens a { color: var(--dc-accent); }

/* Pied de page éditorial : remplace celui d'Astra */
.site-footer, .ast-small-footer, footer.site-footer { display: none !important; }
.tec-ftr { background: #1f1b16; color: #d9d2c8; padding: 44px 20px 0; margin-top: 48px; }
.tec-ftr-in { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.tec-ftr-logo { font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.tec-ftr-tag { margin: 6px 0 14px; color: #b8ad9d; font-size: .95rem; }
.tec-ftr-note { font-size: .82rem; line-height: 1.5; color: #9d9285; margin: 0 0 10px; }
.tec-ftr-note a { color: #d9d2c8; text-decoration: underline; }
.tec-ftr-titre { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #c9a26b; margin-bottom: 12px; }
.tec-ftr-col ul { list-style: none; margin: 0; padding: 0; }
.tec-ftr-col li { margin: 0 0 8px; }
.tec-ftr-col a { color: #d9d2c8; text-decoration: none; font-size: .92rem; }
.tec-ftr-col a:hover { color: #fff; text-decoration: underline; }
.tec-ftr-bas { max-width: 1100px; margin: 32px auto 0; padding: 16px 0 24px; border-top: 1px solid #3a332b; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .8rem; color: #8d8377; }
@media (max-width: 921px) {
  .tec-ftr-in { grid-template-columns: 1fr 1fr; gap: 24px; }
  .tec-ftr-brand { grid-column: 1 / -1; }
}

/* ======================================================================
   Accueil et archives : grille de cartes façon magazine (indépendante d'Astra)
   ==================================================================== */
body.home .ast-row, body.archive .ast-row, body.search .ast-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 26px; align-items: stretch;
}
body.home .ast-article-post, body.archive .ast-article-post, body.search .ast-article-post {
  width: 100% !important; max-width: none !important; flex: none !important; padding: 0 !important; margin: 0 !important;
}
body.home .ast-article-inner, body.archive .ast-article-inner, body.search .ast-article-inner {
  display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--dc-line);
  border-radius: 14px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.05); transition: box-shadow .2s, transform .2s;
}
body.home .ast-article-post:hover .ast-article-inner, body.archive .ast-article-post:hover .ast-article-inner { box-shadow: 0 14px 34px rgba(0,0,0,.13); transform: translateY(-3px); }
body.home .post-thumb, body.archive .post-thumb { margin: 0 !important; }
body.home .post-thumb img, body.archive .post-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
body.home .post-content, body.archive .post-content { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
body.home .entry-title, body.archive .entry-title { font-size: 1.1rem; line-height: 1.33; margin: 4px 0; }
body.home .entry-meta, body.archive .entry-meta { font-size: .78rem; color: var(--dc-mut); }
body.home .ast-excerpt-container, body.archive .ast-excerpt-container { color: var(--dc-mut); font-size: .92rem; line-height: 1.5; }

/* La une : premier article sur toute la largeur, image à gauche */
@media (min-width: 922px) {
  body.home .ast-row > article.ast-article-post:first-child { grid-column: 1 / -1; }
  body.home .ast-row > article:first-child .ast-article-inner { display: grid; grid-template-columns: 1.3fr 1fr; align-items: stretch; }
  body.home .ast-row > article:first-child .post-thumb { grid-row: 1 / 9; height: 100%; }
  body.home .ast-row > article:first-child .post-thumb img { height: 100%; aspect-ratio: auto; min-height: 340px; }
  body.home .ast-row > article:first-child .post-content { justify-content: center; padding: 28px 32px; }
  body.home .ast-row > article:first-child .entry-title { font-size: 1.85rem; line-height: 1.22; }
  body.home .ast-row > article:first-child .ast-excerpt-container { font-size: 1.02rem; }
}

/* ======================================================================
   Page d'accueil éditoriale (front-page.php)
   ==================================================================== */
.tec-accueil { max-width: 1160px; margin: 0 auto; padding: 0 16px 8px; }
.tec-pastille { display: inline-block; background: #f0e6d8; color: var(--dc-accent); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; text-decoration: none; }
.tec-pastille:hover { background: var(--dc-accent); color: #fff; }

/* La une */
.tec-une { display: grid; grid-template-columns: 1.35fr 1fr; gap: 0; background: #fff; border: 1px solid var(--dc-line); border-radius: 16px; overflow: hidden; margin: 24px 0 36px; box-shadow: 0 6px 24px rgba(0,0,0,.07); }
.tec-une-img { display: block; }
.tec-une-img img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; display: block; }
.tec-une-texte { padding: 30px 34px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.tec-une-titre { font-size: 2rem; line-height: 1.2; margin: 0; letter-spacing: -.015em; }
.tec-une-titre a { color: var(--dc-ink); text-decoration: none; }
.tec-une-titre a:hover { color: var(--dc-accent); }
.tec-une-chapo { margin: 0; color: var(--dc-mut); font-size: 1.04rem; line-height: 1.55; }
.tec-une-meta { font-size: .84rem; color: var(--dc-mut); }
.tec-btn { align-self: flex-start; background: var(--dc-accent); color: #fff; text-decoration: none; font-weight: 700; font-size: .92rem; padding: 10px 20px; border-radius: 999px; }
.tec-btn:hover { background: #6f4722; color: #fff; }

/* Blocs et grille de cartes */
.tec-bloc { margin: 0 0 40px; }
.tec-bloc-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 18px; border-bottom: 2px solid var(--dc-accent); padding-bottom: 8px; }
.tec-bloc-tete h2 { font-size: 1.15rem; margin: 0; text-transform: uppercase; letter-spacing: .05em; }
.tec-lien-tete { font-size: .85rem; color: var(--dc-accent); text-decoration: none; }
.tec-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 24px; }
.tec-card { background: #fff; border: 1px solid var(--dc-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.tec-card:hover { box-shadow: 0 14px 32px rgba(0,0,0,.13); transform: translateY(-3px); }
.tec-card-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.tec-card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.tec-card-titre { font-size: 1.06rem; line-height: 1.34; margin: 0; }
.tec-card-titre a { color: var(--dc-ink); text-decoration: none; }
.tec-card-titre a:hover { color: var(--dc-accent); }
.tec-card-chapo { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--dc-mut); }
.tec-card-meta { font-size: .78rem; color: #9a9184; }

/* Deux colonnes : plus lus et en ce moment */
.tec-deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

/* Territoires et rubriques */
.tec-territoires { display: flex; flex-wrap: wrap; gap: 10px; }
.tec-territoire { background: #fff; border: 1px solid var(--dc-line); border-radius: 999px; padding: 9px 16px; text-decoration: none; color: var(--dc-ink); font-size: .92rem; }
.tec-territoire:hover { border-color: var(--dc-accent); color: var(--dc-accent); }
.tec-grille-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tec-rubrique { background: #fff; border: 1px solid var(--dc-line); border-radius: 14px; padding: 18px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.tec-rubrique:hover { border-color: var(--dc-accent); }
.tec-rubrique-nom { font-weight: 800; color: var(--dc-ink); font-size: 1.05rem; }
.tec-rubrique-nb { font-size: .78rem; color: var(--dc-accent); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.tec-rubrique-dernier { font-size: .88rem; color: var(--dc-mut); margin-top: 4px; }

@media (max-width: 921px) {
  .tec-une { grid-template-columns: 1fr; }
  .tec-une-img img { min-height: 220px; }
  .tec-une-texte { padding: 22px 20px; }
  .tec-une-titre { font-size: 1.5rem; }
  .tec-deux-col { grid-template-columns: 1fr; gap: 24px; }
}

/* Plan du site */
.tec-plan h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--dc-accent); padding-bottom: 6px; margin: 30px 0 14px; }
.tec-plan ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.tec-plan li { margin: 0 0 8px; break-inside: avoid; }
.tec-plan a { color: var(--dc-ink); text-decoration: none; }
.tec-plan a:hover { color: var(--dc-accent); text-decoration: underline; }
.tec-plan-nb, .tec-plan-date { color: var(--dc-mut); font-size: .8rem; }
@media (max-width: 700px) { .tec-plan ul { columns: 1; } }

/* Liens internes dans les articles */
.single .entry-content a { color: var(--dc-accent); text-decoration: underline; text-underline-offset: 2px; }
.tec-aller-plus-loin { margin: 28px 0; padding: 16px 18px; border-left: 4px solid var(--dc-accent); background: #faf7f2; border-radius: 0 12px 12px 0; }
.tec-aller-plus-loin strong { display: block; margin-bottom: 8px; text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; color: var(--dc-accent); }
.tec-reperes { margin: 24px 0; padding: 16px 18px; border: 1px solid var(--dc-line); border-radius: 12px; background: #fff; }
.tec-reperes strong { display: block; margin-bottom: 8px; text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; color: var(--dc-accent); }

.tec-derniers { list-style: none; margin: 0 0 24px; padding: 0; }
.tec-derniers li { padding: 9px 0; border-bottom: 1px solid var(--dc-line); }
.tec-derniers a { color: var(--dc-ink); text-decoration: none; font-weight: 600; }
.tec-derniers a:hover { color: var(--dc-accent); }

/* Cartes des pages piliers */
.tec-pilier { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--dc-line); border-radius: 14px; background: #fff; text-decoration: none; transition: border-color .15s, transform .15s; }
.tec-pilier:hover { border-color: var(--dc-accent); transform: translateY(-2px); }
.tec-pilier-nom { font-weight: 700; font-size: 1.05rem; color: var(--dc-ink); line-height: 1.3; }
.tec-pilier-chapo { color: var(--dc-mut); font-size: .92rem; line-height: 1.45; }
.tec-ftr-in { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; }
@media (max-width: 900px) { .tec-ftr-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tec-ftr-in { grid-template-columns: 1fr; } }

/* Tableaux dans les articles */
.entry-content .wp-block-table { overflow-x: auto; margin: 26px 0; }
.entry-content .wp-block-table table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content .wp-block-table th { background: #faf7f2; text-align: left; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--dc-accent); }
.entry-content .wp-block-table th, .entry-content .wp-block-table td { border: 1px solid var(--dc-line); padding: 9px 12px; vertical-align: top; }
.entry-content .wp-block-table figcaption { color: var(--dc-mut); font-size: .85rem; margin-top: 7px; }
.entry-content .wp-block-list { margin: 18px 0 22px; padding-left: 20px; }
.entry-content .wp-block-list li { margin-bottom: 9px; }

/* Image à la une en tête d'article */
.dc-hero { margin: 18px 0 26px; }
.dc-hero-img { width: 100%; height: auto; border-radius: 14px; display: block; }
.dc-hero-legende { margin-top: 8px; font-size: .85rem; color: var(--dc-mut); line-height: 1.45; }

/* En-tête de la page d'accueil */
.tec-accueil-tete { margin: 0 0 26px; }
.tec-accueil-tete h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.15; margin: 0 0 10px; }
.tec-accueil-tete p { color: var(--dc-mut); font-size: 1.02rem; max-width: 60ch; margin: 0; }

/* Une seule signature en tête d'article : la nôtre, plus complète que celle d'Astra */
.single-post .ast-single-post-order .entry-meta,
.single-post .entry-header .entry-meta { display: none; }
