/* Styles généraux */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --text-color: #333;
    --background-color: #f9f9f9;
    --footer-background: #2c3e50;
    --footer-text: #ecf0f1;
    --btn-green: #27ae60;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

h1, h2, h3, h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px; /* Added consistency for images */
}

/* Header */
header {
    background-color: #a0cdd9;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.logo {
    max-height: 60px;
}

nav {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--secondary-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.intro {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Les deux conteneurs centrés */
.featured-containers {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.planif-container {
    width: 340px;
    height: 280px;
    background-image: url('Files/Image/planif.jpg'); 
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.planif-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    z-index: 1;
}

.decouvrez-btn {
    background-color: var(--btn-green);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.decouvrez-btn:hover {
    background-color: #219653;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
}

.ads-container {
    width: 340px;
    height: 280px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 1.2rem;
    text-align: center;
}

.content {
    background-color: white;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.pays-card {
    background-color: var(--light-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    transition: all 0.3s ease; /* Moved transition here */
}

.pays-info {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1rem 0;
}

.pays-image-container { /* Added container for better control */
    flex: 1;
    min-width: 250px; /* Adjusted min-width */
}

.pays-image {
    width: 100%; /* Ensure image fills container */
    height: auto;
    object-fit: cover; /* Ensure image covers space well */
    border-radius: 8px;
    display: block;
}


.pays-details {
    flex: 1;
    min-width: 250px;
}

.pays-details p {
    margin-bottom: 0.5rem;
}
.pays-details strong {
    color: var(--secondary-color); /* Style strong tags */
}

/* Footer */
footer {
    background-color: var(--footer-background);
    color: var(--footer-text);
    padding: 3rem 2rem;
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-left, .footer-center, .footer-right {
    flex: 1;
    min-width: 250px;
}

footer h4 {
    color: var(--light-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

footer a {
    color: var(--light-color);
}

footer a:hover {
    color: var(--primary-color);
}

footer ul {
    list-style: none;
    padding: 0; /* Remove default padding */
}

footer li {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .featured-containers {
        flex-direction: column;
        align-items: center;
    }

    .planif-container, .ads-container {
        width: 90%; /* Make containers wider on mobile */
        max-width: 340px; /* But not too wide */
    }

    .pays-info {
        flex-direction: column;
    }

     .pays-image-container {
        min-width: 100%; /* Image takes full width */
    }

    footer {
        flex-direction: column;
        text-align: center; /* Center footer content */
    }

     .footer-left, .footer-center, .footer-right {
        min-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero, .content, .featured-containers {
    animation: fadeIn 0.8s ease-in;
}

/* Amélioration de l'expérience utilisateur */
.pays-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Styles pour améliorer l'accessibilité */
:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.hero h1 {
    font-size: 2.8rem; /* Slightly larger for homepage */
}

/* Ad Section Styling */
.ads-section {
    text-align: center; /* Center the ad block */
    margin: 2rem 0;
    padding: 1rem;
    background-color: var(--light-color); /* Optional background */
    border-radius: 8px;
}

/* Alphabetical Navigation */
.alphabetical-nav {
    /* text-align: center; */ /* Supprimé ou commenté */
    display: flex;           /* ACTIVÉ FLEXBOX */
    flex-wrap: wrap;         /* PERMET LE RETOUR À LA LIGNE */
    justify-content: center; /* CENTRE LES ÉLÉMENTS HORIZONTALEMENT */
    gap: 0.5rem;             /* AJOUTE DE L'ESPACE ENTRE LES ÉLÉMENTS (remplace margin) */
    margin: 2rem 0;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.alphabetical-nav a, .alphabetical-nav span, .alphabetical-nav b {
    display: inline-block; /* Peut être conservé ou supprimé car flex gère l'affichage */
    padding: 0.5rem 0.8rem;
    /* margin: 0.2rem; */ /* Supprimé ou commenté car 'gap' est utilisé sur le parent */
    font-size: 1.2rem;
    font-weight: bold;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
    flex-grow: 0; /* Empêche les éléments de s'étirer */
    flex-shrink: 0; /* Empêche les éléments de rétrécir */
}

/* Styles pour hover, etc. restent les mêmes */
.alphabetical-nav a:hover {
    background-color: var(--primary-color);
    color: white;
}
.alphabetical-nav span, .alphabetical-nav b {
    color: #aaa;
    background-color: #f0f0f0;
    cursor: default;
}

.alphabetical-nav b { /* Specific style for current letter if needed, e.g., A */
    /* Example: background-color: var(--secondary-color); color: white; */
}


/* Content Image */
.content-image {
    display: block;     /* Nécessaire pour margin: auto et bon comportement */
    width: 100%;        /* IMPORTANT: Fait que l'image essaie de prendre toute la largeur disponible */
    max-width: 500px;   /* IMPORTANT: Limite supérieure, empêche l'image d'être > 500px */
    height: auto;       /* IMPORTANT: Maintient les proportions de l'image lors du redimensionnement */
    margin: 1.5rem auto; /* Centre l'image horizontalement */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Region Links */
.region-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.region-link {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px; /* Pill shape */
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.region-link:hover {
    background-color: var(--primary-color);
    color: white; /* Ensure text remains white on hover */
    transform: translateY(-2px);
}

/* Region Sections */
.region-section {
    margin-top: 2.5rem;
    /* padding-top: 1.5rem; */ /* Vous pouvez supprimer ou réduire ce padding si scroll-margin-top suffit */
    border-top: 1px solid #eee;
    scroll-margin-top: 250px; /* <<< AJOUTER CECI - Ajustez la valeur si nécessaire */
}

.region-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.region-section em { /* Style the list summary */
    font-style: normal;
    color: #555;
    font-size: 0.95rem;
    display: block;
    margin-top: 0.5rem;
}

/* Capitals Section */
.capitals-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem; /* Add padding for anchor links */
    border-top: 1px solid #eee;
}
.capitals-section h2 {
     color: var(--primary-color);
}

.capitals-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* Distribute columns */
    gap: 1rem; /* Gap between columns */
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.capitals-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1; /* Allow columns to grow */
    min-width: 200px; /* Minimum width before wrapping */
}

.capitals-list li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Other Territories Section */
.other-territories {
    margin-top: 2.5rem;
    padding: 1rem;
    background-color: #f0f0f0; /* Slightly different background */
    border-radius: 8px;
    font-size: 0.95rem;
    color: #555;
}
.other-territories h2 {
    font-size: 1.5rem; /* Smaller heading */
    color: var(--secondary-color);
}


* Responsive Adjustments for Index */
@media (max-width: 768px) {
    /* ... autres règles responsives ... */

    .alphabetical-nav a, .alphabetical-nav span, .alphabetical-nav b {
        font-size: 1rem;       /* Ajustement de taille conservé */
        padding: 0.4rem 0.6rem; /* Ajustement de padding conservé */
        min-width: 35px;       /* Ajustement de largeur min conservée */
    }

    .alphabetical-nav {
         gap: 0.3rem; /* Réduit l'espace sur mobile si nécessaire */
    }

    .region-links {
        flex-direction: column;
        align-items: center;
    }

    .region-link {
        width: 80%;
        text-align: center;
    }

    .capitals-list {
        flex-direction: column; /* Stack columns on smaller screens */
    }
     .capitals-list ul {
        min-width: 100%; /* Full width columns */
    }
}