/* Core layout */
body {
    font-family: 'Montserrat', Arial, sans-serif;
    background: #f4f6fb;
    margin: 0;
    color: #222;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed; /* Reste fixe lors du défilement */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Placez-le DERRIÈRE le contenu (main, header, footer) */
    
    background-image: url('../images/pacman_background.png');
    background-size: cover;
    background-repeat: no-repeat;
    
    /* APPLIQUEZ L'OPACITÉ ICI UNIQUEMENT */
    opacity: 0.3;
}
/* -------------------------------------------------*/

/* Use border-box everywhere to avoid width + padding overflow */
*, *::before, *::after { box-sizing: border-box; }

/* Header */
header {
    background: linear-gradient(90deg, #2c3e50 0%, #347d99 100%);
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

header nav {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

header h1 {
    color: #fff;
    font-size: 2rem;
    margin: 0;
}

/* Center the header title on desktop, keep normal flow on small screens */
/* header title: keep it in the normal flow and centered */
header h1 {
    position: static;
    width: 100%;
    text-align: center;
    color: #fff;
    font-size: 2rem;
    margin: 0;
    pointer-events: auto;
}
/* reserve space on the right so the absolute nav doesn't overlap the centered title */
/* removed padding-right to avoid horizontal overflow when header nav is absent */

/* header nav links were moved to the footer; header ul is kept for legacy but won't be absolutely positioned */

@media (max-width: 700px) {
    header nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 12px 16px;
    }
    header h1 {
        position: static;
        transform: none;
        width: auto;
        pointer-events: auto;
        font-size: 1.4rem;
        text-align: center;
    }
    header h1 { padding-right: 0; }
    header ul { position: static; order: 2; transform: none; display: none; }
}

header ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

header ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

header ul li a:hover {
    color: #6ed6ff;
}

/* Main content */
main {
    max-width: 700px;
    margin: 40px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: none;
    padding: 0px 0px;
    flex: 1;
    position: relative; /* Crée un nouveau contexte d'empilement */
    z-index: 1;
}

/* Professional container with soft background color */
.professional-container {
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 10px;
    background: rgba(52, 125, 153, 0.1);
}

/* Hobby container with same soft background */
.hobby-container {
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 0px;
    background: rgba(52, 125, 153, 0.1);
}

.profile {
    background: linear-gradient(135deg, rgba(44,62,80,0.6), rgba(52,125,153,0.6)), url('../images/fond.png');
    background-size: cover;
    background-position: center;
    padding: 30px 40px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 16px;
    text-align: center;
}

/* Alternative profile (hobby) - replace image by adding img/photo.png */
.hobby-section {
    background: linear-gradient(135deg, rgba(44,62,80,0.6), rgba(52,125,153,0.6)), url('../images/LeverdesoleilBrezouard138.JPG');
    background-size: cover;
    background-position: center;
    padding: 30px 40px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 16px;
    text-align: center;
}

@media (max-width: 500px) {
    /* Appliquer ces styles lorsque l'écran est plus petit que 500px (la taille d'un mobile typique) */
    
    .profile, .hobby-section {
        /* Annule le comportement de "pousser aux extrémités" et utilise l'espacement par défaut */
        justify-content: flex-start; 
        
        /* Réduit encore le padding horizontal pour gagner de l'espace */
        padding: 20px; 
        
        /* Assurez-vous qu'il n'y a pas de hauteur fixe restrictive sur mobile */
        height: auto;
        min-height: auto; 
    }
    
    /* Ajoute une marge en bas du paragraphe pour éviter le contact direct avec les boutons */
    .profile p, .hobby-section p {
        margin-bottom: 20px; 
    }
}

.profile h2, .profile h3, .profile p,
.hobby-section h2, .hobby-section h3, .hobby-section p {
    color: #fff;
}

.profile h2, .hobby-section h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.profile h3, .hobby-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 10px 0 15px 0;
}

.profile h4, .hobby-section h4 {
    color: transparent;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 10px 0 15px 0;
}

.profile-img {
    display: none;
}

.download-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0 40px 0;
}


.download-btn {
    background: #2c3e50;
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background 0.2s, transform 0.2s;
}

.download-btn:hover {
    background: #6ed6ff;
    color: #2c3e50;
    transform: translateY(-2px) scale(1.05);
}

/* Footer */
footer {
    background: linear-gradient(90deg, #2c3e50 0%, #347d99 100%);
    color: #fff;
    text-align: center;
    padding: 18px 0;
    margin-top: 40px;
    font-size: 1rem;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

/* Footer links (moved from header) */
.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 12px;
}
.footer-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.footer-links a:hover { color: #6ed6ff; }

/* Modal styles for suggestion form */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal[aria-hidden="false"] {
    display: flex;
}
.modal-content {
    background: #fff;
    padding: 20px 22px;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
}
.modal-close {
    position: absolute;
    right: 12px;
    top: 10px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.modal .muted {
    color: #666;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Form fields */
#s-message {
    min-height: 100px;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    resize: vertical;
}
#s-name, #s-email {
    width: 100%;
    padding: 8px;
    margin-top: 6px;
    border-radius: 8px;
    border: 1px solid #ddd;
}
#suggestion-form label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}

/* Utility */
.muted { color: #666; font-size: 0.9rem; }




/* =========================================
   SECTION PORTFOLIO MASONRY
   ========================================= */

/* Le conteneur principal */
.photo-grid {
    /* Utilise le système de colonnes (comme dans un journal) */
    column-count: 3; 
    column-gap: 15px; /* Espace entre les colonnes */
    padding: 20px;
}

/* Le bloc contenant l'image */
.photo-grid a {
    display: block; /* Important pour que le lien englobe l'image */
    margin-bottom: 15px; /* Espace sous chaque image */
    break-inside: avoid; /* Empêche une image d'être coupée entre deux colonnes */
    
    /* Style visuel */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden; /* Pour l'arrondi des coins */
}

/* L'image elle-même */
.photo-grid a img {
    width: 100%; /* L'image prend toute la largeur de la colonne */
    height: auto; /* L'image garde sa hauteur naturelle (pas de rognage !) */
    display: block; /* Supprime un petit espace blanc fantôme sous l'image */
    transition: transform 0.3s ease;
}

/* Effet au survol */
.photo-grid a:hover img {
    transform: scale(1.05);
    cursor: zoom-in;
}

/* --- VERSION MOBILE --- */
@media (max-width: 800px) {
    .photo-grid {
        column-count: 2; /* 2 colonnes sur tablette */
    }
}

@media (max-width: 500px) {
    .photo-grid {
        column-count: 1; /* 1 colonne sur mobile */
    }
}

/* =========================================
   MEDIA QUERIES (Responsif)
   ========================================= */

@media (max-width: 768px) {
    /* Diminue la taille du titre sur mobile */
    header h1 {
        font-size: 1.5rem;
    }

    /* CORRECTION ICI : Réduit le padding du main pour éviter le débordement */
    main {
        /* On garde le padding vertical, mais on réduit le padding horizontal */
        padding: 40px 15px; 
    }
}
