/*
Theme Name: Habitudes Zen 2026
Theme URI: https://habitudes-zen.net/
Author: Olivier Roland
Description: Thème en blocs, sans constructeur de pages, pour Habitudes Zen. Adapté du thème « Des Livres 2026 ».
Version: 0.1.3
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: hz2026
*/
:root{color-scheme:only light}
html{scroll-behavior:smooth;scroll-padding-top:5.5rem}
body{-webkit-font-smoothing:antialiased}
img{height:auto}

/* En-tête */
.hz-header{position:sticky;top:0;z-index:50;background:#fff;border-bottom:1px solid var(--wp--preset--color--border)}
.hz-header .hz-logo{display:block;line-height:0}
.hz-header .hz-logo img{width:170px;height:auto}
.hz-header .wp-block-navigation{font-weight:900;font-size:.82rem;text-transform:uppercase;letter-spacing:.06em;color:var(--wp--preset--color--slate)}
.hz-header .wp-block-navigation a:hover{color:var(--wp--preset--color--accent)}
.hz-header .wp-block-search__inside-wrapper{border:1px solid var(--wp--preset--color--border);border-radius:999px;padding:0 .25rem 0 .9rem;background:var(--wp--preset--color--light)}
.hz-header .wp-block-search__input{border:0;background:transparent;font-size:.9rem;min-width:0;width:9rem;padding:.45rem 0}
.hz-header .wp-block-search__button{background:transparent;color:var(--wp--preset--color--slate);padding:.3rem;margin:0;min-width:0}
.hz-cta-mini a{white-space:nowrap}
.hz-header .hz-cta-mini .wp-block-button__link,.hz-header .hz-cta-mini .wp-block-button__link:hover{color:#fff}

/* Barre de progression de lecture, sans JavaScript */
.hz-progress{position:fixed;top:0;left:0;height:3px;width:100%;background:var(--wp--preset--color--primary);transform-origin:0 50%;transform:scaleX(0);z-index:60;pointer-events:none}
@supports (animation-timeline: scroll()){
  .hz-progress{animation:hz-grow linear both;animation-timeline:scroll(root)}
  @keyframes hz-grow{to{transform:scaleX(1)}}
}

/* Article */
.hz-fil{font-size:.85rem;color:var(--wp--preset--color--muted);margin:0}
.hz-fil a{color:inherit;text-decoration:none}
.hz-fil a:hover{text-decoration:underline}
.hz-meta{font-size:.9rem;color:var(--wp--preset--color--muted);margin:0}
.hz-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:2rem;max-width:1160px;margin-inline:auto;padding-inline:1.25rem}
@media (min-width:1024px){
  .hz-layout{grid-template-columns:minmax(0,740px) minmax(0,300px);justify-content:space-between;gap:3.5rem}
  .hz-aside{order:2}
  .hz-aside-inner{position:sticky;top:5.5rem;max-height:calc(100vh - 6.5rem);overflow:auto}
}
.hz-contenu > *{margin-block-start:0}
.entry-content > * + *, .wp-block-post-content > * + *{margin-block-start:1.35em}
.wp-block-post-content h2{margin-block-start:2.2em;padding-top:.2em}
.wp-block-post-content h3{margin-block-start:1.8em}
.wp-block-post-content img{border-radius:6px}
.wp-block-post-content a{text-underline-offset:.18em}
.wp-block-post-content :where(ul,ol):not(.wp-block-post-template):not(.wp-block-social-links){padding-left:1.3em}
.wp-block-post-content :where(ul,ol):not(.wp-block-post-template):not(.wp-block-social-links) > li + li{margin-top:.45em}

/* En-tête d'article, placé au-dessus de la grille pour passer avant le sommaire sur mobile */
.hz-entete-article{max-width:1160px;margin-inline:auto;padding-inline:1.25rem;margin-bottom:1.5rem}
.hz-entete-article h1{max-width:900px}
.hz-contenu > .hz-livre-fin{margin-top:2rem}
@media (min-width:1024px){.hz-contenu > .hz-livre-fin{display:none}}
@media (max-width:1023px){.hz-aside .hz-livre{display:none}.hz-layout{gap:1.2rem}}
.hz-quiz-vide{margin-top:2rem}

/* Sommaire */
.hz-toc{border:1px solid var(--wp--preset--color--border);border-radius:10px;padding:.9rem 1.1rem;background:#fff;font-size:.9rem}
.hz-toc summary{font-weight:700;cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center}
.hz-toc summary::-webkit-details-marker{display:none}
.hz-toc summary::after{content:"+";font-weight:400;font-size:1.2rem;color:var(--wp--preset--color--muted)}
.hz-toc[open] summary::after{content:"–"}
.hz-toc ol{list-style:none;margin:.7rem 0 0;padding:0}
.hz-toc li{margin:0;padding:.32rem 0;border-top:1px solid var(--wp--preset--color--light);line-height:1.35}
.hz-toc li a{color:var(--wp--preset--color--text);text-decoration:none;display:block}
.hz-toc li a:hover{color:var(--wp--preset--color--accent)}

/* Encart du livre gratuit */
.hz-livre{background:var(--wp--preset--color--slate);color:#fff;border-radius:10px;padding:1.2rem 1.2rem 1.3rem;margin-top:1.2rem;font-size:.92rem;line-height:1.5}
.hz-livre strong{display:block;font-size:1.05rem;line-height:1.3;margin-bottom:.4rem}
.hz-livre a{display:inline-block;margin-top:.8rem;background:var(--wp--preset--color--primary);color:#fff;text-transform:uppercase;font-size:.85rem;letter-spacing:.04em;font-weight:700;text-decoration:none;padding:.55rem 1rem;border-radius:999px}
.hz-livre a:hover{background:var(--wp--preset--color--accent)}

/* Emplacement du quiz, suite de lecture */
.hz-quiz-vide{border:2px dashed var(--wp--preset--color--border);border-radius:10px;padding:1.4rem;text-align:center;color:var(--wp--preset--color--muted);font-size:.95rem}
.hz-suite{margin-top:3rem;padding-top:2rem;border-top:1px solid var(--wp--preset--color--border)}
.hz-suite h2{font-size:1.35rem;margin:0 0 1.2rem}
.hz-suite-grille{display:grid;gap:1.2rem;grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.hz-carte{display:block;text-decoration:none;color:var(--wp--preset--color--text);border:1px solid var(--wp--preset--color--border);border-radius:10px;overflow:hidden;background:#fff;transition:box-shadow .15s,transform .15s}
.hz-carte:hover{box-shadow:0 8px 24px rgba(0,0,0,.08);transform:translateY(-2px)}
.hz-carte img{display:block;width:100%;aspect-ratio:3/2;object-fit:cover}
.hz-carte span{display:block;padding:.8rem .9rem 1rem;font-weight:600;line-height:1.35;font-size:.98rem}

/* Grilles d'articles */
.hz-grille .wp-block-post{border:1px solid var(--wp--preset--color--border);border-radius:10px;overflow:hidden;background:#fff;display:flex;flex-direction:column}
.hz-grille .wp-block-post-featured-image{margin:0}
.hz-grille .wp-block-post-featured-image img{display:block;width:100%;aspect-ratio:3/2;object-fit:cover}
.hz-grille .wp-block-post-title{font-size:1.08rem;line-height:1.35;margin:.9rem 1rem 0}
.hz-grille .wp-block-post-title a{text-decoration:none;color:var(--wp--preset--color--text)}
.hz-grille .wp-block-post-title a:hover{color:var(--wp--preset--color--accent)}
.hz-grille .wp-block-post-excerpt{font-size:.9rem;line-height:1.55;color:#555;margin:.5rem 1rem 1.1rem}
.hz-grille .wp-block-post-excerpt__more-link{font-weight:600}
.wp-block-query-pagination{margin-top:2.5rem;justify-content:center;gap:.6rem;font-weight:600}
.wp-block-query-pagination .page-numbers{padding:.3rem .65rem;border-radius:6px;text-decoration:none}
.wp-block-query-pagination .page-numbers.current{background:var(--wp--preset--color--primary);color:#fff}

/* Boutons pleins : texte blanc, quelles que soient les règles de liens */
.wp-block-button:not(.is-style-outline) .wp-block-button__link,.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover{color:#fff}
.wp-block-button.is-style-outline .wp-block-button__link{color:var(--wp--preset--color--primary);border-color:currentColor}
.wp-block-button.is-style-outline .wp-block-button__link:hover{background:var(--wp--preset--color--primary);color:#fff}

/* Accueil */
.hz-hero{background:#F5EFE0 url(../../uploads/2021/11/background-habitudes.jpeg) right bottom/cover no-repeat;overflow:hidden}
.hz-hero h1{font-size:clamp(2.4rem,5vw,3.8rem);line-height:1.1;margin:0;font-weight:900}
.hz-hero>.wp-block-columns{min-height:clamp(26rem,34vw,38rem);margin:0}
.hz-hero p{max-width:30rem}
@media (max-width:781px){
  .hz-hero{background:#F5EFE0 url(../../uploads/2020/04/bg-tab.jpg) center bottom/cover no-repeat}
  .hz-hero>.wp-block-columns{min-height:0}
}
.hz-accroche{color:var(--wp--preset--color--primary)!important}
.hz-section-titre{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.2rem}
.hz-section-titre h2{margin:0}
.hz-om-bloc{background:var(--wp--preset--color--beige)}
.hz-om-bloc .hz-om:empty{display:none}
.hz-videos{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.hz-videos a{display:block;border-radius:8px;overflow:hidden;line-height:0;transition:transform .15s,box-shadow .15s}
.hz-videos a:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,0,0,.12)}
.hz-videos img{width:100%;height:auto;aspect-ratio:16/9;object-fit:cover}
.hz-mots{display:inline-block;position:relative;height:1.15em;overflow:hidden;vertical-align:bottom}
.hz-mots span{display:block;height:1.15em;animation:hz-mots 9s infinite}
@keyframes hz-mots{0%,28%{transform:translateY(0)}33%,61%{transform:translateY(-100%)}66%,94%{transform:translateY(-200%)}100%{transform:translateY(0)}}
@media (prefers-reduced-motion:reduce){.hz-mots span{animation:none}html{scroll-behavior:auto}}
.hz-bande{background:var(--wp--preset--color--slate);color:#fff}
.hz-bande h2{color:#fff}

/* Présentation du blog, emplacements OptinMonster */
.hz-presentation{display:flex;gap:1.2rem;align-items:center;background:var(--wp--preset--color--beige);border-radius:10px;padding:1rem 1.2rem;margin-top:2.5rem;font-size:.95rem;line-height:1.55}
.hz-presentation img{flex:0 0 110px;width:110px;height:auto}
@media (max-width:520px){.hz-presentation{flex-direction:column;text-align:center}}
.hz-presentation p{margin:0}
.hz-om{margin-top:1.2rem}

/* Commentaires */
.wp-block-comments{margin-top:3rem;padding-top:2rem;border-top:1px solid var(--wp--preset--color--border)}
.wp-block-comment-template{list-style:none;padding:0}
.wp-block-comment-template li{margin:0 0 1.2rem;padding:1rem 1.1rem;background:var(--wp--preset--color--light);border-radius:10px}
.wp-block-comment-template ol{list-style:none;padding-left:1.2rem;margin-top:1rem}
.wp-block-comment-template ol li{background:#fff;border:1px solid var(--wp--preset--color--border)}
.wp-block-comment-author-name{font-weight:700}
.wp-block-comment-date{font-size:.8rem;color:var(--wp--preset--color--muted)}
.wp-block-comment-content{font-size:.95rem}
.wp-block-comment-reply-link{font-size:.85rem;font-weight:600}
.wp-block-post-comments-form textarea,.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]){border:1px solid var(--wp--preset--color--border);border-radius:8px;padding:.6rem .8rem;font:inherit;width:100%;box-sizing:border-box}

/* Pied */
.hz-footer{background:var(--wp--preset--color--primary);color:#fff;font-size:.92rem}
.hz-footer a{color:#fff;text-decoration:none}
.hz-footer a:hover{color:var(--wp--preset--color--slate)}
.hz-footer h2{font-size:1rem;color:#fff;margin:0 0 .8rem;text-transform:uppercase;letter-spacing:.04em}
.hz-footer ul{list-style:none;padding:0;margin:0}
.hz-footer li{margin:0 0 .45rem}
.hz-footer .hz-logo-pied img{width:170px;height:auto}

/* Tableaux et citations dans les résumés */
.wp-block-table{overflow-x:auto}
.wp-block-table td,.wp-block-table th{border:1px solid var(--wp--preset--color--border);padding:.5rem .7rem;font-size:.95rem}
.wp-block-quote{border-left:4px solid var(--wp--preset--color--primary);margin-inline:0;padding:.2rem 0 .2rem 1.2rem;color:#333}
.wp-block-quote cite{font-size:.85rem;color:var(--wp--preset--color--muted)}

@media (max-width:781px){
  .hz-header .wp-block-search{display:none}
  .hz-header .hz-logo img{width:120px}
}
/* Les sujets */
.hz-sujets{margin:1rem 0 2rem}
.hz-sujets-titre{display:block;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#607D8B;margin-bottom:.6rem}
.hz-sujets ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.5rem}
.hz-sujets li{margin:0}
.hz-sujets a{display:inline-block;padding:.35rem .85rem;border:1px solid #DDDDDD;border-radius:999px;font-size:.9rem;line-height:1.3;text-decoration:none;color:#222222;background:#fff}
.hz-sujets a:hover,.hz-sujets a[aria-current]{background:var(--wp--preset--color--primary);border-color:var(--wp--preset--color--primary);color:#fff}
@media (max-width:781px){.hz-sujets ul{flex-wrap:nowrap;overflow-x:auto;padding-bottom:.5rem;-webkit-overflow-scrolling:touch}.hz-sujets a{white-space:nowrap}}
.hz-footer .hz-sujets-pied{display:flex;flex-wrap:wrap;gap:.4rem 1.4rem;margin:0 0 2.5rem;padding:0 0 2rem;border-bottom:1px solid rgba(255,255,255,.3)}
.hz-footer .hz-sujets-pied li{margin:0}
@media print{.hz-header,.hz-footer,.hz-aside,.hz-progress,.wp-block-comments{display:none}}
