/*
Theme Name: Les Gralettes
Description: Thème maison de lesgralettes.com, charte V5 carreaux de ciment (Caprasimo, Gabarito, Gaegu hébergées sur le site). Sans constructeur ni jQuery. Le HTML du catalogue vient du plugin gralettes-catalogue.
Version: 0.3.8
Requires PHP: 8.0
Text Domain: gralettes
*/

:root {
  --vert: #0E6B50; --safran: #F4B41A; --brique: #E5462F; --rose: #F6B8C4; --ardoise: #2F4E7A;
  --encre: #1B1B1F; --chaux: #FBF8F1; --menthe: #BFE3D3; --gris: #555; --trait: #eee;
  --titre: Caprasimo, Georgia, serif; --texte: Gabarito, system-ui, -apple-system, "Segoe UI", sans-serif;
  --large: 1240px; --lecture: 720px; --marge: 32px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: #fff; color: var(--encre); font-family: var(--texte); font-size: 16px; line-height: 1.5; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--vert); }
h1, h2, h3 { line-height: 1.12; }
.saut { position: absolute; left: -9999px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saut:focus { left: 16px; top: 16px; z-index: 50; background: #fff; padding: 8px 12px; border: 2px solid var(--encre); }
:focus-visible { outline: 3px solid var(--ardoise); outline-offset: 2px; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- En-tête (maquettes V5 à V7) ---------- */
.ann { background: var(--menthe); text-align: center; font-weight: 600; font-size: 13px; padding: 7px 16px; }
.tete { border-bottom: 1px solid #f0f0f0; background: #fff; position: relative; z-index: 20; }
.tete-in { max-width: var(--large); margin: 0 auto; display: flex; align-items: center; gap: 26px; padding: 14px var(--marge); }
.logo { font-family: var(--titre); font-size: 27px; color: var(--vert); display: flex; align-items: center; gap: 9px; text-decoration: none; line-height: 1; white-space: nowrap; }
.logo svg { flex: none; }
.nav { display: flex; gap: 22px; font-weight: 500; }
.nav a, .nav-m a { color: var(--encre); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--vert); }
.loupe { margin-left: auto; }
.loupe > summary, .menu-m > summary { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--encre); }
.loupe[open] > summary, .loupe > summary:hover { background: var(--chaux); }
.loupe-p { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--trait); box-shadow: 0 12px 24px rgba(0,0,0,.06); padding: 18px var(--marge) 22px; }
.loupe-p .rech { max-width: 900px; margin: 0 auto; }
/* « Ma zone » (décision 143) */
.zone > summary { height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 8px; color: var(--encre); font-weight: 600; font-size: 14px; cursor: pointer; list-style: none; white-space: nowrap; }
.zone[open] > summary, .zone > summary:hover { background: var(--chaux); }
.zone.choisie > summary { color: var(--vert); }
.zone.choisie > summary svg { fill: var(--menthe); }
.zone-p { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--trait); box-shadow: 0 12px 24px rgba(0,0,0,.06); padding: 18px var(--marge) 22px; }
.zone-f { max-width: 560px; margin: 0 auto; }
.zone-t { margin: 0 0 12px; color: var(--gris); font-size: 15px; }
.zone-f label { display: block; font-weight: 600; margin-bottom: 6px; }
.zone-r { display: flex; gap: 10px; }
.zone-r select { flex: 1; min-width: 0; font: inherit; padding: 9px 10px; border: 1.5px solid var(--encre); border-radius: 8px; background: #fff; }
.zone-ok { font: inherit; font-weight: 600; background: var(--vert); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; }
.zone-x { margin-top: 12px; font: inherit; font-size: 14px; background: none; border: 0; padding: 0; color: var(--brique); text-decoration: underline; cursor: pointer; }
.zone-x[hidden] { display: none; }
.cadeau { background: var(--rose); color: var(--encre); padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.menu-m { display: none; }

/* recherche Où / Quand / Envie de */
.rech { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; border: 2px solid var(--encre); border-radius: 12px; overflow: hidden; background: #fff; }
.rech-c { display: flex; flex-direction: column; padding: 8px 14px; border-right: 1px solid #ddd; font-size: 12px; font-weight: 600; min-width: 0; }
.rech-c em { font-style: normal; font-weight: 400; color: #888; }
.rech-c select, .rech-c input { border: 0; background: transparent; font: inherit; font-size: 15px; font-weight: 400; color: var(--encre); padding: 2px 0; min-width: 0; width: 100%; }
.rech-c select:focus, .rech-c input:focus { outline: none; }
.rech-c:focus-within { background: var(--chaux); }
.bouton { background: var(--vert); color: #fff; border: 0; font: inherit; font-weight: 600; padding: 0 22px; cursor: pointer; border-radius: 0; }
.bouton:hover { background: #0a5540; }

/* ---------- Pied de page ---------- */
.pied { margin-top: 64px; background: #fff; }
.frise { height: 46px; background-size: 184px 46px; background-repeat: repeat-x; }
.pied-in { max-width: var(--large); margin: 0 auto; padding: 34px var(--marge) 10px; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.pied-marque p { color: var(--gris); font-size: 14px; max-width: 280px; }
.pied-t { font-family: var(--titre); font-size: 17px; margin: 4px 0 10px; }
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin: 0 0 7px; font-size: 14px; }
.pied li a { color: var(--encre); text-decoration: none; }
.pied li a:hover { text-decoration: underline; }
.pied-aff, .pied-c { max-width: var(--large); margin: 0 auto; padding: 6px var(--marge); font-size: 12.5px; color: #666; }
.pied-c { padding-bottom: 28px; }

/* ---------- Fil d'Ariane, titres de page ---------- */
.fil { font-size: 13px; color: #777; padding: 18px 0 0; }
.fil a { color: var(--gris); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #ccc; }
.chapo { color: #444; max-width: 700px; line-height: 1.5; margin: 0 0 8px; }

/* ---------- Pages du catalogue : le plugin porte sa mise en page (.gc) ---------- */
.cat-p { max-width: var(--large); margin: 0 auto; }
.cat-p > .fil { padding-left: var(--marge); }
.cat-h1 { font-family: var(--titre); font-weight: 400; font-size: 40px; margin: 4px var(--marge) 6px; }
.cat-p .gc.alignwide { max-width: none; width: auto; margin: 0; }
/* les liens du catalogue prennent le style des maquettes (feuilles du plugin), pas celui des articles. :where() ramene la regle
   au poids d'un simple « a » : elle bat le vert des articles (ligne a {}), mais jamais une couleur posee par le plugin
   (texte blanc des boutons « Reserver », decision 146) */
:where(.cat-p .gc) a { color: inherit; text-decoration: none; }
.gc-rech .rech-haut { padding: 8px var(--marge) 14px; }
.gc-rech .rech-haut .rech { max-width: 900px; }
.gc-rech .blocs .tags { padding: 0 var(--marge); }

/* ---------- Pages simples ---------- */
.g-page { max-width: var(--lecture); margin: 0 auto; padding: 0 16px; }
.g-page h1, .billet h1, .blog h1, .e404 h1 { font-family: var(--titre); font-weight: 400; font-size: 40px; margin: 6px 0 10px; }

/* ---------- Article ---------- */
.billet { max-width: var(--lecture); margin: 0 auto; padding: 0 16px; }
.billet-m { color: var(--gris); font-size: 14px; margin: 0 0 18px; }
.billet-m a { color: inherit; }
.billet-ph { margin: 0 0 22px; }
.billet-ph img { width: 100%; border-radius: 12px; display: block; }
.sommaire { border: 1.5px solid var(--trait); border-radius: 12px; margin: 0 0 26px; background: #fff; }
.sommaire > summary { padding: 12px 16px; font-family: var(--titre); font-size: 18px; display: flex; align-items: center; gap: 10px; }
.sommaire > summary::before { content: ""; width: 10px; height: 10px; border-right: 2.5px solid var(--vert); border-bottom: 2.5px solid var(--vert); transform: rotate(-45deg); transition: transform .15s; }
.sommaire[open] > summary::before { transform: rotate(45deg); }
.sommaire > summary span { font-family: var(--texte); font-size: 13px; color: #777; margin-left: auto; }
.sommaire ol { margin: 0; padding: 0 20px 14px 40px; }
.sommaire li { margin: 0 0 6px; }
.sommaire a { color: var(--encre); }

/* texte des articles et des pages */
.texte { font-size: 18px; line-height: 1.65; }
.texte > * { margin-top: 0; margin-bottom: 1.1em; }
.texte h2 { font-family: var(--titre); font-weight: 400; font-size: 28px; margin: 1.8em 0 .5em; }
.texte h3 { font-size: 21px; font-weight: 700; margin: 1.5em 0 .4em; }
.texte h4 { font-size: 18px; font-weight: 700; margin: 1.3em 0 .3em; }
.texte a { text-underline-offset: 3px; }
.texte ul, .texte ol { padding-left: 1.3em; }
.texte li { margin-bottom: .35em; }
.texte img { border-radius: 8px; }
.texte figure { margin-left: 0; margin-right: 0; }
.texte figcaption { font-size: 14px; color: #666; margin-top: 6px; }
.texte blockquote { border-left: 4px solid var(--safran); margin-left: 0; padding: 2px 0 2px 18px; color: #333; }
.texte hr { border: 0; height: 14px; background: none; }
.texte .wp-block-table { overflow-x: auto; }
.texte table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.4; }
.texte th, .texte td { border-bottom: 1px solid #e6e6e6; padding: 9px 10px; text-align: left; vertical-align: top; }
.texte thead th, .texte tr:first-child th { background: var(--chaux); font-weight: 700; }
.texte .wp-block-media-text { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.texte .wp-block-media-text .wp-block-media-text__content { padding: 0; }
/* FAQ Yoast */
.texte .schema-faq { border-top: 1.5px solid var(--trait); }
.texte .schema-faq-section { border-bottom: 1.5px solid var(--trait); padding: 14px 0; }
.texte .schema-faq-question { display: block; font-weight: 700; font-size: 19px; margin-bottom: 6px; }
.texte .schema-faq-answer { margin: 0; }

/* fiches recettes WP Recipe Maker, dans la charte (décision 108) */
.texte .wprm-recipe, .wprm-popup { --meadow-main-background-color: var(--chaux); --meadow-list-border-color: #E9DFC8; --meadow-accent-color: var(--vert); --comment-rating-star-color: var(--safran); --wprm-popup-accent: var(--vert); }
.texte .wprm-recipe-container { margin: 2em 0; }
.texte .wprm-recipe { font-family: var(--texte) !important; border: 1.5px solid var(--trait) !important; border-radius: 12px; padding: 22px !important; background: #fff !important; font-size: 16px; }
.texte .wprm-recipe-name, .texte .wprm-recipe .wprm-recipe-header { font-family: var(--titre) !important; font-weight: 400 !important; color: var(--encre) !important; }
.texte .wprm-recipe-name { font-size: 28px !important; }
.texte .wprm-recipe .wprm-recipe-header { font-size: 21px !important; margin-top: 1.2em !important; }
.texte .wprm-recipe a.wprm-recipe-link { background: var(--vert) !important; border-color: var(--vert) !important; color: #fff !important; border-radius: 8px !important; text-decoration: none; }
.texte .wprm-recipe-image img { border-radius: 8px; }
.texte .wprm-recipe-details-label, .texte .wprm-recipe-time-label { font-weight: 700; }
.texte .wprm-rating-star svg path, .texte .wprm-rating-star svg polygon { fill: var(--safran) !important; stroke: var(--safran) !important; }
.texte .wprm-recipe-ingredients li, .texte .wprm-recipe-instructions li { margin-bottom: .4em; }

/* carte de recommandation [reco] (décision 127) : photo, produit, marchand, phrase, bouton, mention d'affiliation */
.texte .reco { display: grid; grid-template-columns: 170px 1fr; gap: 6px 22px; margin: 1.8em 0; padding: 18px; background: var(--chaux); border: 2px solid var(--encre); border-radius: 14px; box-shadow: 5px 5px 0 var(--safran); font-size: 16px; line-height: 1.45; }
.texte .reco > * { margin: 0; }
.texte .reco p { margin: 0; }
.reco-im { display: grid; place-items: center; aspect-ratio: 1; background: #fff; border-radius: 10px; overflow: hidden; align-self: start; }
.reco-im img { width: 100%; height: 100%; object-fit: contain; border-radius: 0 !important; }
.reco-vide { background: var(--chaux); border: 1.5px solid #E9DFC8; }
.reco-ill { width: 100%; height: 100%; background-size: 70% auto, cover; background-position: center; background-repeat: no-repeat; }
.reco-c { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.reco-e { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brique); }
.reco-t { font-family: var(--titre); font-size: 24px; line-height: 1.15; }
.texte .reco-t a { color: var(--encre); text-decoration: none; }
.texte .reco-t a:hover { text-decoration: underline; text-decoration-color: var(--vert); }
.reco-m { color: var(--gris); font-size: 14px; }
.reco-x { margin-top: 6px !important; color: #333; }
.texte .reco-b { align-self: flex-start; margin-top: 10px; background: var(--vert); color: #fff; text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: 10px; }
.texte .reco-b:hover { background: #0a5540; }
.reco-a { grid-column: 1 / -1; font-size: 12.5px; color: #666; border-top: 1px dashed #E0D6C0; padding-top: 10px; margin-top: 10px !important; }
.reco-err { background: #fff3cd; border: 1px solid var(--safran); padding: 8px 12px; font-size: 14px; border-radius: 8px; }

/* autrice et articles liés */
.autrice { display: flex; gap: 16px; align-items: flex-start; border-top: 1.5px solid var(--trait); margin-top: 34px; padding-top: 20px; font-size: 15px; color: #444; }
.autrice-av { border-radius: 50%; flex: none; }
.autrice p { margin: 0 0 4px; }
.autrice-n { font-family: var(--titre); font-size: 19px; color: var(--encre); }
.lies { max-width: var(--large); margin: 40px auto 0; padding: 0 var(--marge); }
.lies h2, .g-blog h2 { font-family: var(--titre); font-weight: 400; font-size: 30px; margin: 0 0 16px; }

/* ---------- Listes d'articles ---------- */
.g-blog { max-width: var(--large); margin: 0 auto; padding: 0 var(--marge); }
.pastilles { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 22px; scrollbar-width: none; }
.pastilles a { flex: none; border: 1.5px solid var(--encre); border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 500; color: var(--encre); text-decoration: none; }
.pastilles a span { color: #888; font-size: 12.5px; }
.pastilles a[aria-current] { background: var(--menthe); border-color: var(--menthe); font-weight: 600; }
.grille-a { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
.ca-l { display: block; color: var(--encre); text-decoration: none; }
.ca-im { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--chaux); }
.ca-im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ca-vide { display: grid; place-items: center; }
.ca-c { display: block; font-size: 12.5px; font-weight: 600; color: var(--vert); margin-top: 10px; text-transform: uppercase; letter-spacing: .04em; }
.ca-t { display: block; font-weight: 600; font-size: 17px; line-height: 1.28; margin-top: 4px; }
.ca-l:hover .ca-t { text-decoration: underline; text-underline-offset: 3px; }
.ca-m { display: block; font-size: 13px; color: #777; margin-top: 4px; }
.pagin { display: flex; gap: 8px; justify-content: center; margin: 34px 0 0; flex-wrap: wrap; }
.pagin a, .pagin span { border: 1.5px solid var(--trait); border-radius: 8px; padding: 7px 12px; color: var(--encre); text-decoration: none; font-size: 14px; }
.pagin .current { background: var(--encre); border-color: var(--encre); color: #fff; }

/* ---------- Contact ---------- */
.contact { margin-top: 18px; }
.contact label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.contact input, .contact textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid #cfcfcf; border-radius: 8px; background: #fff; color: var(--encre); }
.contact input:focus, .contact textarea:focus { border-color: var(--vert); outline: none; box-shadow: 0 0 0 3px rgba(14,107,80,.15); }
.contact .piege { position: absolute; left: -9999px; }
.contact-rgpd { font-size: 13px; color: #666; }
.bouton-plein { padding: 12px 26px; border-radius: 8px; font-size: 16px; }
.note-ok, .note-ko { padding: 12px 14px; border-radius: 8px; font-weight: 600; }
.note-ok { background: var(--menthe); }
.note-ko { background: #FBE0DA; }

/* ---------- 404 et pages vides ---------- */
.e404 { max-width: 760px; margin: 0 auto; padding: 30px 16px 0; text-align: center; }
.e404-ill { position: relative; width: 140px; height: 140px; margin: 10px auto 18px; }
.e404-bol { position: absolute; inset: 0; margin: auto; width: 86px; height: 86px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M18 46h64c-3 22-16 32-32 32S21 68 18 46z' fill='%23E0A23A'/%3E%3Cellipse cx='50' cy='46' rx='32' ry='7' fill='%23C98A24'/%3E%3Cpath d='M40 32c3-5 8-5 10 0M52 28c3-5 8-5 10 0' stroke='%23999' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center / 66px no-repeat; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.e404 .chapo { margin: 0 auto 20px; }
.e404 .rech { text-align: left; }
.e404-l { list-style: none; padding: 0; margin: 24px 0 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.e404-l a { display: block; border: 1.5px solid var(--encre); border-radius: 8px; padding: 6px 12px; color: var(--encre); text-decoration: none; font-weight: 500; }

/* ---------- Écrans moyens et mobiles ---------- */
@media (max-width: 1100px) {
  .grille-a { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pied-in { grid-template-columns: repeat(3, 1fr); }
  .pied-marque { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  :root { --marge: 16px; }
  .tete-in { gap: 6px; padding: 10px var(--marge); }
  .tete .nav, .tete-in > .cadeau { display: none; }
  .menu-m { display: block; }
  .zone > summary { padding: 0 8px; }
  .zone:not(.choisie) .zone-l { display: none; }
  .zone .zone-l { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .menu-m-p { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--trait); box-shadow: 0 12px 24px rgba(0,0,0,.06); padding: 6px var(--marge) 18px; }
  .nav-m { display: flex; flex-direction: column; }
  .nav-m a { padding: 12px 0; border-bottom: 1px solid #f2f2f2; font-weight: 600; font-size: 17px; }
  .menu-m-p .cadeau { display: inline-block; margin-top: 14px; }
  .logo { font-size: 23px; }
  .logo svg { width: 26px; height: 26px; }
  .rech { grid-template-columns: 1fr; }
  .rech-c { border-right: 0; border-bottom: 1px solid #ddd; }
  .rech .bouton { padding: 12px; }
  .g-page h1, .billet h1, .g-blog h1, .e404 h1, .cat-h1 { font-size: 30px; }
  .texte { font-size: 17px; }
  .texte h2 { font-size: 24px; }
  .texte .wp-block-media-text { grid-template-columns: 1fr; }
  .texte .wprm-recipe { padding: 16px !important; }
  .pied-in { grid-template-columns: 1fr 1fr; gap: 22px; }
}
@media (max-width: 560px) {
  .grille-a { grid-template-columns: 1fr; }
  .pied-in { grid-template-columns: 1fr; }
  .texte .reco { grid-template-columns: 96px 1fr; gap: 6px 14px; padding: 14px; box-shadow: 4px 4px 0 var(--safran); }
  .reco-t { font-size: 20px; }
  .reco-c { display: contents; }
  .reco-im { grid-row: 1 / span 3; }
  .reco-e, .reco-t, .reco-m { grid-column: 2; }
  .reco-x, .texte .reco-b { grid-column: 1 / -1; }
  .texte .reco-b { align-self: stretch; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* « Ma zone » sur un petit téléphone : l'épingle seule, remplie en vert quand une zone est choisie */
@media (max-width: 420px) {
  .zone .zone-l, .zone.choisie .zone-l { display: none; }
  .zone.choisie > summary svg { fill: var(--vert); stroke: var(--vert); }
}
