/* ============================================
   漫画セクション（マリコ、夜間部へ行く！）
   section_manga.php から自動読み込み
   ============================================ */

/* Scrollable Track */
.manga-track-wrapper {
    position: relative;
}

.manga-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 8px 4px 20px;
    scrollbar-width: none;
}

.manga-track::-webkit-scrollbar {
    display: none;
}

/* Scroll Arrows (PC only) */
.scroll-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #E0F2FE;
    box-shadow: 0 4px 20px rgba(27, 172, 232, 0.12);
    cursor: pointer;
    z-index: 10;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #1BACE8;
    font-size: 18px;
}

.scroll-arrow:hover {
    background: #1BACE8;
    color: #fff;
    border-color: #1BACE8;
    box-shadow: 0 8px 32px rgba(27, 172, 232, 0.22);
}

.scroll-arrow-left { left: -22px; }
.scroll-arrow-right { right: -22px; }

@media (min-width: 768px) {
    .scroll-arrow { display: flex; }
}

/* Manga Card */
.manga-card {
    position: relative;
    flex: 0 0 220px;
    scroll-snap-align: start;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(27, 172, 232, 0.12);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.manga-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 32px rgba(27, 172, 232, 0.22);
}

.manga-card:active {
    transform: translateY(-2px) scale(0.98);
}

.manga-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.manga-card:hover img {
    transform: scale(1.05);
}

.theme-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    color: #0284c7;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

.manga-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 12px 12px;
    background: linear-gradient(to top, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.6) 60%, transparent 100%);
}

.manga-card-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    color: #333;
}

/* Scroll Indicator Dots (mobile only) */
.scroll-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D0E8EF;
    transition: all 0.3s ease;
}

.scroll-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #1BACE8;
}

@media (min-width: 768px) {
    .scroll-dots { display: none; }
}

/* Fullscreen Modal */
.manga-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.manga-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.manga-modal-overlay.fade-in {
    opacity: 1;
}

.modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    z-index: 10;
}

.modal-title-text {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    opacity: 0.9;
}

.modal-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(8px);
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 80px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

@media (max-width: 767px) {
    .modal-image-container {
        align-items: flex-start;
        padding: 56px 8px 72px;
    }
    .modal-image-container img {
        max-height: none;
        width: 100%;
    }
}

.modal-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}

.modal-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.modal-page-indicator {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    min-width: 60px;
    text-align: center;
}

/* Manga Responsive */
@media (min-width: 768px) {
    .manga-card {
        flex: 0 0 220px;
    }
}

@media (max-width: 767px) {
    .manga-card {
        flex: 0 0 68vw;
    }
    .manga-track {
        padding-left: 16px;
        padding-right: 16px;
        gap: 12px;
    }
    .manga-card-title {
        font-size: 14px;
    }
}
