/* /css/style-galleria.css (Versione Professionale e Completa) */

body {
    background-color: #f0f2f5; /* Sfondo grigio chiaro, tipico dei social */
}

/* --- Layout Principale --- */
.gallery-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}
.gallery-sidebar {
    flex: 0 0 280px; /* Larghezza fissa per la sidebar */
    position: sticky;
    top: 20px;
}
.gallery-feed {
    flex-grow: 1;
    max-width: 800px;
}

/* --- Stile per i Filtri --- */
.filter-box {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.filter-box h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #004080;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}
.filter-group { margin-bottom: 15px; }
.filter-group label { font-weight: bold; font-size: 14px; display: block; margin-bottom: 8px; }
.filter-group select, .filter-group input { width: 100%; padding: 8px; border-radius: 5px; border: 1px solid #ccc; box-sizing: border-box; }
.filter-buttons { display: flex; gap: 10px; margin-top: 15px; }
.filter-buttons button, .filter-buttons a { flex: 1; padding: 10px; border-radius: 5px; text-align: center; font-weight: bold; text-decoration: none; border: none; cursor: pointer; }
.filter-buttons button { background-color: #0056b3; color: white; }
.filter-buttons a { background-color: #6c757d; color: white; line-height: 1.5; box-sizing: border-box; }


/* --- Stile del "Post" --- */
.post-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    border: 1px solid #ddd;
    margin-bottom: 30px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}
.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.post-avatar img {
    width: 80%;
    height: auto;
}
.post-info .author { font-weight: bold; color: #050505; }
.post-info .date { font-size: 13px; color: #65676b; }

.post-excerpt {
    padding: 0 16px 12px 16px;
    font-size: 15px;
    color: #333;
    line-height: 1.5;
}
.post-title {
    padding: 0 16px 16px 16px;
    font-size: 18px;
}
.post-title a { color: #0056b3; text-decoration: none; font-weight: bold; }
.post-title a:hover { text-decoration: underline; }

/* --- Griglia Media Quadrata --- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
}
.media-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #eee;
    aspect-ratio: 1 / 1; /* Forza il formato quadrato */
}
.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}
.media-item:hover img {
    transform: scale(1.05);
}
.media-item .more-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); color: white; font-size: 48px;
    font-weight: bold; display: flex; justify-content: center; align-items: center;
}
.media-item .play-icon {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); width: 60px; height: 60px;
    background-color: rgba(0,0,0,0.6); border-radius: 50%; color: white;
    display: flex; justify-content: center; align-items: center; pointer-events: none;
}
.media-item .play-icon svg { width: 32px; height: 32px; }

/* --- NUOVI STILI PER LE STATISTICHE (come index.php) --- */
.card-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* MODIFICA: Stile per stat-item (generico) e per il pulsante */
.card-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6c757d;
    text-decoration: none;
    /* Stili per resettare il <button> */
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}
.card-stats .stat-item:hover {
    color: #0056b3;
}
.card-stats .stat-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Stili specifici per il pulsante "like" */
.card-stats .like-button-gallery:disabled {
    cursor: not-allowed;
    color: #6c757d; /* Mantiene il colore grigio */
    opacity: 0.7;
}
.card-stats .like-button-gallery:disabled:hover {
    color: #6c757d; /* Disattiva l'hover blu */
}
.card-stats .like-button-gallery.liked {
    color: #dc3545; /* Colore rosso quando cliccato */
    font-weight: bold;
}
.card-stats .like-button-gallery.liked svg {
    fill: #dc3545;
    opacity: 1;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .gallery-container {
        flex-direction: column;
    }
    .gallery-sidebar {
        position: static;
        width: 100%;
        flex-basis: auto;
    }
    .gallery-feed {
        max-width: 100%;
    }
}
@media (max-width: 480px) {
    /* Su schermi molto piccoli, la griglia ha una sola colonna */
    .media-grid {
        grid-template-columns: 1fr;
    }
}