/*
  All About Toys — site styles
  NOTE: This file must be deployed with index.html + /js/*.
*/

:root {
  /* Light + frosted glass theme (white base, primary color blur behind) */
  --bg: #f7f9ff;
  --bg2: #ffffff;
  --card: rgba(255, 255, 255, 0.70);
  --card-strong: rgba(255, 255, 255, 0.82);
  --border: rgba(15, 23, 42, 0.10);
  --text: rgba(15, 23, 42, 0.92);
  --muted: rgba(15, 23, 42, 0.72);
  --muted2: rgba(15, 23, 42, 0.60);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.10);
  --accent: #2f6feb;   /* primary blue */
  --accent2: #ff3b6b;  /* primary pink/red */
  --accent3: #7c4dff;  /* purple */
  --accent4: #22c55e;  /* green */
  --good: #36d399;
  --warning: #fbbf24;
  --radius: 16px;
  --radius-sm: 12px;
  --max: 1140px;
  --nav-w: 280px;
  --side-w: 320px;
  --top-nav-h: 64px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: ui-rounded, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    linear-gradient(180deg, var(--bg), var(--bg2));
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.background-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Big primary-color blobs (blurred behind frosted glass panels) */
  background:
    radial-gradient(520px 520px at 12% 20%, rgba(47, 111, 235, 0.36), transparent 62%),
    radial-gradient(620px 620px at 88% 18%, rgba(255, 59, 107, 0.30), transparent 64%),
    radial-gradient(680px 680px at 22% 82%, rgba(124, 77, 255, 0.26), transparent 66%),
    radial-gradient(520px 520px at 78% 84%, rgba(34, 197, 94, 0.20), transparent 64%);
  filter: blur(34px);
  opacity: 0.95;
}

/* Top navigation */
.top-navigation {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--top-nav-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border);
}

.top-nav-container {
  max-width: calc(var(--max) + var(--nav-w) + var(--side-w));
  margin: 0 auto;
  padding: 0 18px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.top-nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(15, 23, 42, 0.92);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.top-nav-icons {
  font-size: 18px;
}

.top-nav-links {
  display: flex;
  gap: 12px;
}

.top-nav-link {
  color: rgba(15, 23, 42, 0.70);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.top-nav-link:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

/* App layout */
.app-container {
  max-width: calc(var(--max) + var(--nav-w) + var(--side-w));
  margin: 18px auto 0;
  padding: 0 18px 24px;
  display: grid;
  grid-template-columns: var(--nav-w) 1fr var(--side-w);
  gap: 18px;
  align-items: start;
}

.left-navigation {
  position: sticky;
  top: calc(var(--top-nav-h) + 18px);
  max-height: calc(100vh - var(--top-nav-h) - 36px);
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.main-content {
  min-height: calc(100vh - var(--top-nav-h) - 24px);
}

.right-sidebar {
  position: sticky;
  top: calc(var(--top-nav-h) + 18px);
  max-height: calc(100vh - var(--top-nav-h) - 36px);
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

/* Branded header */
.page-header-branded {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  text-align: center;
}

.brand-header-content {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.brand-header-icons {
  font-size: 26px;
  opacity: 0.95;
}

.brand-header-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.2vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.6px;
  font-weight: 900;
}

.brand-header-title a {
  color: inherit;
  text-decoration: none;
}

.brand-header-title a:hover {
  text-decoration: underline;
}

.brand-header-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
  max-width: 56ch;
}

.brand-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  justify-content: center;
}

.brand-badge {
  font-weight: 700;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.78);
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(15, 23, 42, 0.10);
}

/* Home */
.home-page {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.about-section {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.about-section h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.about-section p {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.65;
}

.featured-article {
  display: block;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: var(--shadow);
  color: var(--text);
}

.featured-article:hover {
  transform: translateY(-1px);
  transition: transform 120ms ease;
  text-decoration: none;
}

.featured-article-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(47, 111, 235, 0.12);
  border: 1px solid rgba(47, 111, 235, 0.22);
  color: rgba(15, 23, 42, 0.86);
  margin-bottom: 10px;
}

.featured-article-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.2px;
}

.featured-article-subheader {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.featured-article-meta {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted2);
  font-size: 13px;
}

.featured-article-excerpt {
  margin: 12px 0 0;
  color: rgba(15, 23, 42, 0.78);
  line-height: 1.6;
}

.featured-article-link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 800;
}

/* Left nav */
.nav-loading,
.nav-category-loading,
.nav-category-empty {
  color: var(--muted);
  font-size: 13px;
}

.nav-category {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.62);
  margin-bottom: 10px;
  overflow: hidden;
}

.nav-category-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.nav-category-header:hover {
  background: rgba(15, 23, 42, 0.04);
}

.nav-category-name {
  font-size: 14px;
}

.nav-category-caret {
  color: var(--muted);
}

.nav-category-articles {
  padding: 10px 12px 12px;
  display: none !important;
}

/* Show category articles only when expanded */
.nav-category-header[aria-expanded="true"] + .nav-category-articles {
  display: block !important;
}

.nav-article-count {
  color: var(--muted2);
  font-size: 12px;
  margin-bottom: 8px;
}

.nav-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.nav-article-link {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid rgba(15, 23, 42, 0.10);
  color: rgba(15, 23, 42, 0.88);
  font-size: 13px;
  line-height: 1.35;
}

.nav-article-link:hover {
  background: rgba(47, 111, 235, 0.10);
  border-color: rgba(47, 111, 235, 0.22);
  text-decoration: none;
}

/* Article pages */
.article-content {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.article-header h1 {
  margin: 14px 0 8px;
  font-size: 30px;
  letter-spacing: -0.3px;
}

.article-subheader {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted2);
  font-size: 13px;
}

.trust-badge {
  display: inline-block;
  font-weight: 800;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(15, 23, 42, 0.10);
  color: rgba(15, 23, 42, 0.82);
  margin-right: 8px;
}

.trust-badge.expert {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
}

.article-body {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 18px 0 8px;
}

.article-body p,
.article-body li {
  color: rgba(15, 23, 42, 0.84);
  line-height: 1.75;
}

.article-body ul,
.article-body ol {
  padding-left: 20px;
}

.article-body pre {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 12px;
  overflow: auto;
}

.article-body code {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 8px;
  padding: 2px 6px;
}

.author-profile,
.related-articles {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.author-profile-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(47, 111, 235, 0.14);
  border: 1px solid rgba(47, 111, 235, 0.22);
}

.author-name {
  font-weight: 900;
}

.author-credentials {
  color: var(--muted2);
  font-size: 12px;
}

.author-bio {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.related-articles h3 {
  margin: 0 0 10px;
}

.related-article-link {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.10);
  color: rgba(15, 23, 42, 0.88);
  margin-top: 8px;
}

.related-article-link:hover {
  text-decoration: none;
  background: rgba(124, 77, 255, 0.10);
  border-color: rgba(124, 77, 255, 0.20);
}

.related-article-title {
  font-weight: 900;
}

.related-article-meta {
  margin-top: 4px;
  color: var(--muted2);
  font-size: 12px;
}

/* Sidebar */
.home-hero-sidebar h2 {
  margin: 0;
  font-size: 18px;
}

.tagline-sidebar {
  margin: 8px 0 12px;
  color: var(--muted);
}

.trust-signals-sidebar {
  display: grid;
  gap: 10px;
}

.trust-signal-sidebar {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.trust-signal-icon-sidebar {
  font-size: 18px;
}

.trust-signal-title-sidebar {
  font-weight: 900;
}

.home-hero-sidebar {
  display: none !important;
}

.ad-container {
  /* Ad containers should size to the actual ad once it loads.
     Only reserve space while empty/loading to avoid big blank gaps. */
  margin: 14px 0;
  border-radius: 14px;
  overflow: hidden;
}

.ad-mid-article {
  /* keep for clarity; loading placeholder handled by :empty below */
  min-height: 0;
}

/* Loading placeholders (only when the container truly has no children) */
.ad-container:empty {
  min-height: 84px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.60);
}

.ad-container.ad-mid-article:empty {
  min-height: 130px;
}

/* Ensure the injected ad element doesn't add extra spacing */
.ad-container ins.adsbygoogle {
  display: block;
  margin: 0 auto;
}

/* Footer */
.site-footer {
  margin-top: 30px;
  border-top: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.footer-container {
  max-width: calc(var(--max) + var(--nav-w) + var(--side-w));
  margin: 0 auto;
  padding: 22px 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.footer-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.footer-section a {
  display: block;
  color: var(--muted);
  margin: 8px 0;
  font-weight: 600;
}

.footer-section a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-bottom {
  padding: 14px 18px 22px;
  text-align: center;
  color: rgba(15, 23, 42, 0.55);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 1100px) {
  .app-container {
    grid-template-columns: 260px 1fr;
    grid-template-areas: "nav main";
  }
  .right-sidebar {
    display: none;
  }
}

@media (max-width: 860px) {
  /* Mobile stacked layout:
     show sidebar ad first, then main content, then navigation */
  .app-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Reorder columns for mobile */
  #right-sidebar {
    display: block; /* override tablet hide */
    order: 1;
    position: relative;
    top: 0;
    max-height: none;
  }

  #main-content {
    order: 2;
    min-height: auto;
  }

  #left-nav {
    order: 3;
    position: relative;
    top: 0;
    max-height: none;
  }

  #left-nav,
  #main-content,
  #right-sidebar {
    width: 100%;
  }

  .left-navigation {
    position: relative;
    top: 0;
    max-height: none;
  }
  .page-header-branded {
    padding: 22px 16px;
  }
  .brand-header-title {
    font-size: clamp(32px, 7vw, 42px);
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .top-nav-links { display: none; }
  .footer-container { grid-template-columns: 1fr; }
}
