/*
Theme Name: Terre et nuit
Author: Jeanne Encastre
Description: Thème du blog jeanneencastre.fr. Sable, nuit et terre de Sienne ; Instrument Serif pour les titres, Plus Jakarta Sans pour le texte. Polices hébergées sur le site, aucun appel à un service tiers.
Version: 1.0
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: terre-et-nuit
*/

/* Mode sombre : suit le réglage de l'appareil du lecteur. */
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --wp--preset--color--sable: #131a2a;
    --wp--preset--color--sable-fonce: #1c2438;
    --wp--preset--color--nuit: #ece3d3;
    --wp--preset--color--nuit-douce: #aeb3c2;
    --wp--preset--color--sienne: #e39566;
    --wp--preset--color--filet: #2e3850;
  }
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:where(a, button, input, textarea):focus-visible { outline: 2px solid var(--wp--preset--color--sienne); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
em { font-style: italic; }

/* Petites capitales d'étiquette */
.etiquette, .etiquette a, .wp-block-post-date.etiquette {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--wp--preset--color--nuit-douce); text-decoration: none;
}

/* En-tête */
.entete { border-bottom: 1px solid var(--wp--preset--color--filet); }
.marque { font-family: var(--wp--preset--font-family--titres); font-size: 1.9rem; line-height: 1; margin: 0; }
.marque a { color: var(--wp--preset--color--nuit); text-decoration: none; }
.marque em { color: var(--wp--preset--color--sienne); }
.entete .wp-block-navigation a { color: var(--wp--preset--color--nuit-douce); text-decoration: none; }
.entete .wp-block-navigation a:hover,
.entete .wp-block-navigation .current-menu-item a { color: var(--wp--preset--color--nuit); text-decoration: underline; }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--sable) !important; color: var(--wp--preset--color--nuit) !important; }

/* Thèse d'accueil */
.these h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1.02; margin: 0; }
.these h1 em { color: var(--wp--preset--color--sienne); }
.these > * { margin-block: 0; }
.these h1 { margin-top: 0.6rem !important; }
.these p:not(.etiquette) { font-size: 1.15rem; color: var(--wp--preset--color--nuit-douce); margin-top: 1rem; }
.wp-block-categories.filtres { margin-top: 2rem; margin-bottom: 1.5rem; }

/* Thèmes en pastilles */
.filtres ul, ul.filtres { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filtres li a { display: inline-block; font-size: 0.85rem; padding: 0.3rem 0.85rem; border: 1px solid var(--wp--preset--color--filet); border-radius: 999px; color: var(--wp--preset--color--nuit); text-decoration: none; }
.filtres li a:hover { border-color: var(--wp--preset--color--sienne); color: var(--wp--preset--color--sienne); }
.filtres li.current-cat a { background: var(--wp--preset--color--nuit); color: var(--wp--preset--color--sable); border-color: var(--wp--preset--color--nuit); }

/* Liste des billets */
.liste .wp-block-post-template { list-style: none; padding: 0; margin: 0; }
.liste .wp-block-post-template > li { border-top: 1px solid var(--wp--preset--color--filet); padding-block: 1.1rem; margin: 0; }
.liste .wp-block-post-template > li:last-child { border-bottom: 1px solid var(--wp--preset--color--filet); }
.ligne { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.25rem 2.5rem; }
.ligne > * { margin: 0 !important; }
.quand { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.quand > * { margin: 0 !important; }
.quand .wp-block-post-terms a { color: var(--wp--preset--color--nuit-douce); }
.quand .wp-block-post-date { color: var(--wp--preset--color--sienne); }
.liste .wp-block-post-title { font-size: 1.55rem; line-height: 1.12; margin: 0; }
.liste .wp-block-post-title a { color: var(--wp--preset--color--nuit); text-decoration: none; }
.liste .wp-block-post-title a:hover { color: var(--wp--preset--color--sienne); }
.liste .wp-block-post-excerpt { margin: 0.3rem 0 0; color: var(--wp--preset--color--nuit-douce); font-size: 0.95rem; }
.liste .wp-block-post-excerpt__excerpt { margin: 0; }
@media (max-width: 640px) { .ligne { grid-template-columns: minmax(0, 1fr); } .quand { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem; } }

/* Billet */
.chapo, .wp-block-post-content > p.chapo { font-size: 1.18rem; line-height: 1.6; }
.wp-block-post-content table, .wp-block-table table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.wp-block-post-content th, .wp-block-table th { text-align: left; background: var(--wp--preset--color--nuit); color: var(--wp--preset--color--sable); padding: 0.45rem 0.55rem; font-weight: 600; border: 0; }
.wp-block-post-content td, .wp-block-table td { padding: 0.45rem 0.55rem; border: 0; border-bottom: 1px solid var(--wp--preset--color--filet); vertical-align: top; }
.wp-block-table { overflow-x: auto; }
.wp-block-table figcaption { font-size: 0.82rem; color: var(--wp--preset--color--nuit-douce); }
.sources, .wp-block-post-content .sources { font-size: 0.85rem; line-height: 1.55; color: var(--wp--preset--color--nuit-douce); border-top: 1px solid var(--wp--preset--color--filet); padding-top: 1rem; margin-top: 1.5rem; }
.dans-budget { border-left: 3px solid var(--wp--preset--color--sienne); background: var(--wp--preset--color--sable-fonce); padding: 1.1rem 1.3rem; }
.hypothese::before { content: "★ "; color: var(--wp--preset--color--sienne); }
.suite { font-size: 0.92rem; }

/* Commentaires */
.commentaires { border-top: 1px solid var(--wp--preset--color--filet); padding-top: 1.5rem; }
.commentaires .regle { font-size: 0.92rem; color: var(--wp--preset--color--nuit-douce); }
.wp-block-comment-template { list-style: none; padding-left: 0; }
.wp-block-comment-template ol { list-style: none; padding-left: 1.5rem; border-left: 1px solid var(--wp--preset--color--filet); }
.wp-block-comment-author-name { font-weight: 600; }
.wp-block-comment-date a { color: var(--wp--preset--color--nuit-douce); font-size: 0.82rem; text-decoration: none; }
.comment-form label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; padding: 0.6rem 0.75rem;
  border: 1px solid var(--wp--preset--color--filet); background: var(--wp--preset--color--sable); color: var(--wp--preset--color--nuit); border-radius: 0;
}
.comment-form .comment-form-url { display: none; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; }

/* Pied de page */
.pied { border-top: 1px solid var(--wp--preset--color--filet); font-size: 0.85rem; color: var(--wp--preset--color--nuit-douce); }
.pied p { margin: 0; }
.pied a { color: var(--wp--preset--color--nuit-douce); }
.pied a:hover { color: var(--wp--preset--color--sienne); }

/* Styles proposés dans l'éditeur */
.is-style-hypothese::before { content: "★ "; color: var(--wp--preset--color--sienne); }
.is-style-dans-budget { border-left: 3px solid var(--wp--preset--color--sienne); background: var(--wp--preset--color--sable-fonce); padding: 1.1rem 1.3rem; }
.is-style-sources { font-size: 0.85rem; line-height: 1.55; color: var(--wp--preset--color--nuit-douce); border-top: 1px solid var(--wp--preset--color--filet); padding-top: 1rem; margin-top: 1.5rem; }
.is-style-chapo { font-size: 1.18rem; line-height: 1.6; }

/* Citations : la taille s'applique aussi aux paragraphes intérieurs */
.wp-block-quote p { font-family: var(--wp--preset--font-family--titres); font-size: 1.5rem; line-height: 1.3; margin: 0; }
.wp-block-quote cite { font-family: var(--wp--preset--font-family--texte); font-size: 0.85rem; font-style: normal; color: var(--wp--preset--color--nuit-douce); }
