/*
Theme Name: Sauge Verrière
Template: generatepress
Version: 1.0.0
Description: Habillage sur mesure pour Mieux par Céline
*/

/* ---------------------------------------------------------------------------
   Jetons de couleur et de forme — palette sage-calm, rayon subtle,
   ombre medium, rythme spacious. Tout le reste passe par les options GP.
   --------------------------------------------------------------------------- */
:root {
    --sv-primaire:        #4D7C0F;
    --sv-primaire-fonce:  #3E6309;
    --sv-secondaire:      #65A30D;
    --sv-accent:          #84CC16;
    --sv-accent-chaud:    #F5ECD7;
    --sv-surface:         #F7FEE7;
    --sv-fond:            #FFFFFF;
    --sv-texte:           #1A2E05;
    --sv-texte-second:    #4B5563;
    --sv-bordure:         #D9F0B4;

    --sv-pied-fond:       #1F3407;
    --sv-pied-texte:      #F7FEE7;
    --sv-pied-lien:       #D9F0B4;
    --sv-pied-lien-survol:#A3E635;

    --sv-rayon:           4px;
    --sv-ombre:           0 4px 12px rgba(0, 0, 0, 0.1);
    --sv-ombre-survol:    0 8px 20px rgba(26, 46, 5, 0.16);

    --sv-ecart-section:   6rem;
    --sv-ecart-bloc:      2rem;
    --sv-marge-interne:   3rem;
}

/* ---------------------------------------------------------------------------
   Lisibilité de base
   --------------------------------------------------------------------------- */
body {
    color: var(--sv-texte);
    -webkit-font-smoothing: antialiased;
}

.entry-content a,
.site-content a:not(.button):not(.wp-block-button__link) {
    color: var(--sv-primaire);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.entry-content a:hover,
.site-content a:not(.button):not(.wp-block-button__link):hover {
    color: var(--sv-primaire-fonce);
}

.entry-content h2,
.entry-content h3 {
    letter-spacing: -0.01em;
}

.entry-content h2 {
    margin-top: 2.4em;
}

.entry-content blockquote {
    border-left: 3px solid var(--sv-secondaire);
    background: var(--sv-surface);
    padding: 1.1rem 1.4rem;
    margin-left: 0;
    border-radius: var(--sv-rayon);
    font-style: normal;
}

/* Encadré de rappel « lecture personnelle » utilisé en fin d'article. */
.sv-rappel {
    background: var(--sv-accent-chaud);
    border: 1px solid var(--sv-bordure);
    border-radius: var(--sv-rayon);
    padding: 1.1rem 1.3rem;
    font-size: 0.94em;
    color: var(--sv-texte);
    margin: 2.2rem 0 0;
}

.sv-rappel p:last-child {
    margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Titre H1 de la page d'accueil (§26 — obligatoire, visible)
   --------------------------------------------------------------------------- */
.site-tagline-heading {
    display: block;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 1.95rem;
    line-height: 1.25;
    color: var(--sv-texte);
    margin: 0 0 0.6rem;
}

/* ---------------------------------------------------------------------------
   En-tête — sig-F : navigation alignée à droite, sur la même ligne que le logo
   --------------------------------------------------------------------------- */
.main-navigation .main-nav > ul > li > a {
    font-weight: 500;
    letter-spacing: 0.01em;
}

.main-navigation .main-nav > ul > li.current-menu-item > a,
.main-navigation .main-nav > ul > li > a:hover {
    color: var(--sv-primaire);
}

.main-navigation .main-nav > ul > li.current-menu-item > a {
    box-shadow: inset 0 -2px 0 var(--sv-secondaire);
}

.site-header {
    border-bottom: 1px solid var(--sv-bordure);
}

/* ---------------------------------------------------------------------------
   Accueil — composition par rubriques (blog-3, sans hero)
   --------------------------------------------------------------------------- */
.sv-intro {
    text-align: center;
    max-width: 44rem;
    margin: 0 auto 3.2rem;
    font-size: 1.06rem;
    color: var(--sv-texte-second);
}

.sv-section {
    margin-bottom: var(--sv-ecart-section);
}

.sv-section--surface {
    background: var(--sv-surface);
    padding: 2.6rem var(--sv-marge-interne);
    border-radius: var(--sv-rayon);
}

.sv-section__tete {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--sv-bordure);
}

.sv-section__tete h2 {
    margin: 0;
    font-size: 1.45rem;
    letter-spacing: -0.01em;
}

.sv-section__tout {
    font-size: 0.93rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--sv-primaire);
}

.sv-section__tout:hover {
    color: var(--sv-primaire-fonce);
}

.sv-section__chapeau {
    margin: -0.6rem 0 1.5rem;
    font-size: 0.97rem;
    color: var(--sv-texte-second);
    max-width: 46rem;
}

/* Grille de cartes — ratio d'image constant, ombre et rayon issus des jetons. */
.sv-cartes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sv-ecart-bloc);
}

.sv-cartes--trois {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sv-carte {
    background: var(--sv-fond);
    border: 1px solid var(--sv-bordure);
    border-radius: var(--sv-rayon);
    box-shadow: var(--sv-ombre);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.sv-carte:hover {
    box-shadow: var(--sv-ombre-survol);
    transform: translateY(-2px);
}

.sv-carte__visuel {
    display: block;
    line-height: 0;
    background: var(--sv-surface);
}

.sv-carte__visuel img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.sv-carte__corps {
    padding: 1.05rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
}

.sv-carte__rubrique {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    color: var(--sv-primaire);
}

.sv-carte__titre {
    font-size: 1.03rem;
    line-height: 1.35;
    font-weight: 700;
    margin: 0;
}

.sv-carte__titre a {
    color: var(--sv-texte);
    text-decoration: none;
}

.sv-carte__titre a:hover {
    color: var(--sv-primaire);
}

.sv-carte__extrait {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--sv-texte-second);
    margin: 0;
}

.sv-carte__pied {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    font-size: 0.82rem;
    color: var(--sv-texte-second);
}

.sv-carte__lien {
    font-weight: 500;
    color: var(--sv-primaire);
    white-space: nowrap;
}

.sv-tout-voir {
    text-align: center;
    margin: 0;
    font-size: 1rem;
}

/* ---------------------------------------------------------------------------
   Page « Qui écrit ici ? » — portrait centré au-dessus du texte
   (about-centered-above, §10)
   --------------------------------------------------------------------------- */
.sv-apropos {
    text-align: center;
    margin: 0 auto 2rem;
}

.sv-apropos img,
.avatar-centered img {
    width: 200px;
    height: 200px;
    max-width: 100%;
    object-fit: cover;
    border-radius: var(--sv-rayon);
    box-shadow: var(--sv-ombre);
    margin: 0 auto;
    display: block;
}

.sv-apropos figcaption {
    font-size: 0.86rem;
    color: var(--sv-texte-second);
    margin-top: 0.7rem;
}

.sv-apropos-corps {
    max-width: 42rem;
    margin: 0 auto;
}

/* ---------------------------------------------------------------------------
   Signature d'auteur en pied d'article
   --------------------------------------------------------------------------- */
.sv-signature {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--sv-surface);
    border: 1px solid var(--sv-bordure);
    border-radius: var(--sv-rayon);
    padding: 1.1rem 1.2rem;
    margin-top: 2.6rem;
}

.sv-signature img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.sv-signature__nom {
    font-weight: 700;
    display: block;
    margin-bottom: 0.2rem;
}

.sv-signature__nom a {
    color: var(--sv-texte);
    text-decoration: none;
}

.sv-signature__nom a:hover {
    color: var(--sv-primaire);
}

.sv-signature__mot {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--sv-texte-second);
    margin: 0;
}

/* Vignette de portrait dans la ligne de signature d'en-tête d'article. */
.sv-byline-portrait {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: -8px;
    margin-right: 0.35rem;
}

/* ---------------------------------------------------------------------------
   Archives, résultats de recherche : cartes d'extrait, jamais l'article entier
   --------------------------------------------------------------------------- */
.blog .site-main > article,
.archive .site-main > article,
.search .site-main > article {
    background: var(--sv-fond);
    border: 1px solid var(--sv-bordure);
    border-radius: var(--sv-rayon);
    box-shadow: var(--sv-ombre);
    padding: 1.3rem 1.5rem;
    margin-bottom: var(--sv-ecart-bloc);
    transition: box-shadow 0.18s ease;
}

.blog .site-main > article:hover,
.archive .site-main > article:hover,
.search .site-main > article:hover {
    box-shadow: var(--sv-ombre-survol);
}

.blog .site-main > article .entry-title,
.archive .site-main > article .entry-title,
.search .site-main > article .entry-title {
    font-size: 1.3rem;
    line-height: 1.3;
}

.page-header,
.archive .page-header,
.search .page-header {
    margin-bottom: 1.8rem;
}

.taxonomy-description,
.archive-description {
    color: var(--sv-texte-second);
    font-size: 0.98rem;
    max-width: 46rem;
}

.read-more,
.more-link {
    font-weight: 500;
}

/* ---------------------------------------------------------------------------
   Formulaire de recherche et de contact — jetons du site, pas les styles du navigateur
   --------------------------------------------------------------------------- */
.search-field,
.wp-block-search__input,
.ff-el-form-control,
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
    border: 1px solid var(--sv-bordure);
    border-radius: var(--sv-rayon);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.95em;
    width: 100%;
    background: var(--sv-fond);
    color: var(--sv-texte);
}

.search-field:focus,
.wp-block-search__input:focus,
.ff-el-form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus {
    border-color: var(--sv-secondaire);
    outline: 2px solid rgba(101, 163, 13, 0.25);
    outline-offset: 1px;
}

.ff-el-input--label label {
    font-weight: 600;
    color: var(--sv-texte);
}

/* Règle de couleur du bouton d'envoi — obligatoire dans tout thème enfant
   portant un formulaire de contact (contact-form-render.cjs,
   form_button_palette_match). primary = sage-calm. */
body button.wpforms-submit,
body .wpcf7-submit,
body .ff-btn-submit {
    background-color: #4D7C0F !important;
    color: #ffffff !important;
}

body button.wpforms-submit:hover,
body .wpcf7-submit:hover,
body .ff-btn-submit:hover {
    filter: brightness(0.88) !important;
}

.search-submit,
.wp-block-search__button {
    background: var(--sv-primaire);
    color: #fff;
    border: none;
    border-radius: var(--sv-rayon);
    padding: 9px 16px;
    font-family: inherit;
    font-size: 0.95em;
    cursor: pointer;
}

.search-submit:hover,
.wp-block-search__button:hover {
    background: var(--sv-primaire-fonce);
}

/* ---------------------------------------------------------------------------
   Pied de page — pile centrée sur fond sombre (centered-dark, sans intitulés)
   --------------------------------------------------------------------------- */
.site-footer,
.site-info {
    background-color: var(--sv-pied-fond);
    color: var(--sv-pied-texte);
}

.site-info {
    padding-top: 2.6rem;
    padding-bottom: 2.6rem;
}

.site-info .inside-site-info {
    display: block;
    text-align: center;
}

.sv-pied {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.05rem;
    max-width: 36rem;
    margin: 0 auto;
}

.sv-pied__logo img {
    width: 164px;
    height: auto;
    display: block;
}

.sv-pied__mot {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--sv-pied-texte);
    margin: 0;
}

.sv-pied__liens {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 1.15rem;
    font-size: 0.88rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sv-pied__liens a,
.sv-pied a {
    color: var(--sv-pied-lien);
    text-decoration: none;
}

.sv-pied__liens a:hover,
.sv-pied a:hover {
    color: var(--sv-pied-lien-survol);
    text-decoration: underline;
}

.sv-pied__droits {
    font-size: 0.84rem;
    color: var(--sv-pied-lien);
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(217, 240, 180, 0.22);
    width: 100%;
}

/* ---------------------------------------------------------------------------
   Bouton de retour en haut (scroll-to-top = yes)
   --------------------------------------------------------------------------- */
.generate-back-to-top {
    background-color: var(--sv-primaire);
    color: #fff;
    border-radius: var(--sv-rayon);
    box-shadow: var(--sv-ombre);
}

.generate-back-to-top:hover,
.generate-back-to-top:focus {
    background-color: var(--sv-primaire-fonce);
    color: #fff;
}

/* ---------------------------------------------------------------------------
   Page 404
   --------------------------------------------------------------------------- */
.sv-404 {
    max-width: 38rem;
}

.sv-404__corps {
    color: var(--sv-texte-second);
    font-size: 1.03rem;
}

.sv-404 .search-form {
    margin-top: 1.6rem;
    display: flex;
    gap: 0.6rem;
}

/* ---------------------------------------------------------------------------
   Mobile
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .sv-cartes,
    .sv-cartes--trois {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .inside-navigation {
        position: relative;
    }

    /* GP Menu Plus fond le logo dans #mobile-header : la barre reste claire pour
       que le logotype en encre sauge garde son contraste. */
    #mobile-header,
    #mobile-header .inside-navigation {
        background-color: var(--sv-fond);
        border-bottom: 1px solid var(--sv-bordure);
    }

    #mobile-header .inside-navigation {
        min-height: 60px;
        display: flex;
        align-items: center;
    }

    #mobile-header .site-logo {
        display: flex;
        align-items: center;
    }

    #mobile-header .site-logo img {
        width: 118px;
        height: auto;
    }

    #mobile-header .menu-toggle,
    #mobile-header .menu-toggle:hover,
    #mobile-header .menu-toggle:focus {
        background-color: transparent;
        color: var(--sv-texte);
        min-height: 60px;
        display: flex;
        align-items: center;
    }

    /* Style distinctif petit écran */
    .inside-navigation::before {
        content: "Réflexions de Suisse romande sur la santé, le corps et le bien-être du quotidien";
        position: absolute;
        left: 136px;
        top: 50%;
        transform: translateY(-50%);
        max-width: 30%;
        font-style: italic;
        font-size: 9px;
        line-height: 1.2;
        color: var(--sv-texte-second);
        pointer-events: none;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .sv-cartes,
    .sv-cartes--trois {
        grid-template-columns: 1fr;
    }

    .sv-section--surface {
        padding: 1.8rem 1.2rem;
    }

    .site-tagline-heading {
        font-size: 1.5rem;
    }

    .sv-signature {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .sv-404 .search-form {
        flex-direction: column;
    }
}
