/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic Pro', sans-serif;
    background-color: #f5f5f0;
    color: #333;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/common/pattern.png');
    background-repeat: repeat;
    opacity: 0.03;
    pointer-events: none;
    z-index: -1;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ol {
    list-style-position: inside;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 74px;
    z-index: 1000;
    overflow: hidden;
}

.header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Container */
.container-manga {
    display: flex;
    justify-content: center;
    gap: 40px;
    _padding-top: 100px;
    padding-top: 40px;
    max-width: 1440px;
    margin: 0 auto;
    padding-bottom: 180px;
}

@media screen and (max-width:959px) {
    .container-manga {
        padding-left: 20px;
        padding-right: 20px;
        gap: clamp(20px, 3.5vw, 40px);
    }
}

/* Sidebar */
.sidebar {
    width: 344px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    _height: calc(100vh - 180px);
    overflow-y: auto;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0px 0 24px;
}

/* Logo Section */
.logo-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo-link {
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    width: 100%;
    aspect-ratio: 1723 / 544;
}

.logo img {
    width: 100%;
    height: auto;
}

.description {
    font-family: 'Hiragino Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #000;
    line-height: normal;
}

/* Book Banner */
.book-banner {
    display: block;
    background: white;
    border: 3.704px solid #d3d3d3;
    border-radius: 4.444px;
    width: 339px;
    height: 98.912px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: opacity 0.2s;
}

.book-banner:hover {
    opacity: 0.9;
}

.book-banner-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.book-text {
    position: absolute;
    left: 10.43px;
    top: 7.36px;
    width: 218.765px;
}

.book-subtitle {
    font-family: 'Hiragino Kaku Gothic Std', sans-serif;
    font-size: 11.906px;
    font-weight: 800 !important;
    color: #4b8946;
    line-height: normal;
}

.book-title {
    font-family: 'A-OTF Shin Go Pro', sans-serif;
    font-size: 32.856px;
    font-weight: 800 !important;
    color: #f2357a;
    line-height: 1;
    letter-spacing: -1.9713px;
}

.book-image {
    position: absolute;
    right: 3.7px;
    top: 1.69px;
    width: 90.82px;
    height: 90.82px;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-status {
    position: absolute;
    left: 136.57px;
    top: 60.54px;
    font-family: 'Hiragino Kaku Gothic Std', sans-serif;
    font-size: 17.247px;
    font-weight: 800 !important;
    color: #f2357a;
}

.book-volume {
    position: absolute;
    left: 49.35px;
    top: 60.14px;
    width: 83.626px;
    height: 26.976px;
    font-family: 'Hiragino Kaku Gothic Std', sans-serif;
    font-size: 17.247px;
    font-weight: 800 !important;
    color: #f2357a;
}

/* Episode Section */
.episode-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.section-title {
    font-family: 'Hiragino Kaku Gothic Std', sans-serif;
    font-size: 24px;
    font-weight: 800 !important;
    color: #5f3f3f;
    line-height: normal;
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.episode-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 344px;
    padding: 10px 16px 10px 24px;
    border-radius: 56px;
    box-shadow: 0px 6px 0px 0px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.episode-item.active:hover {
    background: #ffc50f;
    box-shadow: 0px 3px 0px 0px rgba(0, 0, 0, 0.15);
    transform: translateY(3px);
}

.episode-item.active:hover .episode-arrow {
    content: url('images/common/arrow-hover.svg');
}

.episode-item.disabled {
    background: #e5e5e5;
    cursor: not-allowed;
}

.episode-item ol {
    font-family: 'Hiragino Kaku Gothic Std', sans-serif;
    font-size: 17px;
    font-weight: 800;
    line-height: 0;
    white-space: nowrap;
    list-style-position: inside;
}


.episode-item ol li span {
    line-height: normal;
}

.episode-item.active ol {
    color: #5f3f3f;
}

.episode-item.disabled ol {
    color: #979797;
}

.episode-text {
    font-family: 'Hiragino Kaku Gothic Std', sans-serif;
    font-size: 17px;
    font-weight: 800;
    line-height: normal;
    color: #979797;
}

.episode-arrow {
    width: 16px;
    height: auto;
    transform: rotate(90deg);
    flex-shrink: 0;
    object-fit: contain;
}

/* Share Section */
.share-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 16px 0;
    width: 100%;
    height: 93px;
    border-radius: 6px;

    .section-title {
        margin-bottom: 20px;
    }
}

.share-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-icon {
    width: 32px;
    height: 32px;
    overflow: hidden;
    transition: opacity 0.2s;
}

.share-icon:hover {
    opacity: 0.7;
}

.share-icon img {
    width: 100%;
    height: 100%;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    padding: 16px 40px 48px;
    overflow-x: hidden;
    overflow-y: auto;
    align-self: flex-start;
}

/* Manga Viewer */
.manga-viewer {
    display: flex;
    flex-direction: column;
    gap: 0px;
    align-items: center;
    width: 420px;
}

.manga-title {
    font-family: 'Hiragino Kaku Gothic Std', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #333;
    text-align: center;
}

.manga-page {
    width: 420px;
    height: auto;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.manga-page img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Explanation Page */
.explanation-page {
    width: 397px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 0 8px 8px;
}

.explanation-content {
    font-family: 'Hiragino Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #333;
    line-height: 1.6;
    width: 100%;
}

.explanation-content p {
    margin-bottom: 0;
}

.explanation-content p+p {
    margin-top: 16px;
}

.explanation-content .highlight {
    color: #448d3e;
    text-decoration: underline;
    text-underline-position: from-font;
}

.explanation-thumbnail {
    width: 100%;
    aspect-ratio: 364.568 / 171;
    overflow: hidden;
    position: relative;
}

.explanation-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media screen and (min-width:768px) and (max-width:959px) {

    .manga-page,
    .explanation-page {
        width: clamp(350px, 45vw, 420px);
    }
}

/* Navigation */
.navigation {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
}

.nav-btn {
    padding: 8px 16px;
    font-family: 'Hiragino Kaku Gothic Std', sans-serif;
    font-size: 18px;
    font-weight: 800;
    line-height: normal;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    background: #ffc50f;
    color: #333;
}

.nav-btn.prev {
    border-radius: 100px 6px 6px 100px;
}

.nav-btn.next {
    border-radius: 6px 100px 100px 6px;
}

.nav-btn:hover:not(:disabled) {
    background: #ffaa00;
}

.nav-btn:disabled {
    background: #d3d3d3;
    color: #8a8a8a;
    cursor: not-allowed;
}

/* Copyright */
.copyright {
    font-family: 'Hiragino Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #666;
    line-height: normal;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .container-manga {
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding: 60px 20px 80px;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        display: contents;
    }

    .sidebar-content {
        display: contents;
    }

    .logo-header {
        width: 100%;
        max-width: 344px;
        order: 1;
        align-self: center;
    }

    .main-content {
        width: 100%;
        padding: 25px 0px 32px;
        order: 2;

        .manga-title {
            margin-bottom: 10px;
        }
    }

    .episode-section {
        width: 100%;
        max-width: 344px;
        order: 3;
        align-self: center;
    }

    .book-banner {
        order: 4;
        align-self: center;
    }

    .share-section {
        width: 100%;
        max-width: 344px;
        order: 5;
        align-self: center;

        .section-title {
            margin-bottom: 25px;
        }
    }

    .manga-viewer {
        width: 100%;
        max-width: 420px;
    }

    .manga-page {
        width: 100%;
        height: auto;
        aspect-ratio: 420 / 834;
    }

    .explanation-page {
        width: 100%;
        max-width: 420px;
        padding: 8px 0px;
    }

    .explanation-content {
        font-size: 14px;
    }
}

@media screen and (max-width:480px) {
    .container-manga {
        padding-left: 10px;
        padding-right: 10px;
    }

    .manga-viewer {
        width: 95%;
    }
}

/* footer */
body.manga__body {
    footer {
        margin-top: 0rem;
    }
}