/* SNS図鑑：白ベース、カテゴリごとに差し色 */
:root {
  --ink: #2b2620;
  --muted: #7a7064;
  --line: #ece6dd;
  --bg: #fffdf9;
  --paper: #ffffff;
  --accent: #d9692b;
  --recipe: #d9692b;
  --interior: #4f8a6b;
  --news: #3d6fa8;
  --funny: #c9a227;
  --travel: #2a9d9d;
  --economy: #7a5aa6;
  --radius: 12px;
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-top { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.logo { font-weight: 800; font-size: 1.1rem; text-decoration: none; letter-spacing: .02em; }
.menu-btn { width: 40px; height: 40px; border: 0; background: transparent; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 9px; cursor: pointer; border-radius: 8px; }
.menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* カテゴリのチップ：スマホは横にスクロール */
.cat-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 16px 10px; -webkit-overflow-scrolling: touch; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-home { --c: var(--ink); }
/* メニュー（ハンバーガー）を開いたときの一覧 */
.drawer { border-top: 1px solid var(--line); background: var(--paper); padding: 8px 0 16px; }
.drawer a { display: flex; align-items: center; gap: 10px; padding: 12px 4px; text-decoration: none; border-bottom: 1px solid var(--line); font-weight: 700; }
.drawer-h { margin: 14px 4px 2px; font-size: .78rem; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
@media (min-width: 761px) {
  .site-header .header-top { height: 60px; }
  .cat-nav { padding-bottom: 12px; }
}

/* チップ（ナビとカードのカテゴリで共通）。色はカテゴリごと */
.cat-recipe { --c: var(--recipe); }
.cat-interior { --c: var(--interior); }
.cat-news { --c: var(--news); }
.cat-funny { --c: #a8860f; }
.cat-travel { --c: var(--travel); }
.cat-economy { --c: var(--economy); }
.chip { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 700; white-space: nowrap; text-decoration: none;
  color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, #999) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c, #999) 35%, #fff); }
.cat-nav .chip { padding: 6px 14px; font-size: .88rem; transition: background .15s, color .15s; flex: none; }
.cat-nav .chip:hover { background: color-mix(in srgb, var(--c) 22%, #fff); }
.cat-nav .chip.on { background: var(--c); border-color: var(--c); color: #fff; }

main.wrap { padding-top: 16px; padding-bottom: 48px; }
@media (min-width: 761px) { main.wrap { padding-top: 24px; } }
h1 { font-size: 1.6rem; line-height: 1.4; margin: 8px 0 12px; }
h2 { font-size: 1.2rem; margin: 32px 0 12px; }
.hero { padding: 8px 0 8px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(60, 40, 20, .08); }
.card-thumb { aspect-ratio: 4 / 5; background: #f4eee6; display: block; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { display: flex; align-items: center; justify-content: center; height: 100%; padding: 12px; font-weight: 700; font-size: .95rem; text-align: center; color: #fff; }
.cat-recipe .thumb-ph { background: var(--recipe); }
.cat-interior .thumb-ph { background: var(--interior); }
.cat-news .thumb-ph { background: var(--news); }
.cat-funny .thumb-ph { background: var(--funny); }
.cat-travel .thumb-ph { background: var(--travel); }
.cat-economy .thumb-ph { background: var(--economy); }
.card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.card-cat { align-self: flex-start; font-size: .72rem; padding: 2px 10px; }
.card-title { font-weight: 700; line-height: 1.5; font-size: .95rem; }
.card-meta { font-size: .78rem; color: var(--muted); }
.home-cat h2 a { text-decoration: none; }
.sec-note { font-size: .8rem; color: var(--muted); margin: -6px 0 10px; }

/* スライダー（トップ）：スマホは画面いっぱい・横にスワイプ */
.slider { margin: 0 -16px; }
.slides { display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; display: block; text-decoration: none; color: #fff; aspect-ratio: 1 / 1; max-height: 62vh; overflow: hidden; background: #f4eee6; }
.slide-img, .slide-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 16px 18px; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); display: flex; flex-direction: column; gap: 6px; }
.slide-title { font-weight: 800; font-size: 1.15rem; line-height: 1.45; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.slide .card-cat { background: #fff; }
.dots { display: flex; justify-content: center; gap: 8px; padding: 10px 0 0; }
.dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.dots button.on { background: var(--accent); width: 20px; border-radius: 4px; }
@media (min-width: 761px) {
  .slider { margin: 0; }
  .slides { gap: 12px; }
  .slide { flex-basis: calc(50% - 6px); aspect-ratio: 4 / 3; max-height: 420px; border-radius: var(--radius); }
}

/* PVランキング：順位つきの縦リスト */
.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: none; }
.rank-list li { margin: 0; }
.rank-row { display: flex; align-items: center; gap: 12px; text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.rank-no { flex: none; width: 28px; text-align: center; font-weight: 900; font-size: 1.15rem; color: var(--muted); }
.rank-no.r1 { color: #c9a227; } .rank-no.r2 { color: #9aa3ad; } .rank-no.r3 { color: #b7794f; }
.rank-img { flex: none; width: 64px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: #f4eee6; }
.rank-img img { width: 100%; height: 100%; object-fit: cover; }
.rank-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rank-title { font-weight: 700; font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 761px) { .rank-list { display: grid; grid-template-columns: 1fr 1fr; } }
.more { text-align: right; font-size: .9rem; }

.article { max-width: 720px; margin: 0 auto; }
.crumbs { font-size: .82rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.article-meta { font-size: .85rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.lead { font-size: 1.05rem; }
.embed { margin: 20px 0; display: flex; justify-content: center; }
.embed-youtube { position: relative; aspect-ratio: 16 / 9; }
.embed-youtube.embed-short { aspect-ratio: 9 / 16; width: min(100%, 360px); margin-left: auto; margin-right: auto; }
.embed-youtube iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 12px; margin: 20px 0; }
.box h2 { margin-top: 16px; }
.box h2 small { font-size: .8rem; color: var(--muted); font-weight: 400; margin-left: 8px; }
.ingredients, .impact { width: 100%; border-collapse: collapse; }
.ingredients th, .ingredients td, .impact th, .impact td { padding: 8px 4px; border-bottom: 1px dashed var(--line); text-align: left; vertical-align: top; }
.ingredients th { font-weight: 400; }
.ingredients td { text-align: right; white-space: nowrap; }
ol li, ul li { margin: 6px 0; }
dt { font-weight: 700; margin-top: 12px; }
dd { margin: 0 0 0 1em; }
.source { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 32px; }
.tags span, .tags a { display: inline-block; font-size: .8rem; color: var(--muted); margin: 0 10px 6px 0; }
.tags a { color: var(--accent); text-decoration: none; }
.tags a:hover { text-decoration: underline; }

/* 検索 */
.header-top { gap: 4px; }
.header-top .logo { margin-right: auto; }
.search-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 8px; }
.search-btn:hover { background: var(--line); }
.drawer-search, .search-form { display: flex; gap: 8px; margin: 8px 0 12px; }
.drawer-search input, .search-form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 16px; background: #fff; color: var(--ink); }
.drawer-search button, .search-form button { height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.search-help { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }
.search-count { font-weight: 700; margin: 4px 0 12px; }
.search-popular .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.search-popular .chip { padding: 7px 14px; font-size: .9rem; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.search-popular .chip:hover { border-color: var(--accent); color: var(--accent); }
.related { max-width: 1040px; }
.site-note { font-size: .86rem; color: var(--muted); background: #faf8f5; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 16px; line-height: 1.7; }
.crumbs span { color: var(--muted); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 760px; margin: 28px auto; }
.prevnext a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-size: .92rem; line-height: 1.5; }
.prevnext a:hover { border-color: var(--accent); }
.prevnext small { display: block; color: var(--muted); font-size: .76rem; margin-bottom: 2px; }
.prevnext .pn-prev { text-align: right; }
@media (max-width: 560px) { .prevnext { grid-template-columns: 1fr; } .prevnext .pn-prev { text-align: left; } }
.ad { margin: 24px 0; min-height: 100px; }

.pager { display: flex; gap: 6px; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: var(--paper); }
.pager span[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); background: var(--paper); padding: 20px 0; font-size: .85rem; color: var(--muted); }
.foot-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-nav a { text-decoration: none; }

/* 管理 */
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stats span { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: .9rem; }
table.admin { width: 100%; border-collapse: collapse; font-size: .85rem; background: var(--paper); }
table.admin th, table.admin td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.perm-granted { color: var(--interior); font-weight: 700; }
.perm-requested { color: #9a7b12; }
.perm-declined { color: #b03a2e; }
