/* ============================================================
   /learn/ article pages.
   Pairs with css/marketing.css (header/nav/brand reused).
   Color palette matches site-wide values: #1657c2 brand blue,
   #f7b733 brand yellow, #1f2430 dark, #475066 mid-gray,
   #6b7280 muted, #e5e7eb borders.
   ============================================================ */

.learn-article { background: #fff; padding: 0 0 40px; }

/* ===== Visible breadcrumb (in addition to BreadcrumbList JSON-LD) ===== */
.learn-breadcrumb {
  padding: 18px 24px 0;
  font-size: 13px;
  color: #6b7280;
}
.learn-breadcrumb ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.learn-breadcrumb li::after { content: '›'; margin-left: 6px; color: #c4ccd6; }
.learn-breadcrumb li:last-child::after { content: ''; }
.learn-breadcrumb a { color: #475066; text-decoration: none; }
.learn-breadcrumb a:hover { color: #1657c2; }
.learn-breadcrumb li[aria-current="page"] { color: #1f2430; font-weight: 600; }

/* ===== Hero (title + byline + top CTA) ===== */
.learn-hero {
  padding: 24px 24px 32px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 32px;
}
.learn-h1 {
  font-size: 38px; line-height: 1.2; letter-spacing: -0.8px;
  font-weight: 800; color: #1f2430;
  margin: 0 0 12px;
}
.learn-sub {
  font-size: 18px; line-height: 1.55; color: #475066;
  margin: 0 0 18px;
}

/* Byline row — author + credentials + updated date */
.learn-byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: #475066;
  padding: 12px 14px; margin: 0 0 22px;
  background: #f6f7fb; border-radius: 8px;
}
.learn-byline-author strong { color: #1f2430; }
.learn-byline-creds { color: #6b7280; }
.learn-byline-date { color: #6b7280; }
.learn-byline-sep { color: #c4ccd6; }

/* Top CTA — compact, above the fold */
.learn-cta-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: #f7faff; border-left: 4px solid #1657c2;
  border-radius: 8px;
}
.learn-cta-sub { font-size: 13px; color: #475066; flex: 1; min-width: 200px; }

/* The CTA button — reused for top + bottom */
.learn-cta-btn {
  display: inline-block;
  background: #1657c2; color: #fff !important;
  padding: 10px 20px; border-radius: 8px;
  text-decoration: none; font-weight: 700; font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s;
}
.learn-cta-btn:hover { background: #0a3a87; }

/* ===== Two-column layout: body + sticky sidebar ===== */
.learn-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 300px;
  gap: 40px;
  align-items: start;
}
.learn-body { min-width: 0; /* prevents grid blowout on long inline content */ }

.learn-sidebar {
  position: sticky; top: 80px;
  width: 300px;
}

/* Mobile: collapse to single column, hide sidebar entirely */
@media (max-width: 1023px) {
  .learn-layout { grid-template-columns: 1fr; gap: 0; }
  .learn-sidebar { display: none; }
}

/* ===== Article body typography ===== */
.learn-intro,
.learn-section {
  font-size: 17px; line-height: 1.75; color: #1f2430;
}
.learn-intro p,
.learn-section p { margin: 0 0 18px; }

.learn-section h2 {
  margin: 36px 0 14px;
  font-size: 26px; line-height: 1.25; letter-spacing: -0.4px;
  color: #1657c2; font-weight: 800;
}
.learn-section h3 {
  margin: 28px 0 10px;
  font-size: 20px; line-height: 1.3;
  color: #1f2430; font-weight: 700;
}
.learn-section ul,
.learn-section ol { margin: 0 0 18px 22px; padding: 0; }
.learn-section li { margin-bottom: 6px; }
.learn-section a { color: #1657c2; text-decoration: underline; }
.learn-section blockquote {
  margin: 24px 0; padding: 14px 18px;
  border-left: 4px solid #f7b733; background: #fffaf0;
  color: #5a3e00; font-style: italic;
}
.learn-section code {
  background: #f6f7fb; padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px; color: #1f2430;
}

/* ===== Ad slots — reserved dimensions to prevent CLS ===== */
/* Frame holds the explicit min-height that protects layout from shifting
   when the AdSense iframe loads. The label sits above the frame so a user
   always knows it's an ad even when nothing has rendered yet. */
.learn-ad {
  margin: 28px 0;
  padding: 0;
  background: transparent;
}
.learn-ad-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: #6b7280; padding: 4px 0; text-align: center;
}
.learn-ad-frame {
  background: #f6f7fb;
  border: 1px solid #e5e7eb; border-radius: 8px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* In-content ad: reserve 280px tall (covers 250–280 responsive units) */
.learn-ad-in-content .learn-ad-frame { min-height: 280px; }
/* Sidebar ad: reserve 600px tall (covers 300x600 half-page) */
.learn-ad-sidebar .learn-ad-frame { min-height: 600px; }

/* Ads disabled — hide the entire ad block (label, frame, and placeholder
   copy) so the article reads cleanly for the family-friendly preview.
   Layout shift at the moment SP_ADS_ENABLED flips to true is the accepted
   tradeoff vs. showing visible "Advertisement" markers on every page while
   ads are off. */
body:not(.ads-enabled) .learn-ad { display: none; }

/* ===== FAQ block ===== */
.learn-faq {
  margin: 40px 0 20px;
}
.learn-faq h2 {
  font-size: 26px; color: #1657c2; font-weight: 800; margin: 0 0 16px;
  letter-spacing: -0.4px;
}
.learn-faq details {
  border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 14px 18px; margin-bottom: 10px;
  background: #fff;
}
.learn-faq summary {
  cursor: pointer; font-weight: 700; color: #1f2430; font-size: 16px;
  list-style: none;
}
.learn-faq summary::marker { content: ''; }
.learn-faq summary::after {
  content: '+'; float: right; font-size: 20px; color: #1657c2;
  font-weight: 400; line-height: 1;
}
.learn-faq details[open] summary::after { content: '−'; }
.learn-faq details > div {
  margin-top: 12px; color: #475066; font-size: 15px; line-height: 1.7;
}

/* ===== Bottom CTA — bigger than the top one ===== */
.learn-cta-bottom {
  margin: 40px 0 28px;
  padding: 24px;
  background: linear-gradient(180deg, #f7faff 0%, #eef2ff 100%);
  border: 1px solid #c7d2fe; border-radius: 12px;
  text-align: center;
}
.learn-cta-bottom h3 {
  margin: 0 0 8px; font-size: 22px; color: #1657c2; font-weight: 800;
}
.learn-cta-bottom p {
  margin: 0 0 16px; font-size: 15px; color: #475066; line-height: 1.6;
}
.learn-cta-bottom .learn-cta-btn { padding: 12px 28px; font-size: 15px; }

/* ===== Related articles ===== */
.learn-related {
  margin: 32px 0 24px; padding: 22px;
  background: #f6f7fb; border-radius: 8px;
}
.learn-related h3 {
  margin: 0 0 12px; font-size: 16px; text-transform: uppercase;
  letter-spacing: 0.6px; color: #475066; font-weight: 700;
}
.learn-related ul { list-style: none; padding: 0; margin: 0; }
.learn-related li { margin-bottom: 8px; font-size: 15px; line-height: 1.5; }
.learn-related a { color: #1657c2; text-decoration: none; font-weight: 600; }
.learn-related a:hover { text-decoration: underline; }
.learn-related .related-blurb { display: block; font-size: 13px; color: #6b7280; font-weight: 400; margin-top: 2px; }

/* Cross-link to an unpublished target — degraded by the generator's
   _downgrade_unpublished_internal_links() into <em class="learn-link-pending">.
   In the related sidebar, show as muted text with a clear "Coming soon" badge
   so it never reads as a dead clickable link. In body context (intro, sections),
   it simply looks like emphasized text — the link will reactivate when the
   target article publishes. */
.learn-related em.learn-link-pending {
  font-style: normal;
  color: #6b7280;
  font-weight: 500;
}
.learn-related em.learn-link-pending::after {
  content: ' · Coming soon';
  font-size: 12px;
  color: #8a93a0;
  font-style: italic;
  font-weight: 400;
}
/* Body context: just inherit the emphasis styling; reads as a phrase
   the article emphasizes, not as a broken link. */
.learn-intro em.learn-link-pending,
.learn-section em.learn-link-pending {
  font-style: italic;
}

/* ===== Disclaimer ===== */
.learn-disclaimer {
  margin-top: 28px; padding: 14px 18px;
  background: rgba(247,183,51,0.08); border-left: 3px solid #f7b733;
  border-radius: 6px;
  font-size: 13px; color: #5a3e00; line-height: 1.6;
}
.learn-disclaimer strong { color: #5a3e00; }

/* ===== Listing index (/learn/) ===== */
.learn-index { padding: 30px 24px 60px; }
.learn-index-h1 {
  font-size: 38px; letter-spacing: -0.8px; font-weight: 800; color: #1f2430;
  margin: 0 0 8px;
}
.learn-index-sub {
  font-size: 17px; color: #475066; max-width: 720px;
  margin: 0 0 32px; line-height: 1.55;
}
.learn-index-group { margin-bottom: 36px; }
.learn-index-group h2 {
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.8px;
  color: #6b7280; font-weight: 700;
  margin: 0 0 14px;
}
.learn-index-list { list-style: none; padding: 0; margin: 0; }
.learn-index-card {
  display: block; padding: 16px 18px; margin-bottom: 8px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  text-decoration: none; transition: all 0.15s;
}
.learn-index-card:hover {
  border-color: #1657c2;
  box-shadow: 0 4px 12px rgba(22,87,194,0.08);
  transform: translateY(-1px);
}
.learn-index-card-title {
  font-size: 17px; font-weight: 700; color: #1f2430;
  margin: 0 0 4px;
}
.learn-index-card-blurb {
  font-size: 14px; color: #475066; line-height: 1.55; margin: 0;
}
.learn-index-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px;
  margin-left: 8px; vertical-align: middle;
}
.learn-index-badge.coming-soon {
  background: #fef3c7; color: #7a5d00;
}
.learn-index-badge.published {
  background: #d1fae5; color: #065f46;
}

/* ===== Mobile typography tweaks ===== */
@media (max-width: 720px) {
  .learn-h1 { font-size: 28px; letter-spacing: -0.4px; }
  .learn-sub { font-size: 16px; }
  .learn-intro,
  .learn-section { font-size: 16px; line-height: 1.7; }
  .learn-section h2 { font-size: 22px; }
  .learn-section h3 { font-size: 18px; }
  .learn-index-h1 { font-size: 28px; letter-spacing: -0.4px; }
  .learn-byline { font-size: 12px; padding: 10px 12px; }
  .learn-cta-top { padding: 14px; }
}
