:root {
  --primary-color: #4f46e5;
  --bg-color: #ffffff;
  --text-color: #1f2937;
  --header-bg: #f8fafc;
  --footer-bg: #1e293b;
  --footer-text: #cbd5e1;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
}

[data-theme="dark"] {
  --primary-color: #818cf8;
  --bg-color: #0f172a;
  --text-color: #e2e8f0;
  --header-bg: #1e293b;
  --footer-bg: #020617;
  --footer-text: #94a3b8;
  --card-bg: #1e293b;
  --border-color: #334155;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--primary-color);
}

.primary-menu > ul {
  display: flex;
  list-style: none;
  gap: 20px;
}

.primary-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s;
}

.primary-menu a:hover {
  color: var(--primary-color);
}

.theme-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Main Content */
.main-content {
  padding: 40px 20px;
  min-height: calc(100vh - 200px);
}

.post-layout .content-wrapper {
  max-width: 1000px; /* Wide layout as requested */
  margin: 0 auto;
}

.page-title {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-align: center;
  color: var(--primary-color);
}

.post-date {
  text-align: center;
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 30px;
  font-weight: 500;
}

/* WP Content Reset */
.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin: 20px 0;
}

.entry-content p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.entry-content h2, .entry-content h3 {
  margin-top: 30px;
  margin-bottom: 15px;
}

.entry-content ul, .entry-content ol {
  margin-bottom: 20px;
  padding-left: 20px;
}

/* Home Grid */
.hero-section {
  text-align: center;
  margin-bottom: 50px;
}

.hero-section h1 {
  font-size: 3rem;
  color: var(--primary-color);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.post-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.post-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card .no-img {
  width: 100%;
  height: 200px;
  background-color: var(--border-color);
}

.post-card h3 {
  padding: 20px;
  font-size: 1.2rem;
}

/* Interaction Bar */
.interaction-bar {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.like-btn, .dislike-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.like-btn:hover { background-color: rgba(79, 70, 229, 0.1); }
.dislike-btn:hover { background-color: rgba(239, 68, 68, 0.1); }

/* Dropdown Menu */
.menu-item-has-children {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--header-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  flex-direction: column !important;
  gap: 0 !important;
  z-index: 1000;
  padding: 10px 0;
}

.menu-item-has-children:hover .dropdown-menu {
  display: flex;
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-menu a {
  padding: 10px 20px;
  display: block;
}

.dropdown-menu a:hover {
  background-color: rgba(0,0,0,0.05);
}

[data-theme="dark"] .dropdown-menu a:hover {
  background-color: rgba(255,255,255,0.05);
}

/* Footer Widgets */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 60px 0 20px;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-widget h3 {
  color: #fff;
  margin-bottom: 20px;
  font-size: 1.2rem;
  position: relative;
  padding-bottom: 10px;
}

.footer-widget h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--primary-color);
}

.footer-widget ul {
  list-style: none;
}

.footer-widget ul li {
  margin-bottom: 10px;
}

.footer-widget ul a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-widget ul a:hover {
  color: #fff;
  padding-left: 5px;
}

.copyright {
  width: 100%;
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  overflow-wrap: anywhere;
}

th, td {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  text-align: left;
}

th {
  background-color: rgba(0,0,0,0.05);
  font-weight: 600;
}

[data-theme="dark"] th {
  background-color: rgba(255,255,255,0.05);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table of Contents */
.toc-container {
  background-color: var(--header-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin: 30px 0;
  max-width: fit-content;
  min-width: 300px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.toc-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--primary-color);
}

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

.toc-list li {
  margin-bottom: 8px;
}

.toc-level-1 {
  font-weight: 600;
}

.toc-level-2 {
  padding-left: 20px;
  font-size: 0.95em;
}

.toc-list a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s;
}

.toc-list a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Coloring Image & Download Button */
.coloring-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 40px 0;
  background-color: var(--header-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.coloring-image-wrapper img {
  margin: 0 0 20px 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 100%;
}

.download-btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: #ffffff !important;
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .header-container {
      flex-direction: row;
      flex-wrap: wrap;
      height: auto;
      padding: 15px 0;
  }
  
  .mobile-menu-toggle {
      display: block;
  }
  
  .primary-menu {
      width: 100%;
      display: none; /* hidden by default on mobile */
      margin-top: 15px;
  }
  
  .primary-menu.active {
      display: block;
  }
  
  .primary-menu > ul {
      flex-direction: column;
      gap: 10px;
      align-items: center;
  }
  
  .dropdown-menu {
      position: static;
      box-shadow: none;
      border: none;
      background-color: rgba(0,0,0,0.02);
      width: 100%;
      text-align: center;
  }
  
  [data-theme="dark"] .dropdown-menu {
      background-color: rgba(255,255,255,0.02);
  }
  
  /* Wrap tables on mobile if they don't have table-responsive wrapper */
  .entry-content {
      overflow-x: auto;
  }
}
