/*
Theme Name: Evve Garden
Theme URI: https://evvebahcenasil.com
Author: Evve Bahce Editorial Team
Description: A clean, SEO-friendly garden theme with sticky TOC and card grid.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.4
Requires PHP: 7.2
License: GPL-2.0-or-later
Text Domain: evve-garden
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  background: #f9fafb;
  color: #1a1a1a;
  line-height: 1.7;
}
a { color: #2e7d32; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ===== HEADER ===== */
.site-header {
  background: #1b5e20;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}
.site-header .site-title a {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: Georgia, serif;
}
.site-header nav a {
  color: rgba(255,255,255,0.9);
  margin-left: 20px;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: #fff; text-decoration: none; }

/* ===== MAIN LAYOUT ===== */
.site-main { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

/* ===== HOMEPAGE GRID ===== */
.home-section { margin-bottom: 48px; }
.home-section h2.category-title {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  color: #1b5e20;
  border-bottom: 3px solid #1b5e20;
  padding-bottom: 8px;
  margin-bottom: 24px;
}
.post-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}
.post-grid li {
  display: block !important;
  max-width: 100% !important;
  width: 100% !important;
}
.post-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.post-card .card-img { width: 100%; height: 180px; object-fit: cover; }
.post-card .card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.post-card .card-title {
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
  line-height: 1.4;
}
.post-card .card-title a { color: inherit; }
.post-card .card-title a:hover { color: #2e7d32; }
.post-card .card-excerpt { font-size: 0.875rem; color: #555; flex: 1; }
.post-card .card-meta { font-size: 0.8rem; color: #888; margin-top: 12px; }

/* ===== ARTICLE LAYOUT ===== */
.article-wrap {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  align-items: start;
}
.article-content { min-width: 0; }
.article-content h1 {
  font-family: Georgia, serif;
  font-size: 2rem;
  color: #1a1a1a;
  margin-bottom: 16px;
  line-height: 1.3;
}
.article-content h2 {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  color: #1b5e20;
  margin: 32px 0 12px;
}
.article-content h3 {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  color: #2e7d32;
  margin: 24px 0 10px;
}
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 16px; }
.article-content li { margin-bottom: 6px; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: #2e7d32; }
.breadcrumb .sep { color: #ccc; }

/* ===== TOC SIDEBAR ===== */
.toc-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.toc-sidebar h3 {
  font-family: Georgia, serif;
  font-size: 1rem;
  color: #1b5e20;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8f5e9;
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 6px; }
.toc-list a {
  font-size: 0.875rem;
  color: #444;
  line-height: 1.4;
  display: block;
  padding: 3px 0;
  border-left: 2px solid transparent;
  padding-left: 8px;
  transition: all 0.15s;
}
.toc-list a:hover, .toc-list a.active {
  color: #1b5e20;
  border-left-color: #1b5e20;
  text-decoration: none;
}
.toc-list .toc-h3 { padding-left: 20px; }

/* ===== POST META ===== */
.post-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.post-meta .author { color: #2e7d32; font-weight: 600; }

/* ===== FEATURED IMAGE ===== */
.featured-image { margin-bottom: 24px; border-radius: 8px; overflow: hidden; }
.featured-image img { width: 100%; height: auto; }

/* ===== FOOTER ===== */
.site-footer {
  background: #1a1a1a;
  color: #ccc;
  padding: 40px 24px;
  margin-top: 60px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 32px; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.footer-col a { color: #aaa; font-size: 0.875rem; display: block; margin-bottom: 6px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { text-align: center; margin-top: 32px; padding-top: 24px; border-top: 1px solid #333; font-size: 0.8rem; color: #666; }

/* ===== WP BLOCK OVERRIDES ===== */
.wp-block-query.post-grid { display: block !important; }
.wp-block-query.post-grid ul.wp-block-post-template { width: 100% !important; max-width: 100% !important; }
.wp-block-post-template { display: grid !important; grid-template-columns: repeat(4,1fr) !important; gap: 20px !important; list-style: none !important; padding: 0 !important; margin: 0 !important; }
.wp-block-post-template li { max-width: 100% !important; }
.is-layout-constrained > * { max-width: 100% !important; }
.entry-content .alignwide { max-width: 100% !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .post-grid, .wp-block-post-template { grid-template-columns: repeat(2,1fr) !important; }
  .article-wrap { grid-template-columns: 1fr; }
  .toc-sidebar { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .post-grid, .wp-block-post-template { grid-template-columns: 1fr !important; }
  .article-content h1 { font-size: 1.5rem; }
}
