@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');

/* --- DEFINITION DES THEMES --- */

/* 1. Thème Sombre (Par défaut) */
:root {
    --bg-main: linear-gradient(180deg, #0B132B 0%, #1C2541 100%);
    --bg-card: rgba(28, 37, 65, 0.85);
    --border-card: #3A506B;
    --text-primary: #FFFFFF;
    --text-secondary: #A3B1C6;
    --accent-blue: #60A5FA;
    --btn-bg: #10B981;
    /* Vert menthe pour boutons */
    --btn-text: #FFFFFF;
    --input-bg: #0F0F3D;
    --input-border: #3A506B;
}

/* 2. Thème Clair (Sakura & Neko) */
body.light-theme {
    --bg-main: #E0DCD3;
    /* Beige poudré */
    --bg-card: #C5A4A4;
    /* Vieux rose */
    --border-card: #A88383;
    --text-primary: #272323;
    /* Sombre pour le texte */
    --text-secondary: #4A3E3E;
    --accent-blue: #8B5E68;
    --btn-bg: #272323;
    /* Boutons sombres */
    --btn-text: #FFFFFF;
    --input-bg: #FFFFFF;
    --input-border: #CCCCCC;
}

/* --- BASE --- */
* {
    font-family: "Ubuntu", 'Segoe UI', Arial, sans-serif;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    background: var(--bg-main) !important;
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

/* --- HERO & INTRO --- */
.hero-section {
    text-align: center;
    padding: 20px 20px 10px;
}

.hero-section h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.hero-section h1 span {
    color: var(--accent-blue);
}

.intro {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-card);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    text-align: center;
}

/* --- SEPARATEURS DE CATEGORIES --- */
.section-divider {
    text-align: center;
    margin: 35px 0 15px;
    width: 100%;
}

.section-divider span {
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 5px 15px;
}

/* --- GRILLE DE CARTES (boxFill) --- */
.boxFill,
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.box,
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.box:hover,
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.box h2,
.card h3 {
    color: var(--text-primary);
    margin: 5px 0 10px;
    font-size: 1.3em;
}

.box p,
.card p {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 15px;
}

.btn-card {
    background-color: var(--btn-bg) !important;
    color: var(--btn-text) !important;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-card:hover {
    opacity: 0.9;
}

/* --- SECTION CONTACT --- */
.contact-section {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.contact-container {
    background: var(--bg-card);
    border: 2px solid var(--border-card);
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.contact-container h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    outline: none;
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 400px;
}

.btn-submit,
.contact-form button {
    background: var(--btn-bg) !important;
    color: var(--btn-text) !important;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-submit:hover,
.contact-form button:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* --- RESPONSIVE MOBILE & TABLETTE --- */
@media (max-width: 1024px) {

    .boxFill,
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }

    .boxFill,
    .grid-container {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .box,
    .card {
        padding: 20px;
    }
}

/* ==========================================================================
   CORRECTIF ODORI — DECALAGE GAUCHE + RESPONSIVE RENFORCE
   A coller a la FIN du fichier : il est dernier, donc il gagne.
   Ne rien supprimer au-dessus.
   --------------------------------------------------------------------------
   Pourquoi la page Rumillia etait decalee vers la gauche :
   `main` est en flex column avec `align-items: center`. Sur mobile, un
   enfant plus large que l'ecran ne se reduit PAS sur l'axe horizontal
   (le flex-shrink ne joue que sur l'axe vertical ici) : il reste centre
   et deborde autant a gauche qu'a droite, donc la gauche est coupee.
   Le correctif : sur mobile, `main` passe en `align-items: stretch`
   (les enfants prennent la largeur de l'ecran au lieu de deborder)
   + aucun bloc ne peut depasser l'ecran.
   ========================================================================== */

@media (max-width: 768px) {

    /* --- Anti-debordement : la page ne peut plus glisser sur le cote --- */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }

    /* --- LE correctif du decalage : les enfants de main s'etirent --- */
    main {
        align-items: stretch;
        width: 100%;
        padding: 16px;
    }

    /* --- Aucun bloc ne depasse jamais l'ecran --- */
    main>* {
        max-width: 100%;
        min-width: 0;
    }

    /* --- Hero : titre plus doux, pas de debordement --- */
    .hero-section {
        padding: 16px 4px 8px;
    }

    .hero-section h1 {
        font-size: 1.6rem;
        line-height: 1.25;
        overflow-wrap: break-word;
    }

    /* --- Carte intro / Rumillia : pleine largeur, centree, texte intact --- */
    .intro {
        width: 100%;
        margin: 16px auto;
        padding: 18px 16px;
    }

    .intro p {
        overflow-wrap: break-word;
    }

    /* --- Separateurs : les longs mots passent a la ligne --- */
    .section-divider span {
        display: inline-block;
        max-width: 100%;
        overflow-wrap: break-word;
        letter-spacing: 1px;
    }

    /* --- Contact : on respire, champs pleine largeur --- */
    .contact-section {
        padding: 28px 0;
    }

    .contact-container {
        padding: 22px 16px;
    }

    .contact-form input,
    .contact-form textarea {
        width: 100%;
    }
}

@media (max-width: 480px) {

    .hero-section h1 {
        font-size: 1.35rem;
    }

    .intro {
        padding: 16px 14px;
    }

    .box,
    .card {
        padding: 18px 14px;
    }
}