/*
Theme Name: Potaden
Description: オリジナルテーマ(多言語対応版)。日本語・繁体字中国語の切替に対応。ポタ電ノート/日本祕景で共用。
Author: bloomgo
Version: 1.1.1
Text Domain: potaden
*/

/* ===== Design tokens ===== */
:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --ink: #3A352F;
  --muted: #8B8177;
  --line: #E7DFD3;
  --accent: #8A7361;
  --accent-dark: #6E6157;
  --badge-bg: #EDE4D7;
  --footer-bg: #6F665D;
  --gold: #C99A3F;
  --silver: #9AA0A6;
  --bronze: #B0754B;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(58, 53, 47, .06);
  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

/* ===== Header ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container { max-width: none; padding: 0 28px; }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 72px;
}
.site-brand { line-height: 1.3; }
.site-title { font-size: 20px; font-weight: 700; letter-spacing: .04em; margin: 0; }
.site-tagline { font-size: 11px; color: var(--muted); margin: 2px 0 0; }

.global-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.global-nav a {
  display: block; padding: 8px 12px; font-size: 13px; font-weight: 500;
  letter-spacing: .05em; border-radius: 6px;
}
.global-nav a:hover { background: var(--badge-bg); opacity: 1; }

.header-search { position: relative; }
.search-toggle {
  background: none; border: none; cursor: pointer; padding: 8px;
  color: var(--ink); display: grid; place-items: center;
}
.search-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px;
}
.search-panel.is-open { display: block; }
.search-panel form { display: flex; gap: 6px; }
.search-panel input[type="search"] {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
  font-size: 14px; width: 220px; background: var(--bg);
}
.search-panel button[type="submit"] {
  border: none; background: var(--accent); color: #fff; border-radius: 6px;
  padding: 8px 14px; font-size: 13px; cursor: pointer;
}

.nav-toggle { display: none; }

/* ===== Hero ===== */
.hero { padding: 0; }
.hero .container { max-width: none; padding: 0; }
.hero-box {
  position: relative; overflow: hidden;
  min-height: 440px; display: flex; align-items: center;
  background: #4a443c center / cover no-repeat;
}
.hero-box::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(30, 26, 22, .72) 0%, rgba(30, 26, 22, .35) 55%, rgba(30, 26, 22, .05) 100%);
}
.hero-content {
  position: relative; width: 100%; max-width: var(--container);
  margin: 0 auto; padding: 56px 20px; color: #fff;
}
.hero-title, .hero-text { max-width: 560px; }
.hero-title { font-size: 30px; font-weight: 700; line-height: 1.6; letter-spacing: .04em; margin: 0 0 14px; }
.hero-text { font-size: 14px; line-height: 2; margin: 0 0 24px; opacity: .95; }
.btn-hero {
  display: inline-block; background: #F3EEE6; color: var(--ink);
  font-size: 14px; font-weight: 500; letter-spacing: .08em;
  padding: 12px 34px; border-radius: 999px;
}

/* ===== Sections ===== */
.section { padding: 52px 0 8px; }
.section-title {
  text-align: center; font-size: 20px; font-weight: 700;
  letter-spacing: .1em; margin: 0 0 8px;
}
.section-title::after {
  content: ""; display: block; width: 36px; height: 3px;
  background: var(--accent); margin: 12px auto 0; border-radius: 2px;
}
.section-body { padding-top: 28px; }

/* ===== Post cards (top page) ===== */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .2s ease;
}
.post-card:hover { transform: translateY(-3px); opacity: 1; }
.post-card-thumb { position: relative; aspect-ratio: 16 / 10; background: var(--badge-bg); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 500;
  letter-spacing: .06em; padding: 3px 10px; border-radius: 4px;
}
.post-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.post-card-title { font-size: 15px; font-weight: 700; line-height: 1.7; margin: 0; }
.post-card-date { font-size: 12px; color: var(--muted); }

/* ===== Category grid ===== */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 8px 16px; text-align: center; transition: box-shadow .2s ease;
}
.cat-item:hover { box-shadow: var(--shadow); opacity: 1; }
.cat-item svg { width: 30px; height: 30px; stroke: var(--accent); margin: 0 auto 10px; display: block; }
.cat-item span { font-size: 12px; font-weight: 500; letter-spacing: .03em; display: block; line-height: 1.5; }

/* ===== Ranking ===== */
.rank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.rank-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px 24px 26px; text-align: center;
}
.rank-flag {
  position: absolute; top: 0; left: 16px; width: 30px; height: 40px;
  color: #fff; font-weight: 700; font-size: 15px;
  display: grid; place-items: center; padding-bottom: 8px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.rank-1 .rank-flag { background: var(--gold); }
.rank-2 .rank-flag { background: var(--silver); }
.rank-3 .rank-flag { background: var(--bronze); }
.rank-thumb { height: 170px; display: grid; place-items: center; margin-bottom: 14px; }
.rank-thumb img { max-height: 100%; width: auto; object-fit: contain; }
.rank-name { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.rank-desc { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 0 0 18px; }
.btn-outline {
  display: inline-block; border: 1px solid #C9BCA9; color: var(--ink);
  font-size: 13px; font-weight: 500; letter-spacing: .06em;
  padding: 9px 26px; border-radius: 999px; background: none; cursor: pointer;
}
.btn-more-wrap { text-align: center; padding: 36px 0 20px; }
.btn-more {
  display: inline-block; background: #D9CDBC; color: var(--ink);
  font-size: 14px; font-weight: 500; letter-spacing: .08em;
  padding: 13px 48px; border-radius: 999px;
}

/* ===== Category page ===== */
.archive-hero { background: var(--badge-bg); border-bottom: 1px solid var(--line); }
.archive-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 40px 0; }
.archive-title { font-size: 26px; font-weight: 700; letter-spacing: .05em; margin: 0 0 10px; }
.archive-desc { font-size: 14px; color: var(--muted); margin: 0; max-width: 640px; }
.archive-hero-thumb { flex: 0 0 220px; }
.archive-hero-thumb img { border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; }

.archive-list { display: flex; flex-direction: column; gap: 18px; padding: 36px 0 10px; }
.list-card {
  display: flex; gap: 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; transition: transform .2s ease;
}
.list-card:hover { transform: translateY(-2px); opacity: 1; }
.list-card-thumb { position: relative; flex: 0 0 240px; aspect-ratio: 16/10; background: var(--badge-bg); border-radius: 8px; overflow: hidden; }
.list-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-card-body { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.list-card-title { font-size: 17px; font-weight: 700; line-height: 1.7; margin: 0; }
.list-card-excerpt { font-size: 13px; color: var(--muted); margin: 0; }
.list-card-date { font-size: 12px; color: var(--muted); margin-top: auto; }

.pagination { display: flex; justify-content: center; gap: 6px; padding: 34px 0 10px; }
.pagination .page-numbers {
  min-width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; padding: 0 8px;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===== Single ===== */
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding: 30px 0 40px; }
.breadcrumb { font-size: 12px; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { margin: 0 6px; }

.entry {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 44px;
}
.entry-badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 500; letter-spacing: .06em;
  padding: 3px 12px; border-radius: 4px; margin-bottom: 14px;
}
.entry-title { font-size: 26px; font-weight: 700; line-height: 1.7; margin: 0 0 10px; }
.entry-date { font-size: 13px; color: var(--muted); display: block; margin-bottom: 22px; }
.entry-thumb { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }

.entry-content { font-size: 15.5px; }
.entry-content h2 {
  font-size: 20px; background: var(--badge-bg); border-left: 4px solid var(--accent);
  padding: 12px 16px; border-radius: 6px; margin: 44px 0 20px; line-height: 1.6;
}
.entry-content h3 {
  font-size: 17px; border-bottom: 2px solid var(--line);
  padding-bottom: 8px; margin: 36px 0 16px;
}
.entry-content img { border-radius: var(--radius); margin: 20px 0; }
.entry-content a { color: var(--accent-dark); text-decoration: underline; }
.entry-content blockquote {
  margin: 20px 0; padding: 14px 18px; background: var(--bg);
  border-left: 3px solid var(--line); color: var(--muted); font-size: 14px;
}
.entry-content table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 20px 0; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; }
.entry-content th { background: var(--badge-bg); font-weight: 700; }

/* Table of contents */
.toc-box {
  border: 1px solid #D9C9A8; background: #FDFBF6; border-radius: var(--radius);
  padding: 22px 26px; margin: 28px 0;
}
.toc-title { font-size: 14px; font-weight: 700; color: var(--accent-dark); margin: 0 0 10px; letter-spacing: .04em; }
.toc-box ol { margin: 0; padding-left: 20px; font-size: 14px; }
.toc-box li { margin: 6px 0; }
.toc-box a { color: var(--ink); }
.toc-box ol ol { margin-top: 4px; font-size: 13px; color: var(--muted); }

/* Share */
.share-bar { display: flex; gap: 10px; margin: 0 0 24px; }
.share-btn {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.share-x { background: #1a1a1a; }
.share-fb { background: #1877F2; }
.share-hb { background: #00A4DE; }
.share-line { background: #06C755; font-size: 10px; }

/* ===== Sidebar ===== */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.widget-title {
  font-size: 14px; font-weight: 700; letter-spacing: .08em;
  text-align: center; margin: 0 0 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.profile-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; }
.profile-text { font-size: 13px; color: var(--muted); line-height: 1.9; margin: 0 0 16px; }
.profile-btn-wrap { text-align: center; }

.widget-cats ul { list-style: none; margin: 0; padding: 0; }
.widget-cats li { border-bottom: 1px solid var(--line); }
.widget-cats li:last-child { border-bottom: none; }
.widget-cats a { display: flex; justify-content: space-between; padding: 11px 4px; font-size: 14px; }
.widget-cats a::after { content: "\203A"; color: var(--muted); }

.popular-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.popular-item:last-child { border-bottom: none; }
.popular-thumb { flex: 0 0 84px; aspect-ratio: 16/11; border-radius: 6px; overflow: hidden; background: var(--badge-bg); }
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-title { font-size: 13px; line-height: 1.6; font-weight: 500; margin: 0 0 4px; }
.popular-date { font-size: 11px; color: var(--muted); }

/* ===== Footer ===== */
.site-footer { background: var(--footer-bg); color: #F3EEE6; margin-top: 64px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 0 20px; flex-wrap: wrap; }
.footer-brand .site-title { color: #fff; font-size: 18px; }
.footer-brand .site-tagline { color: #D8D0C6; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 2px 22px; list-style: none; margin: 0; padding: 0; }
.footer-nav a { font-size: 12px; color: #EDE7DD; }
.copyright { text-align: center; font-size: 11px; color: #C9C1B6; padding: 0 0 26px; margin: 0; }

/* PR表記(ステマ規制対応) */
.pr-notice {
  font-size: 12px; color: var(--muted); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 14px; margin: 0 0 20px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .nav-toggle {
    display: grid; place-items: center; background: none; border: none;
    padding: 8px; cursor: pointer; color: var(--ink);
  }
  .global-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .global-nav.is-open { display: block; }
  .global-nav ul { flex-direction: column; padding: 8px 20px 16px; }
}
@media (max-width: 960px) {
  .content-layout { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid, .rank-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero-content { padding: 36px 20px; }
  .hero-title { font-size: 23px; }
  .card-grid, .rank-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-hero-inner { flex-direction: column; align-items: flex-start; }
  .archive-hero-thumb { display: none; }
  .list-card { flex-direction: column; }
  .list-card-thumb { flex: none; }
  .entry { padding: 26px 20px; }
  .entry-title { font-size: 21px; }
}
