/* PAGE NEWS
   ============================================ */

:root {
    --bg: #fafafa;
    --carte: #fff;
    --texte: #111;
    --texte-clair: #555;
    --bordure: #ccc;
    --image-bg: #f5f5f5;
    --video-bg: #2a2a2a;
    --blanc: #fff;
    --bouton: #111;
}


/* HEADER / NAVIGATION
   ============================================ */
.page-news .nav-actualites {
    font-weight: 700;
}
.page-news .menu-langue {
    display: none;
}
.site-header a {
    text-decoration: none;
}


/* CONTENEUR PRINCIPAL
   ============================================ */
.conteneur-actu {
    width: 100%;
    margin: 0 auto;
    max-width: clamp(20rem, 90vw, 50rem);
}


/* FORMULAIRE NOUVEAU POST
   ============================================ */

/* details > summary (le bouton "+ Nouveau post") */
.nouveau {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    padding: 1rem 0;
    margin-bottom: 1rem;
}
.bouton {
    display: inline-block;
    background: transparent;
    border: none;
    padding: 0;
    color: var(--texte-clair);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.75rem;
}
.bouton::-webkit-details-marker {
    display: none;
}
.bouton:hover {
    color: var(--texte);
}

/* conteneur */
.formulaire {
    display: none;
    margin-top: 0.5rem;
    padding: 1rem;
    background: var(--carte);
    border-bottom: 1px solid var(--bordure);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
details[open] .formulaire {
    display: block;
}

/* champ (label + input/textarea) */
.formulaire .champ {
    margin-bottom: 0.4rem;
}


.formulaire label {
    display: block;
    font-size: 0.6rem;
    color: var(--texte-clair);
    margin-bottom: 0.2rem;
    font-family: sans-serif;
}


.formulaire textarea {
    min-height: 50px;
    resize: both;
    max-width: none;
    width: 100%;
    padding: 0.35rem;
    border: 2px solid var(--bordure);
    font-size: 0.7rem;
    font-family: sans-serif;
    background: var(--carte);
}

/* input type="file" */
.formulaire input[type="file"] {
    font-size: 0.65rem;
    font-family: sans-serif;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* section-titre "Médias (3 maximum)" */
.section-titre {
    font-size: 0.6rem;
    color: var(--texte-clair);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.75rem 0 0.4rem;
    font-family: sans-serif;
    font-weight: 600;
}

/* boutons publier / annuler */
.form-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}
.form-submit {
    background: var(--bouton);
    color: var(--blanc);
    border: none;
    cursor: pointer;
}
.form-cancel {
    background: transparent;
    border: 1px solid var(--bordure);
    cursor: pointer;
}


/* FORMULAIRE MODIFICATION
   ============================================ */

.form-modif {
    padding: var(--spacing-sm);
}


.form-modif .champ {
    margin-bottom: 0.4rem;
}


.form-modif label {
    display: block;
    font-size: 0.6rem;
    color: var(--texte-clair);
    margin-bottom: 0.2rem;
    font-family: sans-serif;
 
}


.form-modif textarea {
    min-height: 50px;
    resize: both;
    max-width: none;
    width: 100%;
    padding: 0.35rem;
    border: 2px solid var(--bordure);
    font-size: 0.7rem;
    font-family: sans-serif;
    background: var(--carte);
}


.form-modif input[type="file"] {
    font-size: 0.65rem;
    font-family: sans-serif;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* lien Annuler */
.form-modif .form-actions a.form-cancel {
    text-decoration: none;
}

/* medias */
.form-modif .media {
    position: relative;
    display: inline-block;
    max-width: 8rem;
}

.form-modif .media img,
.form-modif .media video {
    width: 100%;
    height: auto;
}

.form-modif .suppr-media {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    border: none;
    border-radius: 50%;
    background: red;
    color: white;
    cursor: pointer;
    z-index: 2;
}


/* CARTE ARTICLE (affichage des posts)
   ============================================ */
.carte {
    background: var(--carte);
    border-bottom: 1px solid var(--bordure);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    margin-bottom: 1rem;
    transition: outline 0.3s ease;
}
.carte-highlight {
    outline: 2px solid var(--bouton);
    outline-offset: 4px;
}
.carte-entete {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--bordure);
}
.carte-date {
    font-size: 0.6rem;
    color: var(--texte-clair);
    font-family: sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.carte-corps {
    padding: 0.75rem;
}
.texte {
    font-family: sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--texte);
    margin-bottom: 0.75rem;
}


/* POST ADMIN (edit/delete)
   ============================================ */
.post-admin {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}
.post-admin svg {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--texte-clair);
    cursor: pointer;
}
.post-admin svg:hover {
    color: var(--texte);
}
.carte-partage {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--texte-clair);
    cursor: pointer;
}
.carte-partage:hover {
    color: var(--texte);
    border-bottom: 1px solid #111;
}


/*  MEDIAS (images et videos)
   ============================================ */

.medias {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.media {
    flex: 1;
}
.media img,
.media video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}


/* ICONES BOUTONS
   ============================================ */
.action-form {
    display: inline;
}
.icon-btn {
    all: unset;
    cursor: pointer;
}
.icon-btn svg {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--texte-clair);
}
.icon-btn:hover svg {
    color: var(--texte);
}


/* Lire plus
   ============================================ */
.js-readmore {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}
.js-readmore.expanded {
    display: block;
}
.bouton-suite {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    text-align: center;
}
.bouton-suite button {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8rem;
    color: var(--texte-clair);
    cursor: pointer;
}
.bouton-suite button:hover {
    color: var(--texte);
}


/* --- lightbox --- */

.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
}

.lightbox.active {
    display: flex;
}

.lightbox-img,
.lightbox-video {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    font-size: 1.75rem;
    background: transparent;
    border: 0;
    color: white;
    cursor: pointer;
}




/* --- RECHERCHE --- */

.recherche {
    margin-bottom: var(--spacing-sm);
}

.recherche input {
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--bordure);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--carte);
}

.recherche input:focus {
    outline: 2px solid var(--bouton);
    outline-offset: 2px;
}