/* assets/css/events-frontend.css v 1.2 */

.tprb-events-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.tprb-events-main { 
    flex: 1; 
    min-width: 300px; 
}

.tprb-events-sidebar {
    width: 300px;
    position: sticky;
    top: 20px;
}

/* Griglia delle Card (Desktop: 2 o 3 colonne a seconda dello spazio, Mobile: 1) */
.tprb-events-list.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* --- BARRA FILTRI --- */
.tprb-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.tprb-filter-btn {
    padding: 8px 15px;
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.tprb-filter-btn.active {
    background: var(--tp-rt-primary-color);
    color: #fff !important;
    border-color: #0073aa;
}

/* --- CALENDARIO SIDEBAR (Grande) --- */
.tprb-calendar-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tprb-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tprb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
}

.tprb-cal-grid .dow {
    font-weight: bold;
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    padding-bottom: 8px;
}

.tprb-cal-day {
    padding: 8px 0;
    font-size: 14px; /* Ridotto per non conflittare con la card */
    color: #444;
}

.tprb-cal-day.has-event {
    background: rgba(var(--tp-rt-primary-color), 0.1);
    color: var(--tp-rt-primary-color);
    font-weight: bold;
    border-radius: 4px;
    border: 1px solid var(--tp-rt-primary-color);
}

.tprb-cal-day.has-event a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tprb-cal-day.today { 
    border-bottom: 2px solid #ffb900; 
}

/* --- CARD ANTEPRIMA (Grid View) --- */
.tprb-event-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.tprb-event-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #eee;
    height: 100%;
}

.tprb-event-card-link:hover .tprb-event-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.tprb-event-poster {
    position: relative;
    overflow: hidden;
    height: 180px;
}

.tprb-event-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tprb-event-card-link:hover .tprb-event-poster img {
    transform: scale(1.1);
}

/* Widget Calendario sulla Card (Thumb) */
.tprb-card-calendar-thumb {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #fff;
    width: 45px;
    height: 50px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

.tprb-thumb-month {
    background: var(--tp-rt-primary-color);
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    text-align: center;
    padding: 2px 0;
    text-transform: uppercase;
}

.tprb-thumb-day {
    font-size: 18px;
    font-weight: 800;
    color: #333;
    text-align: center;
    line-height: 1.4;
}

.tprb-event-info { padding: 15px; }
.tprb-event-category { font-size: 10px; text-transform: uppercase; color: var(--tp-rt-primary-color); font-weight: bold;}
.tprb-event-title { margin: 5px 0; font-size: 1.1rem; line-height: 1.3; }

/* --- VISTA ELENCO (List) --- */
.view-list .tprb-event-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
    margin-bottom: 5px;
    transition: background 0.2s;
}
.view-list .tprb-event-list-item:hover { background: #f9f9f9; }
.tprb-list-date { width: 130px; font-size: 13px; color: #666; }
.tprb-list-title { flex: 1; font-weight: 600; color: #222; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .tprb-events-sidebar {
        position: static;
        width: 100%;
        order: -1;
    }
    .tprb-events-list.view-grid {
        grid-template-columns: 1fr; /* Una card per riga su mobile */
    }
    .view-list .tprb-event-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

.tprb-event-detail-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.tprb-detail-nav { margin-bottom: 20px; }

.tprb-detail-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Colonna Immagine (Max 50%) */
.tprb-detail-poster-column {
    flex: 0 0 45%; /* Larghezza fissa al 45% per lasciare spazio al gap */
    max-width: 50%;
}

.tprb-main-poster {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Colonna Info */
.tprb-detail-info-column {
    flex: 1;
}

.tprb-detail-title {
    text-align: center;
    margin: 10px 0 20px 0;
    font-size: 2.2rem;
    line-height: 1.2;
    color: #111;
}

.tprb-detail-meta-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: 1px solid #f0f0f0;
}

.tprb-detail-meta-box p.tprb-meta-row {
    margin: 0 0 10px 0 !important; /* Margine fisso ridotto tra le righe */
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    line-height: 1.4;
    color: #333;
}

.tprb-detail-meta-box p.tprb-meta-row:last-child { margin-bottom: 0 !important; }

.tprb-detail-meta-box p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
}

/* --- TAGS STYLING --- */
.tprb-detail-tags {
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tprb-tag {
    color: var(--tp-rt-primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- SOCIAL BUTTONS --- */
.tprb-soc-grid {
    display: flex;
    gap: 10px;
}

.tprb-soc-button {
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    font-size: 14px;
}

.tprb-soc-button.facebook { background: #3b5998; }
.tprb-soc-button.instagram { background: #e1306c; }

/* --- RESPONSIVE MOBILE PER DETTAGLIO --- */
@media (max-width: 900px) {
    .tprb-detail-wrapper {
        flex-direction: column;
    }
    
    .tprb-detail-poster-column {
        max-width: 100%;
        width: 100%;
        margin-bottom: 30px;
    }
    
    .tprb-detail-title {
        text-align: center;
        font-size: 1.8rem;
    }
}

.tprb-list-link {margin-left: 15px;}

.tprb-meta-row .dashicons {
    color: var(--tp-rt-primary-color);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.tprb-meta-row strong {
    min-width: 70px; /* Allinea i valori se i testi "Data:", "Orario:" hanno lunghezze diverse */
    color: #111;
}

.tprb-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #444 !important; /* Colore testo neutro */
}

.tprb-icon-back {
    width: 20px;
    height: 20px;
    fill: var(--tp-rt-primary-color); /* Qui usiamo la tua variabile */
    transition: transform 0.3s ease;
}

.tprb-back-btn:hover {
    background: #fff;
    border-color: var(--tp-rt-primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.tprb-back-btn:hover .tprb-icon-back {
    transform: translateX(-4px);
    fill: var(--tp-rt-hover-color); /* Usa il colore pių scuro creato prima */
}

/* --- PROTEZIONE CONTRO GLI STILI DEL TEMA --- */

/* Applichiamo il colore primario a tutti i nostri link interattivi */
.tprb-events-wrapper a.tprb-clickable,
.tprb-events-wrapper a.tprb-clickable span,
.tprb-events-wrapper .tprb-cal-nav {
    color: var(--tp-rt-primary-color) !important;
    text-decoration: none !important;
    box-shadow: none !important; /* Rimuove eventuali sottolineature di Avada */
}

/* Gestione Hover: usiamo la variabile hover che abbiamo iniettato */
.tprb-events-wrapper a.tprb-clickable:hover,
.tprb-events-wrapper a.tprb-clickable:hover span,
.tprb-events-wrapper .tprb-cal-nav:hover {
    color: var(--tp-rt-hover-color) !important;
}

/* Eccezione per i bottoni "Active" (testo bianco su sfondo colore primario) */
.tprb-events-wrapper a.tprb-filter-btn.active,
.tprb-events-wrapper a.tprb-filter-btn.active span {
    background-color: var(--tp-rt-primary-color) !important;
    color: #ffffff !important;
}

/* Correzione specifica per le frecce del calendario */
.tprb-cal-header a {
    font-weight: bold;
    font-size: 1.2rem;
    padding: 5px 10px;
    line-height: 1;
}

.tprb-view-btn {
    padding: 8px !important; /* Padding ridotto per le icone */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Stile dell'icona SVG all'interno del bottone */
.tprb-icon-view {
    width: 20px;
    height: 20px;
    fill: #666; /* Colore di default grigio neutro */
    transition: fill 0.3s ease;
}

/* Hover sul bottone non attivo: scuriamo l'icona */
.tprb-view-btn:not(.active):hover .tprb-icon-view {
    fill: #000;
}

.tprb-view-btn.active {
    background-color: var(--tp-rt-primary-color) !important;
    border-color: var(--tp-rt-primary-color) !important;
}

/* Quando il bottone č attivo, l'icona SVG diventa BIANCA */
.tprb-view-btn.active .tprb-icon-view {
    fill: #ffffff !important;
}