/*
Theme Name:   TopicBuzz Child
Theme URI:    https://topicbuzzdaily.com
Description:  Lightweight GeneratePress child theme for TopicBuzz Daily (design Option A: ink and amber on cream).
Author:       TopicBuzz Editorial
Template:     generatepress
Version:      0.1.6
License:      GPL-2.0-or-later
Text Domain:  topicbuzz-child
*/

/* Self-hosted brand fonts (OFL, see assets/fonts/). No font is loaded from another host. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin-wght-normal.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;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-latin-wght-normal.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;
}

/* Brand tokens: copied from assets/brand/tokens.css (keep in sync; scripts/build_theme.py checks this). */
:root {
  --tbd-ink: #1F2430;        /* header, footer, primary text, dark buttons */
  --tbd-cream: #FFF8EC;      /* page background */
  --tbd-amber: #E8A33D;      /* accent, CTA buttons, highlights (use on ink, not on cream) */
  --tbd-amber-deep: #C9851A; /* amber on light backgrounds (logos, large shapes only) */
  --tbd-tan: #F3DFC0;        /* image placeholders, soft panels */
  --tbd-sand: #EBDDC4;       /* chips, subtle fills */
  --tbd-line: #E6DCC8;       /* borders, dividers */
  --tbd-line-strong: #C9B88F;
  --tbd-muted: #5B6170;      /* secondary text on cream (5.9:1) */
  --tbd-eyebrow: #8A5A12;    /* small uppercase labels on cream (5.6:1) */
  --tbd-brown: #6B4A12;      /* rare, dark text on tan */
  --tbd-white: #FFFFFF;      /* cards */
  --tbd-font-head: "Space Grotesk", system-ui, sans-serif; /* 600-700 */
  --tbd-font-body: "Inter", system-ui, sans-serif;         /* 400-600 */

  /* Theme aliases (all point at brand tokens) */
  --tb-ink: var(--tbd-ink);
  --tb-cream: var(--tbd-cream);
  --tb-amber: var(--tbd-amber);
  --tb-amber-dark: var(--tbd-eyebrow);
  --tb-sand: var(--tbd-tan);
  --tb-line: var(--tbd-line);
  --tb-muted: var(--tbd-muted);
  --tb-soft: var(--tbd-line);
  --tb-head: var(--tbd-font-head);
  --tb-body: var(--tbd-font-body);
  --tb-wrap: 1120px;
}
/* ---------- Base ---------- */
body.tb { margin: 0; background: var(--tb-cream); color: var(--tb-ink); font-family: var(--tb-body); font-size: 17px; line-height: 1.6; }
.tb *, .tb *::before, .tb *::after { box-sizing: border-box; }
.tb a { color: inherit; text-decoration: none; }
.tb a:hover { text-decoration: underline; }
.tb a:focus-visible, .tb button:focus-visible, .tb input:focus-visible { outline: 3px solid var(--tb-amber); outline-offset: 2px; }
.tb img { max-width: 100%; height: auto; display: block; }
.tb h1, .tb h2, .tb h3 { font-family: var(--tb-head); font-weight: 700; color: var(--tb-ink); margin: 0; line-height: 1.15; }
.tb-wrap { max-width: var(--tb-wrap); margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; background: var(--tbd-white); color: var(--tb-ink); padding: 8px 12px; z-index: 100; }

/* ---------- Header and footer ---------- */
.tb-header { background: var(--tb-ink); color: var(--tb-cream); }
.tb-header .tb-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.tb-logo { display: flex; align-items: center; gap: 10px; font: 700 22px var(--tb-head); color: var(--tb-cream); }
.tb-logo:hover { text-decoration: none; }
.tb-logo--image .custom-logo-link { display: block; line-height: 0; }
.tb-logo--image .custom-logo { height: 40px; width: auto; max-width: 240px; }
.tb-nav ul { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.tb-nav a { color: var(--tb-cream); }
.tb-btn { display: inline-block; background: var(--tb-amber); color: var(--tb-ink); padding: 12px 18px; border-radius: 8px; font-weight: 600; font-size: 15px; border: 0; cursor: pointer; }
.tb-btn:hover { text-decoration: none; filter: brightness(1.05); }
.tb-btn--dark { background: var(--tb-ink); color: var(--tb-cream); }
.tb-footer { background: var(--tb-ink); color: var(--tb-soft); padding: 16px 0; margin-top: 40px; font-size: 14px; }
.tb-footer .tb-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; justify-content: space-between; }
.tb-footer ul { display: flex; gap: 8px 16px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.tb-footer a { color: var(--tb-soft); }
.tb-footer__by a { text-decoration: underline; }

/* ---------- Layout ---------- */
.tb-main { padding-top: 40px; display: flex; flex-direction: column; gap: 40px; }
.tb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; padding-top: 32px; }
.tb-article { max-width: 720px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tb-aside { display: flex; flex-direction: column; gap: 24px; }

/* ---------- Home ---------- */
.tb-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; align-items: center; }
.tb-hero__text { display: flex; flex-direction: column; gap: 16px; }
.tb-hero h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; }
.tb-hero p { margin: 0; font-size: 18px; line-height: 1.6; color: var(--tbd-muted); }
.tb-kicker { margin: 0; font-size: 14px; font-weight: 600; color: var(--tb-amber-dark); text-transform: uppercase; letter-spacing: 1px; }
.tb-hero__img, .tb-featured { aspect-ratio: 16 / 9; background: var(--tb-sand); border-radius: 12px; overflow: hidden; width: 100%; }
.tb-hero__img img, .tb-featured img { width: 100%; height: 100%; object-fit: cover; }
.tb-section h2 { font-size: 26px; margin-bottom: 20px; }
.tb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.tb-card { background: var(--tbd-white); border-radius: 12px; overflow: hidden; border: 1px solid var(--tb-line); display: flex; flex-direction: column; }
.tb-card__img { aspect-ratio: 16 / 9; background: var(--tb-sand); }
.tb-card__img img { width: 100%; height: 100%; object-fit: cover; }
.tb-card__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.tb-card__cat { font-size: 13px; font-weight: 600; color: var(--tb-amber-dark); }
.tb-card__title { font: 600 19px/1.3 var(--tb-head); }
.tb-meta { font-size: 13px; color: var(--tb-muted); }
.tb-chips { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tb-chips strong { margin-right: 6px; }
.tb-chip { background: var(--tbd-white); border: 1px solid var(--tb-line); padding: 10px 16px; border-radius: 999px; font-size: 14px; }

/* ---------- Article ---------- */
.tb-crumbs { margin: 0; font-size: 14px; color: var(--tb-muted); }
.tb-article h1 { font-size: clamp(28px, 5vw, 40px); }
.tb-byline { margin: 0; font-size: 14px; color: var(--tb-muted); }
.tb-content { font-size: 18px; line-height: 1.75; }
.tb-content > * { margin: 0 0 1.1em; }
.tb-content h2 { font-size: 26px; margin: 1.4em 0 .5em; }
.tb-content h3 { font-size: 21px; margin: 1.2em 0 .4em; }
.tb-content a { text-decoration: underline; color: var(--tb-ink); overflow-wrap: anywhere; }
.tb-content ul, .tb-content ol { padding-left: 22px; }
.tb-content blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--tb-amber); color: var(--tbd-muted); }
.tb-takeaways, .tb-sources { background: var(--tbd-white); border: 1px solid var(--tb-line); border-radius: 8px; padding: 20px; }
.tb-takeaways { border-left: 6px solid var(--tb-amber); }
.tb-takeaways h2, .tb-sources h2 { font-size: 20px; margin: 0 0 10px; }
.tb-takeaways ul, .tb-sources ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.tb-sources { font-size: 15px; }
.tb-sources h2 { font-size: 18px; }
.tb-disclosure { font-size: 14px; color: var(--tb-muted); border-top: 1px solid var(--tb-line); padding-top: 12px; }

/* ---------- Newsletter and side boxes ---------- */
.tb-news { background: var(--tb-ink); color: var(--tb-cream); border-radius: 12px; padding: 24px; }
.tb-news h2 { color: var(--tb-cream); font-size: 20px; margin: 0 0 8px; }
.tb-news p { margin: 0 0 14px; line-height: 1.6; color: var(--tb-soft); font-size: 15px; }
.tb-news input[type=email] { width: 100%; padding: 14px; border-radius: 8px; border: 0; font-size: 16px; margin-bottom: 10px; }
.tb-news .tb-btn { width: 100%; padding: 14px; font-size: 16px; }
.tb-news--wide { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding: 32px; }
.tb-news--wide h2 { font-size: 26px; }
.tb-news--wide form { display: flex; gap: 10px; flex-wrap: wrap; }
.tb-news--wide input[type=email] { min-width: 240px; margin: 0; width: auto; }
.tb-news--wide .tb-btn { width: auto; padding: 14px 20px; }
.tb-box { background: var(--tbd-white); border: 1px solid var(--tb-line); border-radius: 12px; padding: 20px; }
.tb-box h2 { font-size: 18px; margin: 0 0 12px; }
.tb-box ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; line-height: 1.4; }

/* ---------- Reserved ad slots (fixed size, no layout shift) ---------- */
.tb-ad { display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 0 auto; max-width: 100%; }
.tb-ad--728x90 { width: 728px; height: 90px; }
.tb-ad--300x250 { width: 300px; height: 250px; }
.tb-ad--300x600 { width: 300px; height: 600px; }
.tb-ad--demo { border: 1px dashed var(--tbd-line-strong); border-radius: 8px; color: var(--tb-muted); font-size: 13px; }

/* ---------- Pagination, pages ---------- */
.tb-pager { display: flex; gap: 12px; justify-content: space-between; }
.tb-page { max-width: 720px; margin: 0 auto; }
.tb-page h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 20px; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .tb-layout { grid-template-columns: minmax(0, 1fr); }
  .tb-aside { max-width: 720px; }
  .tb-ad--300x600 { height: 600px; }
}
@media (max-width: 760px) {
  .tb-ad--728x90 { width: 320px; height: 100px; } /* 320x100 mobile banner, same reserved box */
}
@media (max-width: 480px) {
  .tb-logo--image .custom-logo { height: 34px; }
  .tb-wrap { padding: 0 16px; }
  .tb-content { font-size: 17px; }
}
/* Header layout: on narrower screens the menu takes its own row.
   On phones that row scrolls sideways instead of wrapping into 3 lines. */
@media (max-width: 1180px) {
  .tb-nav { order: 3; flex: 1 0 100%; min-width: 0; }
}
@media (max-width: 760px) {
  .tb-header .tb-wrap { gap: 10px 12px; padding-top: 12px; padding-bottom: 12px; }
  .tb-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tb-nav ul { flex-wrap: nowrap; white-space: nowrap; gap: 18px; padding-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { .tb * { transition: none !important; } }
