/*
Theme Name: QueenDojin
Description: M男漫画レビュー館 ～女性優位同人専門～
Version: 1.0
*/

/* ===== リセット・基本 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif; font-size: 14px; color: #222; background: #f5f5f5; }
a { color: #c0392b; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== レイアウト ===== */
.container { max-width: 1300px; margin: 0 auto; padding: 0 16px; }
.layout { display: flex; gap: 24px; padding: 24px 0; align-items: flex-start; }
.main-col { flex: 1; min-width: 0; }
.sidebar { flex: 0 0 260px; max-width: 260px; min-width: 0; overflow: hidden; }

/* ===== ヘッダー ===== */
header { background: #1a1a2e; color: #fff; padding: 12px 0; }
.header-inner { display: flex; align-items: center; gap: 16px; }
.site-title { font-size: 18px; font-weight: bold; color: #fff; }
.site-title a { color: #fff; }
.site-title span { font-size: 12px; color: #aaa; display: block; }
.header-search { margin-left: auto; display: flex; gap: 8px; }
.header-search input { padding: 6px 10px; border-radius: 4px; border: none; width: 200px; }
.header-search button { padding: 6px 12px; background: #c0392b; color: #fff; border: none; border-radius: 4px; cursor: pointer; }

/* ===== カテゴリボタン ===== */
.category-nav { background: #fff; border-bottom: 2px solid #e0e0e0; padding: 10px 0; }
.category-nav .container { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-btn { padding: 7px 16px; background: #f0f0f0; border-radius: 20px; font-size: 13px; color: #333; font-weight: bold; transition: background 0.2s; }
.cat-btn:hover, .cat-btn.active { background: #c0392b; color: #fff; text-decoration: none; }

/* ===== セクションタイトル ===== */
.section-title { font-size: 16px; font-weight: bold; border-left: 4px solid #c0392b; padding-left: 10px; margin-bottom: 16px; }

/* ===== 記事カード（横並び・トップ・タグページ共通）===== */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  position: relative;
}
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.18); }

/* stretched-link：タイトルのaをカード全面クリック領域に拡張 */
.stretched-link::after { content: ''; position: absolute; inset: 0; z-index: 0; }
.stretched-link { color: inherit; text-decoration: none; }
.stretched-link:hover { color: inherit; text-decoration: none; }

/* タグはstretched-linkの前面に出す */
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; position: relative; z-index: 1; }

/* サムネ：左固定・横長16:9・幅30% */
.card-thumb { width: 30%; flex-shrink: 0; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/9; display: block; }
.card-thumb .thumb-placeholder {
  background: linear-gradient(135deg, #2c2c54, #474787);
  width: 100%;
  height: 100%;
  min-height: 120px;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
}

/* テキストエリア */
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.card-summary { font-size: 18px; color: #222; line-height: 1.6; font-weight: bold; }
.card-detail { font-size: 15px; color: #555; line-height: 1.7; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
span.tag, a.tag { font-size: 11px; background: #f0f0f0; color: #555; padding: 2px 6px; border-radius: 3px; text-decoration: none; display: inline-block; position: relative; z-index: 1; }
.card-tags a.tag:hover { background: #c0392b; color: #fff; text-decoration: none; }
.card-title { font-size: 14px; font-weight: bold; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: auto; padding-top: 4px; }
.card-meta { font-size: 11px; color: #999; }
.card-date { font-size: 11px; color: #aaa; text-align: right; }

/* ===== サイドバー ===== */
.sidebar-block { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ランキングリスト（サムネあり） */
.ranking-list-thumb { list-style: none; }
.ranking-list-thumb li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; align-items: flex-start; }
.ranking-list-thumb li:last-child { border-bottom: none; }
.rank-thumb-img { width: 40px; flex-shrink: 0; }
.rank-thumb-img img { width: 40px; aspect-ratio: 3/4; object-fit: cover; border-radius: 3px; display: block; }
.rank-thumb-img .thumb-placeholder {
  width: 40px;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #2c2c54, #474787);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 8px;
  border-radius: 3px;
}
.rank-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rank-info .rank-num { font-size: 11px; font-weight: bold; color: #c0392b; }
.rank-info .rank-title { font-size: 12px; line-height: 1.4; }
.rank-info .rank-tags { display: flex; gap: 3px; flex-wrap: wrap; }

/* タグクラウド */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a { font-size: 12px; background: #f0f0f0; color: #444; padding: 4px 8px; border-radius: 12px; }
.tag-cloud a:hover { background: #c0392b; color: #fff; text-decoration: none; }

/* ===== パンくず ===== */
.breadcrumb { font-size: 12px; color: #888; padding: 10px 0; }
.breadcrumb a { color: #888; }
.breadcrumb span { margin: 0 4px; }

/* ===== タグページヘッダー ===== */
.tag-header { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.tag-header h1 { font-size: 22px; margin-bottom: 8px; }
.tag-header .tag-desc { font-size: 13px; color: #555; line-height: 1.7; margin-bottom: 12px; }
.tag-header-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tag-header-row h1, .tag-header-row h2 { flex: 1; margin: 0; font-size: 18px; }
.tag-meta { display: flex; gap: 16px; align-items: center; }
.tag-count { font-size: 13px; color: #888; white-space: nowrap; }
.sort-btns { display: flex; gap: 6px; }
.sort-btn { padding: 5px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; cursor: pointer; background: #fff; color: #333; }
.sort-btn.active { background: #c0392b; color: #fff; border-color: #c0392b; }

/* ===== 記事ページ ===== */
.article-wrap { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.article-title { font-size: 22px; font-weight: bold; line-height: 1.4; margin-bottom: 16px; }

/* 作品情報テーブル */
.work-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.work-table th { background: #f8f8f8; padding: 8px 12px; text-align: left; white-space: nowrap; width: 100px; border: 1px solid #e0e0e0; color: #555; }
.work-table td { padding: 8px 12px; border: 1px solid #e0e0e0; line-height: 1.5; }

/* 優先タグバッジ（えっちポイント内ジャンル行） */
.highlights-genre { margin-top: 12px; padding-top: 10px; border-top: 1px solid #f5c6c6; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.highlights-genre-label { font-size: 12px; color: #888; }
.priority-tag-badge { background: #c0392b; color: #fff; font-size: 12px; font-weight: bold; padding: 4px 10px; border-radius: 20px; text-decoration: none; }
.priority-tag-badge:hover { background: #a93226; color: #fff; text-decoration: none; }

/* えっちポイント */
.highlights-block { background: #fff5f5; border: 2px solid #e74c3c; border-radius: 8px; padding: 16px 20px; margin-bottom: 24px; }
.highlights-title { font-size: 17px; font-weight: bold; color: #c0392b; margin-bottom: 10px; }
.highlights-list { margin: 0; padding: 0 0 0 20px; }
.highlights-list li { font-size: 17px; font-weight: bold; line-height: 1.8; margin-bottom: 6px; color: #333; }

/* 説明文 */
.summary-text { font-size: 14px; line-height: 1.8; color: #444; background: #fafafa; padding: 14px; border-radius: 6px; border-left: 3px solid #c0392b; margin-bottom: 20px; }
.detail-text { font-size: 16px; line-height: 1.75; color: #333; margin-bottom: 20px; }
.detail-text p { margin-bottom: 12px; }
.detail-text h3 { font-size: 18px; font-weight: bold; border-left: 3px solid #c0392b; padding-left: 10px; margin: 20px 0 8px; color: #222; }

/* タグ語句ハイライト（1段階：普通の強調） */
.tag-hl { color: #e91e8c; font-weight: bold; font-size: 1.25em; }
/* 2段階：YAMLに複数登録された重要ワード */
.tag-hl .tag-hl { font-size: 1.2em; }

/* Rinker購入ブロック */
.rinker-block { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; margin: 24px 0; text-align: center; }
.rinker-cover { width: 350px; margin: 0 auto 10px; display: block; border-radius: 4px; }
.sidebar-rinker .rinker-cover { width: 200px; }
.rinker-title { font-weight: bold; font-size: 13px; color: #333; line-height: 1.4; margin-bottom: 4px; }
.rinker-author { font-size: 12px; color: #888; margin-bottom: 12px; }
.rinker-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sidebar-rinker .rinker-btns { grid-template-columns: 1fr; }
.rinker-btn { display: flex; justify-content: space-between; align-items: center; padding: 26px 14px; border-radius: 6px; font-weight: bold; font-size: 18px; text-decoration: none; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.rinker-btn:hover { opacity: 0.85; text-decoration: none; color: #fff; }
.rinker-btn.fanza  { background: #e74c3c; }
.rinker-btn.dlsite { background: #e67e22; }

/* 購入ボタン（本文内・2枚横並び） */
.buy-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.buy-img-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
}
.buy-img-link:hover { box-shadow: 0 4px 14px rgba(0,0,0,.25); transform: translateY(-2px); text-decoration: none; }
.buy-img-cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.buy-img-label { text-align: center; padding: 10px 6px; font-weight: bold; font-size: 14px; color: #fff; }
.buy-img-label.fanza  { background: #e74c3c; }
.buy-img-label.dlsite { background: #e67e22; }

/* サンプル画像グリッド */
.sample-grid-2 { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.all-samples { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.sample-grid-2 img, .all-samples img { width: 100%; border-radius: 6px; display: block; }
/* 記事ページ：サンプル画像縦並び */
.sample-images { display: flex; flex-direction: column; gap: 24px; margin: 20px 0; }
.sample-images img { width: 100%; border-radius: 6px; display: block; box-shadow: 0 0 0 1px #222; }

/* ===== サイドバー購入ボタン（記事ページ専用・表紙1枚＋縦2段）===== */
.sidebar-buy-cover { width: 100%; margin-bottom: 10px; border-radius: 6px; overflow: hidden; }
.sidebar-buy-cover img { width: 100%; display: block; aspect-ratio: 3/4; object-fit: cover; }
.sidebar-buy-btn {
  display: block;
  text-align: center;
  padding: 10px 6px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  color: #fff;
  margin-bottom: 8px;
  transition: opacity 0.2s;
}
.sidebar-buy-btn:hover { opacity: 0.85; text-decoration: none; color: #fff; }
.sidebar-buy-btn.fanza  { background: #e67e22; }
.sidebar-buy-btn.dlsite { background: #e74c3c; }

/* ===== 関連記事（6列グリッド）===== */
.related-section { margin-bottom: 28px; }
.related-section-title { font-size: 13px; font-weight: bold; color: #888; margin-bottom: 10px; padding-left: 8px; border-left: 3px solid #ddd; }
.related-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.related-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: box-shadow 0.2s;
}
.related-card:hover { box-shadow: 0 3px 8px rgba(0,0,0,.18); text-decoration: none; color: inherit; }
.related-card .rel-thumb img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.related-card .rel-body { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.related-card .rel-title { font-size: 11px; font-weight: bold; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.related-card .rel-excerpt { font-size: 10px; color: #666; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.related-card .rel-tags { display: flex; gap: 3px; flex-wrap: wrap; }
.related-card .rel-price { font-size: 10px; color: #999; }

/* 記事タグ一覧 */
.article-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.article-tags a { font-size: 12px; background: #f0f0f0; color: #555; padding: 3px 8px; border-radius: 3px; }
.article-tags a:hover { background: #c0392b; color: #fff; text-decoration: none; }

/* 記事ページサイドバー */
.sticky-sidebar { position: sticky; top: 16px; }

/* ===== フッター ===== */
footer { background: #1a1a2e; color: #aaa; text-align: center; padding: 20px; font-size: 12px; margin-top: 40px; }
footer a { color: #ccc; margin: 0 8px; }

/* ===== ページネーション ===== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span { padding: 7px 13px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.pagination span.current { background: #c0392b; color: #fff; border-color: #c0392b; }

/* ===== PC版：記事ページ固有 ===== */
@media (min-width: 769px) {
  .article-wrap .sample-grid-2 img,
  .article-wrap .all-samples img { max-width: 600px; margin-left: auto; margin-right: auto; }
  .main-col .buy-pair { max-width: 260px; margin-left: auto; margin-right: auto; }
}

/* ===== ハンバーガーメニュー ===== */
.hamburger { display: none; }

/* ===== モバイル検索ボックス（PC非表示・@media より前に定義すること）===== */
.mobile-search { display: none; }

/* ===== モバイル ===== */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .header-search { display: none; }

  header { padding: 8px 0; }
  .site-title { font-size: 14px; }
  .site-title span { display: none; }

  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    flex-shrink: 0;
  }
  .hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
  }
  .hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.active span:nth-child(2) { opacity: 0; }
  .hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .category-nav { display: none; }
  .category-nav.nav-open { display: block; }
  .category-nav.nav-open .container { flex-wrap: wrap; overflow-x: visible; padding-bottom: 0; }

  .card-grid { gap: 14px; }
  .card { flex-direction: column; }
  .card-thumb { width: 100%; }
  .card-thumb img { width: 100%; aspect-ratio: 2/1; height: auto; object-fit: contain; background: linear-gradient(135deg, #1a1a2e, #2c2c54); }
  .card-body { padding: 10px 12px 12px; gap: 6px; }
  .card-summary { font-size: 15px; }
  .card-detail { font-size: 13px; -webkit-line-clamp: 3; }

  .related-grid { grid-template-columns: repeat(3, 1fr); }

  .tag-header { padding: 10px 14px; margin-bottom: 12px; }
  .tag-header h1, .tag-header h2 { font-size: 16px; margin-bottom: 6px; }
  .tag-header .tag-desc { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tag-meta { gap: 8px; }
  .sort-btn { padding: 4px 10px; font-size: 11px; }

  .category-nav .container { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .cat-btn { white-space: nowrap; flex-shrink: 0; }

  /* --- 記事ページ --- */
  .article-wrap { padding: 12px; }
  .sample-images { margin-left: -12px; margin-right: -12px; }
  .sample-images img { border-radius: 0; }
  .article-title { font-size: 17px; line-height: 1.45; margin-bottom: 12px; }

  /* 作品情報テーブル */
  .work-table th { width: 72px; padding: 6px 8px; font-size: 12px; }
  .work-table td { padding: 6px 8px; font-size: 12px; }

  /* Rinkerブロック：SP は2列横並び・画像小・サイドバー非表示 */
  .rinker-btns { grid-template-columns: 1fr 1fr; }
  .rinker-cover { width: 200px; }
  .sidebar-rinker { display: none; }

  /* 概要・本文 */
  .summary-text { font-size: 13px; padding: 10px 12px; }
  .detail-text { font-size: 15px; line-height: 1.7; }
  .detail-text p { margin-bottom: 14px; }
  .detail-text h3 { font-size: 17px; margin: 16px 0 8px; }

  /* 購入ボタン画像：モバイルはさらに横長に */
  .buy-img-cover img { aspect-ratio: 2/1; }

  /* サイドバー購入ブロック（本文内に同じボタンがあるため非表示） */
  .sidebar .sidebar-block { display: none; }

  /* 関連記事：2カラムに変更（3列は小さすぎて潰れる） */
  .related-grid { grid-template-columns: repeat(2, 1fr); }

  /* モバイル検索ボックス */
  .mobile-search { display: block; background: #0f0f1e; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); width: 100%; overflow: hidden; }
  .mobile-search .search-form { display: flex; align-items: center; background: rgba(255,255,255,0.1); border-radius: 24px; overflow: hidden; border: 1px solid rgba(255,255,255,0.18); }
  .mobile-search .search-form label { flex: 1; min-width: 0; display: flex; align-items: center; }
  .mobile-search .search-field { flex: 1; min-width: 0; padding: 10px 16px; background: transparent; border: none; color: #fff; font-size: 15px; outline: none; width: 100%; }
  .mobile-search .search-field::placeholder { color: rgba(255,255,255,0.45); }
  .mobile-search .search-submit { padding: 10px 18px; background: #c0392b; color: #fff; border: none; font-size: 14px; cursor: pointer; white-space: nowrap; border-radius: 0 24px 24px 0; flex-shrink: 0; }
  .mobile-search .search-submit:active { background: #a93226; }
}

/* ===== フッター カテゴリナビ ===== */
.footer-cat-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px; margin-bottom: 16px; }
.footer-cat-nav a { color: #ccc; font-size: 13px; }
.footer-cat-nav a:hover { color: #fff; text-decoration: none; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 8px; }
.footer-links a { color: #aaa; font-size: 12px; }

/* ===== Twitter共有ボタン ===== */
.share-btn-wrap { margin: 16px 0; text-align: center; }
.share-btn { display: inline-block; padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: bold; text-decoration: none; transition: opacity .2s; }
.share-btn:hover { opacity: .85; text-decoration: none; }
.share-btn-twitter { background: #000; color: #fff; }
