/*
Theme Name: 行走的风景
Theme URI:
Author:
Author URI:
Description: 一个简约温暖的个人博客主题，灵感来源于纸本杂志与旅途风景。单栏居中布局，暖色调配色，专注于文字阅读体验。支持自定义 Logo、菜单、侧边栏部件，兼容 WordPress 6.0+。
Version: 1.0
Requires at least: 6.0
Tested up to: 6.4.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: walking-scenery
Tags: blog, one-column, custom-logo, custom-menu, translation-ready, accessibility-ready, warm-colors, minimal-design
*/

/* ========================================
   Design Tokens
   ======================================== */

:root {
  /* Background — warm, like aged paper */
  --color-bg:             #f6f1e8;
  --color-surface:        #ffffff;
  --color-border:         #e8e2d8;
  --color-border-subtle:  #f0ebe2;

  /* Text */
  --color-text:           #2c2c2c;
  --color-text-soft:      #5e5e5e;
  --color-text-muted:     #969696;

  /* Accent — muted blue-teal */
  --color-accent:         #4a8fa8;
  --color-accent-hover:   #3a7288;
  --color-accent-subtle:  #e8f2f6;

  /* Semantic */
  --color-selection:      rgba(74, 143, 168, 0.15);

  /* Typography */
  --font-body: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Menlo', monospace;

  /* Type scale */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  0.9375rem;  /* 15px */
  --text-md:    1.0625rem;  /* 17px */
  --text-lg:    1.25rem;    /* 20px */
  --text-xl:    1.5rem;     /* 24px */
  --text-2xl:   1.875rem;   /* 30px */
  --text-3xl:   2.25rem;    /* 36px */

  /* Line heights */
  --leading-tight:   1.2;
  --leading-snug:    1.35;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  /* Spacing — 4pt base */
  --space-1:  0.25rem;   /* 4px */
  --space-2:  0.5rem;    /* 8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-card:       0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 0 0 1px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-dropdown:   0 4px 24px rgba(0,0,0,0.12);

  /* Transitions */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --duration-slow:   400ms;
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
  color: var(--color-accent-hover);
}
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-snug);
  color: var(--color-text);
  font-weight: 600;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

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

blockquote {
  border-left: 3px solid var(--color-accent);
  padding: var(--space-3) var(--space-6);
  margin: var(--space-6) 0;
  color: var(--color-text-soft);
  font-style: italic;
  background: var(--color-accent-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-12) 0;
}

code, pre {
  font-family: var(--font-mono);
}

code {
  font-size: 0.9em;
  background: var(--color-border-subtle);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

pre {
  background: #f4f3f0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: var(--space-6) 0;
}

pre code {
  background: none;
  padding: 0;
}

::selection {
  background: var(--color-selection);
}

/* WordPress screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: var(--color-surface);
  clip: auto !important;
  clip-path: none;
  color: var(--color-text);
  display: block;
  font-size: var(--text-base);
  height: auto;
  left: var(--space-2);
  line-height: normal;
  padding: var(--space-4);
  text-decoration: none;
  top: var(--space-2);
  width: auto;
  z-index: 100000;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  z-index: 100000;
  transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-2);
}

/* ========================================
   Layout — Page Wrapper (v2 paper-card style)
   ======================================== */

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: var(--space-12) var(--space-4) var(--space-16);
}

.page-content {
  width: 100%;
  max-width: 720px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  padding: var(--space-12) var(--space-10);
  position: relative;
  animation: fadeUp 0.6s var(--ease-out);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Paper fold shadow */
.page-content::before {
  content: '';
  position: absolute;
  z-index: -1;
  transform: skew(3deg, 2deg);
  box-shadow: 0 15px 10px rgba(0,0,0,0.15);
  height: 60px;
  bottom: 12px;
  right: 3px;
  width: 200px;
}

/* ========================================
   Header
   ======================================== */

.site-header {
  text-align: center;
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--color-border);
}

/* Custom Logo */
.custom-logo-link {
  display: inline-block;
  line-height: 0;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.custom-logo-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.custom-logo-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.custom-logo {
  display: block;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
}

/* Site title (when no custom logo) */
.site-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}
.site-title a {
  color: var(--color-text);
}
.site-title a:hover {
  color: var(--color-accent);
}

/* Site description */
.site-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

/* ========================================
   Primary Navigation (Avatar-style)
   ======================================== */

.nav-avatar {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  z-index: 100;
}

.nav-avatar-toggle {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  z-index: 2;
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out);
  padding: 0;
}

.nav-avatar-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  opacity: 0.15;
}

/* Menu icon (hamburger) inside avatar */
.nav-avatar-toggle span,
.nav-avatar-toggle span::before,
.nav-avatar-toggle span::after {
  display: block;
  position: absolute;
  width: 16px;
  height: 2px;
  background: var(--color-accent);
  left: 50%;
  transform: translateX(-50%);
  transition: all var(--duration-normal) var(--ease-out);
}
.nav-avatar-toggle span {
  top: 50%;
  margin-top: -1px;
}
.nav-avatar-toggle span::before {
  content: '';
  top: -5px;
}
.nav-avatar-toggle span::after {
  content: '';
  top: 5px;
}

/* Checkbox hack */
#nav-avatar-input { display: none; }

#nav-avatar-input:checked ~ .nav-avatar-toggle span {
  background: transparent;
}
#nav-avatar-input:checked ~ .nav-avatar-toggle span::before {
  top: 0;
  transform: translateX(-50%) rotate(45deg);
}
#nav-avatar-input:checked ~ .nav-avatar-toggle span::after {
  top: 0;
  transform: translateX(-50%) rotate(-45deg);
}
#nav-avatar-input:checked ~ .nav-avatar-overlay {
  display: block;
}
#nav-avatar-input:checked ~ .primary-menu {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.nav-avatar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
}

/* Primary Menu — dropdown from avatar */
.primary-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 98;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  overflow: hidden;
  min-width: 140px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-out);
  list-style: none;
  padding: var(--space-1) 0;
}

.primary-menu li {
  margin: 0;
}

.primary-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}
.primary-menu a:hover {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* Highlight current page */
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
  color: var(--color-accent);
  font-weight: 600;
}

/* ========================================
   Category Filter (from v2)
   ======================================== */

.category-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-6);
}

.category-filter a,
.category-filter .current-cat {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-out);
}

.category-filter a:hover {
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.category-filter .current-cat {
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  font-weight: 600;
}

/* ========================================
   Post Loop
   ======================================== */

.posts-list {
  list-style: none;
}

/* Sticky post highlight */
.sticky {
  background: var(--color-accent-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

/* Post item */
.post-item {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  transition: all var(--duration-normal) var(--ease-out);
}

.post-item:first-of-type {
  padding-top: 0;
}

.post-item:hover {
  padding-left: var(--space-3);
}

/* ========================================
   No Results
   ======================================== */

.no-results {
  text-align: center;
  padding: var(--space-16) var(--space-4);
}

.no-results .page-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.no-results p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.no-results .search-form {
  max-width: 400px;
  margin: 0 auto;
}

/* ========================================
   Entry Meta
   ======================================== */

.entry-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.entry-meta .byline { display: none; }

.cat-links a {
  display: inline-block;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-size: var(--text-xs);
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  display: inline-block;
}

/* ========================================
   Entry Title
   ======================================== */

.entry-title {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: var(--space-2);
}
.entry-title a {
  color: var(--color-text);
}
.entry-title a:hover {
  color: var(--color-accent);
}

/* ========================================
   Entry Summary / Excerpt
   ======================================== */

.entry-summary {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  line-height: 1.7;
}

.entry-summary p {
  margin-bottom: var(--space-2);
}

/* ========================================
   Featured / Hero Post (v2 style)
   ======================================== */

.post-hero {
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--color-border);
}

.post-hero .entry-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.post-hero .entry-summary {
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

/* Hero thumbnail */
.post-hero-thumb {
  margin-bottom: var(--space-6);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-border-subtle);
}

.post-hero-thumb img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ========================================
   "Read More" link
   ======================================== */

.read-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  transition: gap var(--duration-fast) var(--ease-out);
}
.read-more:hover {
  gap: var(--space-2);
}
.read-more::after {
  content: '→';
  transition: transform var(--duration-fast) var(--ease-out);
}
.read-more:hover::after {
  transform: translateX(2px);
}

/* ========================================
   Post Thumbnail in Loop
   ======================================== */

.post-thumbnail {
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-border-subtle);
}
.post-thumbnail img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ========================================
   Single Post
   ======================================== */

.single .entry-header {
  margin-bottom: var(--space-8);
}

.single .entry-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.single .entry-meta {
  font-size: var(--text-sm);
}

.single .post-thumbnail {
  margin-bottom: var(--space-8);
}

/* Entry content */
.entry-content {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

.entry-content p {
  margin-bottom: var(--space-5);
}

.entry-content h2 {
  font-size: var(--text-xl);
  margin: var(--space-10) 0 var(--space-4);
}

.entry-content h3 {
  font-size: var(--text-lg);
  margin: var(--space-8) 0 var(--space-3);
}

.entry-content h4 {
  font-size: var(--text-md);
  margin: var(--space-6) 0 var(--space-3);
}

.entry-content ul,
.entry-content ol {
  margin: var(--space-4) 0 var(--space-4) var(--space-6);
}

.entry-content li {
  margin-bottom: var(--space-2);
}

.entry-content img {
  border-radius: var(--radius-md);
  margin: var(--space-6) auto;
}

.entry-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.entry-content a:hover {
  text-decoration: none;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.entry-content th {
  background: var(--color-border-subtle);
  font-weight: 600;
}

/* Entry footer (tags, edit link) */
.entry-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.tags-links a {
  display: inline-block;
  padding: 1px var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-border-subtle);
  border-radius: var(--radius-sm);
  margin-right: var(--space-1);
  transition: all var(--duration-fast) var(--ease-out);
}
.tags-links a:hover {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* Post navigation (prev/next on single) */
.post-navigation {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  font-size: var(--text-sm);
}

.post-navigation a {
  color: var(--color-text-soft);
}
.post-navigation a:hover {
  color: var(--color-accent);
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  max-width: 48%;
}

.post-navigation .nav-previous a::before {
  content: '← ';
}
.post-navigation .nav-next a::after {
  content: ' →';
}

/* ========================================
   Page template
   ======================================== */

.page .entry-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-8);
}

/* ========================================
   Comments
   ======================================== */

.comments-area {
  margin-top: var(--space-16);
  padding-top: var(--space-10);
  border-top: 1px solid var(--color-border);
}

.comments-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-6);
}

.comment-list {
  list-style: none;
}

.comment-list .comment {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.comment-list .depth-2 {
  padding-left: var(--space-8);
}
.comment-list .depth-3 {
  padding-left: var(--space-16);
}

.comment-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.comment-meta .fn {
  font-weight: 600;
  color: var(--color-text);
  font-style: normal;
}

.comment-meta a {
  color: var(--color-text-muted);
}

.comment-content {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.comment-content p {
  margin-bottom: var(--space-3);
}

.comment-reply-link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-out);
}
.comment-reply-link:hover {
  color: var(--color-accent);
}

/* Comment form */
.comment-respond {
  margin-top: var(--space-10);
}

.comment-reply-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-6);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.comment-form label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  margin-bottom: var(--space-1);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--duration-fast) var(--ease-out);
  outline: none;
}
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--color-accent);
}

.comment-form textarea {
  min-height: 140px;
  resize: vertical;
}

.comment-form .submit {
  align-self: flex-start;
  padding: var(--space-2) var(--space-6);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.comment-form .submit:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}
.comment-form .submit:active {
  transform: translateY(0);
}

.comment-form .required {
  color: #ef4444;
}

.comment-notes,
.logged-in-as {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ========================================
   Archive / Category / Tag / Search pages
   ======================================== */

.archive .page-header,
.search .page-header {
  margin-bottom: var(--space-10);
  text-align: center;
}

.archive .page-title,
.search .page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}

.archive .archive-description,
.search .archive-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.archive .taxonomy-description {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  margin-top: var(--space-3);
}

/* ========================================
   Search Form
   ======================================== */

.search-form {
  display: flex;
  gap: var(--space-2);
}

.search-form label {
  flex: 1;
}

.search-form .search-field {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.search-form .search-field:focus {
  border-color: var(--color-accent);
}

.search-form .search-submit {
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.search-form .search-submit:hover {
  background: var(--color-accent-hover);
}

/* ========================================
   Pagination (Fooleap-style prev/next)
   ======================================== */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-10);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

.nav-links {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-soft);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}

a.page-numbers:hover {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.page-numbers.current {
  color: var(--color-accent);
  font-weight: 600;
}

.page-numbers.prev,
.page-numbers.next {
  font-weight: 500;
}

/* ========================================
   Sidebar
   ======================================== */
/* Sidebar is only shown on pages that call get_sidebar().
   When active, the layout switches to two-column. */

.has-sidebar .page-content {
  max-width: 1000px;
}

.has-sidebar .content-area {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-12);
  align-items: start;
}

/* Sidebar column */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* Sidebar on archive/search pages — top of content area */
.archive .sidebar,
.search .sidebar {
  margin-top: var(--space-8);
}

/* ========================================
   Widgets
   ======================================== */

.widget {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.widget-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.widget ul {
  list-style: none;
}

.widget ul li {
  margin-bottom: var(--space-2);
}

.widget ul li:last-child {
  margin-bottom: 0;
}

.widget ul li a {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  transition: color var(--duration-fast) var(--ease-out);
}
.widget ul li a:hover {
  color: var(--color-accent);
}

/* Categories widget with count */
.widget_categories ul li,
.widget_archive ul li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-1) 0;
}

.widget_categories ul li a,
.widget_archive ul li a {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
}

.widget_categories .post-count,
.widget_archive .post-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Tag cloud */
.tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.tagcloud a {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs) !important;
  color: var(--color-text-muted) !important;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}
.tagcloud a:hover {
  background: var(--color-accent-subtle);
  color: var(--color-accent) !important;
  border-color: var(--color-accent);
}

/* Recent Posts / Comments widget */
.widget_recent_entries ul li,
.widget_recent_comments ul li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.widget_recent_entries ul li:last-child,
.widget_recent_comments ul li:last-child {
  border-bottom: none;
}

.widget_recent_entries .post-date {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* RSS widget */
.widget_rss .rsswidget {
  font-weight: 600;
  color: var(--color-accent);
}
.widget_rss .rss-date {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: var(--space-1) 0;
}
.widget_rss .rssSummary {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
}
.widget_rss cite {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  font-style: normal;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
  text-align: center;
  padding: var(--space-10) 0 0;
  margin-top: var(--space-12);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.site-footer a {
  color: var(--color-text-muted);
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-3);
  list-style: none;
  flex-wrap: wrap;
}

/* ========================================
   Back to Top
   ======================================== */

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-out);
  border: 1px solid var(--color-border-subtle);
  z-index: 50;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  color: var(--color-accent);
}
.back-to-top svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

/* ========================================
   Reading Progress Bar
   ======================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--color-accent);
  z-index: 200;
  width: 0%;
  transition: width 100ms linear;
}

/* ========================================
   WordPress Core Alignment Styles
   ======================================== */

.alignleft {
  float: left;
  margin-right: var(--space-6);
  margin-bottom: var(--space-4);
}

.alignright {
  float: right;
  margin-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-4);
}

.wp-caption {
  max-width: 100%;
  margin-bottom: var(--space-6);
}

.wp-caption img {
  display: block;
  margin: 0 auto;
}

.wp-caption-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-2);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.gallery-item {
  margin: 0;
}

.gallery-icon img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.gallery-caption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-1);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .page-wrapper {
    padding: var(--space-6) var(--space-3) var(--space-10);
  }

  .page-content {
    padding: var(--space-8) var(--space-6);
  }

  .page-content::before {
    display: none;
  }

  .has-sidebar .content-area {
    grid-template-columns: 1fr;
  }

  .single .entry-title {
    font-size: var(--text-xl);
  }

  .post-hero .entry-title {
    font-size: var(--text-lg);
  }

  .entry-title {
    font-size: var(--text-base);
  }

  .custom-logo {
    max-width: 220px;
  }

  .nav-avatar {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: var(--space-6) var(--space-4);
  }

  .post-item:hover {
    padding-left: 0;
  }

  .entry-meta {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .pagination .page-numbers {
    padding: var(--space-2);
  }

  .footer-links {
    gap: var(--space-4);
  }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .page-content {
    box-shadow: none;
    max-width: 100%;
    padding: 0;
  }
  .page-content::before { display: none; }
  .nav-avatar { display: none; }
  .back-to-top { display: none; }
  .reading-progress { display: none; }
  .site-footer { display: none; }
  a { color: #000; }
}
