/* Editorial components share Logicum tokens; all selectors are scoped. */
@layer page-layout {
  .blog-page { background: var(--surface); }
  .blog-page .breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 32px; }
  .blog-page .breadcrumbs a:hover { color: var(--brand-700); text-decoration: underline; }
  .blog-index { padding-block: 32px 80px; }
  .blog-index__intro { max-width: 800px; margin-bottom: 40px; }
  .blog-index h1, .article-header h1 { margin: 12px 0 24px; font-size: var(--text-h1); line-height: 1.14; letter-spacing: var(--heading-track); }
  .blog-index__intro > p:last-child { max-width: 68ch; font-size: var(--text-lead); color: var(--muted); line-height: 1.7; }
  .blog-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; }
  .blog-card { max-width: 700px; min-width: 0; padding: var(--card-space); border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
  .blog-card .section-kicker { margin: 0 0 16px; font-size: var(--text-small); }
  .blog-card :is(h2, h3) { margin: 0 0 14px; font-size: var(--text-h3); line-height: 1.3; letter-spacing: -.025em; }
  .blog-card :is(h2, h3) a:hover { color: var(--brand-700); }
  .blog-card > p:not(.section-kicker) { color: var(--muted); line-height: 1.65; font-size: var(--text-card); margin: 0 0 22px; }
  .blog-card__bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
  .blog-card__bottom > span { color: var(--muted); }
  .blog-card__link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--brand-700); font-weight: 700; }
  .blog-card__link:hover { text-decoration: underline; }
  .blog-materials { padding-block: 48px; background: var(--surface-soft); }
  .blog-materials__heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
  .blog-materials__heading h2 { margin: 0 0 12px; font-size: 26px; line-height: 1.3; letter-spacing: -.035em; }
  .blog-materials__heading p { margin: 0; color: var(--muted); line-height: 1.6; }
  .blog-materials__heading > a { color: var(--brand-700); white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; }
  .blog-materials--featured { --container: 1568px; padding-block: clamp(56px, 7vw, 84px); background: linear-gradient(135deg, #faf9ff 0%, #fff 48%, #f8f6ff 100%); }
  .blog-materials--featured .blog-materials__heading { margin-bottom: 32px; }
  .blog-materials--featured .blog-materials__heading h2 { font-size: clamp(30px, 3vw, 40px); }
  .blog-materials--featured .blog-materials__heading p { font-size: clamp(16px, 1.6vw, 20px); }
  .blog-materials--featured .blog-materials__heading > a { font-size: 18px; }
  .blog-materials--featured .blog-cards { display: block; }
  .blog-materials--multi .blog-cards { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: stretch; gap: 16px; }
  .blog-materials__side { display: grid; grid-auto-rows: 1fr; gap: 16px; min-width: 0; }
  .blog-materials--multi .blog-card--featured { min-height: 440px; }
  .blog-card--secondary { position: relative; display: flex; flex-direction: column; max-width: none; min-height: 0; overflow: hidden; padding: 24px; box-shadow: 0 12px 32px rgba(40, 25, 100, .04); }
  .blog-card--secondary > :not(.blog-card__mini-visual) { position: relative; z-index: 1; }
  .blog-card--secondary .section-kicker { max-width: calc(100% - 70px); margin-bottom: 8px; font-size: 12px; letter-spacing: .06em; }
  .blog-card--secondary h3 { max-width: calc(100% - 76px); margin-bottom: 8px; font-size: clamp(22px, 1.7vw, 25px); line-height: 1.15; }
  .blog-card--secondary > p.blog-card__description { max-width: calc(100% - 96px); margin: 0 0 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
  .blog-card--secondary .blog-card__bottom { margin-top: auto; }
  .blog-card--secondary .blog-card__link { font-size: 16px; }
  .blog-card__mini-visual { position: absolute; top: 60px; right: 12px; display: grid; place-items: center; width: 110px; height: 110px; border-radius: 50%; background: #f0ecff; transform: rotate(-8deg); }
  .blog-card__mini-code { display: grid; place-items: center; width: 76px; height: 72px; border: 1px solid #fff; border-radius: 17px; background: linear-gradient(155deg, #fff, #f6f4ff); box-shadow: 0 12px 25px rgba(77, 54, 177, .12); color: var(--brand-700); font-size: 29px; font-weight: 800; letter-spacing: -.12em; }
  .blog-card__mini-gamepad { width: 76px; height: 76px; color: #6546ed; fill: currentColor; filter: drop-shadow(0 10px 12px rgba(77, 54, 177, .18)); }
  .blog-card__program-age { color: var(--muted); }
  @media (min-width: 1500px) {
    .blog-materials__side > .blog-card--secondary:only-child h3,
    .blog-materials__side > .blog-card--secondary:only-child > p.blog-card__description { max-width: 100%; }
    .blog-materials__side > .blog-card--secondary:only-child .blog-card__mini-visual { top: auto; right: 40px; bottom: 72px; width: 155px; height: 155px; }
    .blog-materials__side > .blog-card--secondary:only-child .blog-card__mini-code { width: 108px; height: 100px; font-size: 40px; }
  }
  .blog-card--featured { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); width: 100%; max-width: none; min-height: 390px; padding: 0; overflow: hidden; border-color: #dcd8ed; background: rgba(255,255,255,.88); }
  .blog-card--featured .blog-card__content { display: flex; flex-direction: column; padding: clamp(30px, 4vw, 48px); }
  .blog-card--featured .section-kicker { margin-bottom: 24px; font-size: 15px; letter-spacing: .08em; }
  .blog-card--featured h3 { max-width: 720px; margin-bottom: 20px; font-size: clamp(30px, 3.1vw, 46px); line-height: 1.12; }
  .blog-card--featured .blog-card__content > p:not(.section-kicker) { max-width: 720px; margin: 0 0 28px; color: var(--muted); font-size: clamp(16px, 1.6vw, 20px); line-height: 1.65; }
  .blog-card--featured .blog-card__bottom { margin-top: auto; font-size: 16px; }
  .blog-card__reading { display: inline-flex; align-items: center; gap: 12px; }
  .blog-card__clock { position: relative; width: 20px; height: 20px; border: 2px solid currentColor; border-radius: 50%; }
  .blog-card__clock::before, .blog-card__clock::after { content: ""; position: absolute; left: 8px; top: 4px; width: 2px; height: 6px; border-radius: 2px; background: currentColor; transform-origin: 1px 5px; }
  .blog-card__clock::after { transform: rotate(125deg); }
  .blog-card--featured .blog-card__link { font-size: 17px; }
  .blog-card__visual { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(20px, 3vw, 44px); min-width: 0; overflow: hidden; background: linear-gradient(145deg, rgba(248,246,255,.65), rgba(239,235,255,.86)); }
  .blog-card__orb { position: absolute; width: 170px; height: 170px; border-radius: 50%; background: rgba(220,212,255,.62); }
  .blog-card__orb--left { top: 48px; left: 28px; }
  .blog-card__orb--right { right: 28px; bottom: 42px; }
  .tech-card { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: clamp(140px, 14vw, 185px); aspect-ratio: .86; border: 1px solid rgba(255,255,255,.92); border-radius: 22px; background: rgba(255,255,255,.9); box-shadow: 0 20px 50px rgba(65,44,155,.1); }
  .tech-card--python { transform: rotate(-8deg); }
  .tech-card--roblox { transform: rotate(7deg); }
  .tech-card__python { position: relative; width: 68px; height: 68px; margin-bottom: 8px; }
  .tech-card__python i { position: absolute; width: 40px; height: 35px; border-radius: 13px 13px 7px 13px; }
  .tech-card__python i::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: white; }
  .tech-card__python i:first-child { top: 5px; left: 4px; z-index: 2; background: #3776ab; }
  .tech-card__python i:first-child::after { top: 8px; left: 10px; }
  .tech-card__python i:last-child { right: 4px; bottom: 5px; background: #ffd343; transform: rotate(180deg); }
  .tech-card__python i:last-child::after { top: 8px; left: 10px; }
  .tech-card strong { color: #11131d; font-size: 24px; line-height: 1.2; }
  .tech-card > span:last-child { margin-top: 18px; padding: 8px 14px; border-radius: 11px; color: var(--brand-700); background: #eeeaff; font-size: 13px; font-weight: 600; }
  .tech-card__roblox { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px; transform: rotate(16deg); background: #11131d; }
  .tech-card__roblox i { width: 18px; height: 18px; background: white; }
  .tech-card__switch { position: relative; z-index: 2; color: var(--brand-700); font-size: 54px; font-weight: 400; }
  .blog-card__spark { position: absolute; z-index: 2; width: 5px; height: 30px; border-radius: 4px; background: var(--brand-600); transform: rotate(42deg); }
  .blog-card__spark--one { top: 55px; right: 70px; }
  .blog-card__spark--two { top: 70px; right: 98px; height: 19px; background: #a28cff; }
  .blog-card__spark--three { bottom: 56px; left: 58px; }
  /* Article shell: wide container, reading column capped at ~800px, sticky contents rail. */
  .article-shell { max-width: 1200px; padding-block: 32px 72px; }
  .article-header { max-width: 800px; margin-bottom: 24px; }
  .article-lead { margin-top: 4px; font-size: 18px; line-height: 1.65; color: var(--ink); }
  .article-lead p { margin: 0 0 14px; }
  .article-lead p:last-child { margin-bottom: 0; }
  .article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 0 0 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .article-meta__facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
  .article-meta__facts > span + span { position: relative; padding-left: 19px; }
  .article-meta__facts > span + span::before { content: "·"; position: absolute; left: 6px; }
  .article-author { display: flex; align-items: center; gap: 14px; }
  .article-author__avatar { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; }
  .article-author strong, .article-author div > span { display: block; line-height: 1.5; }
  .article-author strong { font-size: 15px; }
  .article-author div > span { font-size: 14px; color: var(--muted); }

  .article-layout { display: grid; grid-template-columns: minmax(0, 800px) 280px; gap: 48px; align-items: start; }
  @media (min-width: 1180px) { .article-layout { gap: 56px; } }
  .article-main { min-width: 0; }
  .article-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 20px; }
  .article-toc-panel { padding: 22px 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
  .article-toc-panel__title { margin: 0 0 12px; color: var(--brand-900); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .article-toc-panel ol, .article-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
  .article-toc-panel li, .article-toc li { margin: 0; padding: 0; }
  .article-toc-panel a { display: block; padding: 8px 10px 8px 12px; border-left: 2px solid transparent; border-radius: 0 var(--radius-control) var(--radius-control) 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
  .article-toc-panel a:hover { color: var(--brand-800); background: var(--brand-50); }
  .article-toc-panel a[aria-current="true"] { color: var(--brand-800); border-left-color: var(--brand-600); background: var(--brand-50); font-weight: 600; }
  .article-aside__cta { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--brand-50); }
  .article-aside__cta p { margin: 0 0 14px; color: var(--brand-900); font-size: 15px; line-height: 1.5; font-weight: 600; }
  .article-aside__cta .btn { white-space: normal; text-align: center; }
  .article-aside__cta noscript a { display: inline-block; margin-top: 10px; color: var(--brand-700); text-decoration: underline; font-size: 14px; }

  /* Mobile contents: one collapsible copy, hidden on desktop where the rail takes over. */
  .article-toc { display: none; border-block: 1px solid var(--line); margin: 0 0 28px; padding: 8px 0; }
  .article-toc summary { cursor: pointer; padding: 14px 0; color: var(--brand-800); font-weight: 600; }
  .article-toc nav { padding-bottom: 12px; }
  .article-toc a { display: flex; align-items: center; min-height: 44px; padding: 6px 12px; line-height: 1.5; color: var(--muted); border-radius: var(--radius-control); }
  .article-toc a:hover { background: var(--brand-50); color: var(--brand-800); }

  .article-body { font-size: 18px; line-height: 1.8; overflow-wrap: break-word; }
  .article-section { margin: 0; }
  .article-body > p, .article-section > p { margin: 0 0 22px; }
  .article-body h3 { margin: 32px 0 14px; font-size: 23px; line-height: 1.35; letter-spacing: -.025em; }
  .article-body ul, .article-body ol { padding-left: 1.4em; margin: 18px 0 28px; }
  .article-body li { padding-left: 5px; margin-block: 10px; }
  .article-body li::marker { color: var(--brand-700); }
  .article-body a:not(.btn) { color: var(--brand-700); text-decoration: underline; text-underline-offset: 3px; }

  /* Quick answer card: the fast route to the article's main conclusion. */
  .article-summary { margin-bottom: 40px; padding: 26px 30px; border: 1px solid #e3ddf8; border-radius: 20px; background: var(--brand-50); }
  .article-summary > h2 { margin-top: 0 !important; font-size: 21px !important; letter-spacing: -.02em !important; }
  .article-summary ul { margin: 0; padding-left: 1.2em; font-size: 17px; }
  .article-summary li:last-child { margin-bottom: 0; }

  /* Five-question check: numbered decision tool, same text as the article. */
  .article-steps > ol { counter-reset: step; margin: 22px 0 28px; padding: 0; list-style: none; }
  .article-steps > ol > li { position: relative; margin: 0 0 12px; padding: 16px 20px 16px 62px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); font-size: 17px; line-height: 1.6; }
  .article-steps > ol > li::before { counter-increment: step; content: counter(step); position: absolute; top: 15px; left: 18px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--brand-600); font-size: 14px; font-weight: 700; }

  .article-code { margin: 24px 0 32px; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-soft); }
  .article-code figcaption { padding: 10px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
  .article-code pre { margin: 0; padding: 20px; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; font-size: 14px; line-height: 1.7; color: var(--brand-900); }
  .article-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
  .article-table { margin: 28px 0; max-width: 100%; }
  .article-table__hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
  .article-table__scroll { overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: var(--radius-card); }
  .article-table table { width: 100%; min-width: 640px; border-collapse: collapse; text-align: left; font-size: 15px; line-height: 1.65; }
  .article-table caption { padding: 16px; text-align: left; font-weight: 700; color: var(--brand-900); background: var(--brand-50); }
  .article-table td, .article-table th { padding: 16px; vertical-align: top; }
  .article-table thead { background: var(--brand-50); color: var(--brand-900); }
  .article-table tbody tr + tr { border-top: 1px solid var(--line); }
  .article-table th[scope="row"] { width: 26%; font-weight: 600; }
  .article-table td { width: 37%; }
  .article-cta, .practice-note { margin-block: 36px; padding: var(--card-space); border-radius: var(--radius-card); background: var(--brand-50); }
  .article-cta__title { margin: 0 0 14px; color: var(--ink); font-size: 25px; font-weight: 700; line-height: 1.3; letter-spacing: -.03em; }
  .article-cta p:not(.article-cta__title) { font-size: 16px; line-height: 1.7; margin: 0 0 20px; color: var(--muted); }
  .article-cta .btn { white-space: normal; text-align: center; }
  .practice-note { border-left: 3px solid var(--brand-100); background: var(--surface-soft); }
  .practice-note > strong { color: var(--brand-800); font-size: 15px; }
  .practice-note p { margin: 12px 0 0; font-size: 17px; }
  .article-links { margin: 28px 0 36px; padding-block: 18px; border-block: 1px solid var(--line); font-size: 16px; }
  .article-links p { margin: 0 0 8px; color: var(--muted); }
  .article-links a { display: flex; align-items: center; min-height: 44px; gap: 8px; }
  .article-faq > .faq-item:first-of-type { border-top: 1px solid #e7e3eb; }
  .article-faq .faq-item { margin: 0; }
  .article-faq .faq-item summary { cursor: pointer; }
  .article-faq .faq-item h3 { display: inline; margin: 0; font: inherit; letter-spacing: 0; }
  .article-body .faq-item p { margin: 0; }
  /* Tablet and phone: one column, contents collapses above the article.
     The rail only appears once the reading column can still hold ~65-85 characters. */
  @media (max-width: 1079px) {
    .article-layout { display: block; }
    .article-main { max-width: 820px; }
    .article-aside { display: none; }
    .article-toc { display: block; }
  }

  .article-shell > .blog-materials .container { width: 100%; }
  .blog-page .trial { margin: 0; }
  @media (max-width: 1499px) {
    .blog-materials--multi .blog-cards { grid-template-columns: 1fr; }
    .blog-materials__side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
    .blog-card--secondary { min-height: 230px; }
    .blog-card--secondary > p.blog-card__description { max-width: min(64ch, calc(100% - 96px)); }
  }
  @media (max-width: 680px) {
    .blog-index, .article-shell { padding-top: 24px; padding-bottom: 40px; }
    .blog-index h1, .article-header h1 { font-size: clamp(27px, 6.6vw, 36px); line-height: 1.18; }
    .blog-page .breadcrumbs { margin-bottom: 24px; font-size: 12px; }
    .blog-materials__heading { display: block; }
    .blog-materials__heading > a { margin-top: 12px; }
    .blog-materials__heading h2 { font-size: 24px; }
    .blog-materials--featured { padding-block: 44px; }
    .blog-materials--featured .blog-materials__heading h2 { font-size: 28px; }
    .blog-materials--featured .blog-materials__heading > a { font-size: 16px; }
    .blog-card--featured { grid-template-columns: 1fr; }
    .blog-card--featured .blog-card__content { padding: 28px 24px; }
    .blog-card--featured h3 { font-size: 30px; }
    .blog-card--featured .blog-card__bottom { align-items: flex-start; flex-direction: column; }
    .blog-materials__side { grid-template-columns: 1fr; }
    .blog-card--secondary { min-height: 250px; padding: 24px; }
    .blog-card--secondary h3 { font-size: 23px; }
    .blog-card--secondary > p.blog-card__description { max-width: 100%; }
    .blog-card--secondary .blog-card__mini-visual { top: 20px; right: 20px; width: 62px; height: 62px; }
    .blog-card--secondary .blog-card__mini-code { width: 45px; height: 42px; border-radius: 12px; font-size: 18px; }
    .blog-card--secondary .blog-card__mini-gamepad { width: 48px; height: 48px; }
    .blog-card--secondary .blog-card__bottom { gap: 8px; flex-wrap: wrap; }
    .blog-card__visual { min-height: 260px; padding: 30px 18px; gap: 18px; }
    .tech-card { width: min(35vw, 145px); }
    .tech-card strong { font-size: 19px; }
    .tech-card > span:last-child { margin-top: 12px; padding: 6px 9px; font-size: 11px; }
    .tech-card__python { width: 52px; height: 52px; }
    .tech-card__roblox { width: 45px; height: 45px; margin-bottom: 13px; }
    .tech-card__switch { font-size: 36px; }
    .article-body { font-size: 17px; line-height: 1.75; }
    .article-body h3 { font-size: 21px; }
    .article-cta__title { font-size: 22px; }
    .article-code pre { padding: 16px; font-size: 13px; }
    .article-author { align-items: start; }
    .article-toc { margin-bottom: 24px; }
    .article-lead { font-size: 17px; }
    .article-meta { gap: 14px 20px; }
    .article-summary { padding: 22px 20px; border-radius: 18px; }
    .article-summary ul { font-size: 16px; }
    .article-steps > ol > li { padding: 14px 16px 14px 54px; font-size: 16px; }
    .article-steps > ol > li::before { left: 14px; }
  }
}
/* Scoped editorial heading rhythm; shared marketing typography is untouched. */
.blog-page .article-section > h2 { margin: 48px 0 20px; font-size: clamp(26px, 3vw, 32px); line-height: 1.25; letter-spacing: -.035em; scroll-margin-top: calc(var(--header-h) + 24px); }
.blog-page .article-section:first-child > h2 { margin-top: 0; }
.blog-page .article-body > p, .blog-page .article-section > p { font-size: inherit; line-height: inherit; }
.blog-page .article-body .faq-item p { font-size: inherit; line-height: inherit; }
.blog-page :is(.article-code pre, .article-table__scroll):focus-visible,
.blog-card a:focus-visible, .blog-page .article-toc a:focus-visible,
.blog-page .article-toc-panel a:focus-visible, .blog-page .article-toc summary:focus-visible,
.blog-page .faq-item summary:focus-visible { outline: 3px solid var(--brand-600); outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
