/* =========================================
   1. BASES ET COULEURS
   ========================================= */
body {
    background-color: #f4ece0; /* Couleur papier ancien */
    color: #3e2b1d;
    font-family: 'Georgia', serif;
    margin: 0;
    padding: 0;
}

header {
    text-align: center;
    padding: 20px;
    border-bottom: 2px double #3e2b1d;
}

h1 { font-variant: small-caps; margin-bottom: 0; }
.subtitle { font-style: italic; margin-top: 5px; }

/* =========================================
   2. NAVIGATION
   ========================================= */
nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    background: #3e2b1d;
    padding: 10px;
}

nav a {
    color: #f4ece0;
    text-decoration: none;
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 4px;
    transition: background 0.3s;
}

nav a.active {
    background-color: #f4ece0;
    color: #3e2b1d;
    font-weight: bold;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

nav a:hover {
    background-color: rgba(244, 236, 224, 0.2);
}



/* =========================================
   10. IMAGE PRINCIPALE (CORRECTION)
   ========================================= */
.image-focus {
    width: 100%;
    margin-bottom: 30px;
    text-align: center;
}

.main-img {
    width: 100%;           /* L'image occupe toute la largeur du conteneur */
    max-width: 100%;       /* Sécurité pour ne pas déborder */
    height: auto;          /* Garde les proportions */
    border: 5px solid #fff; /* Bordure blanche style photo ancienne */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border-radius: 2px;
    display: block;
}

/* =========================================
   NOUVEAU STYLE POUR LES JOURS FÉRIÉS (.holiday)
   AVEC IMAGE DE FOND
   ========================================= */
.holiday {
    /* --- 1. L'IMAGE --- */
    /* Remplacez 'motif-fete.png' par le nom exact de votre fichier image */
    /* Idéalement une image carrée, pas trop foncée */
    background-image: url('images-calendrier/fete2.png');

    /* --- 2. POSITIONNEMENT --- */
    background-repeat: no-repeat; /* L'image ne se répète pas */
    background-position: center;  /* L'image est centrée dans la case */

    /*
       TAILLE DE L'IMAGE (Choisissez l'option que vous préférez) :
       - cover : L'image s'étire pour remplir TOUTE la case (idéal pour une texture type parchemin).
       - contain : L'image s'adapte pour entrer entièrement sans être coupée (idéal pour un motif).
    */
    background-size: contain;

    /* --- 3. LE TEXTE (LE CHIFFRE) --- */
    /* Il faut s'assurer que le chiffre reste lisible sur l'image */
    font-weight: 800; /* Très gras */
    color: #c5b398;   /* Un rouge brique foncé qui ressort bien sur des tons sépia/crème */
    /* Si votre image est foncée, utilisez une couleur claire : color: #fffdf0; */

    /* Optionnel : une fine bordure pour encadrer le tout */
    border: 3px solid #cba;
}

/* =========================================
   3. STRUCTURE ET GRILLE PRINCIPALE
   ========================================= */
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colonnes (iPad Paysage) */
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: #fffef2;
    padding: 15px 20px;
    border: 1px solid #c5b398;
    border-radius: 5px;
}

.card h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    color: #5d4037;
}

/* Style pour les nouvelles internationales */
.news-world {
    background-color: #fcfcfc;
    border-top: 4px solid #b22222; /* Un rouge "impérial" pour le monde */
}

.news-world h3 {
    color: #8b0000;
}




/* =========================================
   4. CALENDRIER
   ========================================= */
.calendar-section { margin-top: 30px; text-align: center; }

.calendar {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.5);
    margin: 20px 0;
}

.calendar th, .calendar td {
    border: 2px solid #3e2b1d;
    padding: 12px;
    text-align: center;
}

.calendar td {
    font-size: 1.8em;
    font-weight: bold;
    color: #2c1e14;
}

.calendar th { background: #dccfb8; }


/* =========================================
   STYLE POUR LES CASES VIDES AVEC IMAGE
   (Juste la ligne du bas visible)
   ========================================= */
.case-vide {
    /* --- 1. GESTION DES BORDURES --- */

    /* On rend le haut, la gauche et la droite transparents.
       L'utilisation de !important est cruciale ici pour "gagner"
       contre les règles par défaut du tableau. */
    border-top-color: transparent !important;
    border-left-color: 1px !important;
    /*border-right-color: transparent !important;*/
    /*border-bottom-color: transparent !important;*/

    /* On force la bordure du bas à être visible */
    /* NOTE : Si vos lignes de tableau sont d'une autre couleur que le gris standard (#ccc),
       changez le code couleur ci-dessous (ex: #000000 pour du noir) */
    border-bottom: 1px solid #ccc !important;


    /* --- 2. FOND ET IMAGE --- */
    background-color: transparent !important; /* Fond transparent */
    background-repeat: no-repeat;

    /* ASTUCE DE MAÎTRE DE JEU :
       Au lieu de centrer l'image (center center), on la place en bas (center bottom).
       On ajoute un petit décalage (ex: 2px) pour qu'elle ne touche pas exactement la ligne.
       Cela donne l'impression qu'elle est "posée" dessus. */
    background-position: center bottom 0px;

    /* On ajuste la taille pour que ça fasse "gravure" */
    background-size: 115%;
    opacity: 0.9; /* Presque opaque pour bien voir le dessin */
}




/* =========================================
   5. SECTION ANNIVERSAIRES (GRILLE 2 COLONNES)
   ========================================= */
.anniversaire-section {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colonnes de personnages */
    gap: 10px 15px;
    margin-bottom: 10px;
}

.character-birthday {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.character-photo {
    width: 45px;          /* Taille fixe idéale pour l'iPad */
    height: 45px;
    border-radius: 50%;
    border: 1.5px solid #3e2b1d;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;       /* Empêche la photo de se déformer */
    background-color: #dccfb8;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.character-info strong {
    font-size: 0.8em;
    color: #3e2b1d;
    display: block;
    line-height: 1.0;
}

.character-info span {
    font-style: italic;
    font-size: 0.8em;
    color: #5d4037;
    line-height: 1.0;
}

/* =========================================
   6. SECTION SAINTS ET DÉTAILS
   ========================================= */
.mini-title {
    font-size: 0.9em;
    font-variant: small-caps;
    color: #5d4037;
    margin-bottom: 10px;
    margin-top: 5px;
}

.sep-ligne {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(62, 43, 29, 0.4), rgba(0, 0, 0, 0));
    margin: 15px 0;
}

.saints-liste-petite {
    font-size: 0.72em;
    color: #6d544a;
    list-style-type: none;
    padding-left: 0;
    line-height: 1.3;
    column-count: 2;      /* Texte des saints sur 2 colonnes */
    column-gap: 20px;
}

.saints-liste-petite li {
    margin-bottom: 2px;
    padding-left: 5px;
    border-left: 1px solid #dccfb8;
}

/* =========================================
   7. NOUVELLES RÉGIONALES
   ========================================= */
.regional-news {
    background-color: #fcf8f0;
    border-left: 4px solid #c5b398;
}

.news-montreal {
    background-color: #f0f4f7;
    border-left: 4px solid #2c3e50;
}

.card p {
    margin-bottom: 12px;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Permet à une carte d'occuper toute la largeur de la grille */
.full-width {
    grid-column: span 2;
}

/* Sécurité pour iPad Portrait : sur une seule colonne, le span n'est plus nécessaire */
@media (max-width: 768px) {
    .full-width {
        grid-column: span 1;
    }
}

/* =========================================
   8. PANORAMA DÉFILANT
   ========================================= */
.panorama-window {
    width: 100%;
    height: 400px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
    background-color: #3e2b1d;
}

.panorama-image {
    height: 100%;
    width: auto;
    max-width: none;
    display: inline-block;
}

/* =========================================
   9. ADAPTATION IPAD (PORTRAIT)
   ========================================= */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    .anniversaire-section {
        grid-template-columns: 1fr; /* 1 seule colonne de persos en mode portrait */
    }
    .panorama-window {
        height: 250px;
    }
    .calendar td {
        padding: 10px;
        font-size: 1.1em;
    }
}