:root {
    --header-height: 100px;
    --body-padding: 16px 20px;
    --header-padding: var(--box-padding);
    --header-h1-size: 3.2rem;
    --header-date-size: 1.5rem;
    --geometric-box-h2-size: 2.5rem;
    --slider-item-h3-size: 1.8rem;
    --callcenter-h3-size: 2rem;
    --btn-call-padding: 20px 50px;
    --btn-call-font-size: 1.5rem;
    --number-box-font-size: min(10vw, 5rem);
    --section-title-font-size: min(9vw, 4.0rem);

    --section-gap: 27px;
    --geometric-box-margin: 25px;
    --right-padding: 20px;
    --box-padding: 20px 20px;
    --number-box-offset: 20px;
    --number-box-width: 112px;

    /* Default values before JS calculation */
    --section-height: 300px;
    --banner-height: 350px;
}

@media (max-width: 576px) {
    :root {
        --header-h1-size: 2rem;
    }
}

@media (max-width: 991px) {
    :root {
        --body-padding: 10px 15px;
        --header-padding: 20px 20px;
        --header-date-size: 1.2rem;
        --geometric-box-h2-size: 2rem;
        --slider-item-h3-size: 1.5rem;
        --callcenter-h3-size: 1.6rem;
        --btn-call-padding: 15px 30px;
        --btn-call-font-size: 1.2rem;
        --section-gap: 20px;
        --geometric-box-margin: 15px;
        --right-padding: 15px;
        --box-padding: 15px 15px;
    }
}

a {
    text-decoration: none;
}

@media (min-width: 768px) {
    :root {
        --number-box-width: 72px;
    }

    .section-details .section-content {
        min-height: calc(100vh - var(--header-height) - var(--banner-height) - 4 * var(--section-gap));
    }
}

@media (min-width: 992px) {
    :root {
        --box-padding: 25px 35px;
        --number-box-offset: 30px;
        --number-box-width: 72px;
    }
}

@media (min-width: 1201px) {
    :root {
        --section-gap: 25px;
        --geometric-box-margin: 25px;
        --right-padding: 25px;
    }
}

.container-main {
    max-width: 1400px;
    margin: 0 auto;
}

.section-card:hover {
    transform: translateY(-5px);
}

.section-zero {
    --section-height: 120px;
}

.section-zero .empty-state {
    flex-direction: row;
    gap: 1rem;
}

.section-zero .empty-state-icon {
    width: 100px;
    height: 100px;
}

.section-content {
    display: flex;
    height: var(--section-height);
}

.section-left {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
}

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

.geometric-box {
    position: absolute;
    bottom: var(--geometric-box-margin);
    left: var(--geometric-box-margin);
    background: rgba(255, 255, 255, 0.95);
    padding: var(--box-padding);
    border: 4px solid white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.geometric-box h2 {
    font-size: var(--geometric-box-h2-size);
    font-weight: 700;
    margin: 0;
    color: #2c3e50;
}

.geometric-box .subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    margin-top: 5px;
}

.section-right {
    flex: 1;
    padding: var(--right-padding);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.section-right .slider-item, .section-right .callcenter-content {
    overflow: auto;
    max-height: 100%;
}

/* Custom Scrollbar */
.section-right .slider-item::-webkit-scrollbar, .section-right .callcenter-content::-webkit-scrollbar {
    width: 8px;
}

.section-right .slider-item::-webkit-scrollbar-track, .section-right .callcenter-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.section-right .slider-item::-webkit-scrollbar-thumb, .section-right .callcenter-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.section-right .slider-item::-webkit-scrollbar-thumb:hover, .section-right .callcenter-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

.avvisi-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.urgenze-bg {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.callcenter-bg {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.slider-item {
    color: white;
}

.slider-item h3 {
    font-size: var(--slider-item-h3-size);
    font-weight: 600;
    margin-bottom: 15px;
}

.slider-item p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.9;
}

.btn-detail:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    right: var(--right-padding);
    display: flex;
    gap: 10px;
}

.callcenter-content {
    text-align: center;
}

.callcenter-content h3 {
    color: white;
    font-size: var(--callcenter-h3-size);
    margin-bottom: 20px;
}

.callcenter-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.btn-call:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.banner-fixed img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .section-content {
        flex-direction: column;
        height: auto; /* Allow auto height on mobile */
    }

    .section-left {
        flex: 0 0 300px;
    }

    .banner-section {
        grid-template-columns: 1fr !important;
    }
}

/* Quadrato con numero in alto a destra */
.number-box {
    position: absolute;
    top: var(--number-box-offset);
    right: var(--number-box-offset);
    width: var(--number-box-width);
    height: var(--number-box-width);
    border: 8px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.number-box span {
    font-size: var(--number-box-font-size);
    font-weight: 900;
    color: white;
    line-height: 1;
}

/* Titolo sezione in basso a sinistra */
.section-title {
    position: absolute;
    bottom: var(--number-box-offset);
    left: var(--right-padding);
    font-size: var(--section-title-font-size);

    font-weight: 900;
    color: white;
    letter-spacing: 3px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 3;
    line-height: 1;
}

@media (min-width: 768px) {
    .number-box span {
        font-size: min(4.5vw, 3rem);
    }

    .section-title {
        font-size: min(4vw, 4.5rem);
    }
}

@media (min-width: 992px) {
    .section-title {
        font-size: min(5.3vw, 4.5rem);
    }
}

body {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M50 50c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10zM10 10c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10S0 25.523 0 20s4.477-10 10-10zm10 8c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zm40 40c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: var(--body-padding);
}


.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-image: url('header-bg.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom;
    padding: var(--header-padding);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    text-align: center;
    margin-bottom: var(--section-gap);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%);
    z-index: 1;
}

.header h1 {
    font-size: var(--header-h1-size);
    line-height: 1;
    font-weight: 800;
    color: white;
    margin: 0;
    letter-spacing: -1px;
    text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    margin-bottom: 0px;
}

.header .date {
    font-size: var(--header-date-size);
    color: white;
    font-weight: 600;
    text-align: right;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
}

.section-card {
    border-radius: 0px;
    background: white;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: var(--section-gap);
    transition: transform 0.3s ease;
}

/* Gradienti per le sezioni */
.gradient-avvisi {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-urgenze {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-supporto {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.slider-item .date-badge {
    border-radius: 0px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}


.btn-detail {
    border-radius: 0px;
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}


.slider-dot {
    border-radius: 0px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    border-radius: 0px;
    background: white;
    width: 30px;
}


.btn-call {
    border-radius: 0px;
    background: white;
    color: #4facfe;
    border: none;
    padding: var(--btn-call-padding);
    font-size: var(--btn-call-font-size);
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}


.banner-section {
    grid-template-columns: var(--banner-height) 1fr;
    align-items: center;
    gap: 20px;
    display: grid;
    margin-top: var(--section-gap);
}

.banner-fixed {
    border-radius: 0px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    height: var(--banner-height);
    background: white;
    overflow: hidden;
}


.banner-slider {
    --banner-width: var(--banner-height);
    height: var(--banner-height);
    display: flex;
    align-items: center;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.banner-slider-container {
    transition: transform 0.8s ease;
    display: flex;
}

.banner-slide {
    min-width: var(--banner-width);
    flex-shrink: 0;
    padding-right: 20px;
}

.banner-slide > div {
    background-color: white;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.banner-slide img {
    width: calc(var(--banner-width) - 20px);
    height: var(--banner-height);
    margin: auto;
    border-radius: 0px;
    object-fit: contain;
}

/* Stato vuoto - nessun contenuto */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    text-align: center;
}

.empty-state-icon {
    width: 200px;
    height: 200px;
    margin-bottom: 20px;
    opacity: 0.9;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
}

.empty-state h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.custom-toggler {
    border: none;
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
}

.custom-toggler span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}
