/* =============================================================
   YouTube Kids Alternatives — main.css
   Minimal personal-blog aesthetic (TheSweetSetup-inspired)
   No card grids. Flat nav. Single-column reading. 768px breakpoint.
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Colors */
  --color-bg: #FFFFFF;
  --color-bg-offwhite: #FAFAFA;
  --color-text: #1A1A1A;
  --color-text-secondary: #4A4A4A;
  --color-text-meta: #767676;
  --color-accent: #2563EB;
  --color-accent-hover: #1E40AF;
  --color-callout-bg: #F3F4F6;
  --color-border: #E5E7EB;
  --color-green: #10B981;
  --color-amber: #F59E0B;
  --color-disclosure-bg: #FFF9E6;
  --color-budget-bg: #F0FDF4;

  /* Typography */
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --content-max-width: 1200px;
  --article-max-width: 680px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; } /* smooth scroll for ToC anchors only */
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--color-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s ease; }
a:hover { color: var(--color-accent-hover); text-decoration-thickness: 2px; }

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; color: var(--color-text); }
h1 { font-size: 2.5rem; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 2rem; line-height: 1.3; letter-spacing: -0.01em; margin-top: 2.5rem; }
h3 { font-size: 1.5rem; line-height: 1.4; font-weight: 600; letter-spacing: 0; }
h4 { font-size: 1.25rem; line-height: 1.5; font-weight: 600; }
small, .caption { font-size: 0.875rem; line-height: 1.6; }

/* ---------- Header (sticky, flat nav, no login) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: all 0.2s ease;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}
.site-header.scrolled .header-inner {
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}
.main-nav { display: flex; gap: 2rem; }
.main-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
}
.main-nav a:hover { color: var(--color-accent); }

.header-actions { display: flex; align-items: center; gap: var(--space-md); position: relative; }

/* Search icon + inline expandable input */
.search-toggle {
  background: none;
  border: none;
  color: var(--color-text-meta);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: var(--space-xs);
}
.search-toggle:hover { color: var(--color-text); }
.search-inline {
  position: absolute;
  right: 0;
  top: 100%;
  width: 0;
  overflow: hidden;
  transition: width 0.2s ease;
}
.search-inline.open { width: 220px; }
.search-inline input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.875rem;
}

/* Mobile hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text-meta);
}

/* Mobile dropdown nav (simple dropdown, not slide-in/overlay) */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  animation: fade-in 0.2s ease;
}
.mobile-nav a {
  padding: var(--space-lg) var(--space-xl);
  text-decoration: none;
  color: var(--color-text);
  font-size: 1rem;
  border-top: 1px solid var(--color-border);
}
.mobile-nav.open { display: flex; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Hero ---------- */
.hero { padding: var(--space-3xl) 0 var(--space-xl); max-width: var(--article-max-width); }
.hero h1 { margin-top: 0; }
.hero-tagline { color: var(--color-text-secondary); font-size: 1.125rem; }

/* ---------- Section label ---------- */
.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-meta);
  margin-bottom: var(--space-sm);
}

/* ---------- Featured post (single card, minimal chrome) ---------- */
.featured-post { padding: var(--space-xl) 0; max-width: var(--article-max-width); }
.featured-card h2 { margin-top: var(--space-sm); }
.featured-card .excerpt { color: var(--color-text-secondary); }
.post-meta { font-size: 0.875rem; color: var(--color-text-meta); display: flex; gap: var(--space-md); }

/* ---------- Recent posts: simple list, NOT a card grid ---------- */
.recent-posts { padding: var(--space-xl) 0; max-width: var(--article-max-width); }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list-item {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border);
}
.post-list-item:first-child { border-top: none; }
.post-list-item h3 { margin: var(--space-sm) 0; }
.post-list-item h3 a { text-decoration: none; color: var(--color-text); }
.post-list-item h3 a:hover { color: var(--color-accent); }
.post-list-item .excerpt { color: var(--color-text-secondary); margin: 0 0 var(--space-sm); }
.post-list-item time { font-size: 0.875rem; color: var(--color-text-meta); }

/* ---------- Category badges ---------- */
.category-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: var(--space-sm);
}
.category-reviews { background: #DBEAFE; color: #1E40AF; }
.category-guides { background: #D1FAE5; color: #065F46; }
.category-resources { background: #EDE9FE; color: #6B21A8; }

/* ---------- Article layout ---------- */
.post-header { padding-top: var(--space-2xl); max-width: var(--article-max-width); }
.post-header h1 { margin: var(--space-sm) 0; }
.post-byline { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-md); }
.avatar { width: 48px; height: 48px; border-radius: 50%; }
.author { font-weight: 600; display: block; }
.article-meta { font-size: 0.875rem; color: var(--color-text-meta); display: flex; gap: var(--space-md); flex-wrap: wrap; }
.update-date { color: var(--color-amber); }

.post-content { max-width: var(--article-max-width); padding: var(--space-xl) 0; }
.post-content p { margin-bottom: 1.5rem; }

/* Table of contents (inline, non-sticky — long articles only) */
.toc {
  background: var(--color-callout-bg);
  border-left: 4px solid var(--color-accent);
  padding: var(--space-md);
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.8;
  margin: var(--space-xl) 0;
}
.toc h4 { margin: 0 0 var(--space-sm); font-family: var(--font-body); font-size: 1rem; }
.toc ul { margin: 0; padding-left: var(--space-lg); }

/* Callout boxes: Our Pick / Runner-up / Budget */
.callout {
  border-radius: 12px;
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
}
.callout .badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
  color: #fff;
}
.our-pick { background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%); border: 2px solid var(--color-accent); }
.our-pick .badge { background: var(--color-green); }
.runner-up { background: var(--color-disclosure-bg); border: 2px solid var(--color-amber); }
.runner-up .badge { background: var(--color-amber); }
.budget-pick { background: var(--color-budget-bg); border: 2px solid var(--color-green); }
.budget-pick .badge { background: var(--color-green); }
.callout .tagline { color: var(--color-text-secondary); font-style: italic; }
.callout .app-icon { border-radius: 12px; }
.callout .price { display: block; margin-top: var(--space-sm); font-weight: 600; color: var(--color-text-meta); }

.cta-button, .secondary-button {
  display: inline-block;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.cta-button { background: var(--color-accent); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.cta-button:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.secondary-button { background: var(--color-callout-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.secondary-button:hover { background: var(--color-border); }

/* Blockquote */
blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  color: var(--color-text-secondary);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.6;
}
blockquote cite { display: block; margin-top: var(--space-sm); font-size: 0.875rem; font-style: normal; color: var(--color-text-meta); }

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-xl) 0;
  font-size: 0.9rem;
}
.comparison-table caption { text-align: left; font-size: 0.875rem; color: var(--color-text-meta); margin-bottom: var(--space-sm); }
.comparison-table th, .comparison-table td {
  border: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}
.comparison-table th { background: var(--color-callout-bg); font-weight: 600; }

.back-to-top { font-size: 0.875rem; }
.back-to-top a { color: var(--color-text-meta); text-decoration: underline; }

/* Share buttons: end of article, not floating */
.share-buttons { display: flex; gap: var(--space-sm); margin: var(--space-xl) 0; max-width: var(--article-max-width); }
.share-button {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-callout-bg);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  transition: all 0.2s ease;
}
.share-button:hover { background: var(--color-border); transform: translateY(-2px); }

/* Newsletter inline (not a popup) */
.newsletter-inline {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
  text-align: center;
  max-width: var(--article-max-width);
}
.newsletter-inline form { display: flex; gap: var(--space-sm); margin-top: var(--space-md); flex-wrap: wrap; justify-content: center; }
.newsletter-inline input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-body);
}
.newsletter-inline button {
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.newsletter-inline button:hover { background: var(--color-accent-hover); }
.privacy-note { font-size: 0.875rem; color: var(--color-text-meta); margin-top: var(--space-sm); margin-bottom: 0; }

/* Related posts: text-only, no thumbnails */
.related-posts {
  background: var(--color-bg-offwhite);
  border-left: 4px solid var(--color-accent);
  padding: var(--space-lg);
  border-radius: 6px;
  font-size: 0.875rem;
  margin: var(--space-xl) 0;
  max-width: var(--article-max-width);
}
.related-posts ul { list-style: none; padding: 0; margin: var(--space-sm) 0 0; }
.related-posts li { margin-bottom: var(--space-sm); }

/* Disclosure statement: italic paragraph, not a banner */
.disclosure {
  font-size: 0.875rem;
  font-style: italic;
  color: var(--color-text-secondary);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  max-width: var(--article-max-width);
}

/* Feedback CTA instead of comments */
.feedback-cta {
  background: var(--color-callout-bg);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  border-radius: 6px;
  font-size: 0.875rem;
  margin: var(--space-xl) 0;
  max-width: var(--article-max-width);
}

/* Author bio */
.author-bio {
  background: var(--color-bg-offwhite);
  padding: var(--space-xl);
  border-radius: 8px;
  margin-top: var(--space-2xl);
  display: flex;
  gap: var(--space-lg);
  max-width: var(--article-max-width);
}
.bio-photo { border-radius: 50%; flex-shrink: 0; }
.bio-content h4 { margin: 0 0 var(--space-sm); }
.bio-link { font-weight: 600; }

/* ---------- About / Contact pages ---------- */
.page { padding: var(--space-2xl) 0; max-width: var(--article-max-width); }
.about-photo { border-radius: 50%; margin-bottom: var(--space-lg); }
.contact-email { font-size: 1.25rem; }

/* ---------- Footer: minimal 2-section ---------- */
.site-footer { background: var(--color-bg-offwhite); border-top: 1px solid var(--color-border); padding: var(--space-2xl) 0; margin-top: var(--space-2xl); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--space-xl); font-size: 0.875rem; color: var(--color-text-meta); flex-wrap: wrap; }
.footer-copyright { margin: 0 0 var(--space-xs); color: var(--color-text); font-weight: 600; }
.footer-links { display: flex; gap: var(--space-lg); align-items: flex-start; }
.footer-links a { color: var(--color-text-meta); text-decoration: none; }
.footer-links a:hover { color: var(--color-text); }
.footer-social { display: flex; justify-content: center; gap: var(--space-md); margin-top: var(--space-xl); }
.footer-social a { color: var(--color-text-meta); }
.footer-social a:hover { color: var(--color-text); }

/* ---------- Cookie toast: bottom-left, not full-width ---------- */
.cookie-toast {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 320px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: var(--space-md);
  z-index: 100;
  font-size: 0.875rem;
}
.cookie-toast p { margin: 0 0 var(--space-sm); }
.cookie-actions { display: flex; justify-content: space-between; align-items: center; }
.cookie-actions button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ---------- Mobile breakpoint: 768px ---------- */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .container { padding: 0 var(--space-md); }

  .author-bio { flex-direction: column; text-align: center; }
  .bio-photo { width: 60px; height: 60px; margin: 0 auto; }

  .footer-inner { flex-direction: column; }

  .cookie-toast { left: 8px; right: 8px; bottom: 8px; width: auto; }

  .comparison-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- Print stylesheet ---------- */
@media print {
  .site-header, .site-footer, .newsletter-inline, .share-buttons,
  .related-posts, .toc, .cookie-toast, .feedback-cta {
    display: none;
  }
  body { font-size: 12pt; line-height: 1.5; color: #000; background: #fff; }
  a { text-decoration: underline; color: #000; }
  a[href^="http"]:after { content: " (" attr(href) ")"; font-size: 10pt; color: #666; }
}
