/* ============================================================
   TextCarousel – Stili widget
   ============================================================ */

/* Variabili CSS iniettate inline dal PHP */
.text-carousel {
    --tc-accent:  #F0A500;
    --tc-primary: #1A2E5A;

    background: #F5F6FA;
    border-radius: 16px;
    padding: 40px 48px;
    box-sizing: border-box;
    overflow: hidden;
}

/* ----------------------------------------------------------
   Header: titolo + navigazione
   ---------------------------------------------------------- */
.tc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.tc-section-title {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: var(--tc-primary);
}

/* Navigazione frecce + counter */
.tc-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

button.tc-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--tc-primary);
    background: transparent;
    color: var(--tc-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

button.tc-arrow:hover {
    background: var(--tc-primary);
    color: #fff;
}

button.tc-arrow:hover,
button.tc-arrow:focus,
button.tc-arrow:active {
    box-shadow: none;
}

/* Nasconde le frecce quando show_arrows è OFF */
.tc-no-arrows button.tc-arrow {
    display: none;
}

.tc-counter {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tc-primary);
    min-width: 40px;
    text-align: center;
}

/* ----------------------------------------------------------
   Swiper / Slide
   ---------------------------------------------------------- */
.tc-swiper {
    width: 100%;
    overflow: hidden;
}

/* CSS critico Swiper: garantisce layout orizzontale delle slide */
.tc-swiper .swiper-wrapper {
    display: flex;
    width: 100%;
    box-sizing: content-box;
    transition-property: transform;
}

.tc-swiper .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    position: relative;
}

/* Effetto fade */
.tc-swiper.swiper-fade .swiper-wrapper {
    display: block;
    position: relative;
}

.tc-swiper.swiper-fade .swiper-slide {
    pointer-events: none;
    transition-property: opacity;
    opacity: 0 !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.tc-swiper.swiper-fade .swiper-slide-active {
    pointer-events: auto;
    opacity: 1 !important;
    position: relative;
}

.tc-slide {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 8px 0 24px;
}

/* Badge numero slide */
.tc-number-badge {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tc-primary);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Testo slide */
.tc-slide-content {
    flex: 1;
}

.tc-slide-content p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.tc-slide-content p strong {
    color: var(--tc-primary);
}

/* ----------------------------------------------------------
   Barre di avanzamento
   ---------------------------------------------------------- */
.tc-progress-bars {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.tc-bar {
    flex: 1;
    height: 4px;
    border-radius: 9999px;
    background: var(--tc-primary);
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}

.tc-bar:hover {
    opacity: 0.7;
}

.tc-bar--active {
    background: var(--tc-accent);
    opacity: 1;
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    .text-carousel {
        padding: 28px 24px;
    }

    .tc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .tc-slide {
        flex-direction: column;
        gap: 16px;
    }
}
