/**
 * Events Widget - Styles
 * 
 * @package BBAdria
 */

/* ======= Events Section ======= */
.events_section {
    position: relative;
    padding: 0;
    margin: var(--section-margin-desktop) 0;
    overflow: visible;
}

.events_section .container {
    overflow: visible;
}

@media (max-width: 991px) {
    .events_section {
        margin: var(--section-margin-tablet) 0;
    }
}

@media (max-width: 767px) {
    .events_section {
        margin: var(--section-margin-mobile) 0;
    }
}

/* Tab Buttons */
.events_tab_buttons_box {
    margin-bottom: 30px;
}

.events_tab_buttons {
    margin: 0;
    padding: 0;
}

.events_tab_buttons li {
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.events_button {
    display: flex;
    align-items: center;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    padding: var(--spacing-sm);
}

.events_tab_buttons li:hover .events_button,
.events_tab_buttons li.active-btn .events_button {
    box-shadow: var(--shadow-hover);
    transform: translateX(5px);
}

.events_button_img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 15px;
}

.events_button_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.events_button_content {
    flex: 1;
}

.events_button_title {
    font-family: var(--font-heading);
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-main);
    margin-bottom: var(--spacing-xs);
    line-height: var(--line-height-tight);
    opacity: 0.5;
    transition: var(--transition-normal);
}

.events_button_time {
    font-family: var(--font-body);
    font-size: var(--font-size-small);
    color: var(--color-grey-medium);
    margin: 0;
    opacity: 0.5;
    transition: var(--transition-normal);
}

.events_tab_buttons li.active-btn .events_button_title,
.events_tab_buttons li.active-btn .events_button_time {
    color: var(--color-cta-primary);
    opacity: 1;
}

/* Button View All */
.events_btn_box {
    text-align: center;
}

/* Tab Content */
.events_tabs_content {
    position: relative;
}

.event-tab {
    display: none;
    animation: fadeIn 0.5s ease;
}

.event-tab.active-tab {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.events_tab_content_box {
    background: var(--color-white);
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.events_img_box {
    position: relative;
    min-height: 0;
}

/* Quando non c'è immagine, la data diventa inline */
.events_img_box:not(:has(.events_img)) {
    display: none;
}

.events_img img {
    width: 100%;
    height: auto;
    display: block;
}

.events_date {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--color-white);
    color: var(--color-cta-primary);
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
    z-index: 10;
}

/* Fallback: se non c'è immagine, mostra data nel content */
.events_img_box:empty + .events_content::before,
.events_tab_content_box > .events_content:first-child::before {
    content: none;
}

.events_date p {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    color: var(--color-cta-primary);
}

.events_date span {
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    margin-top: 5px;
}

/* Data inline (quando non c'è immagine) */
.events_date_inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--color-cta-primary);
    color: var(--color-white);
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.events_date_inline .date-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.events_date_inline .date-month {
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Content */
.events_content {
    padding: 40px;
}

.events_title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.events_sub_title {
    font-size: 18px;
    color: var(--color-cta-secondary);
    font-weight: 600;
    margin-bottom: 20px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.events_text,
.events_text_2 {
    color: var(--color-grey-medium);
    line-height: 1.8;
    margin-bottom: 20px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.events_points {
    margin: 30px 0;
    padding: 0;
}

.events_points li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.events_points .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    color: var(--color-cta-primary);
    font-size: 18px;
}

.events_points p {
    margin: 0;
    color: var(--color-grey-medium);
    font-size: 15px;
}

.events_read_more {
    margin-top: 15px;
}

/* ========== MOBILE CAROUSEL ========== */
.events_mobile {
    padding: 0 0 40px 0;
    overflow: visible;
}

.events-carousel.owl-carousel {
    overflow: visible;
    padding-bottom: 20px;
}

.events-carousel.owl-carousel .owl-stage-outer {
    overflow: visible;
    padding: 10px 0;
    margin: -10px 0;
}

.event-card {
    background: var(--color-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.event-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.event-card-img {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--color-cream, #f5f5f5);
}

.event-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-cta-primary) 0%, var(--color-cta-secondary) 100%);
}

.event-card-date {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--color-white);
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    min-width: 50px;
}

.event-card-date .day {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-cta-primary);
    line-height: 1;
}

.event-card-date .month {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--color-cta-primary);
    margin-top: 2px;
}

.event-card-content {
    padding: 20px;
}

.event-card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.event-card-excerpt {
    font-size: 14px;
    color: var(--color-grey-medium);
    margin: 0;
    line-height: 1.5;
}

/* Owl Carousel dots per eventi */
.events-carousel.owl-carousel .owl-dots {
    margin-top: 50px;
    padding-top: 20px;
    text-align: center;
    position: relative;
}

.events-carousel.owl-carousel .owl-dot {
    display: inline-block;
    margin: 0 5px;
}

.events-carousel.owl-carousel .owl-dot span {
    width: 12px;
    height: 12px;
    background: rgba(32, 149, 174, 0.3);
    display: block;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.events-carousel.owl-carousel .owl-dot.active span {
    background: var(--color-cta-primary);
    transform: scale(1.2);
}

/* Responsive */
@media (max-width: 1199px) {    
    .events_title {
        font-size: 24px;
    }
}

@media (max-width: 575px) {
    .events_date {
        top: 15px;
        left: 15px;
        padding: 10px 15px;
        min-width: 60px;
    }
    
    .events_date p {
        font-size: 22px;
    }
    
    .event-card-img {
        height: 160px;
    }
    
    .event-card-content {
        padding: 15px;
    }
    
    .event-card-title {
        font-size: 16px;
    }
}
