/* WorldBuzzMap 共通スタイル。Phase 1 はTailwindなしのシンプルCSS */
:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-border: #e3e6eb;
  --color-text: #1f2733;
  --color-muted: #6b7484;
  --color-accent: #1761ff;
  --color-accent-soft: #e4ecff;
  --color-buzz: #ff5b5b;
  --radius: 10px;
  --max-width: 1080px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Header --- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
}
.logo:hover { text-decoration: none; }
.logo-mark { font-size: 22px; }
.header-nav a {
  color: var(--color-muted);
  margin-left: 16px;
  font-size: 14px;
}

/* --- Continent / Category bars --- */
.continent-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.continent-bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
}
.continent-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 13px;
  border: 1px solid transparent;
}
.continent-pill:hover { text-decoration: none; border-color: var(--color-border); }
.continent-pill.is-active {
  background: var(--color-accent);
  color: white;
}

.category-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}
.category-bar-inner {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  white-space: nowrap;
}
.category-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-muted);
}
.category-pill:hover {
  text-decoration: none;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.category-pill.is-active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}

/* --- Main --- */
.main-content {
  padding: 24px 16px 64px;
}

.hero {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.hero h1 {
  font-size: 22px;
  margin: 0 0 12px;
}
.hero-lead {
  color: var(--color-muted);
  margin: 0;
}

.page-header {
  margin-bottom: 18px;
}
.page-header h1 {
  font-size: 26px;
  margin: 0 0 4px;
}
.page-header h1 small {
  font-size: 14px;
  color: var(--color-muted);
  font-weight: 400;
  margin-left: 8px;
}
.page-header-sub {
  color: var(--color-muted);
  margin: 0;
}

/* --- Country block --- */
.country-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.country-block-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.country-block-header h2 {
  font-size: 18px;
  margin: 0;
}
.country-block-header h2 a { color: var(--color-text); }
.flag { font-size: 22px; margin-right: 6px; }
.country-name-ja {
  font-size: 13px;
  color: var(--color-muted);
  margin-left: 6px;
}
.more-link {
  font-size: 13px;
}

/* --- Buzz list --- */
.buzz-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.buzz-list > li + li { border-top: 1px solid var(--color-border); }

.buzz-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
}
.buzz-item-rank {
  flex: 0 0 38px;
  font-weight: 700;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.buzz-item-body { flex: 1; min-width: 0; }
.buzz-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 4px;
}
.buzz-score {
  color: var(--color-buzz);
  font-weight: 700;
}
.buzz-source, .buzz-domain {
  background: var(--color-bg);
  border-radius: 4px;
  padding: 1px 6px;
}
.buzz-sample-tag {
  background: #fff7c4;
  color: #8a6d00;
  border-radius: 4px;
  padding: 1px 6px;
}
.buzz-item-title {
  font-size: 15px;
  margin: 0 0 4px;
  line-height: 1.4;
}
.buzz-item-translation {
  font-size: 13px;
  color: var(--color-muted);
  margin: 0 0 4px;
}
.buzz-item-original {
  font-size: 12px;
  color: var(--color-muted);
  margin: 0 0 4px;
  opacity: 0.75;
}
.buzz-item-why {
  font-size: 12px;
  color: var(--color-muted);
  margin: 4px 0 0;
}

/* --- Item detail --- */
.item-detail {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.breadcrumb { font-size: 12px; color: var(--color-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--color-muted); }
.translated-title { color: var(--color-muted); }
.original-title {
  color: var(--color-muted);
  font-size: 13px;
  margin: 4px 0 12px;
  opacity: 0.8;
}
.item-summary-original {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--color-muted);
}
.item-summary-original summary {
  cursor: pointer;
  user-select: none;
}
.item-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.buzz-score-large {
  background: var(--color-buzz);
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
}
.meta-pill {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 13px;
}
.meta-pill.sample { background: #fff7c4; }
.item-thumb {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  margin: 12px 0;
}
.why-trending, .item-summary, .item-summary-ja {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.why-trending h2, .item-summary h2, .item-summary-ja h2 {
  font-size: 15px;
  margin: 0 0 8px;
}

.item-source-link {
  margin-top: 18px;
}

/* --- Ad slot --- */
.ad-slot {
  margin: 24px 0;
  min-height: 90px;
  /* AdSense 未設置時もレイアウトジャンプを抑える */
  text-align: center;
}

/* --- Cookie consent banner --- */
.cookie-banner {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  max-width: 640px;
  margin: 0 auto;
  background: #1a1f2e;
  color: #ffffff;
  border: 1px solid #2a3142;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 9999;
  font-size: 13px;
  line-height: 1.5;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-text { margin: 0; flex: 1; }
.cookie-banner-text a { color: #fff; text-decoration: underline; }
.cookie-banner-btn {
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cookie-banner-btn:hover { opacity: 0.9; }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}
.pagination-link {
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  font-size: 14px;
}
.pagination-link.disabled {
  color: var(--color-muted);
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination-info {
  color: var(--color-muted);
  font-size: 13px;
}
.breadcrumb-sep {
  color: var(--color-muted);
  margin: 0 4px;
}
.page-header-feed {
  margin-top: 4px;
  font-size: 12px;
}
.page-header-feed a {
  color: var(--color-muted);
}

/* --- Related items --- */
.related-items {
  margin-top: 28px;
}
.related-heading {
  font-size: 16px;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.related-grid .buzz-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

/* --- Static pages --- */
.static-page {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.static-page h2 {
  font-size: 17px;
  margin-top: 28px;
}

.empty-note {
  background: #fffbe6;
  border: 1px solid #ffe9a3;
  color: #7a5b00;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.empty-note code {
  background: #fff5cc;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 18px 0;
  margin-top: 48px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--color-muted);
}
.footer-nav a {
  color: var(--color-muted);
  margin-left: 16px;
}

@media (max-width: 600px) {
  .header-inner { height: 52px; }
  .hero { padding: 18px; }
  .country-block { padding: 16px; }
  .item-detail { padding: 18px; }
}
