/* === A Sustainable Garden — Design System === */
/* Palette: warm cream + honey oak + deep forest green */
/* Typography: Lora (serif headings) + Source Sans 3 (humanist sans body) */

:root {
  --cream: #FAF6F1;
  --cream-dark: #F0E9DF;
  --oak: #C49A6C;
  --oak-light: #D4B48E;
  --oak-dark: #A07A4E;
  --forest: #2D5016;
  --forest-light: #3A6B1E;
  --forest-dark: #1E3A0E;
  --text: #2C2C2C;
  --text-light: #6B6B6B;
  --text-muted: #9B9B9B;
  --white: #FFFFFF;
  --border: #E5DDD3;
  --shadow: rgba(44, 44, 44, 0.08);
  --radius: 8px;
  --max-width: 1200px;
  --narrow-width: 680px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--forest-light); }

/* Focus styles for keyboard navigation (accessibility + CLS prevention) */
:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) { outline: none; }

/* === Layout === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--narrow-width); }
.section { padding: 80px 0; }
.section-intro { color: var(--text-light); font-size: 1.1rem; max-width: 640px; margin-bottom: 40px; }
.section-footer { margin-top: 40px; text-align: center; }

/* === Typography === */
h1, h2, h3, h4 { font-family: 'Lora', Georgia, serif; font-weight: 600; line-height: 1.25; color: var(--text); }
h1 { font-size: 3rem; }
h2 { font-size: 2rem; margin-bottom: 12px; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-align: center;
}
.btn-primary { background: var(--forest); color: var(--white); }
.btn-primary:hover { background: var(--forest-light); color: var(--white); }
.btn-secondary { background: var(--oak); color: var(--white); }
.btn-secondary:hover { background: var(--oak-dark); color: var(--white); }
.btn-outline { background: transparent; border: 2px solid var(--forest); color: var(--forest); }
.btn-outline:hover { background: var(--forest); color: var(--white); }

/* === Announcement Bar === */
.announcement-bar {
  background: var(--forest);
  color: var(--white);
  text-align: center;
  padding: 10px 24px;
  font-size: 0.85rem;
}
.announcement-bar a { color: var(--oak-light); text-decoration: underline; }

/* === Header === */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { color: var(--forest); }
.main-nav { display: flex; gap: 24px; align-items: center; }
.main-nav a { font-size: 0.9rem; color: var(--text-light); font-weight: 500; }
.main-nav a:hover, .main-nav a.active { color: var(--forest); }
.nav-cta {
  background: var(--forest);
  color: var(--white) !important;
  padding: 8px 16px;
  border-radius: var(--radius);
}
.nav-cta:hover { background: var(--forest-light); }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

/* === Search === */
.search-wrapper { position: relative; }
.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.search-toggle:hover { color: var(--forest); }
.search-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 380px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 200;
  overflow: hidden;
}
.search-panel.open { display: block; }
.search-panel input {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
}
.search-panel input:focus { outline: none; }
.search-panel input::placeholder { color: var(--text-muted); }
.search-results { max-height: 360px; overflow-y: auto; }
.search-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.search-result:hover { background: var(--cream); }
.search-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 2px;
}
.search-badge[data-type="article"],
.search-badge[data-type="how-to"] { background: #E8F5E9; color: #2E7D32; }
.search-badge[data-type="comparison"] { background: #E3F2FD; color: #1565C0; }
.search-badge[data-type="beginner"] { background: #FFF3E0; color: #E65100; }
.search-badge[data-type="buying-guide"] { background: #F3E5F5; color: #7B1FA2; }
.search-badge[data-type="seasonal"] { background: #FFF8E1; color: #F57F17; }
.search-badge[data-type="quick-ref"] { background: #E0F7FA; color: #00838F; }
.search-badge[data-type="product"] { background: #FCE4EC; color: #C62828; }
.search-badge[data-type="category"],
.search-badge[data-type="subcategory"] { background: var(--cream-dark); color: var(--oak-dark); }
.search-result-info h4 {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.3;
}
.search-result-info p {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.search-hint {
  padding: 12px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .search-panel {
    width: calc(100vw - 48px);
    right: -12px;
  }
}

/* === Hero === */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--white) 0%, var(--cream) 100%);
}
.hero h1 { margin-bottom: 20px; }
.hero-sub {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* === Card Grid === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  box-shadow: 0 4px 20px var(--shadow);
  transform: translateY(-2px);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-light); font-size: 0.9rem; }
.card .card-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forest);
}

/* === Article Grid === */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}
.article-card:hover {
  box-shadow: 0 4px 20px var(--shadow);
  transform: translateY(-2px);
}
.article-card .card-image {
  aspect-ratio: 16 / 9;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.article-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-card .card-body { padding: 20px; }
.article-card .card-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--oak-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.article-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.article-card p { font-size: 0.9rem; color: var(--text-light); }

/* === Space Grid === */
.space-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.space-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.space-card:hover {
  box-shadow: 0 4px 20px var(--shadow);
  transform: translateY(-2px);
  color: var(--forest);
}
.space-icon { font-size: 2rem; margin-bottom: 12px; }
.space-card h3 { font-size: 0.95rem; }

/* === Product Grid === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.product-card .card-image {
  aspect-ratio: 4 / 3;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.product-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card .card-body { padding: 20px; }
.product-card h3 { margin-bottom: 4px; }
.product-card .price {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 12px;
}
.product-card .btn { width: 100%; }

/* === Email Capture === */
.email-capture {
  background: var(--forest);
  color: var(--white);
  text-align: center;
}
.email-capture h2 { color: var(--white); }
.email-capture p { color: var(--oak-light); margin-bottom: 24px; }
.subscribe-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}
.subscribe-form input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 1rem;
}
.subscribe-form input::placeholder { color: rgba(255,255,255,0.6); }
.subscribe-form input:focus {
  outline: none;
  border-color: var(--oak-light);
}
.subscribe-form .btn { background: var(--oak); white-space: nowrap; }
.subscribe-form .btn:hover { background: var(--oak-dark); }
.form-note { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 12px; }

/* === Affiliate Section === */
.affiliate-section { background: var(--cream-dark); }
.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.affiliate-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.affiliate-card h3 { margin-bottom: 8px; }
.affiliate-card p { font-size: 0.9rem; color: var(--text-light); }

/* === Footer === */
.site-footer {
  background: var(--text);
  color: var(--cream-dark);
  padding: 60px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 { color: var(--white); margin-bottom: 16px; }
.footer-col p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.footer-col a:hover { color: var(--oak-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom p { font-size: 0.85rem; color: var(--text-muted); }
.sister-brands { font-size: 0.85rem; color: var(--text-muted); }
.sister-brands a { color: var(--text-muted); margin-left: 12px; }
.sister-brands a:hover { color: var(--oak-light); }

/* === Mobile === */
@media (max-width: 768px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 56px; }

  .menu-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }
  .main-nav.open {
    display: flex;
    max-height: 400px;
    padding: 16px 24px;
    gap: 12px;
  }
  .nav-cta { text-align: center; }

  .card-grid,
  .article-grid,
  .product-grid,
  .affiliate-grid { grid-template-columns: 1fr; }

  .space-grid { grid-template-columns: repeat(3, 1fr); }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .subscribe-form { flex-direction: column; }

  .hero-actions { flex-direction: column; align-items: center; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .card-grid,
  .article-grid,
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .space-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* === Long-form Content (articles, about, legal pages) === */
.prose { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.prose p { margin-bottom: 20px; font-size: 1.05rem; line-height: 1.8; }
.prose h2 { margin-top: 48px; margin-bottom: 16px; font-size: 1.5rem; }
.prose h3 { margin-top: 32px; margin-bottom: 12px; }
.prose ul, .prose ol { margin-bottom: 20px; padding-left: 24px; }
.prose li { margin-bottom: 8px; font-size: 1.05rem; line-height: 1.8; }
.prose img { border-radius: var(--radius); margin: 32px 0; }
.prose blockquote {
  border-left: 3px solid var(--oak);
  padding-left: 20px;
  color: var(--text-light);
  margin: 32px 0;
  font-style: italic;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--oak-light);
  transition: text-decoration-color 0.2s;
}
.prose a:hover {
  text-decoration-color: var(--forest);
}

/* === Prose Tables (comparison tables, data tables) === */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.95rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.prose thead {
  background: var(--cream-dark);
}
.prose th {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.prose td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.prose tr:last-child td {
  border-bottom: none;
}
.prose tbody tr:hover {
  background: var(--cream);
}
/* Responsive table wrapper for mobile */
@media (max-width: 768px) {
  .prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

/* === Article Page === */
.article-hero { padding: 60px 0 40px; }
.article-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }
.article-meta a { color: var(--oak-dark); }

/* === Category Page === */
.category-hero { padding: 60px 0 40px; }
.subcategory-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.subcat-pill {
  display: inline-block;
  padding: 8px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  transition: all 0.2s;
}
.subcat-pill:hover { background: var(--forest); color: var(--white); border-color: var(--forest); }

/* === Shop Page === */
.shop-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filter-pill {
  padding: 8px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-pill:hover, .filter-pill.active {
  background: var(--forest);
  color: var(--white);
  border-color: var(--forest);
}

/* === Contact Form === */
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.form-group .required { color: var(--oak-dark); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--forest); }
.form-group textarea { resize: vertical; }

/* === Newsletter Page === */
.newsletter-form .form-group input {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 12px;
}
.newsletter-form .form-group input:focus { outline: none; border-color: var(--forest); }

/* === Product Detail === */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.product-detail .product-gallery {
  background: var(--cream-dark);
  border-radius: var(--radius);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.product-detail .product-info h1 { margin-bottom: 8px; }
.product-detail .product-price { font-size: 1.5rem; font-weight: 600; color: var(--forest); margin-bottom: 16px; }
.product-detail .product-desc { color: var(--text-light); line-height: 1.7; margin-bottom: 24px; }
.product-detail .product-meta { font-size: 0.9rem; color: var(--text-muted); margin-top: 24px; }
.product-detail .product-meta dt { font-weight: 600; color: var(--text); margin-top: 12px; }
.product-detail .product-meta dd { margin-left: 0; }

@media (max-width: 768px) {
  .product-detail { grid-template-columns: 1fr; gap: 24px; }
}

/* === Loading Skeleton === */
.skeleton {
  background: linear-gradient(90deg, var(--cream-dark) 25%, var(--cream) 50%, var(--cream-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
.skeleton-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.skeleton-card .skeleton-image { height: 200px; }
.skeleton-card .skeleton-body { padding: 20px; }
.skeleton-card .skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 4px;
}
.skeleton-card .skeleton-line:last-child { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Noscript === */
noscript .static-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
noscript .static-card h3 { margin-bottom: 8px; }
noscript .static-card p { color: var(--text-light); font-size: 0.9rem; }
