/* www/public/css/article.css — article pages (www/scripts/lib/article.mjs): centred ~720px column, hero banner,
   magazine-style body (section ornaments, callouts, check-mark lists, card tables, figures), app comparison cards and
   the Sources box. Loaded after styles.css. RTL-safe: logical properties only. */

/* Layout: everything centred, generous vertical rhythm. On wide screens the lead-magnet rail (styles.css
   .lead-panel) sits beside the 720px column and the pair is centred together. */
.article {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 24px 0 64px;
}
.article-layout {
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
  /* Single column below the rail breakpoint; min-width 0 so a wide table scrolls inside its card instead of
     stretching the grid track past the viewport. */
  grid-template-columns: minmax(0, 1fr);
}
.article-layout > .article {
  min-width: 0;
}
@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(0, 720px) 300px;
    justify-content: center;
  }
  .article-layout .article {
    width: 100%;
  }
}
.article .lead-magnet {
  margin-top: 28px;
}
.article-head {
  text-align: center;
  padding: 8px 0 28px;
}
.article-head .crumbs ol {
  justify-content: center;
}
.article-head h1 {
  margin: 10px 0 14px;
  font-size: clamp(30px, 4.6vw, 44px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.article-dek {
  margin: 0 auto 12px;
  max-width: 56ch;
  font-size: 19px;
  line-height: 1.45;
  color: var(--color-text-2);
}

/* Hero banner: fixed 16:9 box (no layout shift) that also holds the gradient fallback when there is no image. */
.article-hero {
  margin: 0 0 28px;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid var(--color-border);
  box-shadow: 0 6px 0 var(--color-border);
  background: linear-gradient(135deg, #e2f2fb 0%, #fffdf9 55%, #dcf5d6 100%);
}
.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Body card */
.article-body.prose {
  max-width: none;
  padding: 32px clamp(20px, 4vw, 44px) 36px;
  font-size: 17px;
  line-height: 1.65;
}
.article-body p,
.article-body li {
  color: var(--color-text);
}
/* H2 sections as distinct blocks: ornament line above, extra space. */
.article-body h2 {
  margin: 44px 0 14px;
  padding-top: 26px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.01em;
  position: relative;
}
.article-body h2::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-brand);
}
.article-body h2:first-child {
  margin-top: 0;
}

/* Callouts: every quote is a key-takeaway card; the opening quote is the "quick answer". */
.article-body blockquote {
  margin: 22px 0;
  padding: 18px 20px;
  border: 2px solid var(--color-border);
  border-inline-start: 6px solid var(--color-brand);
  border-radius: 16px;
  background: var(--color-surface-sunken);
  color: var(--color-text);
}
.article-body blockquote p {
  margin: 0;
}
.article-body .quick-answer {
  background: #fff6d6;
  border-color: #f0d27a;
  border-inline-start-color: var(--color-brand);
  font-size: 18px;
  font-weight: 700;
}

/* Lists: custom check marks for bullets, bold counters for numbered steps. */
.article-body ul {
  list-style: none;
  padding-inline-start: 0;
}
.article-body ul > li {
  position: relative;
  padding-inline-start: 30px;
  margin: 8px 0;
}
.article-body ul > li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.42em;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--color-success-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 9.5l3 3 7-7' fill='none' stroke='%232b8034' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.article-body ol {
  padding-inline-start: 1.4em;
}
.article-body ol > li {
  margin: 8px 0;
}

/* Tables as cards: zebra rows, horizontal scroll on phones. */
.article-body .table-wrap {
  margin: 22px 0;
  border: 2px solid var(--color-border);
  border-radius: 16px;
  overflow-x: auto;
  background: var(--color-surface);
}
.article-body .md-table {
  min-width: 480px;
}
.article-body .md-table th {
  background: var(--color-surface-sunken);
  font-size: 13px;
  text-transform: uppercase;
}
.article-body .md-table td,
.article-body .md-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
}
.article-body .md-table tbody tr:nth-child(even) td {
  background: var(--color-surface-sunken);
}

/* Figures: markdown images and inline illustrations (centred, generous spacing; square spots smaller). */
.article-body figure {
  margin: 32px auto;
  text-align: center;
}
.article-body figure img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 2px solid var(--color-border);
}
.article-body .article-inline-square img {
  max-width: 320px;
  margin: 0 auto;
}
.article-ornament {
  text-align: center;
  margin: 36px 0 8px;
}
.article-ornament img {
  width: 112px;
  height: auto;
  margin: 0 auto;
}
.article-body figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-2);
}

/* App comparison cards */
.app-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 26px 0;
}
.app-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--color-border);
  padding: 16px;
}
.app-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-card-head h3 {
  margin: 0;
  font-size: 18px;
}
.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex: none;
  display: block;
}
.app-icon-empty {
  background: var(--color-surface-sunken);
  border: 2px solid var(--color-border);
}
/* Uncropped store screenshots in a horizontally scrollable strip (phones swipe). */
.app-shots {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
}
.app-shots img {
  height: 220px;
  width: auto;
  flex: none;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
}

/* Sources box */
.sources-box {
  margin-top: 24px;
  padding: 22px clamp(20px, 4vw, 32px);
  background: var(--color-surface-sunken);
  border: 2px dashed var(--color-border);
  border-radius: 20px;
}
.sources-box h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.sources-box ul,
.sources-box ol {
  margin: 0;
  padding-inline-start: 1.2em;
  font-size: 14px;
  color: var(--color-text-2);
  overflow-wrap: anywhere;
}
.sources-box li.has-logo {
  list-style: none;
  margin-inline-start: -1.2em;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Official logos: contained, on white, with room around the mark (several are transparent PNG/SVG). */
.source-logo {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  padding: 4px 6px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--color-border);
  flex: none;
}
