/* ===========================
   JIKIDON THEME — MAIN CSS
   =========================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

/* ===========================
   CSS VARIABLES — LIGHT MODE
   =========================== */
:root {
  --font-main: 'Noto Sans KR', sans-serif;
  --accent:        #185FA5;
  --accent-hover:  #0C447C;
  --accent-light:  #E6F1FB;
  --accent-dark:   #0C447C;

  --bg-primary:    #ffffff;
  --bg-secondary:  #f8f9fa;
  --bg-tertiary:   #f1f3f5;
  --bg-card:       #ffffff;

  --text-primary:   #1a1a1a;
  --text-secondary: #555555;
  --text-tertiary:  #888888;
  --text-accent:    #185FA5;

  --border:        rgba(0,0,0,0.09);
  --border-strong: rgba(0,0,0,0.18);

  --nav-height: 60px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

/* ===========================
   DARK MODE VARIABLES
   =========================== */
[data-theme="dark"] {
  --bg-primary:    #121212;
  --bg-secondary:  #1e1e1e;
  --bg-tertiary:   #252525;
  --bg-card:       #1e1e1e;

  --text-primary:   #f0f0f0;
  --text-secondary: #aaaaaa;
  --text-tertiary:  #666666;
  --text-accent:    #5BA3E0;

  --accent:        #4A90D9;
  --accent-hover:  #7BB3E8;
  --accent-light:  #1a3a5c;
  --accent-dark:   #7BB3E8;

  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: background 0.3s, color 0.3s;
}

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

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

/* ===========================
   READING PROGRESS BAR
   =========================== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ===========================
   NAVIGATION
   =========================== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background 0.3s;
}

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

/* Logo */
.site-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--accent); }

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-menu > li > a .arrow {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s;
}

.nav-menu > li:hover > a .arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
}

.nav-menu > li:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sub-menu li a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.sub-menu li a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* Nav Right Controls */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  color: var(--text-secondary);
}

.nav-icon-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.nav-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

/* Search Overlay */
#search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

#search-overlay.open {
  opacity: 1;
  visibility: visible;
}

.search-box {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  max-width: 560px;
  margin: 0 20px;
  box-shadow: var(--shadow-md);
}

.search-box form {
  display: flex;
  gap: 10px;
}

.search-box input[type="search"] {
  flex: 1;
  padding: 10px 16px;
  font-size: 16px;
  font-family: var(--font-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
}

.search-box input[type="search"]:focus {
  border-color: var(--accent);
}

.search-box button[type="submit"] {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.search-box button[type="submit"]:hover {
  background: var(--accent-hover);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===========================
   LAYOUT WRAPPER
   =========================== */
#page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   AD SLOTS
   =========================== */
.ad-slot {
  margin: 16px 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  background: var(--bg-secondary);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ad-slot-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===========================
   HOMEPAGE
   =========================== */

/* Hero (Pinned Post) */
.hero-post {
  margin: 24px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  display: flex;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.hero-post:hover { box-shadow: var(--shadow-md); }

.hero-post .post-thumbnail {
  width: 280px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--accent-light);
}

.hero-post .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.hero-post:hover .post-thumbnail img { transform: scale(1.03); }

.hero-post .post-body {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 10px;
}

.post-category-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 6px;
  display: block;
}

.hero-post .post-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.hero-post .post-title a { color: inherit; }
.hero-post .post-title a:hover { color: var(--accent); }

.hero-post .post-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.post-meta svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  vertical-align: middle;
  margin-right: 3px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 14px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

.section-more {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}
.section-more:hover { color: var(--accent-hover); }

/* Post Grid 3 columns */
.post-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* Post Grid 2 columns */
.post-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* Post Card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card .post-thumbnail {
  height: 160px;
  overflow: hidden;
  background: var(--accent-light);
}

.post-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.post-card:hover .post-thumbnail img { transform: scale(1.05); }

.post-card .card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card .post-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .post-title a { color: inherit; }
.post-card .post-title a:hover { color: var(--accent); }

.post-card .post-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Horizontal card (2-col) */
.post-card-h {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  gap: 0;
}

.post-card-h:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card-h .post-thumbnail {
  width: 120px;
  flex-shrink: 0;
  background: var(--accent-light);
  overflow: hidden;
}

.post-card-h .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.post-card-h:hover .post-thumbnail img { transform: scale(1.05); }

.post-card-h .card-body {
  padding: 14px;
  flex: 1;
}

.post-card-h .post-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-h .post-title a { color: inherit; }
.post-card-h .post-title a:hover { color: var(--accent); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 16px 0 32px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: all 0.2s;
}

.pagination .page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===========================
   SINGLE POST
   =========================== */
.single-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 840px;
  margin: 0 auto;
  padding: 32px 0 48px;
}

/* Post Header */
.post-header {
  margin-bottom: 28px;
}

.post-header .post-category-label {
  font-size: 13px;
  margin-bottom: 10px;
}

.post-header h1.post-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.post-header .post-meta {
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* Reading time badge */
.reading-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Table of Contents */
.toc-box {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 24px 0;
}

.toc-box .toc-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-box ol {
  list-style: decimal;
  padding-left: 20px;
}

.toc-box li {
  margin: 4px 0;
}

.toc-box li a {
  font-size: 13px;
  color: var(--accent);
  transition: color 0.2s;
}

.toc-box li a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.toc-box .toc-h3 {
  padding-left: 14px;
  list-style: none;
}

.toc-box .toc-h3 a {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Post Content */
.post-content {
  font-size: 19px;
  line-height: 1.85;
  color: var(--text-primary);
}

.post-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 14px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
}

.post-content h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text-primary);
}

.post-content h4 {
  font-size: 17px;
  font-weight: 700;
  margin: 20px 0 8px;
}

.post-content p { margin-bottom: 20px; }

.post-content ul, .post-content ol {
  margin: 0 0 20px 24px;
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

.post-content li { margin-bottom: 6px; }

.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-content img {
  border-radius: var(--radius-md);
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
}

.post-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 15px;
}

.post-content th, .post-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--bg-secondary);
  font-weight: 700;
}

/* Post Footer Tags */
.post-tags {
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.post-tags span {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-right: 4px;
}

.post-tags a {
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  transition: all 0.2s;
}

.post-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Share Buttons */
.share-section {
  margin: 32px 0;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.share-section .share-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.share-btn-kakao {
  background: #FEE500;
  color: #3C1E1E;
}
.share-btn-kakao:hover { background: #e6cf00; }

.share-btn-twitter {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--border);
}
.share-btn-twitter:hover { background: var(--accent); color: #fff; }

.share-btn-link {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.share-btn-link:hover { border-color: var(--accent); color: var(--accent); }

.share-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Related Posts */
.related-posts {
  margin: 32px 0;
}

.related-posts .section-title {
  margin-bottom: 14px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.related-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: box-shadow 0.2s;
}

.related-card:hover { box-shadow: var(--shadow-md); }

.related-card .thumb {
  width: 70px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--accent-light);
  flex-shrink: 0;
}

.related-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card .info .cat {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
}

.related-card .info .title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card .info .title:hover { color: var(--accent); }

/* ===========================
   COMMENTS
   =========================== */
.comments-area {
  margin: 32px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.comment-list { padding: 0; }

.comment {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.comment:last-child { border-bottom: none; }

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent-light);
}

.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.comment-body { flex: 1; }

.comment-author-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.comment-date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.comment-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Login to comment */
.comment-login-notice {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-top: 20px;
}

.comment-login-notice p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.login-comment-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.login-comment-btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* Comment Form (logged in) */
.comment-form-wrap {
  margin-top: 20px;
}

.comment-form-wrap textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--font-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color 0.2s;
}

.comment-form-wrap textarea:focus { border-color: var(--accent); }

.comment-submit-btn {
  margin-top: 10px;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.comment-submit-btn:hover { background: var(--accent-hover); }

/* ===========================
   FOOTER
   =========================== */
#site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .brand-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.footer-brand .brand-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.newsletter-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.newsletter-form {
  display: flex;
  gap: 6px;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 9px 14px;
  font-size: 13px;
  font-family: var(--font-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  min-width: 0;
  transition: border-color 0.2s;
}

.newsletter-form input[type="email"]:focus { border-color: var(--accent); }

.newsletter-form button {
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.newsletter-form button:hover { background: var(--accent-hover); }

.footer-col-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom span, .footer-bottom a {
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-bottom a:hover { color: var(--accent); }

/* ===========================
   BACK TO TOP
   =========================== */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 500;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover { background: var(--accent-hover); }

#back-to-top svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
}

/* ===========================
   ARCHIVE / SEARCH PAGE
   =========================== */
.archive-header {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.archive-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.archive-header .archive-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ===========================
   404 PAGE
   =========================== */
.error-404 {
  text-align: center;
  padding: 80px 20px;
}

.error-404 .error-num {
  font-size: 80px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 16px;
}

.error-404 h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.error-404 p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
  .post-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid .footer-brand { grid-column: 1 / -1; }
  .hero-post { flex-direction: column; }
  .hero-post .post-thumbnail { width: 100%; height: 200px; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --nav-height: 54px; }

  .nav-menu { display: none; }
  .nav-menu.open { 
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 10px;
    box-shadow: var(--shadow-md);
  }
  .menu-toggle { display: flex; }

  .post-grid-3 { grid-template-columns: 1fr; }
  .post-grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  .post-header h1.post-title { font-size: 20px; }
  .post-content { font-size: 17px; }

  #page-wrap { padding: 0 16px; }
}
