/*
Theme Name: 演歌新曲ナビ
Theme URI: https://chinatrend.net
Author: Kaigo Navi
Description: 演歌・歌謡曲CD特化アフィリエイトサイト専用テーマ。SEO最適化・楽天Yahoo!API対応。
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: enka-navi
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro', 'Meiryo', 'メイリオ', sans-serif;
  font-size: 15px; line-height: 1.7; color: #333; background: #f5f8fa;
  overflow-x: hidden; max-width: 100vw;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #0a4a6e; text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: #0a9b6e; color: #fff; padding: 8px 16px; z-index: 9999; font-size: 14px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ===== TOP BAR ===== */
.top-bar { background: #f0f7fa; border-bottom: 1px solid #d0e8f0; color: #4a7a96; font-size: 11px; padding: 5px 0; }
.top-bar .inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; }

/* ===== HEADER ===== */
.site-header { background: #fff; border-bottom: 3px solid #0a9b6e; padding: 12px 0; }
.site-header .inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-logo { color: #0a4a6e; font-size: 22px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.site-logo span { font-size: 11px; font-weight: 400; color: #0a9b6e; display: block; letter-spacing: 1px; margin-top: 2px; }
.site-logo:hover { text-decoration: none; color: #0a4a6e; }

/* ===== SEARCH ===== */
.header-search { flex: 1; min-width: 0; }
.header-search form { display: flex; border: 2px solid #0d6b9a; border-radius: 4px; overflow: hidden; }
.header-search input[type=search] { flex: 1; padding: 10px 14px; border: none; font-size: 14px; color: #333; min-width: 0; outline: none; -webkit-appearance: none; }
.header-search button { background: #0a9b6e; color: #fff; border: none; padding: 10px 20px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.header-search button:hover { background: #088a5f; }

/* ===== GLOBAL NAV ===== */
.global-nav { background: #fff; border-bottom: 2px solid #e0eef5; }
.global-nav .inner { max-width: 1100px; margin: 0 auto; padding: 0 8px; display: flex; flex-wrap: wrap; }
.global-nav a { color: #0a4a6e; font-size: 13px; padding: 10px 12px; display: block; white-space: nowrap; border-bottom: 3px solid transparent; font-weight: 500; transition: all 0.15s; }
.global-nav a:hover, .global-nav a.current { border-bottom-color: #0a9b6e; color: #0a9b6e; text-decoration: none; }

/* ===== BREADCRUMB ===== */
.breadcrumb { background: #f0f7fa; border-bottom: 1px solid #d0e8f0; font-size: 12px; padding: 6px 0; }
.breadcrumb .inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.breadcrumb li::after { content: '›'; margin-left: 4px; color: #999; }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb a { color: #0a4a6e; }

/* ===== HERO ===== */
.hero-banner { background: #f0faf6; border-bottom: 2px solid #a8dfc8; padding: 16px 0; }
.hero-banner .inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.hero-banner h2 { font-size: 16px; color: #0a4a6e; font-weight: 700; margin-bottom: 6px; }
.hero-banner p { font-size: 12px; color: #555; margin-bottom: 10px; }
.hero-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.hero-tag { background: #fff; border: 1.5px solid #0a9b6e; color: #0a4a6e; font-size: 12px; padding: 5px 14px; border-radius: 20px; cursor: pointer; font-weight: 500; transition: all 0.15s; }
.hero-tag:hover { background: #0a9b6e; color: #fff; }

/* ===== LAYOUT ===== */
.site-layout { max-width: 1100px; margin: 16px auto; padding: 0 16px; display: flex; gap: 20px; align-items: flex-start; }

/* ===== SIDEBAR ===== */
.sidebar { width: 200px; min-width: 200px; display: flex; flex-direction: column; gap: 0; background: #fff; border: 1px solid #e0eef5; border-radius: 6px; overflow: visible; }
.sidebar-widget-title { background: #0d6b9a; color: #fff; font-size: 12px; font-weight: 700; padding: 8px 14px; border-left: 4px solid #0a9b6e; }
.sidebar ul { padding: 6px 0; }
.sidebar ul li a { display: block; padding: 8px 14px; font-size: 13px; color: #333; border-left: 3px solid transparent; transition: all 0.1s; }
.sidebar ul li a:hover, .sidebar ul li.current-cat a { background: #f0faf6; color: #0a4a6e; border-left-color: #0a9b6e; text-decoration: none; }
.sidebar ul li.has-sub > a { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.sidebar ul li.has-sub > a::after { content: '▶'; font-size: 9px; color: #aaa; transition: transform 0.2s; }
.sidebar ul li.has-sub.open > a::after { transform: rotate(90deg); }
.sidebar ul li.has-sub .sub-list { display: none; padding: 0; margin: 0; max-height: 1000px; overflow-y: auto; }
.sidebar ul li.has-sub.open .sub-list { display: block; }
/* デスクトップ（641px以上）：最初から展開 */
@media(min-width:641px){
  .sidebar ul li.has-sub .sub-list { display: block; }
  .sidebar ul li.has-sub > a::after { transform: rotate(90deg); }
}
/* 検索結果表示時のアーティスト一覧高さ */
.sidebar--search ul li.has-sub .sub-list { max-height: 2500px; overflow-y: auto; }
.sidebar ul li.has-sub .sub-list li a { padding: 6px 14px 6px 24px; font-size: 12px; color: #555; border-left: none; background: #f8f8f8; border-bottom: 1px solid #f0f0f0; }
.sidebar ul li.has-sub .sub-list li a:hover { background: #e8f5ee; color: #0a4a6e; }
.sidebar ul li.has-sub .sub-list li.row-header { padding: 4px 14px; font-size: 10px; font-weight: 700; color: #fff; background: #6ba4c0; letter-spacing: 0.05em; }
.price-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.price-btn { padding: 7px 10px; border: 1px solid #d0e0ea; border-radius: 3px; background: #fff; font-size: 12px; cursor: pointer; text-align: left; color: #444; transition: all 0.1s; }
.price-btn:hover, .price-btn.active { background: #0d6b9a; color: #fff; border-color: #0d6b9a; }
.tag-cloud { padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag-cloud a { background: #f0f7fa; border: 1px solid #d0e0ea; color: #555; font-size: 11px; padding: 3px 8px; border-radius: 3px; }
.tag-cloud a:hover { background: #0a9b6e; color: #fff; border-color: #0a9b6e; text-decoration: none; }

/* ===== MAIN ===== */
.main-content { flex: 1; min-width: 0; }

/* ===== TOOLBAR ===== */
.products-toolbar { background: #fff; border: 1px solid #e0eef5; border-radius: 6px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; width: 100%; box-sizing: border-box; }
.products-toolbar .result-info { flex: 1; min-width: 0; font-size: 13px; color: #666; overflow: hidden; }
.products-toolbar .result-info strong { color: #0a4a6e; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.source-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.source-tab { padding: 5px 12px; font-size: 12px; border: 1px solid #d0e0ea; border-radius: 3px; background: #fff; cursor: pointer; color: #666; transition: all 0.1s; }
.source-tab:hover { border-color: #0a9b6e; color: #0a9b6e; }
.source-tab.active-both { background: #0a4a6e; color: #fff; border-color: #0a4a6e; }
.source-tab.active-rakuten { background: #c0392b; color: #fff; border-color: #c0392b; }
.source-tab.active-yahoo { background: #e67e00; color: #fff; border-color: #e67e00; }
.sort-select { padding: 5px 10px; font-size: 13px; border: 1px solid #d0e0ea; border-radius: 3px; background: #fff; color: #333; cursor: pointer; }

/* ===== PRODUCT GRID ===== */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1px; background: #e0eef5; border: 1px solid #e0eef5; border-radius: 6px; overflow: hidden; width: 100%; box-sizing: border-box; align-items: stretch; }

/* ===== PRODUCT CARD ===== */
.product-card { background: #fff; position: relative; transition: background 0.1s; display: flex; flex-direction: column; height: 100%; }
.product-card:hover { background: #f8fcff; }
.product-card-img { background: #fff; padding: 10px; height: 160px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #f0f5f8; overflow: hidden; }
.product-card-img img { max-width: 100%; max-height: 140px; object-fit: contain; width: 100%; }
.product-card-img a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.badge-source { position: absolute; top: 6px; left: 6px; font-size: 10px; padding: 2px 7px; border-radius: 2px; font-weight: 700; color: #fff; z-index: 1; }
.badge-r { background: #c0392b; }
.badge-y { background: #e67e00; }
.badge-sale { position: absolute; top: 6px; right: 6px; background: #0a9b6e; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 2px; font-weight: 700; }
.product-card-body { padding: 10px; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 12px; line-height: 1.5; color: #333; height: 54px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.product-name a { color: #333; }
.product-name a:hover { color: #0a4a6e; text-decoration: none; }
.product-shop { font-size: 11px; color: #aaa; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-stars { color: #f39c12; font-size: 12px; margin-top: 4px; min-height: 20px; display: block; }
.product-review-count { font-size: 10px; color: #aaa; }
.product-price-wrap { margin-top: 6px; display: flex; align-items: baseline; gap: 4px; }
.product-price { font-size: 18px; font-weight: 700; color: #0a4a6e; }
.product-price-unit { font-size: 11px; color: #aaa; }
.product-btn { display: block; width: 100%; background: #0a9b6e; color: #fff; border: none; padding: 9px; font-size: 13px; font-weight: 700; border-radius: 4px; cursor: pointer; margin-top: 6px; text-align: center; text-decoration: none; transition: background 0.1s; }
.product-btn:hover { background: #088a5f; text-decoration: none; color: #fff; }
.product-btn.yahoo-btn { background: #1a73e8; }
.product-btn.yahoo-btn:hover { background: #1558b0; }

/* ===== LOADING / ERROR ===== */
.loading-state { grid-column: 1 / -1; padding: 60px 20px; text-align: center; background: #fff; color: #999; font-size: 14px; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid #e0eef5; border-top-color: #0a9b6e; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { grid-column: 1 / -1; padding: 40px; text-align: center; background: #fff; color: #c0392b; font-size: 14px; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span { display: block; padding: 8px 14px; border: 1px solid #d0e0ea; border-radius: 3px; font-size: 13px; color: #333; background: #fff; cursor: pointer; transition: all 0.1s; }
.pagination a:hover { background: #f0faf6; border-color: #0a9b6e; color: #0a4a6e; text-decoration: none; }
.pagination .current { background: #0a4a6e; color: #fff; border-color: #0a4a6e; }

/* ===== SEO SECTION ===== */
.seo-section { background: #fff; border: 1px solid #e0eef5; border-radius: 6px; padding: 20px; margin-top: 16px; }
.seo-section h2 { font-size: 18px; color: #0a4a6e; border-left: 4px solid #0a9b6e; padding-left: 10px; margin-bottom: 14px; }
.seo-section h3 { font-size: 15px; color: #0a4a6e; margin: 16px 0 8px; border-bottom: 1px solid #e0eef5; padding-bottom: 4px; }
.seo-section p { font-size: 14px; line-height: 1.8; color: #444; margin-bottom: 10px; }
.seo-section ul { margin: 0 0 10px 20px; list-style: disc; }
.seo-section ul li { font-size: 14px; color: #444; line-height: 1.8; }
.faq-item { border: 1px solid #e0eef5; border-radius: 4px; margin-bottom: 8px; overflow: hidden; }
.faq-q { background: #f0faf6; padding: 12px 14px; font-size: 14px; font-weight: 700; color: #0a4a6e; }
.faq-q::before { content: 'Q. '; }
.faq-a { padding: 12px 14px; font-size: 14px; color: #444; line-height: 1.7; border-top: 1px solid #e0eef5; }
.faq-a::before { content: 'A. '; font-weight: 700; color: #0a4a6e; }

/* ===== FOOTER ===== */
.site-footer { background: #0a4a6e; color: #7fb3cc; font-size: 12px; margin-top: 30px; }
.footer-widgets { max-width: 1100px; margin: 0 auto; padding: 24px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.footer-widget h3 { color: #fff; font-size: 14px; margin-bottom: 10px; border-bottom: 1px solid #1a6a96; padding-bottom: 6px; }
.footer-widget ul li { margin-bottom: 4px; }
.footer-widget ul li a { color: #7fb3cc; }
.footer-widget ul li a:hover { color: #a8dfc8; text-decoration: none; }
.footer-bottom { border-top: 1px solid #1a6a96; text-align: center; padding: 12px 16px; font-size: 11px; color: #5a93b0; }
.footer-bottom a { color: #a8dfc8; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-layout { flex-direction: column; padding: 0 8px; }
  .sidebar { width: 100%; min-width: unset; }
  .main-content { width: 100%; min-width: 0; overflow: hidden; }
  /* minmax(0,1fr)でグリッドセルを強制縮小 */
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .product-card { overflow: hidden; max-width: 100%; }
  .product-card-img { height: 90px; padding: 5px; }
  .product-card-img img { max-height: 78px; width: 100%; }
  .product-card-body { padding: 5px; }
  .product-name { font-size: 10px; height: 40px; line-height: 1.3; }
  .product-shop { display: none; }
  .product-stars { display: none; }
  .product-price { font-size: 12px; }
  .product-price-unit { font-size: 9px; }
  .product-btn { font-size: 10px; padding: 5px 2px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .footer-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 8px; }
  .site-header .inner { padding: 0 8px; gap: 8px; }
  .hero-banner .inner { padding: 0 8px; }
  .breadcrumb .inner { padding: 0 8px; }
  .products-toolbar { padding: 8px; gap: 6px; }
  .source-tab { padding: 4px 8px; font-size: 11px; }
  .sort-select { font-size: 11px; padding: 4px 6px; max-width: 100%; }
}
@media (max-width: 480px) {
  .global-nav a { padding: 8px 10px; font-size: 12px; }
  .article-card-img { aspect-ratio: 4/3; }
}

/* ===== ACCESSIBILITY ===== */
:focus-visible { outline: 2px solid #0a9b6e; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===== ボタン色分け ===== */
.product-btn.amazon-btn { background: #ff9900; color: #111; }
.product-btn.amazon-btn:hover { background: #e68a00; color: #111; }
.badge-source.badge-a { background: #ff9900; color: #111; }
.source-tab.active-amazon { background: #ff9900; color: #111; border-color: #ff9900; }

/* ランキングウィジェット */
.ranking-meta { font-size: 10px; color: #888; padding: 4px 12px 2px; background: #f9f9f9; border-bottom: 1px solid #eee; }
.ranking-list { padding: 0; margin: 0; }
.ranking-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s; }
.ranking-item:hover { background: #f0faf6; }
.rank-num { min-width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: #ccc; color: #fff; flex-shrink: 0; }
.rank-1 { background: #c8a400; font-size: 13px; }
.rank-2 { background: #7c7c7c; }
.rank-3 { background: #9c5a1e; }
.rank-info { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.rank-title { font-size: 12px; font-weight: 600; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-artist { font-size: 11px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-empty { padding: 12px; font-size: 12px; color: #999; text-align: center; line-height: 1.6; }

/* ========== ランキングメインビュー ========== */
.ranking-main-header { display:flex; align-items:center; gap:12px; padding:16px 0 12px; border-bottom:2px solid #0d6b9a; margin-bottom:20px; flex-wrap:wrap; }
.ranking-main-badge { background:#c8a400; color:#fff; font-size:11px; font-weight:700; padding:3px 10px; border-radius:20px; }
.ranking-main-title { font-size:18px; font-weight:700; color:#0a4a6e; margin:0; }
.ranking-main-date { font-size:11px; color:#999; margin-left:auto; }

.ranking-main-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-auto-rows:auto; gap:10px; }
@media(max-width:640px){ .ranking-main-grid { grid-template-columns:minmax(0,1fr) !important; } }

.ranking-main-card { display:flex; align-items:center; gap:10px; background:#fff; border:1px solid #e0eef5; border-radius:8px; padding:12px; transition:box-shadow 0.15s; width:100%; box-sizing:border-box; overflow:hidden; }
.ranking-main-card:hover { box-shadow:0 2px 10px rgba(13,107,154,.12); }
.ranking-main-card.top-1 { border-color:#c8a400; background:#fffdf0; }
.ranking-main-card.top-2 { border-color:#aaa; background:#fafafa; }
.ranking-main-card.top-3 { border-color:#9c5a1e; background:#fdf8f4; }

.rmc-rank { min-width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; color:#fff; flex-shrink:0; }
.rank-badge-1 { background:#c8a400; font-size:16px; min-width:36px; height:36px; }
.rank-badge-2 { background:#7c7c7c; }
.rank-badge-3 { background:#9c5a1e; }
.rank-badge-other { background:#b0c8d8; font-size:12px; }
.rank-badge-4 { background:#27ae8f; }
.rank-badge-5 { background:#2196a0; }
.rank-badge-6 { background:#2970b8; }
.rank-badge-7 { background:#3a5fa8; }
.rank-badge-8 { background:#4a5098; }
.rank-badge-9 { background:#5a4a8a; }
.rank-badge-10 { background:#6a4a7a; }

.rmc-info { flex:1; min-width:0; }
.rmc-title { font-size:13px; font-weight:700; color:#222; margin:0 0 3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rmc-artist { font-size:12px; color:#666; margin:0; }

.rmc-actions { display:flex; flex-direction:column; gap:5px; flex-shrink:0; }
.rmc-search-btn { background:#0a9b6e; color:#fff; border:none; border-radius:5px; padding:6px 10px; font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; }
.rmc-search-btn:hover { background:#088a5e; }
.rmc-direct-links { display:flex; gap:4px; flex-wrap:wrap; }
.rmc-link { font-size:10px; padding:3px 6px; border-radius:3px; text-decoration:none; font-weight:600; }
.rmc-r { background:#e8380d; color:#fff; }
.rmc-y { background:#e60012; color:#fff; }  
.rmc-a { background:#ff9900; color:#111; }
.rmc-r:hover,.rmc-y:hover,.rmc-a:hover { opacity:0.85; }

.ranking-main-empty { text-align:center; padding:40px; color:#999; }
.back-to-ranking-btn { background:none; border:1px solid #0d6b9a; color:#0d6b9a; padding:7px 16px; border-radius:20px; font-size:13px; cursor:pointer; margin-bottom:14px; }
.back-to-ranking-btn:hover { background:#f0f7fc; }

/* 最新記事セクション */
.articles-section { margin: 24px 0; }
.articles-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; border-bottom:2px solid #0d6b9a; padding-bottom:8px; flex-wrap:wrap; gap:6px; }
.articles-title { font-size:17px; font-weight:700; color:#0a4a6e; margin:0; }
.articles-more { font-size:12px; color:#0d6b9a; text-decoration:none; }
.articles-more:hover { text-decoration:underline; }
.articles-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
@media(max-width:640px){ .articles-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } }
@media(max-width:380px){ .articles-grid { grid-template-columns:minmax(0,1fr); } }
.article-card { display:flex; flex-direction:column; background:#fff; border:1px solid #e0eef5; border-radius:8px; overflow:hidden; text-decoration:none; transition:box-shadow 0.15s; min-width:0; box-sizing:border-box; }
.article-card:hover { box-shadow:0 2px 10px rgba(13,107,154,.12); }
.article-card-img { aspect-ratio:1/1; overflow:hidden; background:#f0f5f8; display:flex; align-items:center; justify-content:center; }
.article-card-img img { width:100%; height:100%; object-fit:contain; }
.article-card-noimg { font-size:36px; color:#b0c8d8; }
.article-card-body { padding:10px; display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; box-sizing:border-box; }
.article-cat { font-size:10px; background:#e8f5ee; color:#0a9b6e; padding:2px 7px; border-radius:10px; align-self:flex-start; font-weight:600; }
.article-card-title { font-size:12px; color:#222; font-weight:600; line-height:1.5; margin:0; word-break:break-word; overflow-wrap:break-word; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.article-card-date { font-size:10px; color:#aaa; margin-top:auto; }

/* ランキングカード スマホ対応 */
@media(max-width:640px){
    .ranking-main-card { flex-wrap:wrap; gap:8px; padding:10px; }
    .rmc-info { flex:1 1 calc(100% - 44px); min-width:0; }
    .rmc-actions { flex:0 0 100%; flex-direction:row; align-items:center; gap:6px; flex-wrap:wrap; }
    .rmc-search-btn { flex:1; font-size:11px; padding:5px 8px; }
    .rmc-direct-links { display:flex; gap:4px; flex-wrap:wrap; }
    .rmc-title { font-size:12px; }
    .rmc-artist { font-size:11px; }
}

/* ===== 個別投稿 single.php ===== */
.single-article { max-width:720px; }
.single-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.single-cat { font-size:11px; font-weight:700; background:#e8f5ee; color:#0a9b6e; padding:3px 10px; border-radius:20px; text-decoration:none; }
.single-cat:hover { background:#0a9b6e; color:#fff; }
.single-date { font-size:12px; color:#999; }
.single-updated { font-size:12px; color:#bbb; }
.single-title { font-size:22px; font-weight:700; color:#0a4a6e; line-height:1.5; margin:0 0 20px; }
.single-thumbnail { margin-bottom:24px; }
.single-content { font-size:15px; line-height:1.9; color:#333; }
.single-content h2 { font-size:18px; font-weight:700; color:#0a4a6e; border-left:4px solid #0d6b9a; padding-left:12px; margin:36px 0 14px; }
.single-content h3 { font-size:15px; font-weight:700; color:#0d6b9a; margin:28px 0 10px; padding-bottom:4px; border-bottom:1px solid #e0eef5; }
.single-content p { margin:0 0 16px; }
.single-content ul, .single-content ol { padding-left:20px; margin:0 0 16px; }
.single-content li { margin-bottom:6px; }
.single-content a { color:#0d6b9a; text-decoration:underline; }
.single-content a:hover { color:#0a4a6e; }
.single-content img { max-width:100%; height:auto; border-radius:6px; margin:16px 0; }
.single-tags { margin-top:28px; padding-top:16px; border-top:1px solid #e0eef5; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.single-tags-label { font-size:12px; color:#999; }
.single-tag { font-size:12px; background:#f0f7fa; border:1px solid #d0e0ea; color:#555; padding:3px 10px; border-radius:3px; text-decoration:none; }
.single-tag:hover { background:#0a9b6e; color:#fff; border-color:#0a9b6e; }

/* 関連記事 */
.related-section { margin-top:40px; }

/* 前後記事ナビ */
.post-nav { display:flex; gap:12px; margin-top:32px; flex-wrap:wrap; }
.post-nav-item { flex:1; min-width:200px; background:#f0f7fc; border:1px solid #d0e8f5; border-radius:8px; padding:14px 16px; text-decoration:none; display:flex; flex-direction:column; gap:4px; transition:background 0.15s; }
.post-nav-item:hover { background:#e0f0fa; }
.post-nav-label { font-size:11px; color:#0d6b9a; font-weight:700; }
.post-nav-title { font-size:13px; color:#333; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

@media(max-width:640px) {
    .single-title { font-size:18px; }
    .post-nav { flex-direction:column; }
}

/* ===== Contact Form 7 カスタムスタイル ===== */
.wpcf7-form { max-width:600px; }
.wpcf7-form label { display:block; font-size:13px; font-weight:700; color:#0a4a6e; margin-bottom:6px; }
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea { width:100%; box-sizing:border-box; border:1px solid #c8dce8; border-radius:6px; padding:10px 14px; font-size:14px; color:#333; background:#fff; font-family:'Hiragino Kaku Gothic ProN','Meiryo',sans-serif; transition:border-color 0.2s; }
.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form textarea:focus { outline:none; border-color:#0d6b9a; box-shadow:0 0 0 3px rgba(13,107,154,.1); }
.wpcf7-form textarea { height:140px; resize:vertical; }
.wpcf7-form p { margin-bottom:20px; }
.wpcf7-form input[type="submit"] { background:#0a9b6e; color:#fff; border:none; border-radius:6px; padding:12px 40px; font-size:15px; font-weight:700; cursor:pointer; font-family:'Hiragino Kaku Gothic ProN','Meiryo',sans-serif; transition:background 0.2s; }
.wpcf7-form input[type="submit"]:hover { background:#088a5e; }
.wpcf7-not-valid-tip { font-size:12px; color:#e00; margin-top:4px; }
.wpcf7-response-output { border-radius:6px; padding:12px 16px; font-size:13px; margin-top:16px; border:none; }
.wpcf7-mail-sent-ok { background:#e8f5ee; color:#0a9b6e; }
.wpcf7-mail-sent-ng, .wpcf7-aborted { background:#fef0f0; color:#c00; }

/* ===== アーカイブページ archive.php ===== */
.archive-header { margin-bottom:24px; padding-bottom:16px; border-bottom:2px solid #e0eef5; }
.archive-title { font-size:20px; font-weight:700; color:#0a4a6e; margin:0 0 6px; }
.archive-desc { font-size:13px; color:#666; margin:6px 0 0; }
.archive-count { font-size:12px; color:#999; margin:6px 0 0; }

.archive-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:32px; }
@media(max-width:768px){ .archive-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); } }
@media(max-width:480px){ .archive-grid { grid-template-columns:minmax(0,1fr); } }

.archive-card { display:flex; flex-direction:column; background:#fff; border:1px solid #e0eef5; border-radius:8px; overflow:hidden; text-decoration:none; transition:box-shadow 0.15s; }
.archive-card:hover { box-shadow:0 2px 10px rgba(13,107,154,.12); }
.archive-card-img { aspect-ratio:1/1; overflow:hidden; background:#f0f5f8; display:flex; align-items:center; justify-content:center; }
.archive-card-img img { width:100%; height:100%; object-fit:contain; }
.archive-card-noimg { font-size:40px; color:#b0c8d8; }
.archive-card-body { padding:12px; display:flex; flex-direction:column; gap:6px; flex:1; }
.archive-card-cat { font-size:10px; font-weight:700; background:#e8f5ee; color:#0a9b6e; padding:2px 8px; border-radius:10px; align-self:flex-start; }
.archive-card-title { font-size:13px; color:#222; font-weight:600; line-height:1.5; margin:0; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; word-break:break-word; }
.archive-card-date { font-size:11px; color:#aaa; margin-top:auto; }

.archive-pagination { margin-top:16px; }
.archive-pagination .nav-links { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; }
.archive-pagination .page-numbers { display:inline-block; padding:7px 13px; border:1px solid #d0e8f5; border-radius:4px; font-size:13px; color:#0d6b9a; text-decoration:none; }
.archive-pagination .page-numbers.current { background:#0d6b9a; color:#fff; border-color:#0d6b9a; }
.archive-pagination .page-numbers:hover { background:#f0f7fc; }

/* ===== スマホ完全対応（強制） ===== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }
  * { max-width: 100% !important; box-sizing: border-box !important; }
  img { width: 100% !important; height: auto !important; }

  /* レイアウト */
  .site-layout { flex-direction: column !important; padding: 0 8px !important; gap: 10px !important; }
  .sidebar { width: 100% !important; min-width: 0 !important; }
  .main-content { width: 100% !important; min-width: 0 !important; overflow: hidden !important; }

  /* 商品グリッド */
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1px !important; }
  .product-card { overflow: hidden !important; }
  .product-card-img { height: 80px !important; padding: 4px !important; max-width: 100% !important; }
  .product-card-img img { max-height: 70px !important; width: 100% !important; object-fit: contain !important; }
  .product-card-body { padding: 4px !important; }
  .product-name { font-size: 9px !important; height: 36px !important; line-height: 1.3 !important; }
  .product-shop, .product-stars, .product-review-count { display: none !important; }
  .product-price { font-size: 11px !important; }
  .product-price-unit { font-size: 9px !important; }
  .product-price-wrap { margin-top: 2px !important; }
  .product-btn { font-size: 9px !important; padding: 4px 2px !important; margin-top: 2px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }

  /* ランキングカード */
  .ranking-main-grid { grid-template-columns: minmax(0,1fr) !important; }
  .ranking-main-card { padding: 8px !important; gap: 6px !important; overflow: hidden !important; }
  .rmc-info { min-width: 0 !important; overflow: hidden !important; }
  .rmc-title { font-size: 11px !important; }
  .rmc-artist { font-size: 10px !important; }
  .rmc-search-btn { font-size: 10px !important; padding: 4px 8px !important; }
  .rmc-direct-links { flex-wrap: wrap !important; gap: 3px !important; }
  .rmc-link { font-size: 9px !important; padding: 2px 5px !important; }

  /* ツールバー */
  .products-toolbar { padding: 6px !important; gap: 4px !important; flex-wrap: wrap !important; }
  .source-tabs { flex-wrap: wrap !important; gap: 3px !important; }
  .source-tab { font-size: 10px !important; padding: 3px 7px !important; }
  .sort-select { font-size: 10px !important; padding: 3px 4px !important; width: auto !important; max-width: 140px !important; }
  .products-toolbar .result-info strong { font-size: 12px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; display: block !important; }

  /* 記事グリッド */
  .articles-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 6px !important; }
  .article-card-img { aspect-ratio: 1/1 !important; }
  .article-card-body { padding: 6px !important; }
  .article-card-title { font-size: 10px !important; }

  /* フッター */
  .footer-widgets { grid-template-columns: repeat(2, minmax(0,1fr)) !important; padding: 12px 8px !important; gap: 10px !important; }
  .footer-widget h3 { font-size: 12px !important; }
  .footer-widget li, .footer-widget a { font-size: 11px !important; }

  /* ヒーロー */
  .hero-banner .inner { padding: 0 8px !important; }
  .hero-tags { flex-wrap: wrap !important; gap: 4px !important; }
  .hero-tag { font-size: 11px !important; padding: 4px 10px !important; }

  /* ヘッダー */
  .site-header .inner { padding: 0 8px !important; gap: 6px !important; flex-wrap: wrap !important; }
  .breadcrumb .inner { padding: 0 8px !important; }
}
