/* css/base.css */

/* -------------------------------------------------------------------------- */
/*                                VARIABLES CSS                               */
/* -------------------------------------------------------------------------- */
:root {
    /* Typography */
    --font-primary: 'Helvetica Neue', Arial, sans-serif;
    --font-secondary: 'Georgia', serif; /* For headings */

    /* Core Colors */
    --text-color-dark: #212529;    /* Near black for body text */
    --text-color-light: #f8f9fa;   /* Very light gray / Off-white for dark backgrounds */
    --background-light: #ffffff;   /* White for main background */
    --background-medium: #f1f3f5;  /* Light gray for alternating sections */
    --border-color: #dee2e6;       /* Standard border color */

    /* Header Specific Colors */
    --header-background: #001f3f;          /* Deep navy blue */
    --header-text-color: var(--text-color-light); /* For logo text if applicable */
    --header-link-color: #e0e0e0;         /* Light gray for nav links */
    --header-link-hover-color: #ffffff;   /* Pure white for nav link hover */
    --header-link-active-bg: #003366;   /* Slightly lighter navy for active/hover nav link background */

    /* General Link Colors (Body Content) */
    --link-color: #0056b3;         /* Standard blue for links */
    --link-hover-color: #003d80;   /* Darker blue for link hover */

    /* Generic Hero Section Colors */
    --hero-background-generic: #e9ecef;     /* Lightest gray for generic hero */
    --hero-text-color-generic: #343a40;     /* Dark gray for generic hero text */
    /* Alternative Dark Generic Hero (Uncomment to use)
    --hero-background-generic: #343a40;
    --hero-text-color-generic: var(--text-color-light);
    */

    /* Layout */
    --container-max-width: 1200px;
    --spacing-unit: 1rem; /* Approx 16px, adjust as needed */
}

/* -------------------------------------------------------------------------- */
/*                                 RESET & BASE                               */
/* -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%; /* Base font size, often 16px */
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased; /* Smoother fonts on WebKit */
    -moz-osx-font-smoothing: grayscale; /* Smoother fonts on Firefox */
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color-dark);
    background-color: var(--background-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 calc(var(--spacing-unit) / 2); /* Small horizontal padding for safety */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}
.inline-flag-icon { /* For small flags next to text */
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5em;
    border: 1px solid var(--border-color);
}

/* -------------------------------------------------------------------------- */
/*                                TYPOGRAPHY                                  */
/* -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    line-height: 1.3;
    font-weight: 600; /* Slightly bolder headings */
}

h1 { font-size: 2.5rem; } /* Base H1 size, hero will override */
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: var(--spacing-unit);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover, a:focus {
    color: var(--link-hover-color);
    text-decoration: underline;
}

ul, ol {
    margin-bottom: var(--spacing-unit);
    padding-left: calc(var(--spacing-unit) * 1.5);
}

/* -------------------------------------------------------------------------- */
/*                                   HEADER                                   */
/* -------------------------------------------------------------------------- */
.site-header {
    background-color: var(--header-background);
    padding: var(--spacing-unit) 0;
    /* border-bottom: 1px solid #001020; /* Optional: darker border if needed */
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* For smaller screens */
    gap: var(--spacing-unit); /* Gap between logo, nav, search */
}

.site-header .logo a {
    display: inline-block; /* Allows for better control if logo is an image */
}
.site-header .logo img {
    max-height: 90px; /* Adjust as needed */
    /* If logo is dark, uncomment to make it white on dark header: */
    /* filter: brightness(0) invert(1); */
}
.site-header .logo h1 { /* If logo is text */
    margin-bottom: 0; /* Remove default h1 margin */
    font-size: 1.8rem;
}
.site-header .logo h1 a {
    color: var(--header-text-color);
    text-decoration: none;
    font-family: var(--font-primary); /* Or a specific logo font */
    font-weight: bold;
}

.main-navigation ul {
    list-style: none;
    padding-left: 0;
    margin: 0; /* Ensure no default ul margins */
    display: flex;
    flex-wrap: wrap; /* Allow nav items to wrap on small screens */
    gap: calc(var(--spacing-unit) / 4); /* Small gap between nav items */
}
.main-navigation li {
    margin: 0; /* Ensure no default li margins */
}
.main-navigation a {
    color: var(--header-link-color);
    text-decoration: none;
    padding: calc(var(--spacing-unit) * 0.6) var(--spacing-unit); /* Padding for clickable area */
    display: block;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    font-weight: 500; /* Slightly bolder nav links */
}
.main-navigation a:hover,
.main-navigation a:focus,
.main-navigation li.active a { /* Add .active class to current page link */
    color: var(--header-link-hover-color);
    background-color: var(--header-link-active-bg);
    text-decoration: none; /* Remove underline on hover for these specific links */
}

/* Submenu Styles (if used) */
.main-navigation ul ul {
    display: none;
    position: absolute;
    background-color: var(--header-background);
    border: 1px solid var(--header-link-active-bg);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    z-index: 1000; /* Ensure submenu is on top */
    margin-top: 2px; /* Small gap from parent */
    min-width: 200px;
    border-radius: 0 0 4px 4px; /* Rounded bottom corners */
}
.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul {
    display: block;
}
.main-navigation ul ul li {
    width: 100%; /* Full width for submenu items */
}
.main-navigation ul ul li a {
    padding: calc(var(--spacing-unit) * 0.75) var(--spacing-unit);
    border-radius: 0; /* Submenu items typically not individually rounded */
    /* Hover/focus styles are inherited, or can be customized here */
}

.search-bar {
    display: flex; /* To align input and button */
}
.search-bar input[type="search"] {
    padding: calc(var(--spacing-unit) / 1.8); /* Match button padding for height */
    border: 1px solid var(--border-color);
    border-right: none; /* Remove right border to merge with button */
    border-radius: 4px 0 0 4px;
    background-color: var(--background-light);
    color: var(--text-color-dark);
    min-width: 150px; /* Minimum width */
}
.search-bar input[type="search"]:focus {
    outline: none;
    border-color: var(--link-color); /* Highlight on focus */
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.25); /* Subtle glow */
}
.search-bar button {
    padding: calc(var(--spacing-unit) / 1.8);
    border: 1px solid var(--link-color);
    background-color: var(--link-color);
    color: var(--text-color-light);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.search-bar button:hover, .search-bar button:focus {
    background-color: var(--link-hover-color);
    border-color: var(--link-hover-color);
    outline: none;
}

/* -------------------------------------------------------------------------- */
/*                                MAIN CONTENT                                */
/* -------------------------------------------------------------------------- */
.main-content {
    flex-grow: 1; /* Pushes footer down */
}

/* Generic Hero Section */
.hero-section {
    background-color: var(--hero-background-generic);
    color: var(--hero-text-color-generic);
    padding: calc(var(--spacing-unit) * 3) 0; /* Generous padding */
    text-align: center;
    /* No margin-top here; spacing controlled by header's padding-bottom or first section's margin-top */
}
.hero-section h1 {
    color: inherit; /* Inherits from .hero-section color */
    font-size: 2.8rem; /* Specific size for hero H1 */
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}
.hero-section .subtitle {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 750px; /* Constrain line length for readability */
    margin-left: auto;
    margin-right: auto;
}

/* --- OPTIONAL: Special Hero for specific pages (e.g., Red & Blue) --- */
/* To use, add class "hero-red-blue-special" to the hero section in HTML 
   and uncomment the styles below.
*/
/*
.hero-section.hero-red-blue-special {
    background: linear-gradient(135deg, #0033A0 0%, #D81E05 100%);
    color: #FFFFFF;
}
.hero-section.hero-red-blue-special h1 {
    font-size: 3rem; // Slightly larger if desired
}
*/
/* --- END OPTIONAL Special Hero --- */


/* Spacing after header: If .hero-section is NOT the first child of .main-content,
   the actual first section gets a margin-top.
   If .hero-section IS the first child, its own padding provides the space. */
.main-content > section:first-child:not(.hero-section) {
    margin-top: calc(var(--spacing-unit) * 2);
}


/* Standard Content Sections */
.content-section,
.flag-spotlight-section, /* From your flags.css, good to have base padding */
.faq-section,
.related-links-section {
    padding: calc(var(--spacing-unit) * 2.5) 0; /* Vertical padding for sections */
}

/* Alternating Backgrounds for sections (optional, for visual rhythm) */
.main-content > section:nth-child(even):not(.hero-section) {
    background-color: var(--background-medium);
}
/* Ensure flag spotlight (if it has its own background) or hero doesn't get overridden */
.flag-spotlight-section, .hero-section {
    /* If these have specific backgrounds in flags.css or here, they'll take precedence */
}


/* FAQ Basic Styling (from previous version, good to keep in base) */
.faq-section details {
    margin-bottom: var(--spacing-unit);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-light); /* Ensure details bg is light */
}
.faq-section summary {
    padding: var(--spacing-unit);
    font-weight: bold;
    cursor: pointer;
    background-color: var(--background-medium); /* Lighter background for summary */
    border-radius: 3px 3px 0 0; /* Match top corners of details */
    position: relative; /* For pseudo-element arrow */
}
.faq-section summary:hover {
    background-color: #e2e6ea; /* Slightly darker on hover */
}
.faq-section details[open] summary {
    border-bottom: 1px solid var(--border-color);
}
.faq-section details p {
    padding: var(--spacing-unit);
    margin-bottom: 0; /* Remove default p margin inside details */
}
/* Basic arrow indicator for FAQ */
.faq-section summary::after {
    content: '▼'; /* Down arrow */
    font-size: 0.8em;
    position: absolute;
    right: var(--spacing-unit);
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease-in-out;
}
.faq-section details[open] summary::after {
    transform: translateY(-50%) rotate(180deg); /* Up arrow when open */
}


/* -------------------------------------------------------------------------- */
/*                                   FOOTER                                   */
/* -------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--text-color-dark); /* Dark background for footer */
    color: var(--text-color-light);
    padding: calc(var(--spacing-unit) * 2.5) 0;
    font-size: 0.9rem;
}
.site-footer a {
    color: #adb5bd; /* Lighter link color for dark background */
}
.site-footer a:hover, .site-footer a:focus {
    color: var(--text-color-light); /* Brighter on hover */
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 2);
}
.footer-column {
    flex: 1;
    min-width: 200px; /* Ensure columns don't get too narrow */
}
.footer-column h4 {
    color: var(--text-color-light);
    margin-bottom: var(--spacing-unit);
    font-family: var(--font-primary); /* Match body font for footer heading */
    font-size: 1.1rem;
    font-weight: 600;
}
.footer-column ul {
    list-style: none;
    padding-left: 0;
}
.footer-column ul li {
    margin-bottom: calc(var(--spacing-unit) / 2);
}

.copyright {
    text-align: center;
    border-top: 1px solid #495057; /* Slightly lighter border in footer */
    padding-top: calc(var(--spacing-unit) * 1.5);
    font-size: 0.85rem;
    opacity: 0.8;
}

/* -------------------------------------------------------------------------- */
/*                              UTILITY CLASSES                               */
/* -------------------------------------------------------------------------- */
.sr-only { /* For screen-reader only text */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------------- */
/*                      LAYOUT WITH SIDEBAR                                   */
/* -------------------------------------------------------------------------- */
.page-layout-with-sidebar {
    display: flex;
    flex-wrap: wrap; /* Permet à la sidebar de passer en dessous sur mobile */
    gap: calc(var(--spacing-unit) * 2);
    padding-top: calc(var(--spacing-unit) * 1.5); /* Espace au-dessus du layout principal/sidebar */
    padding-bottom: calc(var(--spacing-unit) * 1.5); /* Espace en dessous */
}

.main-content-area {
    flex: 3; /* Le contenu principal prend plus de place */
    min-width: 0; /* Important pour que flex-shrink fonctionne correctement */
}

.sidebar {
    flex: 1; /* La sidebar prend moins de place */
    min-width: 340px; /* Largeur minimale pour la sidebar, peut être ajustée à la largeur de l'ad + padding */

}

/* Styles pour le contenu dans les sections du main-content-area, pour s'assurer qu'il utilise bien .container-content
   si le .container global est sur .page-layout-with-sidebar */
.container-content {
    width: 100%; /* Prend la largeur de son parent (main-content-area ou section) */
    max-width: var(--container-max-width); /* Mais ne dépasse pas la largeur max définie */
    margin-left: auto;
    margin-right: auto;
    padding: 0 calc(var(--spacing-unit) /2) ; /* Conserve le padding horizontal interne */
}
/* Si le hero doit prendre toute la largeur (fluid) */
.hero-section .container-fluid {
    width: 100%;
    padding: 0; /* Pas de padding horizontal si on veut vraiment bord à bord */
}


/* Sidebar specific styles */
.sidebar-ad-slot {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    text-align: center; /* Utile si le bloc pub est plus petit que le slot et display: inline-block */
    background-color: var(--background-medium); /* Pour visualiser l'emplacement pendant le dev, peut être retiré ou rendu transparent */
    border-radius: 4px;
	height: 280px; /* Hauteur fixe pour le slot publicitaire */
    display: flex; /* Optionnel: pour aider à centrer le contenu de l'annonce si elle ne remplit pas le slot */
    overflow: hidden; /* Empêche le contenu de déborder visiblement */
}
.sidebar-ad-slot img {
    max-width: 100%;
    height: auto;
    display: inline-block; /* Pour le centrage */
}


.sidebar-links {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    padding: var(--spacing-unit);
    background-color: var(--background-medium); /* Léger fond pour distinguer les blocs de liens */
    border-radius: 4px;
}
.sidebar-links h3 {
    font-size: 1.2rem;
    color: var(--text-color-dark); /* Ou une couleur d'accent */
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    padding-bottom: calc(var(--spacing-unit) / 2);
    border-bottom: 1px solid var(--border-color);
}
.sidebar-links ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0; /* Pas de marge en bas de la liste */
}
.sidebar-links li {
    margin-bottom: calc(var(--spacing-unit) / 2);
}
.sidebar-links a {
    text-decoration: none;
    color: var(--link-color); /* Couleur de lien standard */
    font-weight: 500;
    display: block; /* Pour que le lien prenne toute la largeur pour clic facile */
    padding: calc(var(--spacing-unit) / 3) 0;
}
.sidebar-links a:hover, .sidebar-links a:focus {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Responsive adjustments for sidebar */
@media (max-width: 992px) { /* Tablette et en dessous */
    .page-layout-with-sidebar {
        flex-direction: column;
    }
    .main-content-area {
        order: 1; /* Contenu principal en premier */
        width: 100%; /* Prend toute la largeur */
    }
    .sidebar {
        order: 2; /* Sidebar en dessous */
        width: 100%; /* Prend toute la largeur */
        max-width: none; /* Annule la max-width pour mobile */
        margin-top: calc(var(--spacing-unit) * 2); /* Espace si elle passe en dessous */
    }
    .sidebar-ad-slot {
        /* S'assurer que l'ad est centré ou s'adapte bien */
        /* Ex: si la pub est 336x280, elle peut être trop large.
           Votre code de pub devrait gérer cela. L'image placeholder s'adaptera. */
    }
}