/* Reset generale */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: sans-serif;
    min-height: 100vh;
}

/* --- HOME PAGE: BLOCCO SENZA SCORRIMENTO SU PC --- */
body:has(.content-wrapper) {
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-wrapper {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
}

body:has(.content-wrapper) .page-wrapper {
    height: 95vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* --- LOGO E HEADER --- */
.site-header {
    width: 100%;
    text-align: center;
    padding: 15px 0;
}

.compact-header {
    padding: 10px 0;
}

.site-header a {
    display: inline-block;
    line-height: 0;
}

.site-logo {
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.site-logo.small-logo {
    max-width: 160px;
}

/* --- HOME PAGE: CORPO CENTRALE A DUE COLONNE --- */
.content-wrapper {
    display: flex;
    width: 100%;
    max-width: 880px;
    gap: 40px;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    flex-grow: 1;
}

.preview-box {
    flex: 0 0 380px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-img {
    width: 100%;
    max-width: 380px;
    height: auto;
    object-fit: contain;
    border-radius: 2px;
    display: block;
}

.synopsis-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 520px;
}

.home-right-column {
    flex: 0 0 380px;
    max-width: 380px;
    justify-content: center;
    gap: 18px;
    padding: 0;
}

.synopsis-text,
.home-top-block .synopsis-text {
    line-height: 1.5;
    font-size: 0.9rem;
    color: #cccccc;
    text-align: justify;
    margin-bottom: 12px;
}

.synopsis-notice {
    margin-bottom: 20px;
    text-align: justify;
}

.synopsis-notice .content-warning {
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-align: justify;
}

.synopsis-notice .disclaimer {
    font-size: 0.75rem;
    color: #999;
    line-height: 1.4;
    margin: 0;
    text-align: justify;
}

/* --- PULSANTI --- */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.home-btn {
    display: block;
    width: 240px;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.btn-read {
    background-color: #FFCC00;
    color: #121212;
}

.btn-read:hover {
    background-color: #FFE780;
}

.btn-reddit {
    background-color: #F54927;
    color: #ffffff;
}

.btn-reddit:hover {
    background-color: #FFBEB0;
}

.btn-tumblr {
    background-color: #001935;
    color: #ffffff;
}

.btn-tumblr:hover {
    background-color: #3876B4;
}

.home-bottom-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    margin-top: 0;
}

.home-bottom-buttons .home-btn {
    width: 100%;
    padding: 10px;
    font-size: 0.76rem;
    letter-spacing: 0.8px;
}

.home-bottom-buttons .home-btn-full {
    grid-column: 1 / -1;
}

.back-home {
    text-align: center;
}

/* --- LISTA CAPITOLI E SCHEDE --- */
.chapters-container {
    max-width: 700px;
    margin: 20px auto 40px auto;
}

.chapters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #333;
    padding-bottom: 12px;
}

.sort-button {
    background-color: transparent;
    border: 1px solid #444;
    color: #cccccc;
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-button:hover {
    background-color: #222;
    border-color: #666;
}

.about-chapter-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background-color: #161616;
    border: 1px solid #222;
    border-radius: 3px;
    padding: 20px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.about-chapter-card:hover {
    border-color: #444;
}

.chapter-thumb-box {
    flex: 0 0 112px;
    width: 112px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 3px;
    border: 1px solid #2b2b2b;
    background-color: #101010;
}

.chapter-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chapter-card-content {
    flex: 1;
    min-width: 0;
}

.about-chapter-card h3 {
    font-family: "Times New Roman", Times, serif;
    font-size: 1.15rem;
    color: #ffffff;
    margin-bottom: 8px;
}

.about-chapter-card p {
    font-size: 0.9rem;
    color: #b0b0b0;
    line-height: 1.5;
    margin-bottom: 15px;
    text-align: justify;
}

.chapters-back-btn {
    margin: 0 auto;
}

/* --- GRIGLIA COVER VOLUMI --- */
.volumes-grid {
    display: flex;
    justify-content: center;
    gap: 35px;
    flex-wrap: wrap;
    margin-top: 25px;
    margin-bottom: 20px;
}

.volume-cover-link {
    display: block;
    width: 300px;
    text-decoration: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.volume-cover-link:hover {
    transform: translateY(-4px);
    opacity: 0.9;
}

.volume-cover-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
}

/* --- NAVIGAZIONE GENERALE E FOOTER --- */
.nav-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #222;
    color: #e0e0e0;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border: 1px solid #444;
    border-radius: 2px;
    transition: all 0.2s;
}

.nav-button:hover {
    background-color: #333;
    color: #ffffff;
    border-color: #666;
}

.site-footer {
    width: 100%;
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid #222;
}

.site-footer p {
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 0.5px;
}

/* --- LETTORE: TAVOLE IN VERTICALE, INTESTAZIONE E NAVIGAZIONE --- */
.comic-strip,
.comic-pages {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
    width: 100%;
}

.comic-strip img,
.comic-pages img,
.comic-page {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.chapter-info {
    text-align: center;
    width: 100%;
    display: block;
    margin: 15px auto 25px auto;
}

.chapter-info h1 {
    text-align: center;
    width: 100%;
}

.reader-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 20px;
    margin: 40px auto 25px auto;
    border-top: 1px solid #333;
    padding-top: 25px;
}

/* ==========================================================
   ADATTAMENTI PER SMARTPHONE (Sotto i 768px)
   ========================================================== */
@media (max-width: 768px) {
    body:has(.content-wrapper) {
        height: auto;
        overflow: auto;
    }

    .page-wrapper {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
    }

    .site-header {
        padding: 12px 0;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 20px;
        max-width: 100%;
    }

    .preview-box {
        flex: none;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .preview-img {
        width: 100vw;
        max-width: 100vw;
        max-height: none;
        border-radius: 0;
    }

    .synopsis-box {
        padding: 0 18px;
        max-width: 100%;
    }

    .home-right-column {
        flex: none;
        width: 100%;
        max-width: 100%;
        justify-content: flex-start;
        gap: 20px;
        padding: 0 20px;
    }

    .home-top-block {
        width: 100%;
    }

    .home-top-block .synopsis-text,
    .home-top-block .synopsis-notice {
        padding-left: 0;
        padding-right: 0;
    }

    .button-group,
    .home-bottom-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .home-btn,
    .home-bottom-buttons .home-btn {
        width: 100%;
        max-width: 300px;
        padding: 10px 15px;
        font-size: 0.8rem;
        letter-spacing: 1px;
    }

    .home-bottom-buttons .home-btn-full {
        grid-column: auto;
    }

    .chapters-container {
        padding: 0 18px;
    }

    .volumes-grid {
        flex-direction: column;
        align-items: center;
        gap: 25px;
        padding: 0 18px;
    }

    .volume-cover-link {
        width: 100%;
        max-width: 340px;
    }

    .site-footer {
        margin-top: 30px;
        padding-bottom: 20px;
    }
}

/* --- SCHEDE CAPITOLO SU SCHERMI STRETTI (Sotto i 600px) --- */
@media (max-width: 600px) {
    .about-chapter-card {
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
    }

    .chapter-thumb-box {
        flex: 0 0 84px;
        width: 84px;
    }

    .about-chapter-card p {
        text-align: left;
    }
}

.top-reader-navigation {
    margin: 15px auto 25px auto;
    border-top: none;
    padding-top: 0;
}