/*
Theme Name: WikiPress
Description: A clean, modern WordPress theme inspired by Wikipedia's design.
Version: 2.2
Author: Your Name
Text Domain: wikipress
*/

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Dark Mode Variables */
:root {
  --bg-color: #fff;
  --text-color: #222;
  --border-color: #a2a9b1;
  --accent-color: #0645ad;
  --secondary-bg: #f8f9fa;
  --tertiary-bg: #eaecf0;
  --meta-color: #54595d;
  --hover-bg: #eaecf0;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --border-color: #404040;
  --accent-color: #4a9eff;
  --secondary-bg: #2d2d2d;
  --tertiary-bg: #404040;
  --meta-color: #b0b0b0;
  --hover-bg: #404040;
}

/* Apply dark mode variables */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Liberation Sans", "Helvetica Neue", Arial,
    sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* Header */
.site-header {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  min-height: 60px;
}

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

.site-logo {
  width: 35px;
  height: 35px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35 35"><circle cx="17.5" cy="17.5" r="17.5" fill="%23f8f9fa" stroke="%23a2a9b1"/><path d="M8 10h19v2H8zm0 4h15v2H8zm0 4h21v2H8zm0 4h17v2H8z" fill="%23222"/></svg>')
    no-repeat center;
  background-size: contain;
}

.site-title {
  font-size: 20px;
  font-weight: 400;
  margin: 0;
  color: var(--text-color);
  font-family: "Linux Libertine", Georgia, Times, serif;
}

.site-title a {
  color: var(--text-color);
  text-decoration: none;
}

.site-description {
  font-size: 11px;
  color: var(--meta-color);
  margin: 2px 0 0 0;
  font-style: italic;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-search {
  position: relative;
}

.header-search input {
  padding: 6px 30px 6px 10px;
  border: 1px solid #a2a9b1;
  font-size: 13px;
  width: 200px;
  background-color: #fff;
}

.header-search input:focus {
  outline: 1px solid #36c;
  border-color: #36c;
}

.header-search button {
  position: absolute;
  right: 2px;
  top: 2px;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.header-links {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.header-links a {
  color: #0645ad;
  text-decoration: none;
}

.header-links a:hover {
  text-decoration: underline;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: none;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dark-mode-toggle:hover {
  background-color: var(--hover-bg);
}

[data-theme="dark"] .dark-mode-toggle .light-icon {
  display: none;
}

[data-theme="light"] .dark-mode-toggle .dark-icon,
.dark-mode-toggle .dark-icon {
  display: none;
}

[data-theme="dark"] .dark-mode-toggle .dark-icon {
  display: inline;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Navigation */
.main-navigation {
  background-color: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
}

.main-navigation .container {
  padding: 0 20px;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.main-navigation li {
  position: relative;
}

.main-navigation a {
  color: var(--accent-color);
  text-decoration: none;
  padding: 8px 12px;
  display: block;
  font-size: 13px;
  transition: background-color 0.2s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  background-color: var(--hover-bg);
  text-decoration: underline;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  padding: 8px 15px;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  text-align: left;
}

/* Breadcrumb */
.breadcrumb-area {
  background-color: var(--secondary-bg);
  padding: 8px 20px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb-area a {
  color: var(--accent-color);
  text-decoration: none;
}

.breadcrumb-area a:hover {
  text-decoration: underline;
}

/* Main Content Area - Improved Proportions */
.site-main {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 25px;
  padding: 20px;
  min-height: calc(100vh - 200px);
}

/* Homepage Layout */
.homepage-layout {
  grid-template-columns: 1fr;
  gap: 0;
}

.homepage-content {
  max-width: 100%;
}

/* Welcome Section with Icons */
.welcome-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #eaecf0 100%);
  border: 1px solid #a2a9b1;
  padding: 30px 20px;
  margin-bottom: 25px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.welcome-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="%23a2a9b1" opacity="0.1"/></svg>')
    repeat;
  animation: float 20s infinite linear;
  pointer-events: none;
}

@keyframes float {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.welcome-title {
  font-size: 32px;
  font-weight: normal;
  margin-bottom: 12px;
  font-family: "Linux Libertine", Georgia, Times, serif;
  color: #000;
  position: relative;
  z-index: 1;
}

.welcome-subtitle {
  font-size: 18px;
  color: #54595d;
  margin-bottom: 20px;
  font-style: italic;
  position: relative;
  z-index: 1;
}

.welcome-description {
  font-size: 14px;
  line-height: 1.6;
  color: #222;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.welcome-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 10px;
}

.stat-number {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #0645ad;
  font-family: "Linux Libertine", Georgia, Times, serif;
}

.stat-label {
  font-size: 12px;
  color: #54595d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Widget Areas */
.homepage-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.widget-box {
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.widget-box:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.widget-box-header {
  background: linear-gradient(135deg, var(--tertiary-bg) 0%, var(--secondary-bg) 100%);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.widget-box-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0645ad, #36c);
}

.widget-box-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.widget-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
}

.widget-box-content {
  padding: 20px;
}

/* Icon Styles */
.icon-articles::before {
  content: "📄";
}
.icon-categories::before {
  content: "📁";
}
.icon-users::before {
  content: "👥";
}
.icon-recent::before {
  content: "🕒";
}
.icon-popular::before {
  content: "⭐";
}
.icon-search::before {
  content: "🔍";
}
.icon-help::before {
  content: "❓";
}
.icon-tools::before {
  content: "🔧";
}

/* Featured Content */
.featured-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.main-content-area {
  background-color: #fff;
}

/* Article Layout - Better Proportions */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 30px;
  padding: 25px;
  min-height: calc(100vh - 200px);
}

.article-content {
  max-width: none;
  background-color: var(--bg-color);
}

.main-article {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 0;
  margin-bottom: 30px;
}

.article-header {
  padding: 30px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
}

.article-title {
  font-size: 32px;
  font-weight: normal;
  margin: 0 0 20px 0;
  font-family: "Linux Libertine", Georgia, Times, serif;
  color: var(--text-color);
  line-height: 1.3;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--meta-color);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-icon {
  font-size: 14px;
}

.article-body {
  padding: 30px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-color);
}

.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  font-family: "Linux Libertine", Georgia, Times, serif;
  color: var(--text-color);
  margin: 25px 0 15px 0;
  font-weight: normal;
}

.article-body h2 {
  font-size: 24px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.article-body h3 {
  font-size: 20px;
}

.article-body h4 {
  font-size: 18px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body a {
  color: var(--accent-color);
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

.article-footer {
  padding: 25px 30px;
  border-top: 1px solid var(--border-color);
  background-color: var(--secondary-bg);
}

.article-tags {
  margin-bottom: 25px;
}

.article-tags h4 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--text-color);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-link {
  background: var(--tertiary-bg);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  text-decoration: none;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.tag-link:hover {
  background-color: var(--hover-bg);
  transform: translateY(-1px);
}

.article-actions h4 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--text-color);
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-link {
  background: var(--tertiary-bg);
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.share-link:hover {
  background-color: var(--hover-bg);
  transform: translateY(-1px);
}

/* Article Navigation */
.article-navigation {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 25px;
  margin-bottom: 30px;
}

.article-navigation h3 {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 20px;
  color: var(--text-color);
  font-family: "Linux Libertine", Georgia, Times, serif;
}

.nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.nav-previous,
.nav-next {
  padding: 15px;
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-previous:hover,
.nav-next:hover {
  background-color: var(--hover-bg);
  transform: translateY(-1px);
}

.nav-subtitle {
  font-size: 12px;
  color: var(--meta-color);
  display: block;
  margin-bottom: 5px;
}

.nav-title {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.nav-title:hover {
  text-decoration: underline;
}

/* Related Articles */
.related-articles {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 25px;
  margin-bottom: 30px;
}

.related-articles h3 {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 20px;
  color: var(--text-color);
  font-family: "Linux Libertine", Georgia, Times, serif;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.related-card {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.related-card:hover {
  background-color: var(--hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-card h4 {
  font-size: 16px;
  margin-bottom: 10px;
  font-family: "Linux Libertine", Georgia, Times, serif;
}

.related-card h4 a {
  color: var(--accent-color);
  text-decoration: none;
}

.related-card h4 a:hover {
  text-decoration: underline;
}

.related-card p {
  font-size: 13px;
  color: var(--text-color);
  margin-bottom: 10px;
  line-height: 1.5;
}

.related-meta {
  font-size: 12px;
  color: var(--meta-color);
}

/* Comments Section */
.comments-section {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 25px;
}

.comments-section h3 {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 20px;
  color: var(--text-color);
  font-family: "Linux Libertine", Georgia, Times, serif;
}

.featured-article {
  border: 1px solid #a2a9b1;
  background-color: #fff;
  margin-bottom: 20px;
  transition: box-shadow 0.3s ease;
}

.featured-article:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.featured-article-header {
  background: linear-gradient(135deg, #eaecf0 0%, #f8f9fa 100%);
  padding: 12px 15px;
  border-bottom: 1px solid #a2a9b1;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.featured-article-header::before {
  content: "⭐";
  font-size: 16px;
}

.featured-article-content {
  padding: 20px;
}

.featured-article h3 {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 12px;
  font-family: "Linux Libertine", Georgia, Times, serif;
}

.featured-article h3 a {
  color: #0645ad;
  text-decoration: none;
}

.featured-article h3 a:hover {
  text-decoration: underline;
}

.featured-article p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.featured-article .read-more {
  color: #0645ad;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.featured-article .read-more:hover {
  text-decoration: underline;
}

/* Categories Section */
.categories-section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 22px;
  font-weight: normal;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 3px solid #a2a9b1;
  font-family: "Linux Libertine", Georgia, Times, serif;
  color: #000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "📚";
  font-size: 24px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.category-box {
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category-box:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.category-header {
  background: linear-gradient(135deg, var(--tertiary-bg) 0%, var(--secondary-bg) 100%);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.category-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0645ad, #36c);
}

.category-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-title a {
  color: var(--accent-color);
  text-decoration: none;
}

.category-title a:hover {
  text-decoration: underline;
}

.category-content {
  padding: 20px;
}

.category-description {
  font-size: 13px;
  color: #54595d;
  margin-bottom: 15px;
  line-height: 1.5;
}

.category-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-links li {
  margin-bottom: 8px;
  font-size: 13px;
  position: relative;
  padding-left: 15px;
}

.category-links li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #0645ad;
  font-weight: bold;
}

.category-links a {
  color: var(--accent-color);
  text-decoration: none;
}

.category-links a:hover {
  text-decoration: underline;
}

.category-meta {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eaecf0;
  font-size: 12px;
  color: #54595d;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Recent Posts */
.recent-posts {
  margin-bottom: 30px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.post-card {
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.post-card-header {
  padding: 20px;
  border-bottom: 1px solid #eaecf0;
}

.post-card-title {
  font-size: 16px;
  font-weight: normal;
  margin: 0 0 10px 0;
  font-family: "Linux Libertine", Georgia, Times, serif;
}

.post-card-title a {
  color: var(--accent-color);
  text-decoration: none;
}

.post-card-title a:hover {
  text-decoration: underline;
}

.post-card-meta {
  font-size: 12px;
  color: #54595d;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-card-content {
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
}

/* Widget Styles for Homepage */
.widget-style-featured {
  border-left: 4px solid #e74c3c;
}

.widget-style-featured .widget-box-header {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
}

.widget-style-highlight {
  border-left: 4px solid #f39c12;
}

.widget-style-highlight .widget-box-header {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: white;
}

.widget-style-minimal .widget-box-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 15px 20px 10px;
}

.widget-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}

.widget-link:hover {
  text-decoration: underline;
}

.widget-action {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

/* Sidebar - Narrower Width */
.sidebar {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar .widget {
  margin-bottom: 25px;
  border-bottom: 1px solid #eaecf0;
  padding-bottom: 20px;
}

.sidebar .widget:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar h3 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  margin-bottom: 6px;
  position: relative;
  padding-left: 12px;
}

.sidebar li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #0645ad;
  font-weight: bold;
}

.sidebar a {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
}

.sidebar a:hover {
  text-decoration: underline;
}

.sidebar .widget-date {
  font-size: 11px;
  color: #54595d;
  display: block;
  margin-top: 2px;
}

/* Footer */
.site-footer {
  background-color: var(--secondary-bg);
  border-top: 1px solid var(--border-color);
  padding: 30px 20px 20px;
  margin-top: 40px;
  font-size: 12px;
  color: var(--meta-color);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
  margin-bottom: 20px;
}

.footer-section h4 {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-section li {
  margin-bottom: 5px;
}

.footer-section a {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 12px;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #a2a9b1;
}

/* Performance Optimizations */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .site-main {
    grid-template-columns: 1fr 200px;
    gap: 20px;
  }

  .featured-content {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .header-search input {
    width: 150px;
  }

  .welcome-stats {
    gap: 20px;
  }

  .article-layout {
    grid-template-columns: 1fr 220px;
    gap: 25px;
  }
}

@media (max-width: 768px) {
  /* Header Mobile */
  .header-content {
    flex-direction: column;
    gap: 12px;
    padding: 12px 15px;
  }

  .site-branding {
    width: 100%;
    justify-content: center;
  }

  .header-right {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-search input {
    width: 200px;
  }

  .header-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Navigation Mobile */
  .mobile-menu-toggle {
    display: block;
  }

  .main-navigation ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #a2a9b1;
    border-top: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .main-navigation ul.show {
    display: flex;
  }

  .main-navigation li {
    border-bottom: 1px solid #eaecf0;
  }

  .main-navigation a {
    padding: 12px 15px;
  }

  /* Main Layout Mobile */
  .site-main {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .homepage-layout {
    padding: 10px;
  }

  .sidebar {
    order: 2;
    position: static;
    margin-top: 20px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .sidebar {
    order: 2;
    position: static;
    margin-top: 20px;
  }

  .article-header,
  .article-body,
  .article-footer {
    padding: 20px;
  }

  .article-title {
    font-size: 26px;
  }

  .article-meta {
    gap: 15px;
  }

  .nav-links {
    grid-template-columns: 1fr;
  }

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

  .header-controls {
    flex-direction: column;
    gap: 10px;
  }

  .header-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Welcome Section Mobile */
  .welcome-section {
    padding: 20px 15px;
    margin-bottom: 20px;
  }

  .welcome-title {
    font-size: 26px;
  }

  .welcome-subtitle {
    font-size: 16px;
  }

  .welcome-stats {
    gap: 15px;
  }

  .stat-number {
    font-size: 20px;
  }

  /* Widgets Mobile */
  .homepage-widgets {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .widget-box-header,
  .widget-box-content {
    padding: 15px;
  }

  /* Categories Mobile */
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .category-header,
  .category-content {
    padding: 15px;
  }

  /* Posts Mobile */
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .post-card-header,
  .post-card-content {
    padding: 15px;
  }

  /* Footer Mobile */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .site-main,
  .homepage-layout {
    padding: 10px;
  }

  .welcome-section {
    padding: 15px 10px;
  }

  .welcome-title {
    font-size: 22px;
  }

  .welcome-subtitle {
    font-size: 14px;
  }

  .welcome-stats {
    flex-direction: column;
    gap: 10px;
  }

  .stat-item {
    padding: 5px;
  }

  .widget-box-header,
  .widget-box-content,
  .category-header,
  .category-content,
  .post-card-header,
  .post-card-content {
    padding: 12px;
  }

  .header-search input {
    width: 100%;
    max-width: 250px;
  }

  .section-title {
    font-size: 20px;
  }

  .article-header,
  .article-body,
  .article-footer {
    padding: 15px;
  }

  .article-title {
    font-size: 22px;
  }

  .share-links {
    flex-direction: column;
  }

  .tags-list {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .main-navigation,
  .sidebar,
  .site-footer {
    display: none;
  }

  .site-main {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .widget-box,
  .category-box,
  .post-card {
    border: 1px solid #000;
    break-inside: avoid;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .widget-box,
  .category-box,
  .post-card,
  .featured-article {
    border-width: 2px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus {
  outline: 2px solid #36c;
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #000;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 1001;
}

.skip-link:focus {
  left: 6px;
  top: 6px;
}
