/* Agentic Assure — editorial layout (matches site + modern blog patterns) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --ink: #0f172a;
  --ink-soft: rgba(15, 23, 42, 0.72);
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --accent-border: rgba(79, 70, 229, 0.22);
  --surface: #f8fafc;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --radius: 1rem;
  --radius-lg: 1.25rem;
  --topbar: #0f172a;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #4338ca;
}

/* ——— Skip link ——— */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
}

.skip-link:focus {
  left: 1rem;
}

/* ——— Sticky top bar (site nav feel) ——— */
.article-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--topbar);
  border-bottom: 1px solid rgba(248, 250, 252, 0.08);
}

.article-topbar a {
  color: rgba(248, 250, 252, 0.88);
  text-decoration: none;
}

.article-topbar a:hover {
  color: #fff;
}

.article-topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.article-topbar__brand img {
  height: 32px;
  width: auto;
}

.article-topbar__cta {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.article-topbar__cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
}

/* ——— Download strip ——— */
.screen-banner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.screen-banner a {
  font-weight: 600;
}

/* ——— Hero (Architetto-style editorial header) ——— */
.article-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, var(--accent-soft), transparent 55%);
  pointer-events: none;
}

.article-hero__inner {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.75rem;
}

@media (min-width: 768px) {
  .article-hero__inner {
    padding: 2.5rem 2rem 3.25rem;
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.back-link:hover {
  color: #4338ca;
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.article-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--accent-border);
}

.article-date {
  font-size: 0.8125rem;
  color: var(--muted);
}

.article-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--ink);
  max-width: 20ch;
}

@media (min-width: 640px) {
  .article-hero h1 {
    max-width: 24ch;
  }
}

.article-dek {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 42rem;
}

.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
}

.article-meta-row strong {
  color: var(--ink);
  font-weight: 600;
}

/* ——— Layout: TOC + article ——— */
.article-layout {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: min(260px, 28%) minmax(0, 1fr);
    gap: 3rem;
    padding: 2.5rem 2rem 5rem;
    align-items: start;
  }
}

/* ——— Table of contents ——— */
.article-toc {
  position: relative;
}

@media (min-width: 1024px) {
  .article-toc {
    position: sticky;
    top: 5.5rem;
  }
}

.article-toc__box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.article-toc__label {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.article-toc li {
  margin: 0 0 0.4rem;
  padding-left: 0;
  counter-increment: toc;
}

.article-toc a {
  display: block;
  padding: 0.35rem 0 0.35rem 1.75rem;
  position: relative;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 0.375rem;
}

.article-toc a::before {
  content: counter(toc) '.';
  position: absolute;
  left: 0;
  width: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.article-toc a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ——— Key takeaways ——— */
.takeaways {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.07) 0%, rgba(79, 70, 229, 0.02) 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  margin-bottom: 2.5rem;
}

.takeaways h2 {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: none;
  padding: 0;
}

.takeaways ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.takeaways li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.65rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.takeaways li:last-child {
  margin-bottom: 0;
}

.takeaways li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ——— Article body ——— */
.article-body {
  min-width: 0;
}

.article-body > p:first-of-type {
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

.article-body h2 {
  margin: 2.75rem 0 1rem;
  padding: 0;
  border: none;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  scroll-margin-top: 5.5rem;
}

.article-body h2:first-of-type {
  margin-top: 0;
}

.article-body h3 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  scroll-margin-top: 5.5rem;
}

.article-body p {
  margin: 0 0 1.1rem;
  max-width: 42rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
  max-width: 42rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body li::marker {
  color: var(--accent);
}

.callout {
  max-width: 42rem;
  margin: 1.5rem 0;
  padding: 1.15rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.9375rem;
}

.callout strong {
  color: var(--ink);
}

/* ——— Tables ——— */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.article-body table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 0;
}

.article-body th,
.article-body td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.article-body tr:last-child td {
  border-bottom: none;
}

.article-body th {
  background: var(--surface);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
  max-width: 42rem;
}

/* ——— Checklist (compliance paper) ——— */
.checklist {
  list-style: none;
  padding-left: 0 !important;
  max-width: 42rem;
}

.checklist li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.65rem;
}

.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 2px solid var(--accent-border);
  background: var(--accent-soft);
}

/* ——— Footer ——— */
.article-footer {
  max-width: 42rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
}

.article-footer strong {
  color: var(--ink);
}

.article-footer a {
  font-weight: 600;
}

/* ——— Single-column (blogs) ——— */
.article-layout--single {
  grid-template-columns: 1fr;
  max-width: 48rem;
}

.article-layout--single .article-body {
  max-width: none;
}

/* ——— Print (PDF / print dialog) ——— */
@media print {
  .article-topbar,
  .screen-banner,
  .article-toc,
  .back-link,
  .skip-link {
    display: none !important;
  }

  body {
    font-size: 10.5pt;
    background: #fff;
    color: #1e293b;
  }

  .article-hero {
    background: #fff;
    border-bottom: 2px solid #4f46e5;
    page-break-after: avoid;
  }

  .article-hero::before {
    display: none;
  }

  .article-layout {
    display: block;
    padding: 0;
    max-width: none;
  }

  .takeaways {
    break-inside: avoid;
    background: #f8fafc;
  }

  .article-body h2 {
    page-break-after: avoid;
    margin-top: 1.5rem;
  }

  .table-wrap {
    box-shadow: none;
  }
}
