html, body {
    height: 100%; /* Assure que le body prend toute la hauteur */
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Empêche le défilement horizontal global */
}

body {
    margin: 0;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background: url('Images/background.png') no-repeat center center fixed;
    background-size: cover;
    color: #e0e0e0;
    line-height: 1.6;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Hauteur minimale de la fenêtre */
    width: 100%; /* Force la largeur à 100% */
    box-sizing: border-box;
}

/* Ajout d'une couche semi-transparente pour améliorer la lisibilité */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Superposition sombre pour le contraste */
    z-index: 1;
}

main {
    flex: 1 0 auto; /* Permet au contenu principal de prendre l’espace disponible */
    position: relative;
    z-index: 2;
}

a {
    color: #66d9ff; /* Couleur par défaut pour tous les liens */
    text-decoration: none;
}

a:hover {
    color: #ffffff; /* Blanc au survol */
    text-decoration: underline;
}

.navbar {
    background-color: rgba(15, 15, 26, 0.9); /* Légère transparence */
    padding: 0,5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    top: 0;
    left: 0; /* Ajout pour ancrer à gauche */
    width: 100%;
    height: 60px;
    box-sizing: border-box; /* Inclut padding dans la largeur */
    z-index: 100;
    overflow-x: hidden; /* Empêche le défilement horizontal */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none; /* Pour le lien */
}

.logo-img {
    height: 50px; /* Ajuste selon la taille de ton logo */
    width: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0; /* Supprime tout padding parasite */
    flex-wrap: wrap; /* Permet aux liens de passer à la ligne si trop nombreux */
    max-width: 100%; /* Limite la largeur au conteneur parent */
}

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #00d4ff;
}

.hamburger {
    display: none; /* Masqué par défaut */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    z-index: 101;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: rgba(15, 15, 26, 0.9); /* Légère transparence */
    position: relative;
    bottom: 0;
    width: 100%;
    z-index: 2;
}

.container {
    max-width: 1000px;
    margin: 70px auto 2rem; /* Augmente à 70px pour couvrir la navbar */
    padding: 1rem;
    background: rgba(26, 26, 46, 0.8); /* Fond semi-transparent pour le contenu */
    border-radius: 8px;
    position: relative;
    z-index: 2;
    width: 100%; /* Ajouté pour limiter */
    box-sizing: border-box;
}

h1, h2, h3 {
    color: #00d4ff;
}

button {
    background-color: #00d4ff;
    border: none;
    padding: 0.5rem 1rem;
    color: #1a1a2e;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0099cc;
}

.button-group {
    display: flex;
    gap: 0.5rem; /* Espace entre les boutons */
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: rgba(15, 15, 26, 0.9);
    flex-shrink: 0; /* Empêche le footer de rétrécir */
    width: 100%;
    z-index: 2;
}

textarea {
    resize: vertical;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0,5rem;
}

input, textarea {
    padding: 0.5rem;
    background-color: #2a2a3e;
    border: 1px solid #00d4ff;
    color: #e0e0e0;
    width: 100%;
    max-width: 500px;
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 2rem; /* Espace entre la photo et le texte */
    flex-wrap: wrap; /* Pour que ça passe en colonne sur mobile */
    text-align: justify;
}

.welcome-photo {
    width: 200px; /* Ajuste selon la taille souhaitée */
    height: auto;
    border-radius: 8px; /* Coins arrondis pour un look moderne */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5); /* Effet lumineux SF */
}

.welcome-ref {
    width: 400px; /* Ajuste selon la taille souhaitée */
    height: auto;
    border-radius: 8px; /* Coins arrondis pour un look moderne */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5); /* Effet lumineux SF */
}

.welcome-text {
    flex: 1; /* Le texte prend l’espace restant */
    min-width: 300px; /* Évite que le texte devienne trop étroit sur petits écrans */
}

.welcome-boxes {
    display: flex;
    justify-content: space-between;
    gap: 1rem; /* Espace entre les cadres */
    margin-top: 2rem; /* Espace après la présentation */
    flex-wrap: wrap; /* Passe en colonne sur petits écrans */
    font-size: x-small;
    text-align: justify;
}

.welcome-box {
    flex: 1; /* Chaque cadre prend un tiers de la largeur */
    min-width: 250px; /* Largeur minimale pour petits écrans */
    background: rgba(40, 40, 60, 0.8); /* Fond légèrement plus clair */
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3); /* Ombre cyan subtile */
}

.welcome-box h2 {
    color: #00d4ff; /* Titre en cyan */
    font-size: x-small;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.welcome-box h3 {
    color: #ffffff; /* Texte en blanc */
    font-size: x-small;
    font-weight: lighter ;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.roman-section {
    display: flex;
    align-items: center;
    gap: 2rem; /* Espace entre la couverture et le texte */
    flex-wrap: wrap; /* Responsive : passe en colonne sur mobile */
    text-align: justify;
}

.roman-cover {
    width: 200px; /* Taille typique pour une couverture de livre */
    height: auto;
    border-radius: 4px; /* Coins légèrement arrondis */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5); /* Ombre lumineuse cyan */
}

.roman-text {
    flex: 1; /* Le texte prend l’espace restant */
    min-width: 300px; /* Évite que le texte devienne trop étroit sur petits écrans */
}
/* Styles pour la popup */
.popup {
    display: none; /* Caché par défaut */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centre exactement */
    width: 582px;
    height: 437px;
    background: rgba(0, 0, 0, 0.8); /* Fond sombre semi-transparent */
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-content {
    position: relative;
    background: #1a1a2e;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.popup-image {
    max-width: 100%;
    height: auto;
    display: block;
}

.subscribe-popup {
    display: none; /* Par défaut masquée */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: #00d4ff;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #0099cc;
}

/* Ajustement pour le lien de téléchargement */
.roman-text a {
    color: #00d4ff;
    text-decoration: none;
    margin-right: 1rem;
}

.roman-text a:hover {
    text-decoration: underline;
}
.project {
    display: flex;
    align-items: flex-start;
    gap: 2rem; /* Espace entre l’image et le texte */
    flex-wrap: wrap; /* Responsive : passe en colonne sur mobile */
    margin-bottom: 2rem; /* Espace entre les projets */
    text-align: justify;
    font-size: smaller;
}

.project-image-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centre le commentaire sous l’image */
}

.project-image {
    width: 200px; /* Taille ajustable selon tes images */
    height: auto;
    border-radius: 8px; /* Coins arrondis */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5); /* Ombre lumineuse cyan */
}

.image-caption {
    margin-top: 0.5rem; /* Espace entre l’image et le commentaire */
    font-size: xx-small; /* Taille plus petite pour la légende */
    color: #b0b0e0; /* Couleur plus claire mais lisible */
    text-align: center;
}

.project-text {
    flex: 1; /* Le texte prend l’espace restant */
    min-width: 300px; /* Évite que le texte devienne trop étroit */
}

.project-text h2 {
    margin-top: 0; /* Supprime l’espace superflu au-dessus du titre */
}
.project-text h3 {
    margin: 0; /* Supprime l’espace superflu au-dessus du titre */
    font-size: smaller;
}
.font-bold {
    font-weight: bold;
}
.blog-posts {
    margin-top: 1rem;
}

.blog-post {
    background: rgba(26, 26, 46, 0.8); /* Fond semi-transparent assorti au site */
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1,5rem; /* Espace entre les articles */
    text-align: justify;
}

.blog-post h2 {
    color: #ffffff; /* Cyan pour les titres */
    margin-top: 0;
    /*font-size: smaller;*/
}

.post-meta {
    color: #ffffff; /* Blanc pour la date */
    margin: 0.2rem 0;
    font-size: smaller;
    font-style: italic;
}

.post-sujet {
    color: #b0b0e0; /* Gris clair pour la date */
    margin: 0.5rem 0;
    font-size: smaller;
}
.blog-post p {
    margin: 0.2rem 0;
}

.discuss {
    font-style: italic;
    color: #b0b0e0; /* Gris clair pour l’appel à discussion */
    margin-top: 1rem;
}

.discuss a {
    color: #66d9ff;
}

.discuss a:hover {
    color: #ffffff;
}

.comments-section {
    margin-top: 1.5rem;
}

.comments-section h3 {
    color: #00d4ff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

.comment-list li {
    background: rgba(40, 40, 60, 0.8); /* Fond légèrement plus clair */
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: xx-large;
}

.comment-list li strong {
    color: #66d9ff; /* Nom en cyan clair */
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 500px;
}

.comment-form textarea {
    padding: 0.5rem;
    background-color: #2a2a3e;
    border: 1px solid #00d4ff;
    color: #e0e0e0;
    border-radius: 4px;
}

.comment-form textarea {
    resize: vertical;
    min-height: 80px;
}

.comment-form button {
    align-self: flex-start;
    background-color: #00d4ff;
    border: none;
    padding: 0.5rem 1rem;
    color: #1a1a2e;
    cursor: pointer;
    transition: background-color 0.3s;
}

.comment-form button:hover {
    background-color: #0099cc;
}

.highlight-boxes {
    display: flex;
    justify-content: space-between;
    gap: 1rem; /* Espace entre les cadres */
    margin-top: 2rem; /* Espace après la présentation */
    flex-wrap: wrap; /* Passe en colonne sur petits écrans */
    font-size: x-small;
    text-align: justify;
}

.highlight-box {
    flex: 1; /* Chaque cadre prend un tiers de la largeur */
    min-width: 250px; /* Largeur minimale pour petits écrans */
    background: rgba(40, 40, 60, 0.8); /* Fond légèrement plus clair */
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3); /* Ombre cyan subtile */
}

.highlight-box h2 {
    color: #00d4ff; /* Titre en cyan */
    font-size: x-small;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.highlight-box h3 {
    color: #ffffff; /* Texte en blanc */
    font-size: x-small;
    font-weight: lighter ;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.highlight-box p {
    color: #e0e0e0;
    font-size: 1rem;
    margin: 0;
}

.about {
    display: flex;
    text-align: justify;
    font-size: smaller;
}

.about-text {
    flex: 1; /* Le texte prend l’espace restant */
    min-width: 300px; /* Évite que le texte devienne trop étroit */
}

.about-photos {
    display: flex;
    justify-content: center; /* Centre les photos horizontalement */
    gap: 1.2rem; /* Espace entre les photos */
    margin: 0,8rem 0; /* Espace au-dessus et en-dessous */
    flex-wrap: wrap; /* Passe en colonne sur petits écrans */
}

.about-photo {
    width: 180px; /* Taille fixe, ajustable selon tes photos */
    height: auto;
    border-radius: 8px; /* Coins arrondis */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5); /* Ombre cyan pour thème SF */
    object-fit: cover; /* S’assure que l’image reste bien proportionnée */
}

.about-signaphoto {
    width: 180px; /* Taille fixe, ajustable selon tes photos */
    height: auto;
    border-radius: 8px; /* Coins arrondis */
    object-fit: cover; /* S’assure que l’image reste bien proportionnée */
}

.contact-section {
    display: flex;
    flex-direction: column; /* Empile par défaut */
    align-items: center; /* Centre horizontalement */
    gap: 1rem;
}

.contact-image {
    width: 250px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    object-fit: cover;
}

form {
    width: 100%;
    max-width: 500px; /* Réduit de 700px pour centrage visuel */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 auto; /* Centre dans son conteneur */
}

.blog-popup {
    display: none;
    position: fixed;
    top: 90px;
    left: 0;
    width: 100%;
    height: calc(100% - 90px);
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex; /* Remplace justify-content/align-items par flex */
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    overflow-y: auto;
}

.blog-popup-content {
    position: relative;
    background: rgba(26, 26, 46, 0.9);
    padding: 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 700px; /* Doit être assez large */
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    margin: 0 auto
}

/* Article dans la popup */
.blog-popup-content h1 {
    font-size: 1.5rem; /* Réduit de ~2rem à 1.5rem */
    color: #00d4ff;
    margin: 0 0 0.5rem;
}

.blog-popup-content .post-meta {
    font-size: 0.9rem; /* Réduit à 14px environ */
    color: #b0b0e0;
    margin: 0 0 0.5rem;
}

.blog-popup-content p {
    font-size: 0.95rem; /* Réduit à ~15px */
    color: #e0e0e0;
    margin: 0 0 0.5rem;
    text-align: justify !important; /* Justifie le texte */
}

/* Commentaires dans la popup */
.comments-section h3 {
    color: #00d4ff;
    font-size: 1.1rem; /* Réduit de ~1.2rem à 1.1rem */
    margin-bottom: 1rem;
}

.comment p {
    font-size: 0.85rem; /* Réduit à ~13px */
    margin: 0.5rem 0;
}

.comment strong {
    font-size: 0.9rem; /* Réduit légèrement pour le nom */
    color: #66d9ff;
}

/* Ajuster le bouton de fermeture pour qu’il reste visible */
.blog-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: #00d4ff;
    cursor: pointer;
}

.blog-close-btn:hover {
    color: #0099cc;
}
.read-more {
    color: #66d9ff;
    text-decoration: none;
    font-weight: bold;
}

.read-more:hover {
    color: #ffffff;
    text-decoration: underline;
}

.ratings-section {
    margin-top: 1.5rem;
}

.ratings-section h3 {
    color: #00d4ff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.rating-form {
    display: flex !important; /* Force flex */
    flex-direction: row !important; /* Assure horizontalité */
    flex-wrap: nowrap !important; /* Empêche le retour à la ligne */
    gap: 0.5rem; /* Espacement entre boutons */
    justify-content: flex-start; /* Alignement à gauche */
    width: 100%; /* Prend toute la largeur disponible */
}

.rating-form button {
    background: none;
    border: 1px solid #00d4ff;
    padding: 0.3rem 0.5rem; /* Réduit padding pour compacité */
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
    min-width: 40px; /* Largeur minimale réduite */
    text-align: center;
}

.rating-form button:hover {
    background: rgba(0, 212, 255, 0.2);
}

.article-footer {
    display: flex;
    justify-content: space-between; /* "Lire la suite" à gauche, commentaires à droite */
    align-items: center;
    margin-top: 0.5rem;
}

.comment-count {
    color: #b0b0e0;
    font-size: 0.9rem; /* Taille légèrement plus petite */
}

.comment-prompt {
    color: #00d4ff; /* Couleur cyan assortie au thème */
    font-size: 1.1rem; /* Taille légèrement plus petite que les autres h3 */
    margin: 1rem 0 0.5rem;
    border-top: 1px dashed #00d4ff; /* Ligne en pointillé au-dessus */
    padding-top: 0.5rem; /* Espace entre la ligne et le texte */
}

.success {
    color: #00d4ff;
    font-size: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.error {
    color: #ff6666;
    font-size: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.news-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.news-controls form {
    display: flex;
    gap: 0.5rem;
}

.news-controls input {
    padding: 0.5rem;
    border: 1px solid var(--cyan);
    background: #2a2a3e;
    color: var(--gray);
    border-radius: 4px;
}

.news-controls button {
    padding: 0.5rem 1rem;
    background: var(--cyan);
    border: none;
    color: #1a1a2e;
    cursor: pointer;
}

.news-controls button:hover {
    background: var(--cyan-hover);
}

.sort-links a {
    color: var(--light-cyan);
    text-decoration: none;
}

.sort-links a:hover {
    color: #fff;
}

.news-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%; /* Assure que ça reste dans le conteneur */
}

.news-post {
    background: var(--dark-bg);
    padding: 0,5rem;
    border-radius: var(--radius);
}

.news-layout {
    display: flex;
    align-items: stretch; /* Alignement en haut */
    gap: 1rem; /* Espace entre photo et texte */
    width: 100%; /* Limite à la largeur disponible */
    flex-wrap: wrap; /* Permet aux éléments de passer à la ligne */
}

.news-photo {
    width: 250px; /* Largeur fixe demandée */
    max-width: 100%; /* Empêche l’image de dépasser */
    height: auto;
    border-radius: 4px;
    object-fit: cover; /* Garde les proportions */
}

.rating-preview {
    font-size: 0.9rem;
    color: #b0b0e0;
}

.news-content {
    flex: 1; /* Prend l’espace restant */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Contenu aligné en haut */
    min-height: 200px; /* Correspond à la hauteur de l’image */
    min-width: 0; /* Évite débordement du texte */
}

/* Ajustements spécifiques pour le titre et le texte */
.news-content h2 {
    margin: 0 0 0.5rem; /* Réduit la marge pour aligner avec l’image */
    color: var(--cyan);
    font-size: 1.5rem;
}

.news-content .post-meta {
    font-size: 0.9rem;
    color: #b0b0e0;
    margin: 0 0 0.5rem;
}

.news-content p {

    font-size: 0.95rem;
    color: var(--gray);
    margin: 0 0 0.5rem;
}

.article-footer {
    margin-top: auto; /* Pousse le footer en bas si besoin */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
    max-width: 600px;
    font-size: 0.7rem !important;
}

.admin-form input,
.admin-form textarea {
    padding: 0.5rem;
    background: #2a2a3e;
    color: var(--gray);
    border-radius: 4px;
}

.admin-form button {
    background: var(--cyan);
    border: none;
    padding: 0.5rem 1rem;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.7rem !important;
}

.admin-form button:hover {
    background: var(--cyan-hover);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.admin-table th,
.admin-table td {
    padding: 0.3rem;
    border: 1px solid var(--cyan);
    text-align: left;
    font-size: 0.7rem !important;
}

.admin-table th {
    background: rgba(40, 40, 60, 0.8);
    color: var(--cyan);
}

.admin-table td {
    background: var(--dark-bg);
}

.admin-police {
    font-size: 1,5rem !important;
    font-weight: bold;
    text-align: center;
    padding: 0.3rem;
    background: rgba(112, 112, 247, 0.8);
}

.admin-table button {
    padding: 0.3rem 0.5rem;
    margin-right: 0.5rem;
    background: var(--cyan);
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.7rem !important;
}

.admin-table button:hover {
    background: var(--cyan-hover);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-buttons {
    display: flex;
    gap: 1rem; /* Espace entre les boutons */
    align-items: center;
}

.header-btn {
    background-color: #00d4ff;
    color: #1a1a2e;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.header-btn:hover {
    background-color: #0099cc;
}

.stats {
    display: flex;
    gap: 1rem;
    font-size: 0.65rem;
    color: #b0b0e0;
}

.stats span {
    background: rgba(40, 40, 60, 0.8);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.logout {
    color: var(--light-cyan);
    text-decoration: none;
}

.logout:hover {
    color: #fff;
}

.subscribe-popup {
    display: none; /* Par défaut masquée */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.subscribe-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.9);
    padding: 1,2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    box-sizing: border-box; /* Inclut padding dans la largeur */
}

.subscribe-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    color: #00d4ff;
    cursor: pointer;
}

.subscribe-close-btn:hover {
    color: #0099cc;
}

.subscribe-popup-content h3 {
    color: #00d4ff;
    font-size: 0,4rem;
    margin-bottom: 0.5rem;
}

.subscribe-popup-content form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.subscribe-popup-content input[type="email"] {
    padding: 0.5rem;
    background: #2a2a3e;
    border: 1px solid #00d4ff;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100%; /* Prend toute la largeur disponible */
    max-width: 100%; /* Empêche le dépassement */
    box-sizing: border-box; /* Inclut padding et bordure dans la largeur */
}

.subscribe-popup-content button {
    background: #00d4ff;
    border: none;
    padding: 0.5rem 1rem;
    color: #1a1a2e;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    width: auto; /* Bouton ajusté à son contenu */
    align-self: flex-start; /* Bouton à gauche, ajuste si besoin */
}

.subscribe-popup-content button:hover {
    background: #0099cc;
}

.subscribe-message.success {
    color: #00d4ff;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.subscribe-message.error {
    color: #ff6666;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Media query combinée pour écrans <= 768px */
@media (max-width: 768px) {

    /* Réduction des tailles de titres */
    h1 {
        font-size: 1.5rem; /* ≈ 24px, réduit de ~32px */
    }
    h2 {
        font-size: 1.25rem; /* ≈ 20px, réduit de ~24px */
    }
    h3 {
        font-size: 1rem; /* ≈ 16px, réduit de ~18px */
    }
    /* Navbar et menu hamburger */
    .navbar {
        height: 50px;
        padding: 0.5rem;
    }
    .hamburger {
        display: block;
        position: absolute;
        right: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
    }
    .nav-links {
        display: none;
        position: fixed;
        top: 50px;
        left: 50%;/* Centre horizontalement */
        transform: translateX(-50%); /* Décalage pour centrage précis */
        width: 150px;
        background: rgba(15, 15, 26, 0.95);
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.3rem;
        z-index: 99;
        font-size: 0.9rem;
        border: 2px solid #00d4ff; /* Remplace border-right pour symétrie */
        box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    }
    .nav-links.active {
        display: flex !important;
        z-index: 100 !important;
        background: rgba(15, 15, 26, 0.95) !important;
    }
    .nav-links a {
        padding: 0.3rem 0.5rem;
        display: block;
    }
    /* Contenu général */
    .container {
        margin-top: 60px;
        padding: 0.5rem;
    }

    /* Page Accueil */
    .button-group {
        display: flex;
        flex-direction: row; /* Force horizontalité */
        gap: 0.5rem; /* Espace réduit */
        flex-wrap: nowrap; /* Empêche le retour à la ligne */
    }
    .button-group button {
        font-size: 0.9rem; /* Réduit légèrement la taille */
        padding: 0.4rem 0.8rem; /* Réduit le padding */
    }

    /* Page roman */
    .popup {
        width: 90%;
        height: auto;
        max-height: 90vh;
        padding: 10px;
    }

    .popup-content {
        padding: 10px;
        max-width: 100%;
        width: 100%;
    }

    .popup-image {
        max-width: 100%;
        height: auto;
    }
    /* Page Blog */
    .article-footer {
        display: flex;
        flex-direction: row; /* Force horizontalité */
        flex-wrap: nowrap; /* Empêche le retour à la ligne */
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem; /* Espace réduit entre éléments */
        overflow-x: auto; /* Permet un défilement horizontal si trop large */
        white-space: nowrap; /* Garde le texte sur une ligne */
    }
    .article-footer .read-more,
    .article-footer .rating-preview,
    .article-footer .comment-count {
        font-size: 0.8rem; /* Réduit la taille du texte */
    }
    .rating-preview {
        flex-shrink: 0; /* Empêche la compression excessive */
    }

    /* Page Actus */
    .news-layout {
        flex-direction: column;
        align-items: center;
    }
    .news-photo {
        width: 100%;
    }
    .news-content {
        width: 100%;
    }

    /* Page Admin */
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stats {
        margin-top: 0.5rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Page Contact */
    .contact-section {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    .contact-image {
        width: 100px;
        max-width: 100px;
        margin: 0.5rem auto;
    }
    form {
        width: 100%;
        max-width: 300px; /* Réduit encore sur mobile */
        margin: 0 auto;
    }
    form input,
    form textarea {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Media query pour écrans <= 480px */
@media (max-width: 480px) {

    h1 {
        font-size: 1.25rem; /* Encore plus petit pour très petits écrans */
    }
    h2 {
        font-size: 1rem;
    }
    h3 {
        font-size: 0.9rem;
    }
    .nav-links {
        align-items: center;
        gap: 0.5rem;
    }
    .container {
        margin-top: 60px;
    }
}