@charset "UTF-8";

.comic-page {
    background: #f4f8fc;
}

#contents #main {
    float: none;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.comic-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 12px 72px;
}

.comic-header {
    margin: 24px 0 32px;
    text-align: center;
}

.comic-hero-heading {
    margin: 0 0 16px;
    font-size: 0;
    line-height: 0;
    position: relative;
}

.comic-hero-heading__img {
    width: 100%;
    max-width: 1120px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(39, 107, 188, 0.14);
}

.comic-header__lead {
    max-width: 760px;
    color: #3e5875;
    font-size: 16px;
    line-height: 1.8;
}

/* common/css/pc.css の #contents #main p { margin: 0 0 30px; } より強く、中央寄せを確実にする */
body.comic-page #contents #main p.comic-header__lead {
    margin: 0 auto 30px;
    text-align: center;
}

.comic-toc {
    max-width: 860px;
    margin: 0 auto 18px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #d2e5ff;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(39, 107, 188, 0.08);
    text-align: left;
}

.comic-toc__title {
    margin: 0 0 6px;
    color: #1b3768;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.comic-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 8px;
}

.comic-toc__item {
    margin: 0;
}

.comic-toc__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #d2e5ff;
    background: #f7faff;
    color: #276bbc;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.comic-toc__link:hover {
    background: #e8f2ff;
    border-color: #bcd8ff;
    text-decoration: none;
    transform: translateY(-1px);
}

.comic-card {
    /* JSで固定ヘッダー分をオフセットしているため、ズレを抑える目的のみ */
    scroll-margin-top: 0;
}

.comic-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.comic-card {
    border: 1px solid #d2e5ff;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(39, 107, 188, 0.12);
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    width: 100%;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.comic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(39, 107, 188, 0.2);
}

.comic-card img {
    width: 100%;
    height: auto;
    display: block;
}

.comic-card__badge {
    position: absolute;
    right: 12px;
    top: 12px;
    border-radius: 999px;
    background: #276bbc;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 8px 12px;
}

.comic-card__meta {
    display: block;
    padding: 12px 14px 0;
    color: #276bbc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.comic-card__title {
    display: block;
    padding: 5px 14px 16px;
    color: #1b3768;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
}

.comic-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(10, 22, 38, 0.86);
    display: none;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.comic-modal.is-open {
    display: flex;
}

.comic-modal__inner {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
}

.comic-modal__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 0;
    max-height: 100dvh;
    box-sizing: border-box;
}

.comic-modal__stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.comic-modal__figure-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    box-sizing: border-box;
}

.comic-modal__figure-wrap img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    object-position: top center;
    border-radius: 0;
    background: #fff;
    vertical-align: middle;
}

.comic-modal__footer {
    flex: 0 0 auto;
    width: 100%;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: rgba(8, 18, 32, 0.92);
    backdrop-filter: blur(8px);
}

.comic-modal__footer-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.comic-modal__cta {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 12px 20px;
    background: #276bbc;
    color: #fff !important;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(39, 107, 188, 0.35);
    transition: background 0.2s ease, transform 0.15s ease;
    box-sizing: border-box;
}

.comic-modal__cta:hover {
    background: #1f5a9e;
    color: #fff !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.comic-modal__cta--dummy {
    background: #8a9aad;
    box-shadow: none;
    cursor: not-allowed;
}

.comic-modal__cta--dummy:hover {
    background: #8a9aad;
    transform: none;
}

.comic-modal__close {
    position: static;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.comic-modal__close-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 22px;
    line-height: 0;
    font-family: system-ui, "Segoe UI Symbol", "Apple Symbols", "Hiragino Sans", sans-serif;
    transform: translateY(0.5px);
}

.comic-modal__nav {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

@media screen and (min-width: 768px) {
    .comic-wrap {
        padding: 40px 8px 96px;
    }

    .comic-grid {
        gap: 18px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .comic-modal {
        align-items: center;
        padding: 16px;
    }

    .comic-modal__inner {
        max-width: 960px;
        max-height: calc(100dvh - 32px);
        border-radius: 12px;
        overflow: hidden;
    }

    .comic-modal__body {
        max-height: calc(100dvh - 32px);
    }

    .comic-modal__figure-wrap img {
        border-radius: 8px;
    }
}
