/* =====================================================
   Terrawatt – Slider Progetti  |  slider.css  v2.0
   ===================================================== */

@font-face {
    font-family: 'Google Sans Flex';
    src: url('/wp-content/uploads/et-fonts/GoogleSansFlex-Light.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --tw-carbone: #1a1713;
    --tw-arancio: #ee7400;
    --tw-bianco:  #ffffff;
    --tw-latte:   #faf8f5;
    --tw-gsf:     'Google Sans Flex', sans-serif;
}

.tw-slider-section { width: 100%; display: flex; flex-direction: column; font-family: inherit; }

/* Barra progressiva */
.tw-progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.tw-slider-section .tw-prog-num   { font-family: var(--tw-gsf); font-size: clamp(11px, 1.2vw, 14px); font-weight: 500; color: var(--tw-carbone); min-width: 24px; flex-shrink: 0; }
.tw-slider-section .tw-prog-total { font-family: var(--tw-gsf); font-size: clamp(11px, 1.2vw, 14px); color: #b5afa8; min-width: 24px; text-align: right; flex-shrink: 0; }
.tw-prog-track { flex: 1; height: 1.5px; background: #e8e2db; border-radius: 2px; overflow: hidden; }
.tw-prog-fill  { height: 100%; background: var(--tw-arancio); border-radius: 2px; transition: width 0.35s ease; }

/* Slider wrap */
.tw-slider-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 12px;
    margin-top: -12px;
    padding-bottom: 4px;
}

/* Fade destra — strettissima, solo bordo */
.tw-slider-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 20px;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(to left,
        #ffffff 0%,
        #ffffff 25%,
        rgba(255,255,255,0) 100%
    );
}

.tw-slider-track {
    display: flex;
    gap: 14px;
    will-change: transform;
}

/* Card — più alte */
.tw-card {
    width: 320px;
    height: 400px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    transition: transform 0.25s;
    background: var(--tw-carbone);
}
.tw-card:hover { transform: translateY(-4px); }

.tw-card-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    filter: blur(3px); transform: scale(1.08); z-index: 0;
}
.tw-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(26,23,19,0.45) 0%, rgba(26,23,19,0.60) 50%, rgba(26,23,19,0.88) 100%);
    z-index: 1;
}
.tw-card-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column;
    height: 100%; padding: 18px 18px 16px; box-sizing: border-box;
}

/* Badge */
.tw-card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: auto; }
.tw-slider-section .tw-badge {
    font-family: var(--tw-gsf) !important;
    display: inline-block; padding: 4px 11px; border-radius: 100px;
    font-size: clamp(11px, 1.1vw, 14px) !important;
    font-weight: 500; line-height: 1.5;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tw-badge-solar          { background: rgba(238,116,0,0.2);    color: #f9c07a !important; border: 0.5px solid rgba(238,116,0,0.45); }
.tw-badge-bess           { background: rgba(255,255,255,0.12); color: #fff    !important; border: 0.5px solid rgba(255,255,255,0.28); }
.tw-badge-ibrido         { background: rgba(255,255,255,0.12); color: #fff    !important; border: 0.5px solid rgba(255,255,255,0.28); }
.tw-badge-rtr            { background: rgba(255,255,255,0.12); color: #fff    !important; border: 0.5px solid rgba(255,255,255,0.28); }
.tw-badge-autorizzato    { background: rgba(238,116,0,0.2);    color: #f9c07a !important; border: 0.5px solid rgba(238,116,0,0.45); }
.tw-badge-in-costruzione { background: rgba(255,255,255,0.12); color: #fff    !important; border: 0.5px solid rgba(255,255,255,0.28); }
.tw-badge-sviluppo       { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6) !important; border: 0.5px solid rgba(255,255,255,0.18); }

.tw-card-bottom { margin-top: 12px; }

/* Titolo */
.tw-slider-section .tw-card .tw-card-content .tw-card-title,
.tw-slider-section .tw-card .tw-card-content h3.tw-card-title {
    color: #ffffff !important;
    font-size: clamp(24px, 2.2vw, 30px) !important;
    font-weight: 400 !important;
    margin: 0 !important; padding: 0 !important;
    line-height: 1.15 !important;
}

/* Regione */
.tw-slider-section .tw-card .tw-card-content .tw-card-region,
.tw-slider-section .tw-card .tw-card-content h4.tw-card-region {
    font-family: var(--tw-gsf) !important;
    font-size: clamp(16px, 1.5vw, 18px) !important;
    font-weight: 300 !important;
    color: #faf8f5 !important;
    opacity: 1 !important;
    margin: 0 0 20px !important; padding: 0 !important;
    line-height: 1.25 !important; border: none !important;
}

/* Meta */
.tw-card-meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.tw-meta-item { display: flex; justify-content: space-between; align-items: center; }
.tw-slider-section .tw-card .tw-card-content .tw-meta-label {
    font-family: var(--tw-gsf) !important;
    font-size: clamp(11px, 1.1vw, 14px) !important;
    font-weight: 300 !important; color: #faf8f5 !important; opacity: 1 !important;
}
.tw-slider-section .tw-card .tw-card-content .tw-meta-value {
    font-family: var(--tw-gsf) !important;
    font-size: clamp(11px, 1.1vw, 14px) !important;
    font-weight: 500 !important; color: #ffffff !important;
}

/* Footer */
.tw-card-footer { padding-top: 12px; border-top: 0.5px solid rgba(255,255,255,0.12); display: flex; justify-content: flex-end; margin-top: auto; }
.tw-slider-section .tw-card .tw-card-content .tw-scopri,
.tw-slider-section .tw-card .tw-card-content a.tw-scopri {
    font-family: var(--tw-gsf) !important;
    font-size: clamp(12px, 1.1vw, 14px) !important;
    font-weight: 400 !important; color: #ffffff !important;
    text-decoration: none !important;
    display: inline-flex !important; align-items: center !important; gap: 5px !important;
    transition: color 0.2s !important;
}
.tw-slider-section .tw-card .tw-card-content .tw-scopri:hover,
.tw-slider-section .tw-card .tw-card-content a.tw-scopri:hover { color: #faf8f5 !important; }
.tw-scopri svg { flex-shrink: 0; transition: transform 0.2s; }
.tw-scopri:hover svg { transform: translate(1px, -1px); }

/* Frecce — entrambe sempre attive (loop infinito) */
.tw-nav-row { display: flex; align-items: center; gap: 10px; padding-top: 22px; }
.tw-nav-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--tw-latte); border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s, transform 0.15s;
    flex-shrink: 0; padding: 0;
}
.tw-nav-btn:hover { background: #ede7de; transform: scale(1.06); }

/* MOBILE */
@media (max-width: 767px) {
    .tw-slider-wrap::after { display: none; }
    .tw-card { width: 100%; height: auto; min-height: 360px; }
    .tw-slider-section .tw-card .tw-card-content .tw-card-title,
    .tw-slider-section .tw-card .tw-card-content h3.tw-card-title  { font-size: 26px !important; }
    .tw-slider-section .tw-card .tw-card-content .tw-card-region,
    .tw-slider-section .tw-card .tw-card-content h4.tw-card-region { font-size: 16px !important; }
    .tw-slider-section .tw-badge { font-size: 12px !important; }
    .tw-slider-section .tw-card .tw-card-content .tw-meta-label,
    .tw-slider-section .tw-card .tw-card-content .tw-meta-value    { font-size: 13px !important; }
    .tw-slider-section .tw-card .tw-card-content .tw-scopri,
    .tw-slider-section .tw-card .tw-card-content a.tw-scopri       { font-size: 13px !important; }
}
