/* ══════════════════════════════════════════════
   BAGLIORI ESOTERICO — Slider v5.0
   [bge_slider tema="schede|cards"]
   Stile: bianco/nero, accento oro, Cormorant per i nomi.
══════════════════════════════════════════════ */

.bge-sl {
    --bge-sl-gap: 18px;
    --bge-sl-gold: #C9A84C;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.75rem 0;
    box-sizing: border-box;
}
.bge-sl *, .bge-sl *::before, .bge-sl *::after { box-sizing: border-box; }
.bge-sl p, .bge-sl ul, .bge-sl blockquote { margin: 0; padding: 0; }
.bge-sl a { text-decoration: none !important; box-shadow: none !important; }

/* ── Binario ── */
.bge-sl-track {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: var(--bge-sl-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 2px 14px;
    outline: none;
}
.bge-sl-track::-webkit-scrollbar { display: none; }
.bge-sl-track:focus-visible { outline: 2px solid var(--bge-sl-gold); outline-offset: 4px; }

/* ── Pulsanti ── */
.bge-sl-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 1.5px solid var(--bge-black, #0a0a0a);
    border-radius: 4px;
    background: var(--bge-white, #fff);
    color: var(--bge-black, #0a0a0a);
    font-family: var(--bge-font, 'Cormorant Garamond', Georgia, serif);
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, opacity .2s ease;
    z-index: 3;
}
.bge-sl-btn span { display: block; transform: translateY(-2px); }
@media (hover: hover) {
    .bge-sl-btn:hover:not(:disabled) { background: var(--bge-black, #0a0a0a); color: var(--bge-white, #fff); }
}
.bge-sl-btn:focus-visible { outline: 2px solid var(--bge-sl-gold); outline-offset: 2px; }
.bge-sl-btn:disabled { opacity: .25; cursor: default; }
.bge-sl--static .bge-sl-btn { display: none; }

/* ── Elemento base ── */
.bge-sl-item {
    position: relative;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: var(--bge-white, #fff);
    border: 1px solid var(--bge-gray-200, #e8e8e8);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease;
}
@media (hover: hover) {
    .bge-sl-item:hover { border-color: #b9b9b9; box-shadow: 0 8px 26px rgba(0,0,0,.09); }
}

.bge-sl-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bge-gray-100, #f5f5f5);
    overflow: hidden;
}
.bge-sl-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.bge-sl-item:hover .bge-sl-img { transform: scale(1.035); }
.bge-sl-svg { display: flex; align-items: center; justify-content: center; color: var(--bge-black, #0a0a0a); opacity: .3; }
.bge-sl-svg svg { width: 76px; height: 76px; }

.bge-sl-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-family: var(--bge-font, 'Cormorant Garamond', Georgia, serif);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.6;
    background: var(--bge-black, #0a0a0a);
    color: var(--bge-white, #fff) !important;
    padding: 3px 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.45);
    pointer-events: none;
}

.bge-sl-name {
    font-family: var(--bge-font, 'Cormorant Garamond', Georgia, serif);
    color: var(--bge-black, #0a0a0a);
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bge-sl-name a { color: inherit !important; }
.bge-sl-name a:hover { color: #6b5418 !important; }
.bge-sl-name a:focus-visible { outline: 2px solid var(--bge-sl-gold); outline-offset: 3px; }

/* ══ TEMA SCHEDE (piccole, tipo schedario) ══ */
.bge-sl--schede .bge-sl-item { flex: 0 0 270px; }
.bge-sl-scheda .bge-sl-media { aspect-ratio: 4 / 3; }
.bge-sl-scheda .bge-sl-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 15px;
    border-top: 2px solid var(--bge-sl-gold);
}
.bge-sl-scheda .bge-sl-name { font-size: 19px; letter-spacing: .07em; }
/* tutta la scheda è cliccabile tramite il link del nome */
.bge-sl-scheda .bge-sl-name a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.bge-sl-sott {
    font-family: var(--bge-font, 'Cormorant Garamond', Georgia, serif);
    font-style: italic;
    font-size: 17px;
    line-height: 1.3;
    color: var(--bge-gray-600, #555);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bge-sl-go {
    margin-top: auto;
    padding-top: 6px;
    font-family: var(--bge-font, 'Cormorant Garamond', Georgia, serif);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bge-gray-400, #aaa);
    transition: color .2s ease;
}
.bge-sl-scheda:hover .bge-sl-go { color: var(--bge-black, #0a0a0a); }

/* ══ TEMA CARDS (grandi, con pulsante) ══ */
.bge-sl--cards .bge-sl-item { flex: 0 0 330px; }
.bge-sl-card .bge-sl-media { aspect-ratio: 16 / 9; display: flex; }
.bge-sl-card .bge-sl-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 22px 22px 24px;
    text-align: center;
}
.bge-sl-card .bge-sl-name { font-size: 21px; letter-spacing: .06em; min-height: calc(1.2em * 2); display: -webkit-box; align-content: center; }
.bge-sl-exc {
    font-size: 16px;
    line-height: 1.6;
    color: var(--bge-gray-600, #555);
    min-height: calc(1.6em * 3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bge-sl-chips {
    list-style: none !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.bge-sl-chips li {
    list-style: none !important;
    margin: 0 !important;
    font-size: 14px;
    line-height: 1.4;
    padding: 4px 14px;
    border: 1px solid #cfcfcf;
    border-radius: 999px;
    color: var(--bge-gray-600, #555);
    background: var(--bge-white, #fff);
}
.bge-sl-cta {
    margin-top: auto;
    display: inline-block;
    padding: 12px 30px;
    background: #1a1a1a;
    color: var(--bge-white, #fff) !important;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: background .2s ease;
}
.bge-sl-cta:hover { background: #000; color: var(--bge-sl-gold) !important; }
.bge-sl-cta:focus-visible { outline: 2px solid var(--bge-sl-gold); outline-offset: 3px; }

/* ══ Mobile ══ */
@media (max-width: 782px) {
    .bge-sl--schede .bge-sl-item { flex-basis: 240px; }
    .bge-sl--cards .bge-sl-item  { flex-basis: 300px; }
}
@media (max-width: 640px) {
    .bge-sl { margin: 1.25rem 0; }
    .bge-sl-track { --bge-sl-gap: 14px; padding: 4px 16px 12px; scroll-padding-inline: 16px; }
    .bge-sl--schede .bge-sl-item     { flex-basis: 72%; }
    .bge-sl--cards .bge-sl-item      { flex-basis: 86%; }
    /* pulsanti in riga sotto lo slider: non coprono mai le card */
    .bge-sl { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
    .bge-sl-track { order: -1; flex: 0 0 100%; }
    .bge-sl-btn { width: 42px; height: 42px; flex-basis: 42px; font-size: 24px; }
    .bge-sl-card .bge-sl-body { padding: 18px 16px 20px; gap: 12px; }
    .bge-sl-card .bge-sl-name { font-size: 19px; }
    .bge-sl-scheda .bge-sl-name { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .bge-sl-track { scroll-behavior: auto; }
    .bge-sl-img, .bge-sl-item { transition: none; }
}

/* ══ «Dove opera»: versione compatta (schede piccole, solo immagine, targhetta e nome) ══ */
.bge-dove-opera .bge-sl { margin: .5rem 0 0; }
.bge-dove-opera .bge-sl--cards .bge-sl-item { flex: 0 0 240px; position: relative; }
.bge-dove-opera .bge-sl-card .bge-sl-body { padding: 10px 14px 12px; gap: 6px; }
.bge-dove-opera .bge-sl-card .bge-sl-name {
    font-size: 15px; letter-spacing: .05em; line-height: 1.3; min-height: 0;
    display: block; -webkit-line-clamp: unset; overflow: visible; white-space: normal; text-overflow: clip;
}
.bge-dove-opera .bge-sl-card .bge-sl-name a { display: inline; white-space: normal; overflow: visible; text-overflow: clip; }
.bge-sl-int {
    display: inline-block; max-width: 100%;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(201,168,44,.12); border: 1px solid rgba(201,168,44,.55);
    color: #6b5418; font-size: 11px; font-weight: 600; letter-spacing: .06em; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bge-dove-opera .bge-sl-card .bge-sl-name a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.bge-dove-opera .bge-sl-exc,
.bge-dove-opera .bge-sl-chips { display: none !important; }
.bge-dove-opera .bge-sl-cta {
    margin-top: 2px; padding: 0; background: none !important; color: #8a8478 !important;
    font-size: 12px; font-weight: 600; letter-spacing: .1em;
}
.bge-dove-opera .bge-sl-cta::after { content: ' →'; }
.bge-dove-opera .bge-sl-item:hover .bge-sl-cta { color: var(--bge-black, #0a0a0a) !important; }
.bge-dove-opera .bge-sl-badge { font-size: 10px; padding: 3px 9px; }
.bge-dove-opera .bge-dove-intro { margin-bottom: 4px; }
.bge-dove-opera .bge-dove-tutti { margin-top: 10px; }
@media (max-width: 640px) {
    .bge-dove-opera .bge-sl--cards .bge-sl-item { flex-basis: 62%; }
}
