@charset "UTF-8";

/* 変数定義（デザインシステム） */
:root {
    --primary-color: #333;
    /* Gunpla.inのような落ち着いた黒系 */
    --accent-color: #e53935;
    /* ガンダムっぽい赤をアクセントに */
    --text-color: #4a4a4a;
    --text-light: #888;
    --bg-color: #f7f9fa;
    /* うっすらグレーの背景 */
    --border-color: #e0e0e0;
    --white: #ffffff;
    --content-width: 1100px;
}

/* ベーススタイル */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    letter-spacing: 0.03em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

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

/* ヘッダー */
.site-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: var(--primary-color);
}

.global-nav ul {
    display: flex;
    gap: 30px;
}

.global-nav a {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
}

.global-nav a:hover {
    color: var(--accent-color);
}

/* メインビジュアル（検索導線） */
.main-visual {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 20px;
    text-align: center;
    /* 背景画像を後で追加する想定 */
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/bg-placeholder.jpg');
    background-size: cover;
    background-position: center;
}

.main-visual-content h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.main-visual-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-search-large {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background-color 0.2s;
}

.btn-search-large:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    color: var(--white);
}

/* 2カラムレイアウト */
.container {
    max-width: var(--content-width);
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 40px;
}

.main-content {
    flex: 1;
}

.sidebar {
    width: 300px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

/* セクションタイトル */
.section-title {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.section-title span {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: normal;
}

/* ブログカードリスト */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.blog-card {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.blog-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.blog-meta {
    font-size: 0.85rem;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.date {
    color: var(--text-light);
}

.category {
    color: var(--accent-color);
    font-weight: 700;
}

.blog-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.pagination a,
.pagination span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.pagination .page-current {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination a:hover:not(.page-current) {
    background: var(--bg-color);
}

/* サイドバーウィジェット */
.widget {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.widget-list li {
    margin-bottom: 10px;
}

.widget-list li:last-child {
    margin-bottom: 0;
}

.widget-list a {
    display: block;
    padding: 5px 0;
}

/* フッター */
.site-footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

/* レスポンシブ対応 (スマホ向け) */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .global-nav ul {
        display: none;
        /* スマホ用ハンバーガーメニューは後日実装 */
    }
}

/* --- ここから下層ページ用（search.html, list.html, detail.html）のスタイル追記 --- */

/* ページタイトルエリア */
.page-title-area {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
}

.page-title-inner h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* ジャンル検索リスト */
.search-section {
    margin-bottom: 40px;
}

.genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.genre-list li {
    width: calc(33.333% - 10px);
    display: flex;
    /* 追加: aタグの高さを揃えるため */
}

.genre-list a {
    display: flex;
    /* 追加: 中央揃えのため */
    align-items: center;
    /* 追加: テキストの垂直中央揃え */
    justify-content: center;
    /* 追加: テキストの水平中央揃え */
    width: 100%;
    /* 追加: 親サイズに追従 */
    height: 100%;
    /* 追加: 親サイズに追従 */
    padding: 15px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    transition: all 0.2s;
}

.genre-list a:hover {
    background: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}

/* パンくずリスト */
.breadcrumb {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    font-size: 0.85rem;
}

.breadcrumb-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 20px;
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

/* 1カラムレイアウト（一覧・詳細用） */
.container-full {
    flex-direction: column;
}

.main-content-full {
    width: 100%;
}

/* 検索結果ヘッダー */
.search-result-count {
    margin-bottom: 20px;
    color: var(--text-light);
}

/* ガンプラカードグリッド（一覧画面） */
.gunpla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.gunpla-card {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gunpla-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.gunpla-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #eee;
    /* 画像がない場合のプレースホルダー色 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.gunpla-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* パッケージ画像を綺麗に入れるため */
}

.gunpla-card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.gunpla-info-main {
    margin-bottom: 15px;
}

.gunpla-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    align-items: center;
}

.badge {
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--white);
    font-weight: bold;
}

.grade-hg {
    background-color: #4CAF50;
}

.grade-mg {
    background-color: #2196F3;
}

.grade-rg {
    background-color: #FF9800;
}

.grade-pg {
    background-color: #9C27B0;
}

.grade-sd {
    background-color: #FBC02D;
    color: #333;
}

.scale,
.series {
    color: var(--text-color);
}

.gunpla-name {
    font-size: calc(1.1rem - 2pt);
    margin-bottom: 10px;
    line-height: 1.4;
}

.release-date {
    font-size: 0.85rem;
    color: var(--text-color);
}

.series-name {
    font-size: 0.85rem;
    color: var(--text-color);
    margin-top: 2px;
}

.gunpla-price-action {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px dotted var(--border-color);
    padding-top: 10px;
}

.price-date {
    font-size: calc(1.15em - 2pt);
    color: var(--accent-color);
    font-weight: bold;
}

.btn-detail-link {
    display: block;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-detail-link:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* ガンプラ詳細画面 */
.product-detail-container {
    max-width: 900px;
}

.product-header {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.product-gallery {
    width: 40%;
}

.product-image-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    margin-bottom: 10px;
}

.product-info {
    width: 60%;
}

.product-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.product-specs {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.product-specs th,
.product-specs td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.product-specs th {
    width: 30%;
    background-color: var(--bg-color);
    font-weight: normal;
    color: var(--text-light);
}

/* アフィリエイトボタンまわり */
.affiliate-links {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 5px;
}

.affiliate-label {
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.affiliate-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-aff {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    color: var(--white);
    font-weight: bold;
    font-size: 0.95rem;
}

.btn-aff:hover {
    color: var(--white);
    opacity: 0.9;
}

.btn-amazon {
    background-color: #FF9900;
}

.btn-rakuten {
    background-color: #BF0000;
}

.btn-yahoo {
    background-color: #FF0033;
}

.btn-amiami {
    background-color: #00A0E9;
}

.btn-auctions {
    background-color: #FDCA00;
    color: #333;
}

.product-description {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.product-description h3 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* スマホ対応（下層用） */
@media (max-width: 768px) {
    .genre-list li {
        width: calc(50% - 7.5px);
    }

    .product-header {
        flex-direction: column;
    }

    .product-gallery,
    .product-info {
        width: 100%;
    }

    .product-title {
        font-size: 1.4rem;
    }
}

/* 一覧表示切り替え（タイル・リスト） */
.view-toggle {
    display: flex;
    gap: 5px;
}

.btn-toggle {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0;
    /* テキストノードがある場合に隠す */
    color: var(--text-color);
    border-radius: 3px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle svg {
    pointer-events: none;
    /* SVG内部でのクリックイベントを防ぐ */
}

.btn-toggle:hover {
    background: var(--bg-color);
}

.btn-toggle.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* リスト表示スタイル (JavaScriptで付与されるクラス) */
.gunpla-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gunpla-grid.list-view .gunpla-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.gunpla-grid.list-view .gunpla-card-image {
    width: 180px;
    height: auto;
    min-height: 180px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    background: var(--white);
    padding: 10px;
}

.gunpla-grid.list-view .gunpla-card-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    padding: 0;
}

.gunpla-grid.list-view .gunpla-info-main {
    flex: 1;
    padding: 20px;
    margin-bottom: 0;
}

.gunpla-grid.list-view .gunpla-name {
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.gunpla-grid.list-view .gunpla-meta {
    margin-bottom: 15px;
}

.gunpla-grid.list-view .gunpla-price-action {
    width: 200px;
    flex-shrink: 0;
    border-top: none;
    border-left: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    background: #fafafa;
}

.gunpla-grid.list-view .price-date {
    font-size: 1.3em;
    text-align: center;
}

.gunpla-grid.list-view .btn-detail-link {
    background: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}

.gunpla-grid.list-view .btn-detail-link:hover {
    background: #d32f2f;
}

@media (max-width: 768px) {

    /* スマホの場合は縦積みに調整するか、画像サイズを大幅縮小 */
    .gunpla-grid.list-view .gunpla-card-image {
        width: 120px;
        min-height: 120px;
        padding: 5px;
    }

    .gunpla-grid.list-view .gunpla-card-body {
        flex-direction: column;
    }

    .gunpla-grid.list-view .gunpla-info-main {
        padding: 15px;
    }

    .gunpla-grid.list-view .gunpla-price-action {
        width: 100%;
        border-left: none;
        border-top: 1px dotted var(--border-color);
        padding: 15px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .gunpla-grid.list-view .price-date {
        text-align: left;
    }

    .gunpla-grid.list-view .btn-detail-link {
        padding: 8px 15px;
    }
}

/* =========================================
   ブログ一覧ページ (タイル / リスト 切替)
========================================= */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* タイル表示時のブログカード */
.blog-grid .blog-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.blog-grid .blog-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.blog-grid .blog-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f5f5f5;
    overflow: hidden;
}

.blog-grid .blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-grid .blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-grid .blog-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-grid .blog-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-grid .blog-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    flex: 1;
}

/* リスト表示時のブログカード */
.blog-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog-grid.list-view .blog-card {
    flex-direction: row;
    align-items: stretch;
}

.blog-grid.list-view .blog-card-image {
    width: 280px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
}

/* メディアクエリ (スマホ対応) */
@media (max-width: 768px) {
    .blog-grid.list-view .blog-card {
        flex-direction: column;
    }

    .blog-grid.list-view .blog-card-image {
        width: 100%;
    }
}

/* =========================================
   ブログ詳細用 (Markdown出力スタイル)
========================================= */
.blog-detail-card {
    background: var(--white);
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.blog-header {
    padding: 30px 30px 10px;
}

.blog-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.blog-meta .category {
    color: var(--accent-color);
    font-weight: bold;
}

/* アイキャッチ画像 */
.blog-hero {
    width: 100%;
    margin-bottom: 20px;
}

.blog-hero img.hero-image {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-content {
    padding: 20px 30px 40px;
    line-height: 1.8;
}

/* markdownの基本スタイル強化 */
.blog-content h1 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 30px;
    line-height: 1.4;
    border-bottom: none;
}

/* ★ 参考サイト風 H2（ステッチ風リボンデザイン） */
.blog-content h2 {
    font-size: 1.4rem;
    margin: 40px -30px 20px -30px;
    /* 親のpaddingを打ち消して左右幅いっぱいに */
    padding: 15px 30px;
    background-color: var(--primary-color);
    color: var(--white);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* 実線と点線を組み合わせるステッチ風ボーダー */
    border-top: solid 2px var(--primary-color);
    border-bottom: solid 2px var(--primary-color);
    /* 内側の見せかけボーダー（点線） */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.blog-content h2::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px dashed rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

/* ★ 参考サイト風 H3（左・下線） */
.blog-content h3 {
    font-size: 1.2rem;
    margin: 30px 0 15px;
    padding: 10px 15px;
    border-left: 5px solid var(--primary-color);
    border-bottom: 1px solid #ddd;
    background-color: #f9f9f9;
}

/* 目次 (TOC) スタイル */
.blog-content .toc {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    margin: 30px 0;
}

.blog-content .toc .toctitle {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.blog-content .toc ul {
    list-style-type: decimal;
    margin-left: 20px;
    margin-bottom: 0;
}

.blog-content .toc ul li {
    margin-bottom: 8px;
}

.blog-content .toc ul li a {
    color: var(--primary-color);
    text-decoration: none;
}

.blog-content .toc ul li a:hover {
    text-decoration: underline;
}

.blog-content p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.blog-content strong {
    background: linear-gradient(transparent 60%, #ffe082 0);
    font-weight: bold;
}

.blog-content ul,
.blog-content ol {
    margin: 0 0 20px 20px;
    padding-left: 20px;
}

.blog-content li {
    margin-bottom: 10px;
}