/* =============================================================================
   public_html/assets/css/components.css
   Styles des composants introduits par la refonte, absents de styles.css.
   Charge apres styles.css et grilles.css dans layouts/public.php.
   ============================================================================= */

:root {
    --t1-green: #006837;
    --t1-navy: #0b1c3a;
    --t1-text: #1f2933;
    --t1-muted: #5b6770;
    --t1-line: #d9dee3;
    --t1-bg-soft: #f5f7f9;
}

/* --- 1. Lien d'evitement : invisible, apparait seulement au clavier (Tab) -- */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 10000;
    padding: .75rem 1.25rem;
    background: var(--t1-navy);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
    transition: top .15s ease;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}

/* Filet de securite si .sr-only n'existe pas deja dans styles.css */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Piege a robots : doit rester invisible pour un humain ---------------- */
.hp-field {
    position: absolute !important;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* --- Icones du sprite SVG ------------------------------------------------- */
.icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: -.15em;
}

/* --- 3. Pastilles de categories (accueil, blog, 404) ---------------------- */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem;
    margin: 0 0 2.5rem;
}
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .6rem .5rem 1rem;
    border: 1px solid var(--t1-line);
    border-radius: 999px;
    background: #fff;
    color: var(--t1-text);
    font-size: .95rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.category-chip:hover,
.category-chip:focus-visible {
    border-color: var(--t1-green);
    color: var(--t1-green);
}
.category-chip[aria-current="page"] {
    background: var(--t1-green);
    border-color: var(--t1-green);
    color: #fff;
}
.category-chip__count {
    min-width: 1.6rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    background: var(--t1-bg-soft);
    color: var(--t1-muted);
    font-size: .8rem;
    font-weight: 600;
    text-align: center;
}
.category-chip[aria-current="page"] .category-chip__count {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

/* --- 4. Newsletter ---------------------------------------------------------- */
.newsletter {
    background: var(--t1-navy);
    color: #fff;
}
.newsletter--section { padding: 4rem 1.25rem; }
.newsletter__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}
.newsletter__title {
    margin: 0 0 .75rem;
    color: #fff;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
}
.newsletter__text {
    margin: 0;
    color: rgba(255, 255, 255, .8);
    line-height: 1.6;
    max-width: 46ch;
}
.newsletter__form {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.newsletter__input {
    flex: 1 1 240px;
    min-width: 0;
    padding: .9rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #fff;
    color: var(--t1-text);
    font: inherit;
}
.newsletter__input:focus {
    outline: 3px solid #ffbf47;
    outline-offset: 1px;
}
.newsletter__button {
    padding: .9rem 1.6rem;
    border: 0;
    border-radius: 6px;
    background: var(--t1-green);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease;
}
.newsletter__button:hover { background: #00552d; }
.newsletter__button:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}
.newsletter__legal,
.newsletter__feedback {
    flex-basis: 100%;
    margin: 0;
    font-size: .85rem;
    color: rgba(255, 255, 255, .7);
}
.newsletter__legal a { color: #fff; }
.newsletter__feedback:empty { display: none; }

/* Variante colonne laterale d'un article */
.newsletter--aside {
    padding: 1.5rem;
    border-radius: 8px;
}
.newsletter--aside .newsletter__inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
.newsletter--aside .newsletter__title { font-size: 1.25rem; }
.newsletter--aside .newsletter__button { width: 100%; }

@media (max-width: 768px) {
    .newsletter__inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* --- 5. Footer : icones et reseaux ---------------------------------------- */
.f-v-address--stack .f-v-link {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.f-v-social {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.25rem;
}
.f-v-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dcdcdc;
    color: var(--t1-navy);
    transition: background-color .15s ease, color .15s ease;
}
.f-v-social-link:hover,
.f-v-social-link:focus-visible {
    background: var(--t1-green);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .skip-link,
    .category-chip,
    .newsletter__button,
    .f-v-social-link { transition: none; }
}