:root{--navy:#11263b;--blue:#1557ad;--muted:#687789;--bg:#f4f6f9;--border:#dbe2eb}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--navy);font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif}a{text-decoration:none;color:inherit}.top{background:#fff;border-bottom:1px solid var(--border)}.top-inner{max-width:1260px;margin:auto;min-height:83px;padding:12px 24px;display:flex;align-items:center;justify-content:space-between;gap:24px}.brand{display:inline-flex;align-items:center;min-width:140px}.brand img{max-width:235px;max-height:64px;object-fit:contain}.brand-text{font-size:30px;font-weight:900;letter-spacing:-1px;color:#17497d;flex-direction:column;align-items:flex-start;line-height:.93}.brand-text span{font-size:10px;letter-spacing:4px;margin-top:7px}.top-label,.eyebrow{font-weight:750;letter-spacing:2px;font-size:12px;color:var(--blue)}.wrap{max-width:1260px;margin:0 auto;padding:45px 24px}.heading{display:flex;justify-content:space-between;align-items:flex-end;gap:15px;margin-bottom:27px}h1{font-size:clamp(26px,4vw,42px);letter-spacing:-1px;margin:6px 0 10px}h2{font-size:17px;margin:0;line-height:1.45;overflow-wrap:anywhere}.muted,.meta{color:var(--muted)}.count{white-space:nowrap;background:#e7edf6;padding:9px 16px;border-radius:99px;color:#375270;font-weight:650}.filter{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 24px}.filter input,.searchbar input{background:#fff;outline:none;border:1px solid var(--border);padding:13px 15px;border-radius:10px;font-size:15px;min-width:0;width:min(420px,100%)}.filter span{font-size:13px;color:var(--muted)}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(236px,1fr));gap:24px}.item{overflow:hidden;border:1px solid var(--border);background:#fff;border-radius:16px;box-shadow:0 7px 30px rgba(18,39,62,.05)}.item[hidden]{display:none}.cover{display:flex;height:280px;align-items:center;justify-content:center;background:#e9edf2;position:relative;padding:20px}.cover img{max-height:100%;max-width:100%;object-fit:contain;box-shadow:0 5px 18px #0002;background:white}.corner{position:absolute;top:12px;right:12px;font-size:10px;color:#fff;background:#d94343;font-weight:700;border-radius:5px;padding:5px 8px}.item-body{padding:20px}.meta{font-size:13px;margin:10px 0 18px}.actions{display:flex;gap:9px;flex-wrap:wrap}.btn{display:inline-flex;justify-content:center;align-items:center;padding:10px 17px;border-radius:9px;font-weight:700;font-size:13px;border:1px solid transparent;cursor:pointer}.btn-primary{color:#fff;background:var(--blue)}.btn-primary:hover{background:#0b448b}.btn-outline{border-color:#bfcddd;background:#fff;color:var(--navy)}.btn-outline:hover{background:#eef3fa}.empty{padding:65px 24px;background:white;border:1px dashed var(--border);text-align:center;border-radius:12px}footer{padding:35px 20px;text-align:center;color:var(--muted);font-size:12px}.reader{min-height:100vh}.back{color:var(--blue);font-weight:650}.reader-main{max-width:1400px;padding:20px 22px 30px;margin:auto}.reader-title{display:flex;justify-content:space-between;align-items:center;gap:12px}.reader-title h1{font-size:clamp(19px,2.5vw,28px);margin:0 0 4px}.reader-title span{font-size:13px;color:var(--muted)}.reading-area{background:linear-gradient(135deg,#dce4ed,#c7d4e3);margin:17px 0 10px;min-height:380px;border-radius:14px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:12px}.book{margin:auto!important}.sheet{background:#fff;box-shadow:inset 0 0 0 1px #ccc;overflow:hidden;position:relative}.sheet img{height:100%;width:100%;object-fit:contain;background:#fff}.page-number{position:absolute;bottom:8px;left:8px;background:#fff9;padding:2px 6px;border-radius:5px;font-size:11px;color:#334}.controls{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px}.controls button{border:1px solid var(--border);background:#fff;border-radius:9px;padding:10px 13px;cursor:pointer;color:var(--navy);font-weight:700}.controls input{width:58px;border:1px solid var(--border);border-radius:6px;padding:7px;font-size:14px}.controls label{font-size:13px;color:var(--muted)}.searchbar{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;margin:20px 0}.searchbar input{width:min(330px,100%)}.searchbar span{font-size:12px}.modal{position:fixed;inset:0;background:rgba(7,16,29,.92);z-index:100;display:flex;align-items:center;justify-content:center;padding:30px;overflow:auto}.modal[hidden]{display:none}.modal img{max-height:calc(100vh - 70px);max-width:100%;object-fit:contain}.modal button{position:absolute;top:18px;right:20px;border:0;background:#fff;color:#111;font-size:22px;border-radius:50%;width:41px;height:41px;cursor:pointer}.reading-area:fullscreen{border-radius:0}.reading-area:fullscreen .book{margin:auto}@media(max-width:700px){.top-inner{min-height:70px}.top-label{display:none}.heading{align-items:flex-start;flex-direction:column}.filter span{display:none}.wrap{padding:27px 17px}.cover{height:240px}.reader-main{padding:15px 9px}.reader-title{padding:0 7px}.reader-title .btn{padding:8px}.reading-area{min-height:330px}.controls{gap:5px}.controls button{padding:9px 7px;font-size:12px}}

/* Basile PDF Manager - aggiornamento layout */
.top-inner{justify-content:center;text-align:center}
.brand{min-width:0;justify-content:center}
.heading{flex-direction:column;justify-content:center;align-items:center;text-align:center}
.heading>div:first-child{width:100%}
.filter{justify-content:center;flex-wrap:wrap}
.cards{justify-content:center;grid-template-columns:repeat(auto-fit,minmax(236px,270px))}
.item-body{text-align:center}
.actions{justify-content:center}
.reader-main{max-width:1420px}
.reader-title{gap:20px;margin:0 0 17px}
.reader-heading{display:flex;align-items:center;gap:18px;min-width:0}
.reader-heading .brand img{max-width:145px;max-height:75px}
.reader-heading-text{min-width:0}
.reader-heading-text h1{overflow-wrap:anywhere}
.reader-actions{display:flex;gap:10px;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}
.reader-main>.controls{margin:15px auto 12px}
.reading-area{position:relative;margin-top:0;padding:12px 64px}
.side-arrow{position:absolute;z-index:20;top:50%;transform:translateY(-50%);border:1px solid #bfccdc;border-radius:50%;background:rgba(255,255,255,.94);color:#11263b;box-shadow:0 3px 12px #0002;cursor:pointer;width:44px;height:44px;font-size:18px;font-weight:800;display:flex;justify-content:center;align-items:center}
.side-arrow:hover{background:#fff;box-shadow:0 4px 18px #0003}
.side-prev{left:12px}.side-next{right:12px}
.reader-hint{text-align:center;color:var(--muted);font-size:12px;margin:10px auto}
.sheet img{-webkit-user-drag:none;user-select:none}
@media(max-width:700px){
 .heading{align-items:center}
 .filter{justify-content:center}
 .reader-title{flex-direction:column;align-items:center;text-align:center}
 .reader-heading{justify-content:center;flex-wrap:wrap;gap:8px}
 .reader-actions{justify-content:center}
 .reader-main{padding:13px 8px}
 .reader-heading .brand img{max-width:125px;max-height:54px}
 .reading-area{padding:8px 40px}
 .side-arrow{width:32px;height:40px;border-radius:9px;font-size:14px}
 .side-prev{left:3px}.side-next{right:3px}
}

/* BASILE - Centratura pagina principale */
body:has(> header.top) .top-inner {
    justify-content: center;
    text-align: center;
}

body:has(> header.top) .brand {
    justify-content: center;
}

body:has(> header.top) .wrap {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

body:has(> header.top) .heading {
    justify-content: center;
    align-items: center;
    text-align: center;
}

body:has(> header.top) .filter {
    justify-content: center;
}

body:has(> header.top) .cards {
    justify-content: center;
}

body:has(> header.top) .item-body {
    text-align: center;
}

body:has(> header.top) .actions {
    justify-content: center;
}


/* BASILE - Centratura principale definitiva */
body > header.top .top-inner {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    display: flex;
    justify-content: center !important;
    align-items: center;
}

body > header.top .brand {
    display: flex;
    justify-content: center !important;
    align-items: center;
    margin: 0 auto;
}

body > main.wrap {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    text-align: center;
}

body > main.wrap .heading {
    display: flex;
    flex-direction: column;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
}

body > main.wrap .filter {
    display: flex;
    justify-content: center !important;
}

body > main.wrap .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(236px, 270px));
    justify-content: center !important;
    gap: 24px;
}

body > main.wrap .item-body {
    text-align: center;
}

body > main.wrap .actions {
    justify-content: center !important;
}


/* BASILE - Frecce sfogliatore ingrandite */
.side-arrow {
    width: 64px;
    height: 64px;
    font-size: 30px;
    font-weight: 900;
    border-radius: 50%;
    z-index: 30;
}

.side-prev { left: 12px; }
.side-next { right: 12px; }

@media (max-width: 700px) {
    .side-arrow {
        width: 44px;
        height: 44px;
        font-size: 23px;
    }
    .side-prev { left: 3px; }
    .side-next { right: 3px; }
}

/* Pulsante X per uscire dal fullscreen */
.fullscreen-close {
    display: none;
}

.reading-area:fullscreen .fullscreen-close {
    display: flex;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid #bfccdc;
    background: rgba(255,255,255,.95);
    color: #11263b;
    font-size: 38px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 12px #0003;
}

.reading-area:fullscreen .fullscreen-close:hover {
    background: white;
}

@media (max-width: 700px) {
    .reading-area:fullscreen .fullscreen-close {
        width: 44px;
        height: 44px;
        font-size: 30px;
        top: 8px;
        right: 8px;
    }
}
