/* Front - Conteneur principal */
.main-container {
    max-width: 700px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 10px 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    font-family: inherit;
}

/* Header et navigation */
.page-header {
    position: relative;
    margin-bottom: 1rem; 
}

.header-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-button, .menu-toggle {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.5rem;
    text-decoration: none;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 11px;
    font-family: inherit;
}

.home-button:hover, .menu-toggle:hover {
    background: #f5f5f5;
}

#page-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    z-index: 1000;
    min-width: 200px;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#page-nav.show {
    display: flex;
}

#page-nav a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

#page-nav a:last-child {
    border-bottom: none;
}

#page-nav a:hover {
    background: #f5f5f5;
}

/* Blocs front */
.front-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 11px;
    border: none;
}
/* Réduction du padding si fond bloc = fond conteneur */
.front-block.same-background {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Premier bloc - marge réduite avec le header */
.page-content .front-block:first-child {
    margin-top: 0;
}

.text-block {
    white-space: pre-line;
}

.custom-list {
    padding-left: 2rem;
}

.custom-list li {
    margin-bottom: 0.5rem;
}

.custom-hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin: 1.5rem 0;
}

.small-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

.custom-link {
    color: inherit;
    text-decoration: underline;
}

/* Blocs code html sur mesure */
.html-h1 { margin: 1.1em auto; }
.html-h2 { margin: 14px auto; font-size: 1.4em; line-height: 1.1; }
.html-h3 { margin: 11px auto; font-size: 1.1em;}
.html-div { margin: 11px auto; line-height: 1.4; }
.html-p { margin: 11px auto; line-height: 1.2; }
.html-small { margin: 11px auto; line-height: 1.2; }
.html-ul { margin: 11px 22px; line-height: 1.2; }
.html-ol { margin: 11px 22px; line-height: 1.2; }
.html-hr { margin: 14px auto; }

/* Modal images */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Conteneur principal des fichiers */
.files-container {
    margin: 1rem 0;
}

.files-section {
    margin-bottom: 2rem;
}

.files-section:last-child {
    margin-bottom: 0;
}

/* Grid pour images */
.square-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 1rem 0;
    justify-items: center;
}

.square-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.square-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.square-image:hover {
    transform: scale(1.05);
}

/* Grid pour une seule image - permet l'alignement */
.single-image-grid {
    display: block;
    text-align: inherit;
}

.single-image-grid .square-image-container {
    display: inline-block;
    width: auto;
    max-width: 100%;
    padding-bottom: 0;
    height: auto;
    background: none;
}

.single-image-grid .square-image.single-image {
    position: static;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Grid pour vidéos et audio */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 1rem 0;
}

.media-container {
    background: #000;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.media-player {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    background: #000;
}

.media-player::-webkit-media-controls-panel {
    background: #000;
}

.media-player::-webkit-media-controls-play-button,
.media-player::-webkit-media-controls-volume-slider,
.media-player::-webkit-media-controls-timeline {
    filter: invert(1);
}

.media-filename {
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
    word-break: break-word;
    width: 100%;
}

/* Grid pour documents */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 1rem 0;
}

.document-container {
    background: #000;
    border-radius: 12px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    position: relative;
    min-height: 120px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.document-container:hover {
    transform: translateY(-2px);
    background: #333;
}

.document-icon {
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    background: #333;
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 60px;
}

.document-name {
    color: #fff;
    font-size: 0.7rem;
    line-height: 1.2;
    word-break: break-word;
    width: 100%;
}

.document-download {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.document-download:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 5px 15px;
    }
    
    .front-block {
        padding: 0.8rem;
        margin-bottom: 0.47rem;
        border-radius: 11px;
    }
    
    .square-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .media-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .document-container {
        padding: 15px 10px;
        min-height: 100px;
    }
    
    .document-icon {
        font-size: 1.2rem;
        min-width: 50px;
        padding: 6px 10px;
    }

    .header-buttons {
        flex-direction: row;
    }

    .home-button, .menu-toggle {
        font-size: 1.2rem;
        padding: 6px 10px;
    }

    #page-nav {
        min-width: 180px;
        right: 0;
        left: auto;
    }
}

/* contact */
.contact-form-container {
    max-width: 500px;
    margin: 0 auto;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.contact-form button {
    background: #333;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 16px;
}

.contact-form button:hover {
    background: #555;
}

/* Partage */
.share-section {
    margin: 2rem;
    text-align: center;
}

.share-section button {
    background: #333;
    color: white;
    border: none;
    padding: 7px 11px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.77rem;
}

.share-section button:hover {
    background: #555;
}
    /* Conteneur principal des fichiers */
    .files-container {
        margin: 1rem 0;
        padding: 0 15px; 
    }
    /* Grid pour images */
    .square-image-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
        gap: 12px; 
        margin: 1rem 0;
        justify-items: center;
    }
    @media (max-width: 768px) {
        .square-image-grid {
            grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); 
            gap: 8px;
        }
        .custom-list {
            line-height: 1.3; 
        }
        
        .custom-list li {
            margin-bottom: 0.2rem;
        }
    }
    .custom-list {
        padding-left: 2rem;
        line-height: 1.4;
    }
    
    .custom-list li {
        margin-bottom: 0.3rem; 
        padding-bottom: 0.1rem; 
    }
    /* Bannière Cookies */
    #cookie-banner {
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        font-size: 0.9rem;
    }
    
    #cookie-banner button:hover {
        background: #f5f5f5 !important;
    }
/* Style pour les blocs HTML */
.html-block {
    margin: 1rem 0;
}

.html-block iframe,
.html-block video,
.html-block audio {
    max-width: 100%;
}

.html-block script {
    display: none; /* Masquer les balises script dans l'affichage */
}