/*
Theme Name: Happy Gabby
Theme URI: https://happygabby.com
Author: Happy Gabby Team
Description: Lightweight, SEO-optimized theme for toy & gift reviews
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: happygabby
*/

/* === Reset & Base === */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --color-primary: #FF6B6B;
  --color-primary-dark: #E85555;
  --color-secondary: #4ECDC4;
  --color-accent: #FFE66D;
  --color-dark: #2C3E50;
  --color-text: #333;
  --color-text-light: #666;
  --color-bg: #FFF;
  --color-bg-light: #F8F9FA;
  --color-bg-warm: #FFF9F0;
  --color-border: #E9ECEF;
  --color-success: #51CF66;
  --color-star: #FFC107;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Nunito', var(--font-sans);
  --max-width: 1200px;
  --content-width: 800px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }
img { max-width: 100%; height: auto; display: block; }

/* === Typography === */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-heading);
  color: var(--color-dark);
  line-height: 1.3;
  font-weight: 700;
}
h1 { font-size: 2.2rem; margin-bottom: 1rem; }
h2 { font-size: 1.6rem; margin: 2rem 0 0.8rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--color-accent); }
h3 { font-size: 1.3rem; margin: 1.5rem 0 0.6rem; }
p { margin-bottom: 1rem; }
ul,ol { margin: 0 0 1rem 1.5rem; }
li { margin-bottom: 0.3rem; }

/* === Layout === */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.content-area { max-width: var(--content-width); margin: 0 auto; padding: 2rem 1.5rem; }
main { flex: 1; }

/* === Header === */
.site-header {
  background: var(--color-bg);
  border-bottom: 3px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-dark);
}
.site-logo span { color: var(--color-primary); }
.site-logo:hover { color: var(--color-dark); }

/* === Navigation === */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.main-nav a:hover { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--color-dark); }

/* === Breadcrumbs === */
.breadcrumbs {
  padding: 0.8rem 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
}
.breadcrumbs a { color: var(--color-text-light); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .sep { margin: 0 0.4rem; }

/* === Article Card (archive/home) === */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.post-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-card__image { aspect-ratio: 16/10; overflow: hidden; background: var(--color-bg-light); }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 1.2rem; }
.post-card__category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.post-card__title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.post-card__title a { color: var(--color-dark); }
.post-card__title a:hover { color: var(--color-primary); }
.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* === Single Article === */
.article-header { margin-bottom: 2rem; }
.article-header .category-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 0.8rem;
}
.article-meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 0.5rem;
}
.article-meta span { margin-right: 1rem; }

.article-content { font-size: 1.05rem; line-height: 1.8; }
.article-content h2 { margin-top: 2.5rem; }
.article-content h3 { margin-top: 2rem; }
.article-content img { border-radius: var(--radius); margin: 1.5rem 0; }
.article-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--color-bg-warm);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.article-content th, .article-content td {
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-border);
  text-align: left;
}
.article-content th { background: var(--color-bg-light); font-weight: 700; }

/* === Product Box === */
.product-box {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.product-box__image { flex: 0 0 150px; }
.product-box__image img { border-radius: var(--radius); }
.product-box__info { flex: 1; }
.product-box__title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.product-box__rating { color: var(--color-star); margin-bottom: 0.5rem; }
.product-box__price { font-size: 1.3rem; font-weight: 700; color: var(--color-primary); margin-bottom: 0.5rem; }
.product-box__pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.8rem 0; }
.product-box__pros h4 { color: var(--color-success); }
.product-box__cons h4 { color: var(--color-primary); }
.btn-affiliate {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  transition: background var(--transition);
}
.btn-affiliate:hover { background: var(--color-primary-dark); color: #fff; }

/* === Table of Contents === */
.toc {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}
.toc__title { font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem; cursor: pointer; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin-bottom: 0.3rem; font-size: 0.9rem; }
.toc a { color: var(--color-text); }
.toc a:hover { color: var(--color-primary); }

/* === FAQ Section === */
.faq-section { margin: 2rem 0; }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.faq-question {
  display: block;
  width: 100%;
  background: var(--color-bg-light);
  border: none;
  padding: 1rem 1.2rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question::after { content: '+'; font-size: 1.3rem; color: var(--color-primary); }
.faq-item.active .faq-question::after { content: '-'; }
.faq-answer { padding: 0 1.2rem 1rem; display: none; }
.faq-item.active .faq-answer { display: block; }

/* === Author Box === */
.author-box {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  background: var(--color-bg-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.author-box__avatar { flex: 0 0 80px; width: 80px; height: 80px; border-radius: 50%; background: var(--color-secondary); }
.author-box__name { font-weight: 700; font-size: 1.05rem; }
.author-box__bio { font-size: 0.9rem; color: var(--color-text-light); margin-top: 0.3rem; }

/* === Related Posts === */
.related-posts { margin: 2.5rem 0; }
.related-posts h3 { margin-bottom: 1rem; }

/* === Hub Page === */
.hub-hero {
  background: linear-gradient(135deg, var(--color-bg-warm), var(--color-bg-light));
  padding: 3rem 0;
  text-align: center;
  margin-bottom: 2rem;
}
.hub-hero h1 { font-size: 2.5rem; }
.hub-hero p { font-size: 1.1rem; color: var(--color-text-light); max-width: 600px; margin: 0.5rem auto 0; }

.age-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.age-card {
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition);
}
.age-card:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.age-card__number { font-size: 2rem; font-weight: 800; color: var(--color-primary); }
.age-card__label { font-size: 0.9rem; color: var(--color-text-light); }

/* === Footer === */
.site-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-about h3, .footer-links h3 { color: #fff; font-size: 1rem; margin-bottom: 0.8rem; }
.footer-about p { font-size: 0.9rem; line-height: 1.6; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding: 1rem 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  text-align: center;
}
.affiliate-notice {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-size: 0.78rem;
  margin-top: 1rem;
  line-height: 1.5;
}

/* === Mobile === */
@media (max-width: 768px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  .header-inner { padding: 0.6rem 1rem; }
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-bg); box-shadow: var(--shadow-lg); padding: 1rem; }
  .main-nav.active { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li { border-bottom: 1px solid var(--color-border); }
  .main-nav a { display: block; padding: 0.7rem 0; }
  .post-grid { grid-template-columns: 1fr; }
  .product-box { flex-direction: column; }
  .product-box__image { flex: none; width: 100%; }
  .product-box__pros-cons { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hub-hero h1 { font-size: 1.8rem; }
  .age-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .content-area { padding: 1rem; }
}

/* Pagination */
.nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.nav-links a, .nav-links span {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.nav-links a {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.nav-links a:hover { background: var(--accent); color: #fff; }
.nav-links .current {
  background: var(--accent);
  color: #fff;
}

/* Print styles */
@media print {
  .site-header, .main-nav, .menu-toggle, .breadcrumbs,
  .toc, .related-posts, .site-footer, .affiliate-notice,
  .faq-section, .author-box, .nav-links { display: none; }
  .content-area { max-width: 100%; padding: 0; box-shadow: none; }
  a[href]:after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
