/* --- Configuration globale --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f4f4;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-weight: 700;
    font-size: 2.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s, transform 0.2s;
}


/* --- Grille de la Galerie (Responsive) --- */
.gallery-grid {
    display: grid;
    /* Par défaut sur mobile : 1 seule colonne */
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1200px; /* Largeur max pour ne pas trop étirer sur grands écrans */
    margin: 0 auto;
    padding-bottom: 50px;
}

/* Sur tablettes et ordinateurs (écrans > 768px) : 3 colonnes */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* --- Carte de visite --- */
.tour-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Important pour l'alignement */
}

.tour-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}


/* --- Zone Image (Haut) --- */
.tour-thumb-link {
    display: block;
    height: 200px; /* Hauteur fixe pour l'image */
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.tour-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover; /* L'image remplit la zone sans être déformée */
    transition: transform 0.5s ease;
}

.tour-card:hover .tour-thumb {
    transform: scale(1.08); /* Zoom léger au survol */
}

/* Placeholder si pas d'image */
.no-thumb {
    height: 100%;
    background: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Badge Cadenas (Overlay) */
.lock-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(231, 76, 60, 0.95); /* Rouge semi-transparent */
    color: white;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75em;
    font-weight: 700;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
}

.lock-overlay span {
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* --- Zone Contenu (Bas) --- */
.tour-info {
    padding: 25px;
    flex-grow: 1; /* Occupe tout l'espace restant */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligne le texte à gauche */
}

/* La Date */
.tour-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Le Titre */
.tour-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: block;
    color: #2c3e50;
    line-height: 1.3;
}

.tour-title:hover {
    color: #007bff;
}

/* Métadonnées (Vues et Statut) */
.tour-meta {
    width: 100%;
    margin-bottom: 25px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #777;
    font-size: 0.9em;
}

.views-count {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #555;
}

.status-locked { color: #e74c3c; font-weight: 700; }
.status-unlocked { color: #27ae60; font-weight: 700; }


/* --- Le Bouton Centré --- */
.tour-button {
    /* Permet de le centrer avec les marges auto */
    display: inline-block;
    /* Centre horizontalement */
    margin: auto auto 0 auto;
    
    /* Style du bouton */
    padding: 12px 30px;
    background-color: #007bff; /* Bleu principal */
    color: white !important;
    text-align: center;
    border-radius: 50px; /* Bords très arrondis */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

.tour-button:hover {
    background-color: #0056b3; /* Bleu plus foncé au survol */
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
}

.tour-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}


/* --- Page de connexion (Gardien - view.php) --- */
.login-container {
    max-width: 450px;
    margin: 80px auto;
    background: white;
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    text-align: center;
}

.login-container h2 { margin-top: 0; color: #2c3e50;}

input[type="password"] {
    width: 100%;
    padding: 15px;
    margin: 25px 0;
    box-sizing: border-box;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: #fafafa;
}

input[type="password"]:focus {
    border-color: #007bff;
    background: white;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover { background: #0056b3; }

.error-msg {
    color: #e74c3c;
    background: #fdecec;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid #fadbd8;
}

.back-link {
    display: block;
    margin-top: 25px;
    color: #999;
    font-size: 0.9rem;
    text-decoration: none;
}
.back-link:hover { color: #007bff; text-decoration: underline;}