/*
Theme Name: Kids Toys Talk — Child
Theme URI: https://kidstoystalk.com/
Description: Design layer for Kids Toys Talk. Adds tokens, a self-hosted variable font, accessibility fixes and responsive layout corrections on top of the parent theme. The parent theme is never modified; switching back to "Kids Toys Talk" restores the previous design.
Author: Web Design Bot
Template: kids-toys-talk
Version: 1.1.0
Requires PHP: 7.4
*/

/* Load the parent design first, then override it below. */
@import url("../kids-toys-talk/style.css");


/* ------------------------------------------------------------------
   1. Font — self-hosted variable Nunito (latin), 200–1000.
      Rounded terminals + high x-height: friendly for a kids audience
      without tipping into novelty; one file covers labels → headlines.
      Font file is uploaded to the Media Library; @font-face URL is
      patched below after upload.
   ------------------------------------------------------------------ */
@font-face {
  font-family: "Nunito Var";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("assets/fonts/nunito.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Sticky header must clear the WordPress admin bar when signed in */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

/* ------------------------------------------------------------------
   2. Tokens
   ------------------------------------------------------------------ */
:root {
  --font-sans: "Nunito Var", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  /* fluid type scale, 1.25 ratio, 320 → 1440 viewport */
  --step--1: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.14vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.08rem + 0.22vw, 1.25rem);
  --step-2: clamp(1.375rem, 1.29rem + 0.42vw, 1.625rem);
  --step-3: clamp(1.75rem, 1.56rem + 0.9vw, 2.25rem);
  --step-4: clamp(2.125rem, 1.78rem + 1.7vw, 3rem);
  --step-5: clamp(2.5rem, 1.95rem + 2.6vw, 3.75rem);

  /* spacing rhythm */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-section: clamp(2.75rem, 6vw, 4.5rem);

  /* keep brand colours, adjust only where contrast needs it */
  --ink: #17223b;
  --muted: #52607a;      /* was #657087 — 6.4:1 on white, 6.0:1 on --soft */
  --line: #d9dfe8;       /* slightly stronger hairlines */
  --ring: #1a3fd6;       /* 6.6:1 on white, 5.9:1 on --soft */
  --radius: 18px;

  --reading: 620px;      /* article column → ~68–72 characters per line */
}

/* ------------------------------------------------------------------
   3. Base typography
   ------------------------------------------------------------------ */
body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  letter-spacing: -0.003em;
  color: var(--ink);
}

h1, h2, h3, h4, .brand, .site-header nav a, .button, .text-link, .story-copy h3,
.age-card strong, .product-card h3, .product-price strong {
  font-family: var(--font-sans);
}

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

h1 { line-height: 1.04; }
h2 { line-height: 1.12; }
h3 { line-height: 1.22; }

p, li { text-wrap: pretty; }

/* numbers/labels line up */
.age-card strong, .product-price strong, .price { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------
   4. Accessibility
   ------------------------------------------------------------------ */
/* two-tone focus indicator: white inner ring + brand blue outer ring,
   so it stays visible on white, cream and navy surfaces */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--ring) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
  border-radius: 6px;
}

::selection { background: #3156e7; color: #fff; }

/* no label below 11px anywhere; body-ish text never below 12px */
.eyebrow,
.article-masthead .eyebrow,
.reading-aside .eyebrow,
.footer-top .eyebrow,
.finder-top .eyebrow,
.hero-copy > .eyebrow,
.hero-product-mini .eyebrow { font-size: 11px !important; letter-spacing: 0.12em; }

.brand small { font-size: 11px !important; letter-spacing: 0.1em; margin-top: 4px; }
.story-label { font-size: 11px !important; letter-spacing: 0.06em; }
.pill { font-size: 11px !important; letter-spacing: 0.06em; }
.age-card > span { font-size: 12px !important; }
.article-meta { font-size: 12px !important; }
.hero-proof { font-size: 12px !important; }
.product-meta { font-size: 11px !important; }
.footer-bottom { font-size: 12px !important; }
.story-copy p { font-size: 14px !important; }
.category-card p { font-size: 13px !important; }
.play-dot { font-size: 10px !important; }
.aside-finder b,
.aside-finder p { font-size: 12px !important; }

/* link affordance: underline on hover, not colour-only */
.article-body a:not(.button),
.story-copy a,
.footer-top a:not(.brand) { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* ------------------------------------------------------------------
   5. Header / navigation
   ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}

.header-inner {
  min-height: 76px;
  gap: 1.5rem;
  padding-block: 10px;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  padding-inline: 4px;
}

.header-actions .button {
  min-height: 44px;
  font-size: 13px;
  padding: 11px 16px;
}

.market-control select { min-height: 40px; }

/* Tablet & down: nav on its own row, horizontally scrollable — one row,
   44px targets, no wrapping to a second block of links. */
@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding-block: 8px;
  }
  .site-header nav {
    order: 3;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 2px;
    margin-inline: calc(-1 * var(--gutter, 18px));
    padding: 2px var(--gutter, 18px) 4px;
    border-top: 1px solid var(--line);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 14px;
  }
  .header-actions { margin-left: auto; gap: 8px; }
}

@media (max-width: 600px) {
  .header-inner { min-height: 0; padding-block: 8px; }
  .brand { font-size: 19px; }
  .brand-mark { width: 36px; height: 36px; font-size: 25px; }
  .brand small { display: none; }        /* 11px tagline is noise at this width */
  .site-header nav a { font-size: 13.5px; padding-inline: 9px; }

  /* the Toy Finder CTA is no longer hidden on mobile */
  .header-actions .button {
    display: inline-flex !important;
    min-height: 40px;
    padding: 9px 13px;
    font-size: 12.5px;
  }
  .market-control select { padding: 8px 6px; font-size: 12px; min-height: 40px; }

  .announcement { font-size: 11px; padding: 6px 12px; }
}

/* ------------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------------ */
.home-hero {
  gap: clamp(1.75rem, 4vw, 3.5rem);
  padding-top: clamp(1.75rem, 4vw, 3.75rem);
  padding-bottom: clamp(1.75rem, 4vw, 3.75rem);
}

.hero-copy h1 {
  font-size: var(--step-5);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
}

.hero-copy > p {
  font-size: var(--step-1);
  line-height: 1.6;
  max-width: 34ch;
}

.hero-copy .eyebrow { margin-bottom: 0.75rem; }

.hero-buttons { gap: 1rem; margin: 1.5rem 0 1rem; }
.hero-buttons .button,
.hero-buttons .text-link { min-height: 44px; }

.button {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.01em;
  border-radius: 12px;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease,
    box-shadow 160ms ease;
}
.button:hover { transform: translateY(-1px); }

.hero-product { border-radius: 20px; }
.hero-product strong { font-weight: 800; }

/* ------------------------------------------------------------------
   7. Sections & cards
   ------------------------------------------------------------------ */
.chapter { padding-top: var(--space-section); padding-bottom: var(--space-section); }
.age-section { padding-block: clamp(2rem, 5vw, 3rem); }

.section-heading { margin-bottom: 1.5rem; }
.section-heading h2 { font-size: var(--step-3); }
.section-heading .text-link { min-height: 44px; display: inline-flex; align-items: center; }

/* cards: consistent height, buttons pinned to the bottom */
.category-grid,
.story-grid,
.journal-grid { align-items: stretch; }

.story-card, .category-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius);
  border-color: var(--line);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.story-card:hover,
.category-card:hover {
  border-color: #b9c4d6;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -16px rgba(23, 34, 59, 0.45);
}
.story-copy { flex: 1; }
.story-copy h3 { font-weight: 800; letter-spacing: -0.022em; }
.read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-weight: 800;
}
.story-image img { width: 100%; height: 100%; object-fit: contain; }

/* ------------------------------------------------------------------
   8. Article / guide template
   ------------------------------------------------------------------ */
.article-masthead {
  padding-block: clamp(1.75rem, 4vw, 3rem);
}
.article-masthead h1 {
  font-size: clamp(2rem, 4.2vw, 3.15rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 26ch;
}
.masthead-deck {
  font-size: var(--step-1);
  line-height: 1.55;
  max-width: 52ch;
  margin-top: 0.85rem;
}
.crumb { font-size: 12px; margin-bottom: 1.25rem; }

.reading-layout {
  grid-template-columns: 220px minmax(0, var(--reading));
  gap: clamp(2rem, 3.5vw, 3.5rem);
  justify-content: start;
  padding-top: clamp(2rem, 4vw, 2.75rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.article-body {
  font-size: 1.0625rem;   /* 17px */
  line-height: 1.72;
  min-width: 0;
}
.article-body p,
.article-body ul,
.article-body ol { color: #3f4b60; }
.article-body p { margin-bottom: 1.25em; }

.article-body h2 {
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 2.4em 0 0.65em;
}
.article-body h3 {
  font-size: var(--step-1);
  line-height: 1.3;
  letter-spacing: -0.018em;
  margin: 1.9em 0 0.5em;
}

.article-body table { font-size: 15px; }
.article-body th { background: var(--soft); font-weight: 800; }
.article-body td, .article-body th { padding: 12px 14px; vertical-align: top; }
.article-body table { display: table; width: 100%; }

.article-body ul, .article-body ol { padding-left: 1.35rem; }
.article-body li { margin-bottom: 0.6rem; }
.article-body blockquote {
  border-left: 4px solid var(--blue);
  background: var(--soft);
  padding: 1rem 1.25rem;
  border-radius: 0 12px 12px 0;
}

.reading-aside { top: 92px; }
.reading-aside nav a {
  min-height: 34px;
  display: flex;
  align-items: center;
  font-size: 13px;
  padding: 6px 0 6px 14px;
}
.reading-aside nav a:hover { color: var(--blue); text-decoration: underline; }
.aside-finder { border-radius: 14px; }

/* Masthead slot. Source assets are 400–560px packshots, so the slot shows
   them at native size in a product panel rather than upscaling to a hero. */
.ktt-hero {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  margin: 0 0 2rem;
  padding: clamp(0.85rem, 2vw, 1.25rem) clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--soft);
}
.ktt-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.ktt-hero figcaption {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  border: 0;
  padding: 0;
  background: none;
}
.ktt-hero figcaption strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 2px;
}
@media (max-width: 600px) {
  .ktt-hero { grid-template-columns: 96px 1fr; padding: 12px 14px; }
  .ktt-hero img { max-height: 96px; }
  .ktt-hero figcaption { font-size: 12px; }
  .ktt-hero figcaption strong { font-size: 13.5px; }
}

@media (max-width: 1100px) {
  .reading-layout {
    grid-template-columns: 200px minmax(0, var(--reading));
    gap: 2rem;
  }
}

@media (max-width: 860px) {
  .reading-layout { grid-template-columns: 1fr; gap: 1.75rem; }
  .reading-aside { display: block; }
  .reading-aside nav { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; }
  .reading-aside nav a { padding-left: 0; }
  .aside-finder { display: block; }   /* keep the conversion path on mobile */
  .article-body { font-size: 1.0625rem; }
}

@media (max-width: 600px) {
  .article-masthead h1 { font-size: clamp(1.85rem, 8vw, 2.3rem); }
  .article-body { font-size: 16.5px; line-height: 1.7; }
  .article-body table { font-size: 12.5px; }
  .article-body td, .article-body th { padding: 8px; }
}

/* ------------------------------------------------------------------
   9. Journal — variety instead of 35 identical cards
   ------------------------------------------------------------------ */
#journal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
#journal-grid .story-card:first-child {
  grid-column: span 2;
  flex-direction: row;
}
#journal-grid .story-card:first-child .story-image {
  width: 46%;
  height: auto;
  min-height: 240px;
  flex: 0 0 46%;
}
#journal-grid .story-card:first-child .story-copy { justify-content: center; }
#journal-grid .story-card:first-child .story-copy h3 { font-size: 26px; }
#journal-grid .story-card:first-child .story-copy p { font-size: 15px !important; }

@media (max-width: 1000px) {
  #journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #journal-grid .story-card:first-child { grid-column: span 2; }
}
@media (max-width: 600px) {
  #journal-grid { grid-template-columns: 1fr; gap: 16px; }
  #journal-grid .story-card:first-child,
  #journal-grid .story-card { grid-column: auto; flex-direction: row; }
  #journal-grid .story-card:first-child .story-image { width: 40%; flex-basis: 40%; min-height: 150px; }
  #journal-grid .story-card:first-child .story-copy h3 { font-size: 18px; }
}

/* ------------------------------------------------------------------
   10. Finder / product cards
   ------------------------------------------------------------------ */
.product-card { border-radius: 16px; border-color: var(--line); }
.product-card > img,
.product-card .ktt-placeholder {
  width: 100%;
  height: 200px;
  object-fit: contain;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.product-card h3 { font-weight: 800; letter-spacing: -0.02em; }
.product-buy {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 800;
}
.fields select, .finder-sort select, .journal-tools input { min-height: 44px; border-radius: 10px; }
.finder { border-radius: 18px; }

/* ------------------------------------------------------------------
   11. Footer & global polish
   ------------------------------------------------------------------ */
.site-footer { padding-top: clamp(2rem, 4vw, 3rem); }
.footer-top > div > a:not(.brand) { min-height: 34px; display: flex; align-items: center; }
.footer-bottom { padding-bottom: 1.25rem; }

img { height: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
