/**
 * @package     Joomla.Site
 * @subpackage  com_wmafotocatalogo
 *
 * @copyright   Copyright (C) 2026 WMA Web Maker Agency. All rights reserved.
 * @license     GNU General Public License version 2 or later;
 *
 * Tutte le classi usano il prefisso "wmafc-" per evitare
 * collisioni con Bootstrap, Cassiopeia e altri template Joomla.
 */
/* =============================================
   CONTAINER PRINCIPALE
   ============================================= */
.wmafc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
/* =============================================
   INTESTAZIONE PAGINA
   ============================================= */
.wmafc-page-header {
    margin-bottom: 30px;
    text-align: center;
}
.wmafc-page-header h1 {
    font-size: 2.5em;
    color: #333;
}
/* =============================================
   BARRA FILTRI
   ============================================= */
.wmafc-filters {
    margin-bottom: 30px;
}
.wmafc-filters-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 16px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
}
.wmafc-filter-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.wmafc-filter-label {
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    white-space: nowrap;
}
.wmafc-filters-bar select {
    margin-bottom: 0px!important;
}
.wmafc-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease;
    box-shadow: none;
    appearance: auto;
}
.wmafc-select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}
.wmafc-filter-reset {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.wmafc-btwma-reset {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #666;
    font-size: 0.9em;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}
.wmafc-btwma-reset:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
    text-decoration: none;
}
/* =============================================
   GRIGLIA IMMAGINI
   ============================================= */
.wmafc-grid {
    display: grid;
    grid-template-columns: repeat(var(--cards-per-row, 3), 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.wmafc-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}
.wmafc-item:hover {
    transform: translateY(-5px);
}
.wmafc-image-link {
    display: block;
    height: 200px;
    overflow: hidden;
}
.wmafc-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.wmafc-image-link img:hover {
    transform: scale(1.05);
}
.wmafc-item-details {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.wmafc-item-title {
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}
.wmafc-category-label {
    display: inline-block;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-bottom: 10px;
}
.wmafc-btwma-detail {
    display: inline-block;
    background-color: #28a745;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 15px;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}
.wmafc-btwma-detail:hover {
    background-color: #218838;
    color: #fff;
    text-decoration: none;
}
/* =============================================
   DISSOLVENZA CARD (load more)
   ============================================= */
.wmafc-item-fadein {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.wmafc-item-visible {
    opacity: 1;
    transform: translateY(0);
}
/* =============================================
   PULSANTE LOAD MORE
   ============================================= */
.wmafc-loadmore-wrap {
    text-align: center;
    margin: 30px 0;
}
.wmafc-btwma-loadmore {
    padding: 12px 40px;
    font-size: 1rem;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}
.wmafc-btwma-loadmore:hover {
    background-color: #218838;
}
.wmafc-btwma-loading {
    opacity: 0.6;
    cursor: wait;
}
/* =============================================
   NESSUN ELEMENTO
   ============================================= */
.wmafc-no-items {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
}
/* =============================================
   PAGINAZIONE
   ============================================= */
.wmafc-pagination {
    margin-top: 30px;
    text-align: center;
}
/* =============================================
   DETTAGLIO IMMAGINE
   ============================================= */
.wmafc-detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 50px;
}
.wmafc-detail-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 30px auto;
    border-radius: 8px;
}
.wmafc-detail-info p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
}
.wmafc-detail-info strong {
    color: #555;
}
.wmafc-btwma-back {
    display: inline-block;
    background-color: #6c757d;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 20px;
    transition: background-color 0.2s ease;
}
.wmafc-btwma-back:hover {
    background-color: #5a6268;
    color: #fff;
    text-decoration: none;
}
.wmafc-detail-descrizione p {
    text-align: justify;
}
/* =============================================
   LIGHTBOX
   ============================================= */
.wmafc-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}
.wmafc-lightbox.active {
    display: flex;
}
.wmafc-lightbox-img {
    max-width: 90%;
    max-height: 90%;
    display: block;
    margin: auto;
    animation: wmafc-zoomIn 0.3s;
}
.wmafc-lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 10px 0;
    font-size: 1.2em;
    position: absolute;
    bottom: 5%;
    width: 100%;
}
.wmafc-lightbox-close,
.wmafc-lightbox-prev,
.wmafc-lightbox-next {
    cursor: pointer;
    position: absolute;
    color: #bbb;
    font-size: 40px;
    font-weight: bold;
    transition: color 0.3s;
    user-select: none;
    padding: 16px;
    text-decoration: none;
    line-height: 1;
}
.wmafc-lightbox-close {
    top: 15px;
    right: 35px;
}
.wmafc-lightbox-prev {
    top: 50%;
    left: 35px;
    transform: translateY(-50%);
}
.wmafc-lightbox-next {
    top: 50%;
    right: 35px;
    transform: translateY(-50%);
}
.wmafc-lightbox-close:hover,
.wmafc-lightbox-prev:hover,
.wmafc-lightbox-next:hover {
    color: #fff;
}
@keyframes wmafc-zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
/* =============================================
   IMMAGINI CORRELATE
   ============================================= */
.wmafc-correlate {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}
.wmafc-correlate-title {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 20px;
}
.wmafc-correlate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.wmafc-correlate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease;
}
.wmafc-correlate-item:hover {
    transform: translateY(-3px);
    text-decoration: none;
    color: #28a745;
}
.wmafc-correlate-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}
.wmafc-correlate-label {
    font-size: 0.8em;
    text-align: center;
    margin-top: 6px;
    line-height: 1.3;
}
/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .wmafc-filters-bar {
        flex-wrap: wrap;
    }
    .wmafc-filter-item {
        flex: 1 1 calc(50% - 8px);
    }
    .wmafc-filter-reset {
        flex: 1 1 100%;
        align-items: flex-start;
    }
    .wmafc-grid {
        grid-template-columns: 1fr;
    }
    .wmafc-item-title {
        font-size: 1.1em;
    }
    .wmafc-page-header h1 {
        font-size: 2em;
    }
    .wmafc-lightbox-close,
    .wmafc-lightbox-prev,
    .wmafc-lightbox-next {
        font-size: 30px;
        padding: 10px;
    }
    .wmafc-lightbox-close {
        top: 5px;
        right: 15px;
    }
    .wmafc-lightbox-prev {
        left: 15px;
    }
    .wmafc-lightbox-next {
        right: 15px;
    }
}
@media (max-width: 480px) {
    .wmafc-filter-item {
        flex: 1 1 100%;
    }
}