/*
Theme Name: 和漢安胎ガイド
Theme URI: https://www.liyanlin.com
Author: 鈴木 和子
Description: 京都の現役助産師による、日本の伝統的な妊娠保持法に特化した情報サイトのテーマ
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: wakan-antai
*/

/* ===========================
   Variables
   =========================== */
:root {
  --bg:           #faf7f2;
  --bg-alt:       #f2ece0;
  --surface:      #ffffff;
  --border:       #e0d8cc;
  --text:         #2a2420;
  --text-muted:   #7a6a5a;
  --primary:      #6b4c35;
  --primary-dark: #4a3325;
  --accent:       #8a6440;
  --accent-light: #c5a882;
  --green:        #4a6b4a;
  --green-light:  #eef4ee;
  --gold:         #b8963e;
  --serif: 'Noto Serif JP', 'Yu Mincho', '游明朝', 'Hiragino Mincho ProN', Georgia, serif;
  --sans:  'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  --max:   1140px;
  --gap:   40px;
  --sidebar: 280px;
  --radius: 4px;
  --shadow: 0 2px 12px rgba(42,36,32,.08);
  --shadow-h: 0 6px 24px rgba(42,36,32,.14);
  --transition: .22s ease;
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.9;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
ul, ol { padding-left: 1.5em; }

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.45;
  color: var(--primary-dark);
  letter-spacing: .03em;
}

h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1.4em; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 4px solid var(--accent-light);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ===========================
   Layout
   =========================== */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.site-main {
  padding: 48px 0 64px;
}

.content-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar);
  gap: var(--gap);
  align-items: start;
}

/* ===========================
   Header
   =========================== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(42,36,32,.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  max-width: var(--max);
  margin: 0 auto;
  height: 64px;
}

.site-branding { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.site-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
  letter-spacing: .04em;
}
.site-title a { color: inherit; }
.site-title a:hover { color: var(--accent); }

.site-tagline {
  font-size: .7rem;
  color: var(--text-muted);
  font-family: var(--sans);
  display: block;
  font-weight: 400;
  letter-spacing: .02em;
}

/* ===========================
   Navigation
   =========================== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.primary-nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 2px; }
.primary-nav > ul > li { position: relative; }

.primary-nav > ul > li > a {
  display: block;
  padding: 8px 14px;
  font-size: .85rem;
  font-family: var(--serif);
  color: var(--text);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.primary-nav > ul > li > a:hover,
.primary-nav > ul > li.current-menu-item > a,
.primary-nav > ul > li.current-menu-ancestor > a {
  background: var(--bg-alt);
  color: var(--primary);
}

/* Dropdown */
.primary-nav .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-h);
  min-width: 220px;
  padding: 6px 0;
  z-index: 200;
}
.primary-nav > ul > li:hover > .sub-menu { display: block; }

.primary-nav .sub-menu li a {
  display: block;
  padding: 9px 18px;
  font-size: .82rem;
  color: var(--text);
  transition: background var(--transition);
}
.primary-nav .sub-menu li a:hover { background: var(--bg-alt); color: var(--primary); }

/* ===========================
   Breadcrumb
   =========================== */
.breadcrumb-wrap {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.breadcrumb {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: .5; }

/* ===========================
   Hero (Front Page)
   =========================== */
.hero {
  background: linear-gradient(135deg, #4a3325 0%, #6b4c35 60%, #8a6440 100%);
  color: #fff;
  padding: 72px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L55 30 L30 55 L5 30 Z' fill='none' stroke='rgba(255,255,255,.04)' stroke-width='1'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 780px; margin: 0 auto; }

.hero-label {
  display: inline-block;
  font-size: .75rem;
  letter-spacing: .12em;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #f0dfc0;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  font-family: var(--sans);
}
.hero h1 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  margin-bottom: 16px;
  text-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.hero-desc {
  font-size: clamp(.9rem, 2vw, 1.05rem);
  color: rgba(255,255,255,.85);
  margin-bottom: 32px;
  line-height: 1.9;
}

.hero-author {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 40px;
  padding: 10px 22px;
}
.hero-author-name {
  font-family: var(--serif);
  font-size: .9rem;
  color: #f0dfc0;
}
.hero-author-title {
  font-size: .75rem;
  color: rgba(255,255,255,.7);
}

/* ===========================
   Category Grid
   =========================== */
.section-heading {
  text-align: center;
  margin-bottom: 36px;
}
.section-heading h2 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.section-heading p {
  color: var(--text-muted);
  font-size: .9rem;
  margin: 0;
}
.section-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-light), var(--gold));
  margin: 12px auto 0;
  border-radius: 2px;
}

.categories-section {
  padding: 60px 24px;
  background: var(--surface);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto;
}

.category-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 22px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.category-card:hover {
  box-shadow: var(--shadow-h);
  transform: translateY(-2px);
  border-color: var(--accent-light);
}

.cat-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--bg-alt), var(--border));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

.category-card h3 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin: 0;
}
.category-card p {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}
.category-card .cat-link {
  font-size: .8rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.category-card .cat-link::after { content: '→'; }
.category-card:hover .cat-link { color: var(--primary); }

/* ===========================
   Recent Articles Section
   =========================== */
.recent-section {
  padding: 60px 24px;
  background: var(--bg);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  box-shadow: var(--shadow-h);
  transform: translateY(-2px);
}

.card-thumb {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--border) 100%);
  overflow: hidden;
  position: relative;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.article-card:hover .card-thumb img { transform: scale(1.03); }

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--accent-light);
  background: linear-gradient(135deg, var(--bg-alt) 0%, #ede5d5 100%);
}

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.card-cat {
  font-size: .72rem;
  font-weight: 500;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--green-light);
  padding: 3px 10px;
  border-radius: 3px;
  display: inline-block;
  width: fit-content;
}

.card-title {
  font-family: var(--serif);
  font-size: .98rem;
  color: var(--primary-dark);
  line-height: 1.5;
  margin: 0;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--accent); }

.card-excerpt {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin: 0;
}

.card-meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.card-meta time::before { content: '📅 '; font-size: .8em; }

/* ===========================
   Archive / Blog Index
   =========================== */
.archive-header {
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.archive-header .cat-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  padding: 4px 14px;
  border-radius: 3px;
  margin-bottom: 12px;
  font-family: var(--sans);
  letter-spacing: .04em;
}
.archive-header h1 { margin-bottom: 10px; }
.archive-header .archive-desc {
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.8;
}

.post-list { display: flex; flex-direction: column; gap: 28px; }

.post-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 220px 1fr;
  transition: box-shadow var(--transition);
}
.post-item:hover { box-shadow: var(--shadow-h); }

.post-item-thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-alt);
}
.post-item-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-item:hover .post-item-thumb img { transform: scale(1.03); }

.post-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2.5rem;
  color: var(--accent-light);
  background: linear-gradient(135deg, var(--bg-alt) 0%, #ede5d5 100%);
}

.post-item-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-item-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.post-item-cat {
  font-size: .72rem;
  font-weight: 500;
  color: var(--green);
  background: var(--green-light);
  padding: 3px 10px;
  border-radius: 3px;
}
.post-item-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0;
}
.post-item-title a { color: var(--primary-dark); }
.post-item-title a:hover { color: var(--accent); }
.post-item-excerpt {
  font-size: .86rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0;
  flex: 1;
}
.post-item-meta {
  font-size: .76rem;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ===========================
   Pagination
   =========================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 44px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
}
.pagination a:hover { background: var(--bg-alt); border-color: var(--accent-light); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===========================
   Single Post
   =========================== */
.entry-header { margin-bottom: 32px; }

.entry-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.entry-cat {
  font-size: .75rem;
  font-weight: 500;
  color: var(--green);
  background: var(--green-light);
  padding: 4px 12px;
  border-radius: 3px;
}

.entry-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.4;
  margin-bottom: 18px;
}

.entry-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: .8rem;
  color: var(--text-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.entry-meta .author { display: flex; align-items: center; gap: 6px; }

.entry-thumb {
  margin-bottom: 32px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.entry-thumb img { width: 100%; max-height: 420px; object-fit: cover; }

.entry-content {
  font-size: 1rem;
  line-height: 1.95;
  color: var(--text);
}
.entry-content h2 {
  font-size: 1.45rem;
  margin: 2em 0 .8em;
  padding-bottom: .4em;
  border-bottom: 2px solid var(--bg-alt);
  color: var(--primary-dark);
}
.entry-content h3 {
  font-size: 1.2rem;
  margin: 1.6em 0 .6em;
  color: var(--primary);
}
.entry-content h4 { font-size: 1.05rem; margin: 1.4em 0 .5em; }
.entry-content p { margin-bottom: 1.4em; }
.entry-content ul, .entry-content ol { margin-bottom: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--primary); }

.entry-content .wp-block-image { margin: 2em 0; }
.entry-content .wp-block-image img { border-radius: 6px; }
.entry-content figcaption { font-size: .8rem; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* Safety notice in content */
.safety-notice {
  background: #fff8f0;
  border: 1px solid #f0c89a;
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 2em 0;
  font-size: .88rem;
  color: #5a4020;
}
.safety-notice strong { color: #8a5010; }

.entry-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.entry-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.entry-tags-label { font-size: .8rem; color: var(--text-muted); }
.tag-link {
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 3px;
  transition: all var(--transition);
}
.tag-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===========================
   Author Bio Box
   =========================== */
.author-bio {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  margin-top: 44px;
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 1.6rem;
  color: #fff;
  font-weight: 700;
}

.author-info h4 {
  font-size: 1.05rem;
  margin-bottom: 2px;
  color: var(--primary-dark);
}
.author-cred {
  font-size: .78rem;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 10px;
}
.author-desc {
  font-size: .86rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0;
}

/* ===========================
   Related Posts
   =========================== */
.related-posts { margin-top: 48px; }
.related-posts h3 {
  font-size: 1.1rem;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.related-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.related-card:hover { box-shadow: var(--shadow); }
.related-card-body { padding: 14px; }
.related-card-title { font-family: var(--serif); font-size: .9rem; color: var(--primary-dark); }
.related-card-title a { color: inherit; }
.related-card-title a:hover { color: var(--accent); }
.related-card-meta { font-size: .75rem; color: var(--text-muted); margin-top: 6px; }

/* ===========================
   Sidebar
   =========================== */
.sidebar { display: flex; flex-direction: column; gap: 28px; }

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.widget-title {
  font-size: .88rem;
  font-family: var(--serif);
  color: var(--surface);
  background: var(--primary);
  padding: 11px 18px;
  margin: 0;
  letter-spacing: .04em;
}
.widget-body { padding: 18px; }

/* Search widget */
.widget-search .widget-body { padding: 14px; }
.search-form { display: flex; gap: 0; }
.search-field {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: .88rem;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.search-field:focus { border-color: var(--accent-light); }
.search-submit {
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: .88rem;
  transition: background var(--transition);
}
.search-submit:hover { background: var(--primary-dark); }

/* Category list widget */
.widget-categories ul { list-style: none; padding: 0; margin: 0; }
.widget-categories li { border-bottom: 1px solid var(--border); }
.widget-categories li:last-child { border-bottom: none; }
.widget-categories a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  font-size: .87rem;
  color: var(--text);
}
.widget-categories a:hover { color: var(--primary); }
.widget-categories .count {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Recent posts widget */
.recent-posts-list { list-style: none; padding: 0; margin: 0; }
.recent-posts-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.recent-posts-list li:last-child { border-bottom: none; }
.recent-post-thumb {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-alt);
}
.recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-post-info { flex: 1; min-width: 0; }
.recent-post-title {
  font-size: .84rem;
  font-family: var(--serif);
  color: var(--primary-dark);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-post-title a { color: inherit; }
.recent-post-title a:hover { color: var(--accent); }
.recent-post-date { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }

/* Safety notice widget */
.widget-safety {
  background: #fff8f0;
  border-color: #f0c89a;
}
.widget-safety .widget-title { background: var(--gold); }
.widget-safety .widget-body {
  font-size: .82rem;
  color: #5a4020;
  line-height: 1.75;
}
.widget-safety strong { color: #8a5010; display: block; margin-bottom: 6px; }

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.8);
  padding: 52px 24px 0;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
  max-width: var(--max);
  margin: 0 auto;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand .footer-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 10px;
}
.footer-brand p {
  font-size: .83rem;
  line-height: 1.85;
  color: rgba(255,255,255,.65);
  margin-bottom: 16px;
}
.footer-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px;
  padding: 7px 16px;
  font-size: .8rem;
}
.footer-author-badge .badge-name { color: #f0dfc0; font-family: var(--serif); }
.footer-author-badge .badge-title { color: rgba(255,255,255,.6); font-size: .72rem; }

.footer-col h4 {
  font-family: var(--serif);
  font-size: .88rem;
  color: #f0dfc0;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-nav { list-style: none; padding: 0; margin: 0; }
.footer-nav li { margin-bottom: 8px; }
.footer-nav a { font-size: .83rem; color: rgba(255,255,255,.65); transition: color var(--transition); }
.footer-nav a:hover { color: var(--accent-light); }

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .76rem;
  color: rgba(255,255,255,.4);
}
.footer-disclaimer {
  font-size: .72rem;
  color: rgba(255,255,255,.35);
  max-width: 480px;
  line-height: 1.6;
  text-align: right;
}

/* ===========================
   Page Template
   =========================== */
.page-content { font-size: 1rem; line-height: 1.95; }
.page-content h2 {
  font-size: 1.45rem;
  margin: 2em 0 .8em;
  padding-bottom: .4em;
  border-bottom: 2px solid var(--bg-alt);
}
.page-content h3 { font-size: 1.2rem; margin: 1.6em 0 .6em; color: var(--primary); }
.page-content p { margin-bottom: 1.4em; }
.page-content ul, .page-content ol { margin-bottom: 1.4em; }

/* ===========================
   Search Results
   =========================== */
.search-header { margin-bottom: 32px; }
.search-header h1 { font-size: 1.4rem; }
.search-header span { color: var(--accent); }

.no-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.no-results h2 { font-size: 1.2rem; margin-bottom: 12px; }
.no-results p { color: var(--text-muted); margin-bottom: 24px; }

/* ===========================
   404
   =========================== */
.error-404 {
  text-align: center;
  padding: 80px 20px;
}
.error-404 .error-num {
  font-family: var(--serif);
  font-size: 6rem;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
}
.error-404 h1 { font-size: 1.5rem; margin-bottom: 12px; }
.error-404 p { color: var(--text-muted); margin-bottom: 28px; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: background var(--transition);
}
.btn:hover { background: var(--primary-dark); color: #fff; }

/* ===========================
   Comments
   =========================== */
.comments-area { margin-top: 48px; }
.comments-title {
  font-size: 1.1rem;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.comment-list { list-style: none; padding: 0; margin: 0 0 36px; }
.comment-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 14px;
}
.comment-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.comment-author-name { font-weight: 600; font-size: .88rem; color: var(--primary-dark); }
.comment-date { font-size: .76rem; color: var(--text-muted); }
.comment-text { font-size: .9rem; line-height: 1.8; }

.comment-respond { background: var(--bg-alt); border-radius: 8px; padding: 28px; }
.comment-respond h3 { font-size: 1.05rem; margin-bottom: 20px; }
.comment-form { display: flex; flex-direction: column; gap: 16px; }
.comment-form label { font-size: .84rem; color: var(--text-muted); display: block; margin-bottom: 5px; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent-light); }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form-submit input[type="submit"] {
  width: auto;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 11px 28px;
  font-size: .9rem;
  transition: background var(--transition);
}
.comment-form-submit input[type="submit"]:hover { background: var(--primary-dark); }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  :root { --sidebar: 240px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .primary-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 12px 0;
    z-index: 100;
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav > ul > li > a { border-radius: 0; padding: 12px 24px; }
  .primary-nav .sub-menu {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    padding: 0;
    border-radius: 0;
    background: var(--bg-alt);
  }
  .primary-nav .sub-menu li a { padding-left: 40px; }

  .content-sidebar { grid-template-columns: 1fr; }
  .sidebar { order: 2; }

  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .articles-grid { grid-template-columns: 1fr; }

  .post-item { grid-template-columns: 1fr; }
  .post-item-thumb { max-height: 180px; }

  .related-grid { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .footer-disclaimer { text-align: center; }

  .hero { padding: 48px 20px; }

  .author-bio { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0 16px; }
  .site-tagline { display: none; }
}
