/* --- Variables de couleur et configuration de base --- */
:root {
    --bg-color: #fcf9f5;
    --text-color: #3e2723; /* Brun foncé */
    --primary-color: #d84315; /* Orange profond */
    --secondary-color: #8d6e63; /* Brun moyen */
    --accent-color: #ffb74d; /* Orange clair */
    --card-bg: #ffffff;
    --border-color: #e0d4c8;
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* --- En-tête et Navigation --- */

/* --- Alignement du logo et du titre H1 --- */
.logo-title-container {
    display: flex;
    align-items: center;  /* Centre verticalement le logo et le texte */
    gap: 0.8rem;          /* Espace horizontal entre le logo et le texte */
    text-decoration: none; /* Supprime le soulignement du lien */
}

.app-logo {
    width: 42px;          /* Largeur de l'icône ajustée à la taille du H1 */
    height: 42px;         /* Hauteur identique pour conserver le ratio carré */
    object-fit: contain;  /* Évite toute distorsion de l'image PNG */
    display: block;
}

header {
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 1.5rem 1rem;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

header h1 {
    color: var(--accent-color);
    font-size: 2rem;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--bg-color);
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover, nav a.active {
    background-color: var(--primary-color);
}

/* --- Structure Principale --- */
main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.95rem;
}

pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3rem;
}

h3 {
    color: var(--secondary-color);
    margin: 1rem 0 0.5rem 0;
}

h4 {
    color: var(--secondary-color);
    margin: 1rem 0 0.5rem 0;
}

h5 {
    color: var(--secondary-color);
    margin: 1rem 0 0.5rem 0;
}

ul {
    list-style-type: square;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* --- Mise en page spécifique : Présentation (Layout asymétrique) --- */
.presentation-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.sidebar-resources {
    background-color: #f5ede6;
    border-left: 4px solid var(--primary-color);
}

.sidebar-resources ul {
    list-style-type: none;
    margin-left: 0;
}

.sidebar-resources a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.sidebar-resources a:hover {
    text-decoration: underline;
}

/* --- Mise en page spécifique : Captures d'écran (Grille) --- */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.screenshot-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screenshot-item a {
    display: block;
    cursor: pointer;
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.screenshot-item img:hover {
    transform: scale(1.02);
}

.screenshot-caption {
    padding: 1rem;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-color);
    font-weight: 500;
}

/* --- Structure du Manuel --- */
.manual-nav {
    background: #f5ede6;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 2rem;
}

.manual-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    margin: 0;
}

.manual-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.manual-nav a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.manual-article {
    margin-bottom: 3rem;
}

/* --- Pied de page --- */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--text-color);
    color: var(--border-color);
    font-size: 0.9rem;
    margin-top: 4rem;
}

/* --- Adaptabilité mobile (Responsive) --- */
@media (min-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .presentation-layout {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 1.2rem;
    }
}

/* --- Sélecteur de langue (Internationalisation) --- */
.lang-selector {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background-color: var(--text-color);
    color: var(--border-color);
}

.lang-selector a {
    color: var(--border-color);
    text-decoration: none;
    font-weight: bold;
}

.lang-selector a:hover, .lang-selector a.active {
    color: var(--accent-color);
}
