/*
 * Your IT & Tech Mates public editorial layout.
 * Shared owner for blog posts, article hubs and case studies.
 * Extends /assets/site.css and the existing page theme without replacing them.
 */
:root {
  --yitm-article-measure: 72ch;
  --yitm-article-wide: 1160px;
  --yitm-article-gutter: clamp(14px, 3vw, 28px);
  --yitm-article-flow: clamp(1rem, 1.5vw, 1.5rem);
  --yitm-article-section-gap: clamp(2.75rem, 6vw, 5.25rem);
  --yitm-article-radius-sm: 14px;
  --yitm-article-radius: 22px;
  --yitm-article-radius-lg: 30px;
  --yitm-article-line: rgba(16, 35, 63, 0.13);
  --yitm-article-muted: #52647a;
  --yitm-article-ink: #10233f;
  --yitm-article-paper: #ffffff;
  --yitm-article-soft: #f6f9f7;
  --yitm-article-focus: #d79d12;
  --yitm-article-shadow: 0 16px 42px rgba(16, 35, 63, 0.08);
}

body.yitm-editorial-page {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.yitm-editorial-page main {
  min-width: 0;
}

body.yitm-editorial-page main :where(h1, h2, h3) {
  color: var(--yitm-article-ink);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

body.yitm-editorial-page main h1 {
  max-width: 20ch;
  margin-block: 0;
  font-size: clamp(2.25rem, 5vw, 4.7rem);
  font-weight: 900;
  line-height: 0.99;
  letter-spacing: -0.042em;
}

body.yitm-editorial-page main h2 {
  margin-block: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.65rem);
  line-height: 1.08;
  letter-spacing: -0.024em;
}

body.yitm-editorial-page main h3 {
  margin-block: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.18;
  letter-spacing: -0.012em;
}

body.yitm-editorial-page main :where(p, li, dd) {
  line-height: 1.72;
}

body.yitm-editorial-page main p {
  text-wrap: pretty;
}

body.yitm-editorial-page main :where(
  article,
  .yitm-main,
  .yitm-article-body,
  .leadroom-article,
  .leadroom-article-content,
  .guide-body,
  .scam-post-main,
  .yitm-content,
  .article-section,
  .content-card,
  .guide-card,
  .yitm-card
) > :where(p, ul, ol, dl, blockquote) {
  max-width: var(--yitm-article-measure);
}

body.yitm-editorial-page main :where(
  article,
  .yitm-article-body,
  .leadroom-article-content,
  .guide-body,
  .scam-post-main,
  .article-section
) > * + * {
  margin-block-start: var(--yitm-article-flow);
}

body.yitm-editorial-page main :where(
  article,
  .yitm-article-body,
  .leadroom-article-content,
  .guide-body,
  .scam-post-main
) > :where(h2, section) {
  margin-block-start: var(--yitm-article-section-gap);
}

body.yitm-editorial-page main :where(
  article,
  .yitm-article-body,
  .leadroom-article-content,
  .guide-body,
  .scam-post-main
) > h3 {
  margin-block-start: clamp(2rem, 4vw, 3.25rem);
}

body.yitm-editorial-page main :where(section, article, [id]) {
  scroll-margin-top: 7rem;
}

body.yitm-editorial-page main :where(
  .yitm-hero,
  .post-hero,
  .leadroom-article-hero,
  .blog-article-hero,
  .scam-post-hero,
  .yitm-guide-hero
) {
  isolation: isolate;
}

body.yitm-editorial-page main :where(
  .yitm-hero-grid,
  .post-hero-grid,
  .hero-grid
) > * {
  min-width: 0;
}

body.yitm-editorial-page main :where(
  .yitm-subtitle,
  .leadroom-lede,
  .lede,
  .post-intro,
  .hero-copy
) {
  max-width: 68ch;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.68;
  text-wrap: pretty;
}

body.yitm-editorial-page main :where(
  .yitm-meta-row,
  .leadroom-article-meta,
  .content-meta,
  .post-meta,
  .article-meta
) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--yitm-article-muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

body.yitm-editorial-page :where(.yitm-breadcrumbs, nav[aria-label="Breadcrumb"], .breadcrumbs) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  max-width: var(--yitm-article-wide);
  line-height: 1.45;
}

body.yitm-editorial-page :where(.quick-links, .yitm-quick-links, [aria-label="Quick links"]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

body.yitm-editorial-page :where(.quick-links, .yitm-quick-links, [aria-label="Quick links"]) a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.58rem 0.88rem;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 999px;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

body.yitm-editorial-page main :where(img, video, iframe) {
  max-width: 100%;
}

body.yitm-editorial-page main img {
  height: auto;
}

body.yitm-editorial-page main figure {
  max-width: var(--yitm-article-wide);
  margin-block: clamp(1.6rem, 4vw, 3rem);
  margin-inline: 0;
}

body.yitm-editorial-page main figure > :where(img, video) {
  display: block;
  border-radius: var(--yitm-article-radius);
}

body.yitm-editorial-page main figcaption {
  max-width: var(--yitm-article-measure);
  margin-block-start: 0.72rem;
  color: var(--yitm-article-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  text-wrap: pretty;
}

body.yitm-editorial-page main blockquote {
  margin-inline: 0;
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1.1rem, 3vw, 1.8rem);
  border-inline-start: 5px solid color-mix(in srgb, currentColor 42%, transparent);
  border-radius: 0 var(--yitm-article-radius-sm) var(--yitm-article-radius-sm) 0;
  background: color-mix(in srgb, var(--yitm-article-soft) 92%, transparent);
  color: var(--yitm-article-ink);
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  line-height: 1.68;
}

body.yitm-editorial-page main :where(pre, code, kbd, samp) {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

body.yitm-editorial-page main pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--yitm-article-line);
  border-radius: var(--yitm-article-radius-sm);
  background: #f4f7f6;
  font-size: 0.9rem;
  line-height: 1.55;
  tab-size: 2;
}

body.yitm-editorial-page main :not(pre) > code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--yitm-article-line);
  border-radius: 0.4em;
  background: #f4f7f6;
  font-size: 0.92em;
}

body.yitm-editorial-page main table {
  width: 100%;
  max-width: var(--yitm-article-wide);
  border-collapse: collapse;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

body.yitm-editorial-page main :where(th, td) {
  padding: 0.8rem 0.85rem;
  border-block-end: 1px solid var(--yitm-article-line);
  text-align: start;
  vertical-align: top;
}

body.yitm-editorial-page main th {
  color: var(--yitm-article-ink);
  font-weight: 800;
}

body.yitm-editorial-page main :where(.table-wrap, .table-scroll, .responsive-table) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

body.yitm-editorial-page main details {
  border: 1px solid var(--yitm-article-line);
  border-radius: var(--yitm-article-radius-sm);
  background: var(--yitm-article-paper);
}

body.yitm-editorial-page main details > summary {
  min-height: 48px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  color: var(--yitm-article-ink);
  font-weight: 800;
  line-height: 1.35;
}

body.yitm-editorial-page main details > :not(summary) {
  margin-inline: 1rem;
}

body.yitm-editorial-page main details > :last-child {
  margin-block-end: 1rem;
}

body.yitm-editorial-page main :where(
  .yitm-card,
  .leadroom-card,
  .content-card,
  .guide-card,
  .card,
  .related-card
) {
  border-radius: var(--yitm-article-radius);
  box-shadow: var(--yitm-article-shadow);
}

body.yitm-editorial-page main :where(
  .yitm-card,
  .leadroom-card,
  .content-card,
  .guide-card,
  .card,
  .related-card
) :where(h2, h3) + p {
  margin-block-start: 0.7rem;
}

body.yitm-editorial-page main a:not([class*="btn"]):not([class*="button"]):not(.logo):not(.brand) {
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
}

body.yitm-editorial-page :focus-visible {
  outline: 3px solid var(--yitm-article-focus);
  outline-offset: 4px;
}

body.yitm-editorial-page main :where(
  .case-related-case-studies,
  .related-ai-guides,
  .yitm-related-guides,
  .yitm-related-scam-links,
  .related-shorts,
  .related-support,
  .leadroom-related-strip,
  .yitm-related-next,
  .yitm-related-groups
) {
  container-type: inline-size;
}

@container (min-width: 44rem) {
  body.yitm-editorial-page main :where(
    .case-related-case-studies,
    .related-ai-guides,
    .yitm-related-guides,
    .yitm-related-scam-links,
    .related-shorts,
    .related-support,
    .leadroom-related-strip,
    .yitm-related-next,
    .yitm-related-groups
  ) :where(.grid, .guide-grid, .cards-3, .leadroom-grid, ul) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.yitm-editorial-page main :where(.yitm-hero-grid, .post-hero-grid, .hero-grid) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.yitm-editorial-page main h1 {
    max-width: 22ch;
    font-size: clamp(2.15rem, 8vw, 3.7rem);
  }
}

@media (max-width: 680px) {
  :root {
    --yitm-article-section-gap: clamp(2.25rem, 12vw, 3.7rem);
    --yitm-article-radius: 18px;
  }

  body.yitm-editorial-page main h1 {
    max-width: none;
    font-size: clamp(2rem, 10.5vw, 3.1rem);
    line-height: 1.02;
  }

  body.yitm-editorial-page main h2 {
    font-size: clamp(1.55rem, 7vw, 2.15rem);
  }

  body.yitm-editorial-page main :where(p, li, dd) {
    line-height: 1.66;
  }

  body.yitm-editorial-page main :where(th, td) {
    padding: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.yitm-editorial-page *,
  body.yitm-editorial-page *::before,
  body.yitm-editorial-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body.yitm-editorial-page main {
    color: #000;
  }

  body.yitm-editorial-page main a {
    color: inherit;
  }

  body.yitm-editorial-page main :where(.yitm-card, .leadroom-card, .content-card, .guide-card, .card) {
    box-shadow: none;
  }
}

/* A0018880 nested editorial measure: legacy articles often place copy inside sections and cards. */
body.yitm-editorial-page main :where(section, .yitm-prose, .prose, .card, .yitm-card, .content-card, .guide-card) > :where(p, ul, ol, dl, blockquote) {
  max-width: var(--yitm-article-measure);
}

body.yitm-editorial-page main > section + section {
  margin-block-start: var(--yitm-article-section-gap);
}
