/* =============================================================
   cms-blocks-public.css
   Task #46 - Stili dei blocchi CMS renderizzati sulla pagina
   pubblica (dentro un wrapper .cms-body).

   Da accoppiare a cms-lightbox.js per il funzionamento del
   modal di ingrandimento sulle gallerie.
   ============================================================= */

/* ── Nascondi tools editor sulla pagina pubblica ─────── */
.cms-body .cms-split-actions,
.cms-body .cms-split-col-empty-hint,
.cms-body .cms-callout-variants,
.cms-body .cms-col-remove,
.cms-body .cms-cols-actions,
.cms-body .cms-cta-toolbar,
.cms-body .cms-img-remove,
.cms-body .cms-gallery-add,
.cms-body .cms-block-remove { display: none; }

/* ── Sezione 2 colonne indipendenti ────────────────── */
.cms-body .cms-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
    margin: 2.5rem 0;
}
.cms-body .cms-split-col > :first-child { margin-top: 0; }
.cms-body .cms-split-col > :last-child  { margin-bottom: 0; }
.cms-body .cms-split-col img {
    width: 100%; height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    margin: 0 0 1.25rem 0;
    display: block;
}
.cms-body .cms-split-col img:last-child { margin-bottom: 0; }
@media (max-width: 768px) {
    .cms-body .cms-split {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 1.75rem 0;
    }
}

/* ── Box Evidenziato (callout) ────────────────────── */
.cms-body .cms-callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: start;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 5px solid;
}
.cms-body .cms-callout-icon {
    font-size: 2.25rem;
    line-height: 1;
    padding-top: .25rem;
}
.cms-body .cms-callout-content > :first-child { margin-top: 0; }
.cms-body .cms-callout-content > :last-child { margin-bottom: 0; }

.cms-body .cms-callout-info {
    border-left-color: #0d6efd;
    background-color: #cfe2ff66;
}
.cms-body .cms-callout-info .cms-callout-icon { color: #0d6efd; }
.cms-body .cms-callout-success {
    border-left-color: #198754;
    background-color: #d1e7dd66;
}
.cms-body .cms-callout-success .cms-callout-icon { color: #198754; }
.cms-body .cms-callout-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd99;
}
.cms-body .cms-callout-warning .cms-callout-icon { color: #fd7e14; }
.cms-body .cms-callout-danger {
    border-left-color: #dc3545;
    background-color: #f8d7da66;
}
.cms-body .cms-callout-danger .cms-callout-icon { color: #dc3545; }

@media (max-width: 576px) {
    .cms-body .cms-callout {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.25rem;
    }
    .cms-body .cms-callout-icon { padding-top: 0; }
}

/* ── Colonne icona+testo ─────────────────────────── */
.cms-body .cms-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}
.cms-body .cms-cols-cell {
    text-align: center;
    padding: 1.5rem 1rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
}
.cms-body .cms-cols-cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
.cms-body .cms-cols-icon {
    font-size: 2.75rem;
    color: #0d6efd;
    margin-bottom: .75rem;
    line-height: 1;
}
.cms-body .cms-cols-cell h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: .5rem 0 .75rem;
    color: #212529;
}
.cms-body .cms-cols-cell p {
    font-size: 1rem;
    color: #495057;
    margin: 0;
    line-height: 1.5;
}

/* ── Bottone CTA ─────────────────────────────────── */
.cms-body .cms-cta {
    text-align: center;
    margin: 2.5rem 0;
}
.cms-body .cms-cta-btn {
    display: inline-block;
    padding: 1rem 2.25rem;
    border-radius: 999px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    transition: transform .15s, box-shadow .15s;
}
.cms-body .cms-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.cms-body .cms-cta-btn i { margin-right: .5rem; }
.cms-body .cms-cta-yellow {
    background: #ffc107; color: #212529;
}
.cms-body .cms-cta-yellow:hover { background: #ffca2c; color: #212529; }
.cms-body .cms-cta-primary {
    background: #0d6efd; color: #fff;
}
.cms-body .cms-cta-primary:hover { background: #0b5ed7; color: #fff; }
.cms-body .cms-cta-outline {
    background: transparent; color: #0d6efd;
    border: 2px solid #0d6efd;
    box-shadow: none;
}
.cms-body .cms-cta-outline:hover {
    background: #0d6efd; color: #fff;
    box-shadow: 0 6px 18px rgba(13,110,253,.25);
}

/* ── Galleria immagini (+ lightbox) ──────────────── */
.cms-body .cms-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2.5rem 0;
}
.cms-body .cms-gallery-item {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
    position: relative;
}
.cms-body .cms-gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.cms-body .cms-gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: opacity .2s;
}
.cms-body .cms-gallery-item:hover img { opacity: .92; }
.cms-body .cms-gallery-item::after {
    content: '\1F50D';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.5);
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.6);
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}
.cms-body .cms-gallery-item:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ── Lightbox (modal Bootstrap 5) ─────────────────── */
#cmsLightbox .modal-dialog {
    max-width: 95vw;
    margin: 1rem auto;
}
#cmsLightbox .modal-content {
    background: transparent;
    border: 0;
}
#cmsLightbox .cms-lb-img {
    max-width: 100%;
    max-height: 88vh;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
#cmsLightbox .cms-lb-close,
#cmsLightbox .cms-lb-prev,
#cmsLightbox .cms-lb-next {
    position: absolute;
    background: rgba(0,0,0,.5);
    color: #fff;
    border: 0;
    width: 48px; height: 48px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
    z-index: 2;
}
#cmsLightbox .cms-lb-close:hover,
#cmsLightbox .cms-lb-prev:hover,
#cmsLightbox .cms-lb-next:hover {
    background: rgba(0,0,0,.85);
}
#cmsLightbox .cms-lb-close { top: 1rem; right: 1rem; }
#cmsLightbox .cms-lb-prev  { top: 50%; left: -10px; transform: translateY(-50%); }
#cmsLightbox .cms-lb-next  { top: 50%; right: -10px; transform: translateY(-50%); }
#cmsLightbox .cms-lb-counter {
    position: absolute;
    bottom: 1rem; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.5);
    color: #fff;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 500;
}
@media (max-width: 576px) {
    #cmsLightbox .cms-lb-prev  { left: 4px; }
    #cmsLightbox .cms-lb-next  { right: 4px; }
}

/* ── Citazione/Testimonianza ─────────────────────── */
.cms-body .cms-quote {
    position: relative;
    margin: 2.5rem auto;
    padding: 1.75rem 2rem 1.5rem 4.5rem;
    max-width: 800px;
    border-left: 4px solid #ffc107;
    background: linear-gradient(to right, #fffaf0, rgba(255,250,240,0));
    border-radius: 4px;
}
.cms-body .cms-quote::before {
    content: '\201C';
    position: absolute;
    top: -.5rem; left: 1rem;
    font-size: 5.5rem;
    color: #ffc107;
    line-height: 1;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    pointer-events: none;
}
.cms-body .cms-quote-text {
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.5;
    color: #2c3e50;
    margin: 0 0 1rem 0 !important;
}
.cms-body .cms-quote-author {
    font-size: .95rem;
    color: #6c757d;
    margin: 0 !important;
    text-align: right;
    font-style: normal;
}
.cms-body .cms-quote-author strong { color: #495057; }

@media (max-width: 576px) {
    .cms-body .cms-quote {
        padding: 1.5rem 1.25rem 1.25rem 3rem;
        margin: 2rem auto;
    }
    .cms-body .cms-quote::before {
        font-size: 4rem;
        left: .5rem;
    }
    .cms-body .cms-quote-text { font-size: 1.15rem; }
}
