﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0 auto;
    background-color: #fff;
    color: #333;
    font-family: "Noto Sans JP", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "ＭＳ Ｐゴシック", "MS PGothic", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ハンバーガーメニューが開いている時、ボディをスクロール不可に */
body.no-scroll {
    overflow: hidden;
}

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

.no-scroll-bar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.no-scroll-bar {
    scrollbar-width: none;
}

object.logo {
    pointer-events: none;
}

.border-gray {
    margin-top: 40px;
    display: flex;
    height: 50px;
    padding: 10px;
    justify-content: center;
    align-items: center;
    gap: 20px;
    align-self: stretch;
    border-radius: 4px;
    border: 1px solid #C0C0C0;
    background: #FBFBFB;
}

.border-gray p {
    color: #3866AC;
    text-align: center;
    font-weight: 700;
    line-height: 1.625;
}

.border-gray.to-top-page {
    margin: 0 auto;
}

.orange-btn {
    display: flex;
    max-width: 390px;
    min-height: 50px;
    padding: 10px;
    margin: 1em auto;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 4px;
    background: #FF8D07;
    color: #FBFBFB;
    text-align: center;
    font-weight: 700;
    line-height: 1.625;
}

.orange-btn.orange-btn-reverse {
    color: #FF8D07;
    background: #FBFBFB;
    border: #FF8D07 1px solid;
}

header {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding-left: 40px;
    position: relative;
}

header .header-inner {    
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .header-actions {    
    display: flex;
    align-items: center;
    gap: 12px;
}

header h1 {
    margin: 0;
    display: flex;
    align-items: center;
}

header .logo {
    max-width: 100%;
    height: auto;
    transition: width .3s ease;
}

header .btn-login {
    font-size: 1.2em;
    color: #3866AC;
    font-weight: bold;
    white-space: nowrap;
}

header .hamburger-menu {
    width: 61px;
    height: 60px;
    cursor: pointer;
}

/* メニューオーバーレイ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateX(100%);
    transition: transform .1s ease-in-out;
    z-index: 999;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.menu {
    background-color: #fff;
    width: 480px;
    max-width: 100%;
    height: 100%;
    padding: 50px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: auto;
}

.menu ul {
    list-style-type: none;
    padding: 0;
}

.menu li {
    padding: 15px 0;
}

.menu a {
    text-decoration: none;
    color: #333;
    font-size: 18px;
}

/* バツ印アイコン */
.close-icon {
    width: 61px;
    height: 60px;
    cursor: pointer;
    margin-bottom: 20px;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 999;
    background-color: rgba(255, 255, 255, .8);
}

.search-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

#search-form {
    display: flex;
    width: 390px;
    height: 50px;
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

#search-box {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

#search-btn {
    background-color: #3866AC;
    border: 1px solid #3866AC;
    width: 50px;
    height: 50px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

#search-btn .search-icon {
    width: 20px;
    height: 20px;
    fill: white;
}

#search-form:focus-within {
    border-color: #3866AC;
}

.menu .categories,
.menu .back_numbers {
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    overflow-x: unset;
    border-bottom: none;
    margin-top: 5px;
}

.menu .back_numbers {
    display: flex;
    white-space: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
}

.menu .categories a,
.menu .back_numbers a {
    width: 50%;
    border-right: 1px solid #C0C0C0;
    border-bottom: 1px solid #C0C0C0;
    padding: 10px 20px;
    overflow: hidden;
}

#hamburger-icon.active {
    display: block;
}

#hamburger-icon.inactive {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    padding: 5px 15px;
    margin-top: 10px;
    justify-content: flex-start;
    align-items: start;
    gap: 5px 20px;
    border-bottom: solid 1px #C0C0C0;
}

.category {
    height: auto;
    white-space: nowrap;
    color: #3866AC;
    text-align: right;
    font-weight: 500;
    line-height: 1.3;
}

.category.selected-category {
    color: #FF8D07;
    border-bottom: 4px solid #FF8D07;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    padding: 1px 10px;
    margin-top: 10px;
    justify-content: flex-start;
    align-items: start;
    gap: 8px 20px;
}

.tag {
    height: auto;
    white-space: nowrap;
    color: #3866AC;
    text-align: right;
    font-weight: 700;
    line-height: 1.3;
    display: flex;
    height: 32px;
    padding: 4px 15px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 20px;
    background: #F0F0F0;
}

.tag.selected-tag {
    color: #FBFBFB;
    background-color: #FF8D07;
}

.back_number {
    height: auto;
    white-space: nowrap;
    color: #3866AC;
    text-align: right;
    font-weight: 500;
    line-height: 1.3;
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 1em auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.carousel_top_title {
    padding: 8px 24px 8px;
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.carousel_viewport {
    position: relative;
    overflow: hidden;
    height: 320px;
    padding: 0 60px;
}

.carousel_track {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    height: 100%;
}

.carousel_slide {
    min-width: calc(100% - 300px);
    height: 100%;
    display: flex;
    margin: 0 10px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel_slide:not(.is-active) {
    transform: scale(0.9);
    opacity: 0.7;
}

.carousel_slide.is-active {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.carousel_card {
    display: flex;
    flex-direction: row;
    width: 100%;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.carousel_card:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.carousel_thumb {
    flex: 0 0 280px;
    height: 100%;
    margin: 0;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel_thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* .no-image {
    flex: 0 0 200px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.no-image::after {
    content: "画像なし";
} */

.carousel_body {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel_title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.4;
    color: #333;
}

.carousel_excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.carousel_nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.carousel_nav:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.carousel_nav--prev {
    left: 16px;
}

.carousel_nav--next {
    right: 16px;
}

.carousel_nav svg {
    width: 24px;
    height: 24px;
    color: #333;
}

.carousel_dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    background: white;
}

.carousel_dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel_dot.is-active {
    background: #007acc;
    transform: scale(1.2);
}

.carousel_dot:hover {
    background: #007acc;
    opacity: 0.7;
}

/* プログレスバー */
.carousel_progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #007acc;
    transition: width 0.1s ease;
    z-index: 3;
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
    .carousel_slide {
        min-width: calc(100% - 150px);
        margin: 0 3px;
    }
}

@media (max-width: 768px) {
    .carousel_viewport {
        padding: 0 20px;
    }
    
    .carousel_slide {
        min-width: calc(100% - 40px);
        margin: 0 3px;
    }
    
    .carousel_card {
        flex-direction: column;
    }
    
    .carousel_thumb {
        flex: 0 0 160px;
        width: 100%;
        height: auto;
    }

    .carousel_thumb img {
        max-height: 200px;
    }

    .carousel_viewport {
        height: 380px;
    }
    
    .carousel_nav {
        width: 40px;
        height: 40px;
    }
    
    .carousel_nav--prev {
        left: 8px;
    }
    
    .carousel_nav--next {
        right: 8px;
    }

    .carousel_excerpt {
        display: none;
    }
}

.article-top-bar {
    margin-top: 20px;
    display: flex;
    height: 40px;
    align-items: center;
    flex-shrink: 0;
    align-self: stretch;
    font-weight: 700;
    line-height: 1.625;
}

.article-top-bar > p:first-child {
    color: #fbfbfb;
    flex-grow: 1;
    border: 1px solid #3866AC;
    background-color: #3866AC;
    padding: 10px 20px;
    text-align: left;
}

.article-top-bar > p + a {
    margin-left: auto;
    border: 1px solid #C0C0C0;
    background-color: #FBFBFB;
    /* padding: 10px 20px; */
    color: #3866AC;
    text-align: center;
}

.article-top-bar .article-top-bar-right {
    padding: 10px 64px 10px 10px;
    background-image: url(../img/viewer-thumbnail.jpg);
    background-repeat: no-repeat;
    background-position: right;
}

.article-list-container {
    display: grid;
    grid-template-columns: repeat(3, 373px);
    gap: 20px;
    justify-content: center;
    margin: 40px 20px 20px;
    grid-auto-rows: minmax(0, auto);
    /* margin-top: 40px;
    display: flex;
    align-items: flex-start;
    align-content: flex-start;
    gap: 40px;
    align-self: stretch;
    flex-wrap: wrap; */
}

.article-list-item {
    width: 373px;
    height: 570px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    /* display: flex;
    max-width: 373px;
    max-height: 590px;
    padding-bottom: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    border-bottom: 1px solid #C0C0C0; */
}

.article-list-item img {
    width: 100%;
    height: 270px;
    object-fit: contain;
    background-color: #FBFBFB;
    border-radius: 10px;
    /* max-width: 373px;
    max-height: 270px;
    flex-shrink: 0;
    align-self: stretch; */
}

/* 画像が無い場合のグレーの長方形 */
.article-list-item .no-image {
    width: 100%;
    height: 270px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
    text-align: center;
    border-radius: 10px;
}

/* 記事のタイトル */
.article-list-item .article-title {
    margin-top: 20px;
    color: #333;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.58333;    
}

/* 記事の本文プレビュー */
.article-list-item .article-preview {
    margin-top: 10px;
    color: #333;
    text-align: justify;
    line-height: 1.75;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-container {
    max-width: 900px;
    padding: 20px;
}

.article-container h2 {
    margin-top: 20px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
}

.article-container .article-date {
    text-align: right;
}

#image-garally {
    width: 400px;
    max-width: 100%;
    float: left;
    margin: 0 1em 1em 0;
}

#image-garally.image-garally-comic {
    width: 100%;
    float: none;
    margin: 0 1em 1em 0;
    display: flex;
    justify-content: center;
}

.comic-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    overflow: hidden;  /* 漫画部分だけがスクロール可能 */
}

.comic-container > p {
    margin-bottom: 1em;
    font-weight: bold;
}

.comic-images {
    display: flex;
    flex-direction: row;
    transition: transform .1s ease-in-out;
}

.comic-image {
    width: 100%;    /* 画像の幅を親要素に合わせて100%に設定 */
    height: auto;   /* 高さは自動で調整 */
    object-fit: cover; /* 画像の縦横比を保ちながら収める */
    flex-shrink: 0;  /* 画像のサイズを固定 */
    max-width: 480px;
}

.comic-pagination {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    margin: 0 5px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
}

.dot.active {
    background-color: #3866AC;
}

#main-image {
    text-align: center;
}

#current-image {
    object-fit: contain;
}

#main-image .caption {
    color: #333;
    text-align: justify;
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

#main-image img {
    background-color: #f8f8f8;
}

#thumbnails {
    margin-top: 20px;
    text-align: center;
}

.thumbnail-container {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail {
    cursor: pointer;
}

.thumbnail-image {
    border: 2px solid #ccc;
    border-radius: 5px;
    transition: all 0.3s ease;
    object-fit: contain;
    width: 60px;
    height: 42px;
}

.thumbnail-image:hover {
    opacity: 0.7;
}

.thumbnail.selected .thumbnail-image {
    filter: brightness(50%);
}

.article-content {
    margin-top: 20px;
}

.article-content p {
    text-align: justify;
    overflow-wrap: anywhere;
    line-height: 1.75;
}

.article-content p.margin-top {
    margin-top: 1.5em;
}

.article-content p.center {
    text-align: center;
}

.article-content h3 {
    font-size: 18px;
    margin-top: 1.5em;
    margin-bottom: 0;
}

.article-content h4 {
    font-size: 17px;
    margin-top: 1em;
}

.article-content h5 {
    font-size: 16px;
    margin-top: 1em;
}

.article-content h3 + h3 {
    margin-top: 0;
}

.article-content a {
    color: #3866AC;
}

.article-container .tags {
    margin-top: 40px;
}

.article-navigation {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.article-navigation > a {
    color: #3866AC;
    font-weight: 700;
    margin-top: 40px;
    height: 50px;
    padding: 10px;
    align-self: stretch;
    border-radius: 4px;
    border: 1px solid #C0C0C0;
    background: #FBFBFB;
    line-height: 1.825;
}

.lightgray-back {
    background-color: #f0f0f0;
    padding: 20px 0;
    margin-top: 20px;
    clear: both;
}

.login-information {
    clear: both;
}

.login-information p {
    text-align: center;
}

.login-information p.strong {
    margin-top: 2em;
    font-weight: bold;
}

.pagination {
    margin-top: 40px;
    display: flex;
    height: 80px;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.pagination > a,
.pagination > span {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    border-radius: 4px;
    background: #3866AC;
    color: #FBFBFB;
    text-align: center;
    font-weight: 500;
    line-height: normal;
}

.pagination > a {
    background: #F0F0F0;
    color: #3866AC;
}

.pagination > a.previous-page {
    background-image: url("../img/previous-page.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.pagination > a.next-page {
    background-image: url("../img/next-page.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.sns-icons {
    margin: 40px auto 0;
    display: flex;
    height: 40px;
    padding-right: 2px;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    flex-shrink: 0;
    background: #c0c0c0;
    padding: 2em 0 4em;
}

.sns-icon-x, .sns-icon-instagram {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #333;
}

.sns-icon-x {    
    background: #333;
}

.sns-icon-x img {
    margin: 7px;
}

.sns-icon-instagram {    
    background: #fbfbfb;
}

.sns-icon-instagram img {
    margin: 6px;
}

.footer-content {
    display: flex;
    padding: 20px;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.footer-content p {
    text-align: right;
    line-height: normal;
}

.menu .footer-content {
    display: block;
}

.menu .footer-content p {
    text-align: left;
    line-height: 1.8;
}

.icon-arrow-gt {
    display: inline-block;
    width: 6px;
    height: 12px;
    margin-right: 10px;
    background-image: url("../img/icon-arrow-gt.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    stroke-width: 2px;
    stroke: #3866AC;
}

.icon-arrow-lt {
    display: inline-block;
    width: 6px;
    height: 12px;
    margin-right: 20px;
    background-image: url("../img/icon-arrow-lt.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    stroke-width: 2px;
    stroke: #3866AC;
}

/* レスポンシブ対応（画面幅が小さい場合に2列に変更） */
@media (max-width: 1200px) {
    .article-list-container {
        grid-template-columns: repeat(2, 373px); /* 2列に変更 */
        grid-template-rows: auto; /* 行数を自動調整 */
    } 
}

/* レスポンシブ対応（さらに小さい画面で1列に変更） */
@media (max-width: 768px) {
    .article-list-container {
        grid-template-columns: 1fr; /* 1列に変更 */
        grid-template-rows: auto; /* 行数を自動調整 */
        gap: 0;
    }

    .article-list-item {
        height: auto;
        width: 100%;
        border-radius: 0;
    }

    .article-list-item:not(.top-article) {
        height: 110px;
        flex-direction: row;
        box-shadow: none;
        border-width: 0 0 1px 0;
        justify-content: flex-start;
    }

    .article-list-item:not(.top-article) img {
        width: 130px;
        height: 90px;
        object-fit: contain;
        border-radius: 10px;
        margin-right: 10px;
    }

    /* 画像が無い場合のグレーの長方形 */
    .article-list-item:not(.top-article) .no-image {
        width: 130px; /* 画像の幅 */
        height: 90px; /* 画像の高さ */
        background-color: #ccc; /* グレーの背景色 */
        display: flex;
        align-items: center;
        justify-content: center;
        color: #666;
        text-align: center;
        border-radius: 10px;
        margin-right: 10px;
    }

    .article-list-item .article-preview,
    .article-list-item:not(.top-article) .tags {
        display: none; /* プレビュー非表示 */
    }

    .article-list-item:not(.top-article) .article-title {
        font-size: 18px;
        font-weight: bold;
        color: #333;
        margin-top: 0;
        overflow: hidden; /* 見切れた部分を隠す */
        text-overflow: ellipsis; /* 見切れた部分を「…」で表示 */
        max-width: calc(100% - 140px); /* 画像の隣に並べるため、タイトルの最大幅を制限 */
    }

    .article-list-date {
        display: none;
    }
}

@media (max-width: 768px) {
    header {
        padding-left: 20px;
    }

    header h1 {
        max-width: 70%;
    }

    .categories, .tags {                
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        padding: 5px 15px;
        margin-top: 10px;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 20px;
    }
 
    #image-garally {
        float: none;
    }

    .comic-container {
        max-width: 100%;
    }

    .footer-content {
        display: block;
    }

    .footer-content > p {
        text-align: left;
        margin: 1em;
    }
}
