/* ==========================================================================
   ELEMENTI ELEMENTAL CUSTOM (App\Elements)
   Stili derivati dal progetto obuv. Palette e caratteri: variabili --el-* qui sotto (da adattare al tema).
   In fondo: compatibilita per i temi senza Bootstrap 5 (griglia, FAQ, video, pulsanti) limitata ai blocchi.
   ========================================================================== */

:root {
    /* palette neutra Sala Truffaut (11/2026, vedi css/themes/lightblue.css) */
    --el-primary: #000;
    --el-primary-dark: #333;
    --el-accent: #e03000;
    --el-light: #f2f2f2;
    --el-text: #232323;
    --el-muted: #66676b;
    --el-border: rgba(35, 35, 35, .12);
    --el-radius: 25px;
    --el-font-text: Inter,'Helvetica Neue',Helvetica,Arial,sans-serif;
    --el-font-title: Inter,'Helvetica Neue',Helvetica,Arial,sans-serif;
}

.el-radius {
    border-radius: var(--el-radius);
    overflow: hidden;
}

.el-section img {
    max-width: 100%;
    height: auto;
}

/* --- Intestazioni comuni --- */
.el-header {
    margin-bottom: 2.5rem;
}

.el-eyebrow {
    color: var(--el-primary);
    font-family: var(--el-font-text);
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    margin-bottom: .75rem;
}

.el-title {
    font-family: var(--el-font-title);
    font-weight: 500;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.15;
    color: var(--el-text);
    margin-bottom: 1.25rem;
}

.el-text {
    color: var(--el-muted);
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 720px;
}

.el-card-title {
    font-family: var(--el-font-text);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--el-text);
    margin-bottom: .5rem;
}

.el-card-text {
    color: var(--el-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* --- BlocchettiBlock --- */
.el-benefit-card {
    background: #fff;
    padding: 2rem 1.6rem;
    height: 100%;
    border-radius: var(--el-radius);
    border-top: 3px solid transparent;
    box-shadow: 0 1px 3px rgba(20, 20, 20, .08);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.el-benefit-card:hover,
.el-benefit-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px -14px rgba(20, 20, 20, .18);
    border-top-color: var(--el-primary);
}

.el-benefit-icon {
    color: var(--el-primary);
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 1rem;
}

/* --- ElementDoveSiamo --- */
.el-venue-map {
    aspect-ratio: 4 / 3;
}

.el-venue-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.el-venue-detail {
    display: flex;
    gap: 1rem;
    padding-block: 1rem;
    border-bottom: 1px solid var(--el-border);
}

.el-venue-detail:last-of-type {
    border-bottom: none;
}

.el-venue-icon {
    flex: 0 0 1.5rem;
    color: var(--el-primary);
    font-size: 1.3rem;
    margin-top: .15rem;
    text-align: center;
}

.el-venue-label {
    display: block;
    font-weight: 700;
    color: var(--el-text);
    margin-bottom: .15rem;
}

.el-venue-text {
    color: var(--el-muted);
    margin-bottom: 0;
}

.el-venue-content {
    margin-top: 1rem;
}

.el-venue-content p:last-child {
    margin-bottom: 0;
}

/* --- ElementFaq --- */
.el-faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.el-faq-item {
    background: #fff;
    border-left: 3px solid transparent;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(20, 20, 20, .08);
}

.el-faq-item.is-open {
    border-left-color: var(--el-primary);
    box-shadow: 0 6px 20px -8px rgba(20, 20, 20, .15);
}

.el-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: none;
    border: none;
    text-align: left;
    padding: 1.3rem 1.6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--el-text);
    cursor: pointer;
}

.el-faq-question:focus-visible {
    outline: 3px solid var(--el-primary);
    outline-offset: -3px;
}

.el-faq-icon {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    position: relative;
}

.el-faq-icon::before,
.el-faq-icon::after {
    content: "";
    position: absolute;
    background: var(--el-primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform .15s ease;
}

.el-faq-icon::before {
    width: 100%;
    height: 2px;
}

.el-faq-icon::after {
    width: 2px;
    height: 100%;
}

.el-faq-question[aria-expanded="true"] .el-faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg) scaleY(0);
}

.el-faq-answer {
    padding: 0 1.6rem 1.5rem;
    color: var(--el-muted);
    line-height: 1.7;
}

/* --- ElementMultiAllegati --- */
.el-downloads {
    background: var(--el-primary);
    padding: 3rem 2.5rem;
}

.el-downloads .el-eyebrow,
.el-downloads .el-title {
    color: #fff;
}

.el-downloads-intro {
    color: rgba(255, 255, 255, .85);
}

.el-download-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    height: 100%;
    text-decoration: none;
    color: #fff;
    transition: background-color .25s ease, transform .25s ease;
}

.el-download-card:hover,
.el-download-card:focus-visible {
    background: rgba(255, 255, 255, .16);
    transform: translateY(-3px);
    color: #fff;
}

.el-download-card:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.el-download-icon {
    font-size: 1.8rem;
    color: var(--el-accent);
}

.el-download-body {
    display: flex;
    flex-direction: column;
}

.el-download-name {
    font-weight: 700;
}

.el-download-meta {
    font-size: .9rem;
    color: rgba(255, 255, 255, .75);
}

.el-download-arrow {
    margin-left: auto;
    opacity: .7;
    transition: transform .25s ease, opacity .25s ease;
}

.el-download-card:hover .el-download-arrow,
.el-download-card:focus-visible .el-download-arrow {
    transform: translateX(4px);
    opacity: 1;
}

.el-download-info {
    font-size: .8rem;
    letter-spacing: .04em;
    margin-top: .2rem;
}

/* un solo allegato: scheda più grande accanto al titolo */
.el-downloads--single .el-download-card {
    padding: 1.75rem 2rem;
}

.el-downloads--single .el-download-icon {
    font-size: 2.4rem;
}

.el-downloads--single .el-download-name {
    font-size: 1.15rem;
}

/* --- BannerBlock (CustomBannerBlockExtension) --- */
.el-banner--bg {
    background: var(--el-light);
}

.el-banner-media img {
    width: 100%;
    display: block;
}

.el-banner-content {
    margin-bottom: 1.5rem;
}

.el-banner-embed {
    margin-bottom: 1.5rem;
}

.el-banner-embed iframe {
    width: 100%;
    border: 0;
    display: block;
}

.el-banner-quote {
    border-left: 3px solid var(--el-accent);
    padding: .25rem 0 .25rem 1.25rem;
    margin: 0 0 1.5rem;
    font-family: var(--el-font-title);
    font-size: 1.2rem;
    color: var(--el-text);
}

.el-banner-file {
    margin-bottom: 1.5rem;
}

/* Comparsa dell'immagine allo scroll (classe el-reveal-ready aggiunta da elements.js: senza JS l'immagine resta visibile) */
.el-reveal-ready .el-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s ease;
}

.el-reveal-ready .el-reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* --- FileBlock (CustomFileBlockExtension) --- */
.el-file-figure {
    margin: 0;
}

.el-file-figure img {
    width: 100%;
    display: block;
}

.el-file-caption {
    color: var(--el-muted);
    font-size: .95rem;
    margin-top: .75rem;
}

.el-file-download {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    background: var(--el-light);
    color: var(--el-primary);
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: 1rem;
}

.el-file-download:hover,
.el-file-download:focus-visible {
    background: var(--el-primary);
    color: #fff;
}

.el-file-meta {
    font-weight: 400;
    opacity: .8;
}

/* --- LatestDocumentsBlock --- */
.el-news-card {
    background: #fff;
    text-decoration: none;
    display: block;
    height: 100%;
    box-shadow: 0 1px 3px rgba(20, 20, 20, .08);
}

.el-news-thumb {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--el-light);
}

.el-news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.el-news-card:hover .el-news-thumb img,
.el-news-card:focus-visible .el-news-thumb img {
    transform: scale(1.06);
}

.el-news-body {
    padding: 1.5rem;
}

.el-news-date {
    display: block;
    color: var(--el-primary);
    font-size: .9rem;
    margin-bottom: .4rem;
}

/* icone SVG dei blocchi: molti temi hanno "svg { display: block; width: auto; height: auto }"
   che le manda a capo e ne cambia la misura */
.el-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    max-width: none;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

.el-readmore {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    margin-top: 1rem;
    color: var(--el-primary);
    font-weight: 700;
    text-decoration: underline;
}

.el-news-card:focus-visible {
    outline: 3px solid var(--el-primary);
    outline-offset: 4px;
}

@media (max-width: 767.98px) {
    .el-downloads {
        padding: 2rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .el-benefit-card,
    .el-download-card,
    .el-download-arrow,
    .el-faq-icon::after,
    .el-news-thumb img,
    .el-reveal-ready .el-reveal {
        transition: none;
    }

    .el-reveal-ready .el-reveal {
        opacity: 1;
        transform: none;
    }
}

/* --- Photo Gallery (griglia a mosaico del tema: .gallery / .gallery__item) --- */
.el-gallery .el-gallery-grid {
    width: 100%;
}

.el-gallery .el-gallery-link {
    display: block;
    overflow: hidden;
}

.el-gallery .el-gallery-link img {
    width: 100%;
    transition: transform .4s ease;
}

.el-gallery .el-gallery-link:hover img,
.el-gallery .el-gallery-link:focus-visible img {
    transform: scale(1.04);
}

.el-gallery-caption {
    color: var(--el-muted);
    font-size: .9rem;
    line-height: 1.5;
    padding-top: .5rem;
}

.el-gallery-caption p {
    margin-bottom: 0;
}

/* --- Carousel (Owl Carousel; frecce e pallini usano gli stili del tema) --- */
.el-carousel-slide {
    position: relative;
}

.el-carousel .el-carousel-img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
}

.el-carousel-video video,
.el-carousel-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.el-carousel-caption {
    padding: 1.5rem 0 .5rem;
    max-width: 760px;
}

.el-carousel-text {
    color: var(--el-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.el-carousel-text p:last-child {
    margin-bottom: 0;
}

@media (min-width: 992px) {
    /* su desktop il testo va sopra l'immagine, in basso a sinistra */
    .el-carousel-slide:has(.el-carousel-img) .el-carousel-caption {
        position: absolute;
        left: 2rem;
        bottom: 2rem;
        max-width: 560px;
        padding: 1.75rem 2rem;
        background: rgba(255, 255, 255, .94);
        border-radius: var(--el-radius);
    }
}

.el-carousel .owl-dots {
    margin-top: 1.5rem;
}

/* ==========================================================================
   COMPATIBILITA' PER I TEMI SENZA BOOTSTRAP 5 (es. siti portati da SS3)
   Le classi usate dai template dei blocchi (row, col-*, g-*, mt/mb, collapse, ratio)
   sono definite SOLO dentro .el-section, per non toccare le classi omonime del tema.
   Con Bootstrap 5 caricato dal tema queste regole coincidono con le sue.
   ========================================================================== */

/* contenitori del kit AGO, se il tema non li definisce */
.el-section.page-section {
    padding: 3rem 0;
}

.el-section .content-width {
    max-width: var(--el-content-width, 1220px);
    margin: 0 auto;
    padding: 0 20px;
}

/* griglia */
.el-section .row {
    --el-gx: 1.5rem;
    --el-gy: 0;
    display: flex;
    flex-wrap: wrap;
    margin: calc(-1 * var(--el-gy)) calc(-.5 * var(--el-gx)) 0;
}

.el-section .row > * {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 0 calc(.5 * var(--el-gx));
    margin-top: var(--el-gy);
}

.el-section .row.g-3 { --el-gx: 1rem; --el-gy: 1rem; }
.el-section .row.g-4 { --el-gx: 1.5rem; --el-gy: 1.5rem; }
.el-section .row.g-5 { --el-gx: 3rem; --el-gy: 3rem; }
.el-section .row.align-items-start { align-items: flex-start; }
.el-section .row.align-items-center { align-items: center; }
.el-section .col-12 { width: 100%; }

@media (min-width: 576px) {
    .el-section .col-sm-6 { width: 50%; }
}

@media (min-width: 768px) {
    .el-section .col-md-4 { width: 33.3333%; }
    .el-section .col-md-6 { width: 50%; }
}

@media (min-width: 992px) {
    .el-section .col-lg-3 { width: 25%; }
    .el-section .col-lg-4 { width: 33.3333%; }
    .el-section .col-lg-5 { width: 41.6667%; }
    .el-section .col-lg-6 { width: 50%; }
    .el-section .col-lg-7 { width: 58.3333%; }
}

/* spaziature e testo */
.el-section .mb-0 { margin-bottom: 0; }
.el-section .mb-5 { margin-bottom: 3rem; }
.el-section .mt-3 { margin-top: 1rem; }
.el-section .mt-4 { margin-top: 1.5rem; }
.el-section .text-center { text-align: center; }

/* FAQ: pannelli chiusi finche' non hanno la classe "show" (gestita da Bootstrap o da elements.js) */
.el-section .collapse:not(.show) {
    display: none;
}

/* video 16:9 */
.el-section .ratio {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.el-section .ratio > * {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* pulsanti del kit AGO, se il tema non li definisce */
.el-section .red-button {
    display: inline-block;
    padding: .7em 1.6em;
    border-radius: 2em;
    background: var(--el-primary);
    color: #fff;
    font-family: var(--el-font-text);
    font-weight: 700;
    text-decoration: none;
    transition: background-color .2s;
}

.el-section .red-button:hover,
.el-section .red-button:focus {
    background: var(--el-primary-dark);
    color: #fff;
}

/* carosello senza Owl Carousel: Slick (se caricato dal tema) o scorrimento orizzontale */
.el-carousel-slider:not(.owl-carousel):not(.slick-initialized) {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.el-carousel-slider:not(.owl-carousel):not(.slick-initialized) > .el-carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.el-carousel .slick-dots {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.el-carousel .slick-dots button {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--el-border);
    font-size: 0;
    cursor: pointer;
}

.el-carousel .slick-dots .slick-active button {
    background: var(--el-primary);
}

/* gallery senza masonry: griglia regolare */
.el-gallery-grid:not([style]) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    width: 100%;
}

.el-gallery-grid .grid-sizer,
.el-gallery-grid .gutter-sizer {
    display: none;
}

.el-gallery-grid .gallery__item {
    width: auto;
    padding: 0;
    margin: 0;
}

/* lightbox integrato (elements.js), usato se il tema non ha iLightBox */
.el-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .9);
}

.el-lightbox img {
    max-width: 92vw;
    max-height: 86vh;
}

.el-lightbox figcaption {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    color: #fff;
    text-align: center;
}

.el-lightbox button {
    position: absolute;
    border: 0;
    background: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 1rem;
}

.el-lightbox .el-lightbox-close { top: 0; right: 0; }
.el-lightbox .el-lightbox-prev { left: 0; top: 50%; transform: translateY(-50%); }
.el-lightbox .el-lightbox-next { right: 0; top: 50%; transform: translateY(-50%); }
