/* ============================================================
   SettlementRadar — Batch B Visual QA Fixes (Task #1517998)
   Blog index/detail • News index/detail • Guides index/detail
   375px mobile + 1440px desktop

   Issues fixed:
   1. Pro CTA secondary button — restore outlined style (white bg, green text)
   2. Blog detail article body — cap prose width at 1440px for readability
   3. Guides hub — mobile card density and touch targets
   4. News hub sidebar card consistency
   5. Article header byline — text overflow on mobile
   6. Hub hero padding on mobile (guides uses .hub-hero not .ch-hero)
   7. Card excerpt min font-size floor for legibility
   8. Filter bar sticky offset for announce bar + FOMO ticker layers
   ============================================================ */

/* ─── 1. Pro CTA Buttons — Restore Visual Hierarchy ──────── */
/* content-polish-1477308.css set both primary + secondary to the same
   green fill. Restore secondary to white/outlined so there's a clear
   primary vs. secondary visual distinction. */
.ch-pro-cta-secondary {
  color: #00875a !important;
  background: #ffffff !important;
  border: 2px solid #00875a !important;
  font-weight: 700 !important;
}
.ch-pro-cta-secondary:hover {
  background: #f0fdf8 !important;
  border-color: #006b4d !important;
  color: #006b4d !important;
}

/* ─── 2. Blog / News Article Detail — Prose Max-Width ─────── */
/* At 1440px the article body stretches too wide. Cap prose at 720px
   and centre it within the post-wrap column. */
.post-body,
.ch-article-body {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Article header centre-align within its max-width */
.ch-article-header {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Hero image in article detail — cap height, maintain aspect */
.ch-article-hero-img {
  max-width: 960px;
  margin: 0 auto 2rem;
  border-radius: 12px;
  overflow: hidden;
}
.ch-article-hero-img img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
.ch-article-hero-fallback {
  background: linear-gradient(135deg, #E6F9F3 0%, #f0fdf8 100%);
  color: #00643e;
  font-weight: 700;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
}

/* ─── 3. Article Byline — Prevent Mobile Overflow ──────────── */
.ch-article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: #4b5563;
  margin-top: 0.85rem;
}
.ch-article-byline-dot { color: #d1d5db; }

/* ─── 4. Guides Hub Hero — Mobile/Desktop Sizing ──────────── */
/* .hub-hero uses inline style with clamp; ensure it doesn't overflow */
@media (max-width: 420px) {
  .hub-hero {
    padding: 3.5rem 1rem 1.75rem !important;
  }
  .hub-hero__title {
    font-size: clamp(1.6rem, 5vw, 2rem) !important;
    line-height: 1.15 !important;
  }
  .hub-hero__sub {
    font-size: 0.95rem !important;
    margin-bottom: 1.25rem !important;
  }
  /* Guide card grid — single column */
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }
  /* Guide cards — ensure 44px touch target */
  .hub-card {
    padding: 1rem !important;
  }
  .hub-card__title {
    font-size: 0.88rem !important;
  }
  .hub-card__desc {
    font-size: 0.82rem !important;
  }
  /* Hub section label spacing on mobile */
  .hub-section-label {
    margin: 2rem 0 0.85rem !important;
    font-size: 0.65rem !important;
  }
  /* Guides CTA buttons full-width */
  .hub-hero a[class],
  .final-cta a {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }
}

@media (min-width: 1440px) {
  /* Guides hub — constrain to 1200px */
  .hub-hero .container,
  .hub-hero-inner {
    max-width: 820px;
    margin: 0 auto;
  }
  /* Guides grid — 3-column max */
  .grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
  }
  /* Final CTA section */
  .final-cta {
    padding: 5rem 2rem !important;
  }
  .final-cta__heading {
    font-size: clamp(1.6rem, 2.5vw, 2rem) !important;
  }
}

/* ─── 5. News Hub Sidebar — Card Consistency ──────────────── */
/* news-hub uses .ch-article-sidebar-card not .ch-sidebar-card */
.ch-article-sidebar-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}
.ch-article-sidebar-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0a0a;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #00875a;
}
.ch-sidebar-links li a {
  color: #1f2a37;
  font-size: 0.85rem;
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.15s;
}
.ch-sidebar-links li a:hover { color: #00875a; }
.ch-sidebar-links li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.ch-sidebar-links li:last-child { border-bottom: none; }

/* ─── 6. Card Excerpt — Font-Size Floor ────────────────────── */
/* Ensure card excerpts never go below 13px regardless of viewport */
.ch-card-excerpt {
  font-size: max(0.82rem, 13px) !important;
  line-height: 1.55 !important;
}

/* ─── 7. Filter Bar — Sticky Top Offset ────────────────────── */
/* The FOMO ticker + announce bar add to page offset.
   The filter bar at top:60px was set for just the header.
   Add a safe offset that accommodates variable bar heights. */
@media (max-width: 768px) {
  .ch-filter-bar {
    top: 56px !important;
  }
}

/* ─── 8. News Hub Missing Polish ───────────────────────────── */
/* news-hub.ejs only loads content-pages-redesign-1469879.css.
   Add the card shadow + contrast fixes inline here for news hub cards. */
.ch-main .ch-featured-card {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
}
.ch-main .ch-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
}
.ch-main .ch-featured-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
.ch-main .ch-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* ─── 9. Blog Detail Inline CTAs — Mobile Sizing ─────────── */
@media (max-width: 420px) {
  .post-inline-pro-cta {
    flex-direction: column !important;
    gap: 0.85rem !important;
    padding: 1.25rem 1rem !important;
    border-radius: 10px !important;
  }
  .post-inline-pro-cta__btn {
    min-height: 44px !important;
    width: 100% !important;
    text-align: center !important;
  }
  .post-end-cta {
    padding: 1.5rem 1rem !important;
  }
  .post-end-cta__primary,
  .post-end-cta__secondary {
    width: 100% !important;
    text-align: center !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .post-end-cta__email-form {
    flex-direction: column !important;
    gap: 0.6rem !important;
  }
  .post-end-cta__email-input,
  .post-end-cta__email-btn {
    width: 100% !important;
    min-height: 44px !important;
  }
  /* Article header on mobile */
  .ch-article-header {
    padding: 1.25rem 1rem 0.75rem !important;
  }
  .ch-article-title {
    font-size: clamp(1.4rem, 5vw, 1.9rem) !important;
    line-height: 1.2 !important;
  }
  .ch-article-breadcrumbs {
    font-size: 0.75rem !important;
    flex-wrap: wrap !important;
  }
  /* Share buttons on mobile */
  .ch-article-share {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }
  .ch-share-btn {
    min-height: 36px !important;
    font-size: 0.8rem !important;
  }
}

/* ─── 10. Blog Detail Prose Width ─────────────────────────── */
/* wrap class for article content — keep comfortable reading width */
.post-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}
@media (max-width: 420px) {
  .post-wrap {
    padding: 0 1rem !important;
  }
}
@media (min-width: 1440px) {
  .post-wrap {
    padding: 0 2rem !important;
  }
}

/* ─── 11. Email Gate Banner — Mobile Layout ───────────────── */
@media (max-width: 480px) {
  .email-gate-inner {
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
  }
  .email-gate-form {
    flex-direction: column !important;
    width: 100% !important;
  }
  .email-gate-input,
  .email-gate-btn {
    width: 100% !important;
    min-height: 44px !important;
  }
}

/* ─── 12. Guides CTA Buttons — Proper Contrast ─────────────── */
/* Hub hero CTA links */
.hub-hero a[href*="how-to-file"],
.hub-hero a[href*="settlements"] {
  background: #00875a;
  color: #ffffff !important;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.hub-hero a[href*="settlements"] {
  background: #ffffff;
  color: #00875a !important;
  border: 2px solid #00875a;
}
.hub-hero a[href*="how-to-file"]:hover {
  background: #006b4d;
}
.hub-hero a[href*="settlements"]:hover {
  background: #f0fdf8;
  border-color: #006b4d;
  color: #006b4d !important;
}

/* ─── 13. 1440px — Article Detail Padding ─────────────────── */
@media (min-width: 1440px) {
  .ch-article-header {
    padding: 2.5rem 2rem 1.5rem !important;
  }
  .ch-article-hero-img {
    max-width: 960px;
    margin-bottom: 2.5rem;
  }
  .post-body {
    font-size: 1.05rem;
    line-height: 1.75;
  }
}

/* ─── 14. Task #1537245: Blog critical fixes ─────────────── */

/* C-01: Category filter pills — wrap on mobile instead of
   horizontal scroll that bleeds and collapses "All Articles" */
@media (max-width: 600px) {
  .ch-filter-inner {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    gap: 0.35rem !important;
  }
  .ch-filter-tab {
    font-size: 0.76rem !important;
    padding: 0.3rem 0.7rem !important;
    min-width: max-content;
  }
}

/* C-02: Blog card thumbnails — show branded placeholder when
   image fails to load (fallback div revealed by onerror) */
.ch-card-img-wrap,
.ch-featured-card-img-wrap {
  background: linear-gradient(135deg, #E6F9F3 0%, #f0fdf8 100%);
}
.ch-card-img-placeholder,
.ch-featured-card-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: linear-gradient(135deg, #E6F9F3 0%, #f0fdf8 100%);
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.95rem;
  color: #00875A;
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* When img fails (onerror sets display:none), placeholder gets display:flex */
.ch-card-img[src=""],
.ch-featured-card-img[src=""] {
  display: none !important;
}

/* Share buttons: consistent sizing at 375px, no orphan wrap */
@media (max-width: 420px) {
  .ch-article-share {
    gap: 0.35rem !important;
    justify-content: flex-start !important;
  }
  .ch-share-btn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    justify-content: center !important;
    padding: 0.4rem 0.65rem !important;
    font-size: 0.75rem !important;
    text-align: center;
  }
  .ch-share-label {
    width: 100% !important;
    margin-bottom: 0.15rem;
  }
}

/* CTA visual hierarchy: paid CTA (Pro) visually dominant over free email */
.ch-pro-cta-primary {
  font-size: 1.05rem !important;
  padding: 0.85rem 2rem !important;
  font-weight: 800 !important;
}
.ch-pro-cta-secondary {
  font-size: 0.88rem !important;
  padding: 0.6rem 1.5rem !important;
}
/* End-of-post CTA: make Pro primary bigger than free quiz secondary */
.post-end-cta__primary {
  font-size: 1rem !important;
  padding: 0.85rem 1.75rem !important;
  font-weight: 800 !important;
}
.post-end-cta__secondary {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
}
/* Footer CTA: paid primary visually dominant */
.post-footer-cta__primary {
  font-size: 1rem !important;
  padding: 0.85rem 1.75rem !important;
  font-weight: 800 !important;
}
.post-footer-cta__secondary {
  font-size: 0.85rem !important;
}

/* ─── Blog CTA Hierarchy: Paid dominant / Free subdued ──── */
/* Issue: .ch-email-capture-btn (free email CTA) uses identical
   green button styling as paid CTAs — users can't distinguish.
   Fix: free email button = ghost/outline style, smaller than paid.
   Paid CTA (.ch-pro-cta-primary, .post-end-cta__primary) stays
   solid dark green, bold, larger. */

/* ── Free email capture button — ghost/outline style ──────── */
/* Override the solid green fill from content-polish-1477308.css */
.ch-email-capture-btn {
  color: #00875a !important;
  background: #ffffff !important;
  border: 2px solid #00875a !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 0.65rem 1.4rem !important;
}
.ch-email-capture-btn:hover {
  background: #f0fdf8 !important;
  color: #006b4d !important;
  border-color: #006b4d !important;
}

/* ── Free email capture section — subtle, not dominant ────── */
.ch-email-capture {
  background: #f9fafb !important;
  border-top: 1px solid #e5e7eb !important;
}
.ch-email-capture h2 {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #374151 !important;
}
.ch-email-capture p {
  font-size: 0.85rem !important;
  color: #6b7280 !important;
}
.ch-email-capture-fine {
  font-size: 0.75rem !important;
  color: #9ca3af !important;
}

/* ── Post-end-CTA email form wrap — subdued within paid section ─ */
.post-end-cta__email-form-wrap {
  background: #fafaf9 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  padding: 1rem !important;
}
.post-end-cta__email-label {
  font-size: 0.82rem !important;
  color: #6b7280 !important;
}
.post-end-cta__email-btn {
  color: #00875a !important;
  background: #ffffff !important;
  border: 2px solid #00875a !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  padding: 0.6rem 1.25rem !important;
  border-radius: 8px !important;
}
.post-end-cta__email-btn:hover {
  background: #f0fdf8 !important;
  color: #006b4d !important;
  border-color: #006b4d !important;
}
.post-end-cta__email-success {
  font-size: 0.85rem !important;
}
.post-end-cta__fine {
  font-size: 0.72rem !important;
  color: #9ca3af !important;
}
.post-end-cta__divider {
  font-size: 0.8rem !important;
  color: #9ca3af !important;
  margin: 0.5rem 0 !important;
}

/* ── Mobile (375px/768px): free email CTA stays subordinate ── */
/* Both .ch-pro-cta-primary and .ch-email-capture-btn are full-width
   on mobile (from content-pages-polish-375px-1440px.css). The email
   button must still look secondary — smaller font, thinner border. */
@media (max-width: 768px) {
  .ch-email-capture-btn {
    font-size: 0.85rem !important;
    padding: 0.6rem 1.25rem !important;
    border-width: 1.5px !important;
  }
  .ch-pro-cta-primary {
    font-size: 1rem !important;
    padding: 0.85rem 1.5rem !important;
  }
  .ch-email-capture h2 {
    font-size: 1rem !important;
  }
  .ch-email-capture p {
    font-size: 0.82rem !important;
  }
  .post-end-cta__email-form-wrap {
    padding: 0.85rem !important;
  }
  .post-end-cta__email-btn {
    font-size: 0.82rem !important;
    padding: 0.55rem 1.1rem !important;
  }
}

@media (max-width: 420px) {
  .ch-email-capture {
    padding: 1.25rem 1rem !important;
  }
  .ch-email-capture-inner {
    padding: 0 !important;
  }
  .ch-email-capture h2 {
    font-size: 1rem !important;
  }
}
