/* ======================= Import Google Font Orbitron ======================= */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

/* ======================= Reset / Global ======================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-image: url(/stylesheet/images/body_background.webp);
    font-family: 'Orbitron', sans-serif;
    color: #00f2ff;
    line-height: 1.5;
}

/* ======================= Visually Hidden (accessibility) ======================= */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ======================= Main Container ======================= */
#main-container {
    max-width: 1024px;
    background-image: url(/stylesheet/images/fiche_background.webp);
    margin: 0 auto;
    padding-top: 0;
    padding-bottom: 0;
}

/* ======================= Center / Layout ======================= */
#center {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    gap: 20px;
    margin: 0;
    flex-wrap: wrap; /* permet aux enfants de ne pas déborder */
}

/* ======================= Container ======================= */
#container {
    flex: 1;                 /* s'adapte à l'espace disponible dans le flex parent */
    max-width: 720px;       /* limite la largeur pour grands écrans */
    margin: 0 auto;          /* centre horizontalement */
    background: linear-gradient(to bottom right, #0a0a0a, #1a1a1a);
    color: #00f2ff;
    padding: 25px;
    border: 2px solid #00f2ff;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0,242,255,0.7), 0 0 25px rgba(0,242,255,0.4) inset;
    box-sizing: border-box;  /* inclut padding et border dans la largeur */
}

/* ======================= News Listing Container ======================= */
.news-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;            /* occupe tout l'espace de #container */
    margin: 0 auto;
    align-items: center;
}

/* ======================= News Card ======================= */
.news-card {
    width: 85%;                /* largeur souhaitée */
    max-width: 850px;          /* limite sur grands écrans */
    min-width: 300px;          /* largeur minimale même si peu de contenu */
    box-sizing: border-box;
    background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 75%);
    border: 2px solid #00f2ff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0 auto;            /* centre horizontalement */
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(0,242,255,0.9), 0 0 50px rgba(0,242,255,0.4) inset;
}

/* ======================= Header: titre + date ======================= */
.title-category {
    background-color: #2980b9;
    padding: 12px 20px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    
    /* ==== MODIFICATION POUR METTRE DATE SOUS LE TITRE ==== */
    display: flex;
    flex-direction: column; /* empile titre et date verticalement */
    align-items: flex-start;
    gap: 6px;
}

.title-category h2 {
    font-size: 1.0em;
    line-height: 1.3;
    margin: 0;
}

.title-category .category {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    color: #00f2ff;
}

.title-category .separator {
    margin: 0 6px;
}

.published-date {
    font-size: 0.85em;
    color: #aefeff; /* bleu clair */
    font-style: italic;
}

/* ======================= Extrait ======================= */
.news-excerpt {
    width: 100%;                /* occupe tout l'espace du parent */
    box-sizing: border-box;      /* inclut padding dans la largeur */
    padding: 15px 20px;
    line-height: 1.6;
    overflow-wrap: break-word;   /* évite que les mots longs dépassent */
}

.news-excerpt p {
    margin-bottom: 10px;
}

.read-more {
    display: inline-block;
    padding: 6px 14px;
    text-decoration: none;
    color: #fff;
    border: 2px solid #00f2ff;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.95em;
    transition: background 0.3s, color 0.3s;
}

.read-more:hover,
.read-more:focus {
    background-color: #00f2ff;
    color: #000;
}

/* ======================= Footer: auteur + réseaux ======================= */
.news-meta {
    background-color: #34495e;
    padding: 12px 20px;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9em;
    color: #ecf0f1;
}

.news-meta .info-left {
    font-weight: bold;
    color: #fff;
}

.news-meta .info-center {
    display: flex;
    gap: 12px;
    color: #aefeff;
}

.news-meta .news-share a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #00f2ff;
    background-color: #00000020;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.news-meta .news-share a:hover,
.news-meta .news-share a:focus {
    background-color: #00f2ff;
}

.news-meta .news-share a svg {
    width: 18px;
    height: 18px;
    fill: #00f2ff;
}

.news-meta .news-share a:hover svg,
.news-meta .news-share a:focus svg {
    fill: #000;
}

/* ======================= Bouton RSS ======================= */
.news-meta .news-share a.rss {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #00f2ff;
    background-color: #00000020;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.news-meta .news-share a.rss:hover,
.news-meta .news-share a.rss:focus {
    background-color: #00f2ff;
}

.news-meta .news-share a.rss svg {
    width: 18px;
    height: 18px;
    fill: #00f2ff;
}

.news-meta .news-share a.rss:hover svg,
.news-meta .news-share a.rss:focus svg {
    fill: #000;
}

/* ======================= Pagination ======================= */
.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    gap: 10px;
}

.pagination a {
    display: inline-block;
    padding: 6px 12px;
    color: #00f2ff;
    border: 1px solid #00f2ff;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

/* ======================= Focus Accessibility ======================= */
a:focus {
    outline: 2px dashed #00f2ff;
    outline-offset: 3px;
}

/* ======================= Responsive général ======================= */
@media (max-width: 1024px) {
    #center {
        flex-direction: column;
    }
    #container {
        width: 90%;
        margin-top: 20px;
    }
    #menu {
        width: 100%;
        margin-bottom: 20px;
    }
    .news-card {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .title-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        font-size: 0.85em;
        padding: 10px 15px;
    }
    #hamburger-btn {
        display: flex;
    }
    #menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 250px;
        height: 100%;
        background-image: url(/stylesheet/images/menu_gauche.webp);
        background-size: cover;
        background-repeat: no-repeat;
        padding: 20px;
        transform: translateX(-100%);
        z-index: 998;
        overflow-y: auto;
        transition: transform 0.3s ease;
    }
    #menu.open {
        transform: translateX(0);
    }
    #center {
        flex-direction: column;
        margin-left: 0;
        gap: 15px;
        padding: 10px;
    }
    #container {
        width: 100%;
        margin: 0 auto;
        padding: 15px;
        border-radius: 10px;
    }
    .news-card {
        width: 100%;
        flex-direction: column;
        padding: 10px;
        border-radius: 12px;
    }
    .title-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 15px;
    }
    .title-category h2 {
        font-size: 1.2em;
    }
    .title-category .category {
        font-size: 0.85em;
    }
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        font-size: 0.85em;
        padding: 10px 15px;
    }
    .news-meta .news-share a {
        width: 28px;
        height: 28px;
    }
    .news-meta .news-share a svg {
        width: 16px;
        height: 16px;
    }
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    .pagination a {
        padding: 6px 10px;
        font-size: 0.85em;
    }
}
