/**
 * @package     mod_galleria_cat
 * @file        media/css/mod_galleria_cat.css
 * @version     1.5.1
 * @date        2026-09-28
 * @author      [DrSoftware + IA]
 * @copyright   Copyright (C) 2026 DrSoftware. All rights reserved.
 * @license     GNU General Public License v2 or later
 *
 * Stili del modulo. Usa le variabili CSS del template (--verde, --bordo, --g*, ...)
 * con fallback. Caricato una sola volta dal WebAssetManager anche con più istanze.
 *
 * Storico modifiche: mod_changelog.md
 */

.mgcat-wrapper {
    font-family: var(--font-b, 'Segoe UI', sans-serif);
    margin: 1.5rem 0;
}

/* --- Gruppo anno --- */
.mgcat-gruppo {
    margin-bottom: 2rem;
    border: 1px solid var(--bordo, #d8e2d8);
    border-radius: var(--r-md, 6px);
    overflow: hidden;
    box-shadow: var(--sh-sm, 0 2px 8px rgba(0,0,0,0.06));
}

/* --- Header anno --- */
.mgcat-anno-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--verde, #1f4023);
    color: #fff;
    padding: 0.65rem 1.1rem;
}

.mgcat-anno-label {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.mgcat-anno-count {
    font-size: 0.85rem;
    opacity: 0.75;
}

/* --- Lista righe --- */
.mgcat-lista {
    background: #fff;
}

/* --- Singola riga --- */
.mgcat-riga {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 140px 110px 20px;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    text-decoration: none;
    color: var(--g800, #2c2c2c);
    border-bottom: 1px solid var(--bordo, #d8e2d8);
    transition: background var(--tr, 0.15s ease);
}

.mgcat-riga:last-child {
    border-bottom: none;
}

.mgcat-riga:hover {
    background: var(--verde-pale, #e8f0e8);
}

/* --- Colonne --- */
.mgcat-data {
    font-size: 0.88rem;
    color: var(--verde-m, #2e5c33);
    white-space: nowrap;
}

.mgcat-titolo {
    min-width: 0;                /* consente alla colonna 1fr di restringersi */
    overflow-wrap: anywhere;     /* titoli senza spazi vanno a capo */
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--g950, #141414);
}

.mgcat-badge-video {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--verde, #1f4023);
    margin-left: 0.35rem;
    vertical-align: middle;
    opacity: 0.7;
}

/* Icona "link esterno" accanto al titolo (gallerie con album esterno) */
.mgcat-ext-icon {
    display: inline-block;
    margin-left: 0.35rem;
    vertical-align: -1px;
    color: var(--verde-l, #4a8050);
}

.mgcat-luogo {
    overflow-wrap: anywhere;
    font-size: 0.85rem;
    color: var(--g600, #595959);
    text-align: right;
}

.mgcat-categoria {
    font-size: 0.78rem;
    color: var(--verde-l, #4a8050);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: right;
}

.mgcat-arrow {
    font-size: 1.1rem;
    color: var(--verde-l, #4a8050);
    text-align: right;
}

/* --- Righe nascoste oltre la soglia --- */
.mgcat-nascoste[hidden],
.mgcat-btn-mostra[hidden] {
    display: none;
}

/* --- Pulsante mostra tutto --- */
.mgcat-btn-mostra {
    display: block;
    width: 100%;
    padding: 0.65rem 1.1rem;
    background: var(--verde-pale, #e8f0e8);
    border: none;
    border-top: 1px solid var(--bordo, #d8e2d8);
    color: var(--verde-m, #2e5c33);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background var(--tr, 0.15s ease);
}

.mgcat-btn-mostra:hover {
    background: var(--bordo, #d8e2d8);
}

/* --- Messaggio vuoto --- */
.mgcat-empty {
    color: var(--g400, #9a9a9a);
    font-size: 0.9rem;
    padding: 1rem 0;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .mgcat-riga {
        grid-template-columns: 90px minmax(0, 1fr) 20px;
    }
    .mgcat-luogo,
    .mgcat-categoria {
        display: none;
    }
}
