/**
 * パンチラ画像カテゴリ一覧（upskirt-categories）スタイル
 */

.snaf-category-catalog {
    margin: 1.5em 0 3em;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

/* ヘッダー・導入文 */
.snaf-category-catalog .catalog-header {
    margin-bottom: 2em;
    padding: 1.2em 1.5em;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ff4d4d;
}

.snaf-category-catalog .catalog-lead {
    margin: 0 0 0.8em 0;
    font-size: 0.95em;
    line-height: 1.7;
    color: #444;
}

.snaf-category-catalog .catalog-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #666;
    background: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.snaf-category-catalog .catalog-summary-badge strong {
    color: #ff4d4d;
    font-size: 1.1em;
}

.snaf-category-catalog .catalog-summary-badge .sep {
    color: #cbd5e1;
}

/* ① 上部クイック目次（ピル型） */
.snaf-category-catalog .catalog-quick-nav {
    margin-bottom: 2.5em;
    padding: 1.2em;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.snaf-category-catalog .quick-nav-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.8em;
}

.snaf-category-catalog .quick-nav-title {
    font-weight: bold;
    font-size: 1.05em;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.snaf-category-catalog .quick-nav-hint {
    font-size: 0.8em;
    color: #64748b;
}

/* 親カテゴリ（ジャンル）ごとの行分割レイアウト */
.snaf-category-catalog .catalog-genre-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0.8em;
}

.snaf-category-catalog .catalog-genre-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e8f0;
}

.snaf-category-catalog .catalog-genre-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.snaf-category-catalog .genre-row-header {
    flex: 0 0 140px;
    max-width: 140px;
}

.snaf-category-catalog .catalog-genre-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    gap: 6px;
    padding: 5px 10px;
    background: #f8fafc;
    color: #1e293b;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
}

.snaf-category-catalog .catalog-genre-pill:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    text-decoration: none;
    transform: translateY(-1px);
}

.snaf-category-catalog .catalog-genre-pill .pill-count {
    display: inline-block;
    padding: 1px 6px;
    background: #e2e8f0;
    color: #475569;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
}

.snaf-category-catalog .catalog-genre-pill:hover .pill-count {
    background: #ef4444;
    color: #fff;
}

.snaf-category-catalog .genre-row-scroll-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.snaf-category-catalog .genre-row-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* スクロールバー */
.snaf-category-catalog .genre-row-scroll::-webkit-scrollbar {
    height: 4px;
}

.snaf-category-catalog .genre-row-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.snaf-category-catalog .genre-row-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.snaf-category-catalog .genre-row-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.snaf-category-catalog .catalog-cat-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85em;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.snaf-category-catalog .catalog-cat-pill:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.snaf-category-catalog .catalog-cat-pill .pill-cat-name {
    font-weight: 500;
}

.snaf-category-catalog .catalog-cat-pill .pill-cat-count {
    display: inline-block;
    padding: 1px 5px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 8px;
    font-size: 0.75em;
}

.snaf-category-catalog .catalog-cat-pill:hover .pill-cat-count {
    background: #fee2e2;
    color: #dc2626;
}

/* スマホ表示の最適化（縦並び＋横スクロール） */
@media (max-width: 680px) {
    .snaf-category-catalog .catalog-genre-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding-bottom: 8px;
    }

    .snaf-category-catalog .genre-row-header {
        flex: none;
        max-width: 100%;
        width: auto;
    }

    .snaf-category-catalog .genre-row-scroll-wrapper {
        width: 100%;
    }
}

/* アンカーのオフセット（サムネイルの最上部に合わせる） */
.snaf-category-catalog .catalog-cat-anchor {
    display: block;
    position: absolute;
    top: -24px;
    left: 0;
    width: 0;
    height: 0;
    visibility: hidden;
    pointer-events: none;
    scroll-margin-top: 24px;
}

/* ② 大枠セクション */
.snaf-category-catalog .catalog-group-section {
    margin-bottom: 3.5em;
    scroll-margin-top: 20px;
}

.snaf-category-catalog .catalog-group-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.2em;
    padding-bottom: 0.6em;
    border-bottom: 2px solid #e2e8f0;
}

.snaf-category-catalog .group-title {
    margin: 0;
    font-size: 1.35em;
    font-weight: bold;
    color: #0f172a;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.snaf-category-catalog .group-title .group-icon {
    font-size: 1.1em;
}

.snaf-category-catalog .group-title small {
    font-size: 0.65em;
    font-weight: normal;
    color: #64748b;
}

.snaf-category-catalog .back-to-top-btn {
    font-size: 0.85em;
    color: #64748b;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    white-space: nowrap;
    transition: all 0.2s;
}

.snaf-category-catalog .back-to-top-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ③ snaf_posts (grid-article) 統合 & カード下部カテゴリ直通ボタン */
.snaf-category-catalog .catalog-posts-wrapper {
    margin-top: 1em;
}

.snaf-category-catalog .catalog-posts-wrapper .snaf-grid-article,
.snaf-category-catalog .catalog-grid-articles {
    gap: 40px 2%;
}

.snaf-category-catalog .catalog-posts-wrapper .snaf-grid-article-item {
    position: relative;
    display: flex;
    flex-direction: column;
}

.snaf-category-catalog .catalog-posts-wrapper .snaf-grid-article-item .a-wrap {
    flex: 1;
}

.snaf-category-catalog .catalog-card-cat-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #1e293b;
    font-size: 0.88em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.snaf-category-catalog .catalog-card-cat-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    text-decoration: none;
}

.snaf-category-catalog .catalog-card-cat-btn .btn-icon {
    font-size: 1.1em;
    line-height: 1;
}

.snaf-category-catalog .catalog-card-cat-btn .btn-text strong {
    color: #dc2626;
}

.snaf-category-catalog .catalog-card-cat-btn .btn-count {
    color: #64748b;
    font-size: 0.85em;
    margin-left: 2px;
}

.snaf-category-catalog .catalog-card-cat-btn .btn-arrow {
    margin-left: auto;
    font-weight: bold;
    color: #dc2626;
    transition: transform 0.2s;
}

.snaf-category-catalog .catalog-card-cat-btn:hover .btn-arrow {
    transform: translateX(3px);
}


/* フッター用スタイル */
.snaf-footer-catalog-nav {
    margin: 1.5em 0;
    padding-top: 1.5em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.snaf-footer-catalog-nav .footer-catalog-title {
    font-size: 1.1em;
    margin-bottom: 1em;
}

.snaf-footer-catalog-nav .footer-catalog-title a {
    color: inherit;
    text-decoration: none;
}

.snaf-footer-catalog-nav .footer-catalog-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.snaf-footer-catalog-nav .footer-group-name {
    font-size: 0.95em;
    font-weight: bold;
    margin-bottom: 0.6em;
    color: inherit;
    opacity: 0.9;
}

.snaf-footer-catalog-nav .footer-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.snaf-footer-catalog-nav .footer-category-list li {
    margin-bottom: 0.4em;
    font-size: 0.85em;
}

.snaf-footer-catalog-nav .footer-category-list a {
    color: inherit;
    opacity: 0.75;
    text-decoration: none;
    transition: opacity 0.2s;
}

.snaf-footer-catalog-nav .footer-category-list a:hover {
    opacity: 1;
    text-decoration: underline;
}

.snaf-footer-catalog-nav .footer-category-list .count {
    font-size: 0.8em;
    opacity: 0.6;
    margin-left: 3px;
}

/* 冒頭ガイドアコーディオン（初めての方へ） */
.snaf-catalog-hub .snaf-hub-guide-accordion {
    margin-bottom: 2em;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.snaf-catalog-hub .snaf-hub-guide-accordion[open] {
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.snaf-catalog-hub .snaf-hub-guide-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: #475569;
    user-select: none;
    list-style: none; /* デフォルトの矢印を非表示 */
}

.snaf-catalog-hub .snaf-hub-guide-summary::-webkit-details-marker {
    display: none;
}

.snaf-catalog-hub .snaf-hub-guide-summary:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.snaf-catalog-hub .snaf-hub-guide-summary .guide-icon {
    font-size: 1.1em;
}

.snaf-catalog-hub .snaf-hub-guide-summary .guide-title {
    flex: 1;
}

.snaf-catalog-hub .snaf-hub-guide-summary .guide-toggle-icon {
    font-size: 0.75em;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.snaf-catalog-hub .snaf-hub-guide-accordion[open] .guide-toggle-icon {
    transform: rotate(180deg);
}

.snaf-catalog-hub .snaf-hub-guide-body {
    padding: 1.2em 1.5em;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9em;
    line-height: 1.7;
    color: #334155;
}

.snaf-catalog-hub .guide-structure-box h4,
.snaf-catalog-hub .guide-links-box h4 {
    margin: 0 0 0.5em 0;
    font-size: 1em;
    color: #1e293b;
}

.snaf-catalog-hub .guide-structure-box p {
    margin: 0 0 0.6em 0;
}

.snaf-catalog-hub .guide-structure-box .guide-qa {
    background: #f8fafc;
    padding: 8px 12px;
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
    margin-bottom: 1.2em;
}

.snaf-catalog-hub .guide-links-box {
    margin-top: 1.2em;
    padding-top: 1.2em;
    border-top: 1px dashed #e2e8f0;
}

.snaf-catalog-hub .snaf-guide-content-links nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0.5em 0 0 0;
}

.snaf-catalog-hub .snaf-guide-content-links nav li {
    margin: 0;
}

.snaf-catalog-hub .snaf-guide-content-links nav a {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #334155;
    font-size: 0.85em;
    text-decoration: none;
    transition: all 0.2s;
}

.snaf-catalog-hub .snaf-guide-content-links nav a:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    text-decoration: none;
}
