/* ====================================
   CSS MODERNE pour la page d'albums photos
   Compatible avec le style du site principal
   Version corrigée - Organisation fixe des photos
   ==================================== */

/* Variables CSS cohérentes avec le site principal */
:root {
    --primary-color: #3d99f7;
    --secondary-color: #fecc03;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --bg-light: #f8f9fa;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --radius: 20px;
    --small-radius: 10px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --border-color: #d3caca;
    --card-bg: #ecf3ff;
    --hover-transform: translateY(-3px);
    --hover-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Body avec fond moderne */
body {
    font-family: "Script MT Bold", "Comic Sans MS", "Times New Roman", -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px 0;
    position: relative;
}

/* Effet de particules en arrière-plan */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(61, 153, 247, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(254, 204, 3, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(61, 153, 247, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* NOUVEAU: Conteneur de navigation centré */
.navigation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Conteneur principal des albums avec glassmorphism */
.album-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(211, 202, 202, 0.4);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
    
    /* NOUVEAU: Grille CSS fixe - 3 colonnes avec espacement */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px 20px; /* 25px entre lignes, 20px entre colonnes */
    align-items: start;
    justify-items: center;
}

.album-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(61, 153, 247, 0.05),
        transparent
    );
    transform: rotate(45deg);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { transform: translateX(0%) translateY(0%) rotate(45deg); opacity: 1; }
}

/* MODIFIÉ: Conteneur de chaque photo avec hauteur fixe */
div.min {
    position: relative;
    /* SUPPRIMÉ: float: left; margin: 15px; */
    width: 300px;
    /* NOUVEAU: Hauteur fixe pour alignement */
    height: 420px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(236, 243, 255, 0.8) 100%);
    border: 2px solid rgba(61, 153, 247, 0.2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    overflow: hidden;
    cursor: pointer;
    
    /* NOUVEAU: Flexbox pour organisation interne */
    display: flex;
    flex-direction: column;
    justify-self: center;
    margin: 0 auto;
}

div.min:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(236, 243, 255, 0.95) 100%);
}

/* Images des photos avec effets modernes */
div.min img#photo {
    display: block;
    margin-top: 15px;
    width: 215px;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid rgba(128, 128, 128, 0.3);
    border-radius: var(--small-radius);
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    /* NOUVEAU: Hauteur fixe pour l'image */
    height: 150px;
    object-fit: cover;
    flex-shrink: 0;
}

div.min:hover img#photo {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(61, 153, 247, 0.3);
    filter: brightness(1.1) saturate(1.1);
}

/* Styles des paragraphes modernisés */
p {
    font-family: "Script MT Bold", "Comic Sans MS", "Times New Roman", sans-serif;
    color: var(--text-dark);
    text-align: center;
    font-size: 28px;
    margin: 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: fadeIn 1s ease-out;
}

/* MODIFIÉ: Paragraphe de description avec hauteur limitée */
p#description {
    display: block;
    margin: 15px auto;
    text-align: justify;
    color: var(--text-dark);
    font-family: "Verdana", sans-serif;
    font-size: 15px;
    width: 250px;
    word-wrap: break-word;
    background: rgba(255,255,255,0.7);
    padding: 12px;
    border-radius: var(--small-radius);
    border-left: 4px solid var(--primary-color);
    line-height: 1.6;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    
    /* NOUVEAU: Contrôle strict de la hauteur */
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

/* MODIFIÉ: Paragraphe commentaires avec position fixe */
p#commentaire {
    display: block;
    margin: 10px auto;
    color: #8B4513;
    font-family: "Verdana", sans-serif;
    font-size: 15px;
    width: 250px;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, rgba(254, 204, 3, 0.1), rgba(254, 204, 3, 0.05));
    border-radius: var(--small-radius);
    transition: var(--transition);
    
    /* NOUVEAU: Position fixe en bas */
    margin-top: auto;
    flex-shrink: 0;
}

div.min:hover p#commentaire {
    background: linear-gradient(135deg, rgba(254, 204, 3, 0.2), rgba(254, 204, 3, 0.1));
    transform: translateY(-2px);
}

p#commentaire a {
    text-decoration: none;
    color: #8B4513;
    transition: var(--transition);
    font-weight: 500;
}

p#commentaire a:hover {
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(61, 153, 247, 0.3);
}

/* Instructions avec style moderne */
p#instruction {
    font-family: "Verdana", sans-serif;
    font-size: 20px;
    color: #2E8B57;
    background: linear-gradient(135deg, rgba(46, 139, 87, 0.1), rgba(46, 139, 87, 0.05));
    padding: 20px;
    border-radius: var(--radius);
    border-left: 5px solid #2E8B57;
    box-shadow: var(--shadow);
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(10px);
    
    /* NOUVEAU: Prend toute la largeur sur les 3 colonnes */
    grid-column: 1 / -1;
    justify-self: stretch;
}

p#description::-webkit-scrollbar-thumb {
    background: var(--secondary-color); /* doré (#D4AF37) */
    border-radius: 3px;
}


/* MODIFIÉ: Liens d'accueil modernisés et centrés */
p#acceuil {
    font-size: 20px;
    color: #8B4513;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    padding: 15px 25px;
    border-radius: var(--radius);
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: var(--shadow);
    margin: 15px auto;
    transition: var(--transition);
    text-align: center;
    backdrop-filter: blur(10px);
    display: inline-block;
    width: auto;
    
    /* NOUVEAU: Centrage automatique */
    justify-self: center;
}

p#acceuil:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
    border-color: #8B4513;
    background: linear-gradient(135deg, rgba(255,255,255,1), rgba(255,255,255,0.9));
}

p#acceuil a {
    text-decoration: none;
    color: #8B4513;
    font-weight: 600;
    transition: var(--transition);
}

p#acceuil a:hover {
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(61, 153, 247, 0.3);
}

/* Viewer modernisé */
div#Viewer {
    position: fixed;
    left: 50%;
    top: 10%;
    width: 800px;
    height: 600px;
    margin-left: -400px;
    border: none;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 15px;
    padding: 20px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1000;
}

/* Icône Love avec effet */
img#love {
    transition: var(--transition);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

img#love:hover {
    transform: scale(1.2) rotate(10deg);
    filter: drop-shadow(0 4px 8px rgba(254, 204, 3, 0.5));
}

/* NOUVEAU: Style pour clearfix au cas où */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive design amélioré */
@media (max-width: 1200px) {
    body {
        width: 95%;
        margin: 0 auto;
        padding: 10px;
    }
    
    .album-container {
        /* Garde 3 colonnes mais réduit l'espacement */
        grid-template-columns: repeat(3, 1fr);
        gap: 20px 15px;
    }
    
    div.min {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 950px) {
    .album-container {
        /* Passe à 2 colonnes */
        grid-template-columns: repeat(2, 1fr);
        gap: 25px 20px;
    }
    
    div.min {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 900px) {
    div#Viewer {
        width: 90%;
        margin-left: -45%;
        height: 80vh;
    }
    
    .navigation-container {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .album-container {
        /* Une seule colonne sur mobile */
        grid-template-columns: 1fr;
        padding: 20px 15px;
        gap: 20px;
    }
    
    div.min {
        width: 100%;
        max-width: none;
        height: 380px;
    }
    
    div.min img#photo {
        width: 180px;
        height: 120px;
    }
    
    p#description {
        width: 220px;
        max-height: 100px;
        -webkit-line-clamp: 4;
    }
    
    p#commentaire {
        width: 220px;
    }
    
    p {
        font-size: 24px;
    }
    
    p#instruction {
        font-size: 18px;
        padding: 15px;
    }
}

/* Mode sombre (bonus) */
/*@media (prefers-color-scheme: dark) {*/
    :root {
        --text-dark: #ecf0f1;
        --card-bg: rgba(52, 73, 94, 0.8);
    }
    
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    div.min {
        background: linear-gradient(135deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
        border-color: rgba(61, 153, 247, 0.3);
    }
    
    p#description {
        background: rgba(52, 73, 94, 0.8);
        color: var(--text-dark);
    }
    
    .album-container {
        background: rgba(52, 73, 94, 0.95);
    }
/*}*/