/* ============================================================
   STILECANZONE.CSS - CSS unificato per le pagine canzone
   Versione: 2.1
   Basato su stileletteraartista.css (header di Ultimo) + canzone20261.css
   Aggiunto: Autoscroll floating panel (destra, allineato al contenuto)
   Aggiunto: Cookie Consent unificato (banner + pannello preferenze)
   ============================================================ */

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ---- TOKEN ---- */
:root {
    --primary:    #1a3d5c;
    --primary2:   #112d44;
    --amber:      #f5a623;
    --amber2:     #e09310;
    --amber-tint: #fff3d6;
    --primary-tint: #eaf2f8;
    --sage:       #2d7d5e;
    --bordeaux:   #7a1f2b;
    --bg:         #fafaf7;
    --surface:    #ffffff;
    --text:       #222222;
    --muted:      #4a5568;
    --border:     #e2e2dc;
    --radius:     10px;
    --shadow:     0 2px 12px rgba(0,0,0,.08);
}

html, body { 
    width: 100%; 
    overflow-x: hidden; 
    transform: none !important; /* Difesa transform su antenati */
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ============================================================
   HEADER — Struttura a 3 colonne (come in Ultimo)
   ============================================================ */
header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 900;
    background: #ffffff;
    padding: 0 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.10);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo center right";
    align-items: center;
    column-gap: 20px;
    height: 150px;
}

.site-brand {
    grid-area: logo;
    display: flex;
    align-items: center;
    justify-self: start;
}

.site-logo {
    height: 150px;
    width: auto;
    display: block;
}

/* ---- Colonna centrale: pulsanti canzone ---- */
.header-center {
    grid-area: center;
    justify-self: center;
    display: flex;
    align-items: center;
}

.song-header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.song-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s, color .2s, border-color .2s, transform .15s;
}

.song-action-btn:first-child {
    background: #d93025;
    border: 2px solid #d93025;
    color: #fff;
    min-width: 115px;
}

.song-action-btn:first-child:hover {
    background: #b71c1c;
    border-color: #b71c1c;
    transform: translateY(-1px);
}

.song-action-btn:nth-child(2) {
    min-width: 170px;
    font-size: 18px;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
}

.song-action-btn:last-child {
    background: var(--amber-tint);
    color: var(--primary);
    border: 2px solid var(--amber);
    min-width: 115px;
}

.song-action-btn:last-child:hover {
    background: var(--amber);
    color: #222;
    transform: translateY(-1px);
}

.song-action-primary {
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
}

.song-action-primary:hover {
    background: var(--primary2);
    border-color: var(--primary2);
}

.song-action-secondary {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.song-action-secondary:hover {
    background: var(--primary);
    color: #fff;
}

/* ---- Colonna destra: menu principale + hamburger ---- */
.header-right {
    grid-area: right;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 14px;
}

nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

nav a {
    color: var(--primary);
    text-decoration: none;
    padding: 8px 13px;
    border: 1.5px solid var(--primary);
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

nav a:hover,
nav a:focus-visible {
    background: var(--primary);
    color: #fff;
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

nav a.active {
    background: var(--primary);
    color: #fff;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    position: relative;
    z-index: 2;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hamburger:hover,
.hamburger:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* ============================================================
   MENU MOBILE — come in Ultimo
   ============================================================ */
.mobile-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary);
    z-index: 850;
    padding: 16px 20px 20px;
    box-shadow: 0 14px 30px rgba(0,0,0,.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .25s ease, transform .3s cubic-bezier(.4,0,.2,1), visibility 0s linear .25s;
}

.mobile-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .25s ease, transform .3s cubic-bezier(.4,0,.2,1), visibility 0s linear 0s;
}

.mobile-nav a {
    display: block;
    color: rgba(255,255,255,.92);
    text-decoration: none;
    padding: 13px 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
    font-size: 16px;
    font-weight: 500;
    transition: color .15s, padding-left .15s;
}

.mobile-nav a:last-child {
    border-bottom: none;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
    color: var(--amber);
    padding-left: 4px;
    outline: none;
}

.mobile-nav a.active {
    color: var(--amber);
}

/* ---- "Ricerca artista" nel drawer mobile ---- */
.quickjump-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.mobile-nav .quickjump-wrap {
    width: 100%;
    margin-top: 10px;
}

.quickjump-wrap::after {
    content: '▾';
    position: absolute;
    right: 16px;
    font-size: 11px;
    color: #ffffff;
    pointer-events: none;
}

.artist-quickjump {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    font-family: 'Inter', Arial, sans-serif;
    padding: 11px 36px 11px 16px;
    border: 1.5px solid rgba(255,255,255,.4);
    border-radius: 24px;
    background: rgba(255,255,255,.08);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.artist-quickjump:hover,
.artist-quickjump:focus-visible {
    background: var(--amber);
    color: #1a1a1a;
    border-color: var(--amber);
    outline: none;
}

.artist-quickjump option {
    color: #222;
    background: #fff;
}

.artist-quickjump:hover ~ .quickjump-wrap::after,
.artist-quickjump:focus-visible ~ .quickjump-wrap::after {
    color: #1a1a1a;
}

/* ============================================================
   CONTENITORE PRINCIPALE (da canzone20261.css)
   ============================================================ */
.page-wrap {
    max-width: 1000px;
    margin: 32px auto;
    padding: 0 16px;
}

.main-content-song { 
    width: 100%; 
    min-width: 0; 
}

.song-page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    color: var(--primary);
    border-bottom: 2px solid var(--amber);
    padding-bottom: 10px;
    margin-bottom: 24px;
}

/* ============================================================
   BLOCCO UNICO — toolbar + testo/accordi
   ============================================================ */
.song-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 0 0 28px;
}

/* ---- Toolbar ---- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-control {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', Arial, sans-serif;
    transition: background .15s, transform .1s, outline .15s;
    min-height: 44px;
    min-width: 44px;
}

.btn-control:hover,
.btn-control:focus-visible {
    background: var(--primary2);
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.btn-control:active { transform: translateY(1px); }
.btn-control.active { background: var(--bordeaux); }

.btn-fontsize { min-width: 42px; }

.scroll-speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.scroll-speed-control input[type="range"] {
    width: 100px;
    accent-color: var(--primary);
    cursor: pointer;
    min-height: 44px;
}

/* ---- Testo e accordi ---- */
.song-lyrics {
    background: var(--surface);
    padding: 24px 22px;
    font-family: "Courier New", Courier, monospace;
    font-size: 18px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.chord {
    font-weight: 700;
    color: var(--bordeaux);
}

/* ============================================================
   AUTOSCROLL FLOATING PANEL — in basso, allineato al contenuto
   ============================================================ */
.autoscroll-panel {
    position: fixed;
    bottom: 24px;
    right: 500px;
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 61, 92, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 14px 8px 10px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: opacity 0.25s ease, transform 0.25s ease;
    opacity: 0.85;
}

.autoscroll-panel:hover {
    opacity: 1;
    transform: scale(1.02);
}

.autoscroll-panel .btn-scroll {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 700;
    line-height: 1;
}

.autoscroll-panel .btn-scroll:hover {
    background: var(--amber);
    color: #1a1a1a;
    transform: scale(1.08);
}

.autoscroll-panel .btn-scroll:active {
    transform: scale(0.92);
}

.autoscroll-panel .btn-scroll.active {
    background: var(--amber);
    color: #1a1a1a;
}

.autoscroll-panel .btn-scroll.speed-btn {
    font-size: 16px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
}

.autoscroll-panel .btn-scroll.speed-btn:hover {
    background: rgba(255, 255, 255, 0.20);
    color: #ffffff;
}

.autoscroll-panel .btn-scroll.play-btn {
    width: 48px;
    height: 48px;
    font-size: 22px;
    background: var(--amber);
    color: #1a1a1a;
    box-shadow: 0 2px 12px rgba(245, 166, 35, 0.4);
}

.autoscroll-panel .btn-scroll.play-btn:hover {
    background: var(--amber2);
    transform: scale(1.06);
}

.autoscroll-panel .btn-scroll.play-btn.active {
    background: #d93025;
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(217, 48, 37, 0.4);
}

.autoscroll-panel .btn-scroll.play-btn.active:hover {
    background: #b71c1c;
}

.autoscroll-speed-indicator {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
    font-family: 'Inter', Arial, sans-serif;
    letter-spacing: 0.02em;
}

/* ============================================================
   ALTRE CANZONI DELL'ARTISTA
   ============================================================ */
.more-songs-box {
    background: var(--surface);
    padding: 28px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 0 0 28px;
}

.more-songs-icon {
    font-size: 34px;
    flex-shrink: 0;
    margin-top: 2px;
}

.more-songs-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 8px;
}

.more-songs-content p {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.more-songs-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: background .15s, outline .15s;
}

.more-songs-button:hover,
.more-songs-button:focus-visible {
    background: var(--primary2);
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* ============================================================
   ADSENSE
   ============================================================ */
.inline-adsense-container {
    width: 100%;
    text-align: center;
    margin: 28px auto;
    min-height: 100px;
}

.inline-adsense-container .adsbygoogle {
    display: inline-block !important;
    margin: 0 auto !important;
}

/* ============================================================
   FOOTER (da stileletteraartista.css)
   ============================================================ */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,.75);
    padding: 32px 20px 24px;
    text-align: center;
    margin-top: 16px;
}

.site-footer p { 
    margin-bottom: 10px; 
    font-size: 14px; 
}

.site-footer a {
    color: var(--amber);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.legal-note {
    max-width: 860px;
    margin: 16px auto 0;
    font-size: 12px;
    line-height: 1.7;
    color: rgba(255,255,255,.45);
}

/* ============================================================
   COOKIE CONSENT — banner + pannello preferenze (GDPR/ePrivacy)
   Versione unificata da stiletea.css
   ============================================================ */
.cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,26,33,.45);
    z-index: 10000;
}

.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0,0,0,.12);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.cc-banner.cc-visible { transform: translateY(0); }

.cc-banner-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 28px;
    align-items: center;
}
.cc-banner .cc-title { grid-column: 1; }
.cc-banner .cc-text { grid-column: 1; }
.cc-banner .cc-actions { grid-column: 2; grid-row: 1 / span 2; }

.cc-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 460px;
    max-height: 86vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    padding: 28px 26px;
    z-index: 10002;
}
.cc-panel[hidden], .cc-banner:not(.cc-visible) + .cc-panel[hidden] { display: none; }

.cc-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 19px;
    color: var(--primary);
    margin-bottom: 8px;
}
.cc-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 4px;
}
.cc-text a { color: var(--primary); text-decoration: underline; }

.cc-option {
    border-top: 1px solid var(--border);
    padding: 14px 0;
}
.cc-option:last-of-type { border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.cc-option-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.cc-option-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}
.cc-option-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    margin-top: 6px;
}
.cc-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}
.cc-option input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .6; }

.cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}
.cc-btn {
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
    white-space: nowrap;
}
.cc-btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    padding: 13px 28px;
    box-shadow: 0 4px 14px rgba(26,61,92,.28);
}
.cc-btn-primary:hover {
    background: var(--primary2);
    border-color: var(--primary2);
    box-shadow: 0 6px 18px rgba(26,61,92,.34);
    transform: translateY(-1px);
}
.cc-btn-primary:active { transform: translateY(0); }

.cc-btn-outline {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
}
.cc-btn-outline:hover { background: var(--primary-tint); }

.cc-btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}
.cc-btn-ghost:hover { background: var(--bg); color: var(--text); }

.cc-btn:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 2px;
}

.cc-manage-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--amber);
    text-decoration: underline;
    font: inherit;
    cursor: pointer;
}
.cc-manage-link:hover { color: var(--amber2); }

/* ============================================================
   RESPONSIVE — HEADER (come in Ultimo)
   ============================================================ */
@media (max-width: 1200px) {
    header {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo right"
            "center center";
        height: auto;
        min-height: 90px;
        row-gap: 12px;
        padding: 14px 16px 16px;
    }
    
    .header-center {
        justify-self: stretch;
    }
    
    .song-header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .header-right nav { display: none; }
    .hamburger { display: flex; }
    .site-logo { height: 80px; }
}

/* ============================================================
   RESPONSIVE — AUTOSCROLL PANEL
   ============================================================ */
@media (max-width: 1200px) {
    .autoscroll-panel {
        right: 24px;
    }
}

@media (max-width: 768px) {
    .autoscroll-panel {
        bottom: 16px;
        right: 16px;
        padding: 6px 12px 6px 8px;
        gap: 6px;
    }
    
    .autoscroll-panel .btn-scroll {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    .autoscroll-panel .btn-scroll.play-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
    
    .autoscroll-panel .btn-scroll.speed-btn {
        font-size: 14px;
    }
    
    .autoscroll-speed-indicator {
        font-size: 11px;
        min-width: 22px;
    }
}

@media (max-width: 480px) {
    .autoscroll-panel {
        bottom: 12px;
        right: 12px;
        padding: 4px 10px 4px 6px;
        gap: 4px;
        border-radius: 40px;
    }
    
    .autoscroll-panel .btn-scroll {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .autoscroll-panel .btn-scroll.play-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .autoscroll-speed-indicator {
        font-size: 10px;
        min-width: 18px;
    }
}

/* ============================================================
   RESPONSIVE — RESTO DEL LAYOUT (da stilecanzone.css originale)
   ============================================================ */
@media (max-width: 768px) {
    .song-page-title { font-size: 22px; }
    .song-lyrics { font-size: 15px; padding: 18px 16px; line-height: 1.4; }
    .toolbar { padding: 14px 16px; gap: 12px; }
    .btn-control { font-size: 13px; padding: 9px 14px; min-height: 38px; min-width: 38px; }
    .more-songs-box { flex-direction: column; align-items: center; text-align: center; }
    
    .song-action-btn {
        height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }
    
    .song-action-btn:first-child,
    .song-action-btn:last-child {
        min-width: 90px;
    }
    
    .song-action-btn:nth-child(2) {
        min-width: 135px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .toolbar { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 8px;
    }
    
    .toolbar-group { 
        justify-content: center; 
    }
    
    .song-lyrics { 
        font-size: 13px; 
        padding: 14px 12px; 
    }
    
    .scroll-speed-control input[type="range"] {
        width: 80px;
    }
    
    /* -Tono / +Tono / A- / A+ sempre su un'unica riga */
    .toolbar-group.toolbar-transpose-fontsize {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        width: 100%;
        justify-content: center;
    }
    
    .toolbar-group.toolbar-transpose-fontsize .btn-control {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 4px;
        font-size: 13px;
        white-space: nowrap;
        min-height: 38px;
    }
    
    header {
        padding: 10px 12px 12px;
        row-gap: 8px;
    }
    
    .site-logo { 
        height: 60px; 
    }
    
    .song-action-btn {
        height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }
    
    .song-action-btn:first-child,
    .song-action-btn:last-child {
        min-width: 80px;
    }
    
    .song-action-btn:nth-child(2) {
        min-width: 110px;
        font-size: 14px;
    }
}

/* ============================================================
   RESPONSIVE — COOKIE BANNER
   ============================================================ */
@media (max-width: 720px) {
    .cc-banner-inner {
        grid-template-columns: 1fr;
    }
    .cc-banner .cc-actions {
        grid-column: 1;
        grid-row: auto;
        justify-content: stretch;
    }
    .cc-banner .cc-btn { flex: 1 1 auto; }
    .cc-panel { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner { transition: none; }
}