/* ANDtr blog post template — single.php. Layers on homepage.css (fonts, resets, .btn, .section-inner). */

.andtr-post { scroll-behavior: smooth; }
/* The default link colour for a post — deliberately written with :where()
   so it carries element-only specificity (0,0,1) and behaves as a true base
   that ANY more specific rule beats.
   post.css loads after homepage.css, so a normal ".andtr-post a" (0,1,1)
   would tie with — and therefore beat — every shared-chrome rule defined in
   homepage.css (.nav-item__link, .nav-item__panel a, .topbar__links a),
   painting the whole site header link-blue on posts. At (0,0,1) the chrome
   keeps its own colours, and .btn--* (0,1,0) wins here without needing a
   :not(.btn) carve-out. */
:where(.andtr-post) a { color: #0b6f9e; }
:where(.andtr-post) a:hover { color: #35a8e0; }

/* ---------- progress bar ---------- */
.post-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 90; background: transparent; pointer-events: none; }
.post-progress__bar { height: 100%; width: 0%; background: #35a8e0; transition: width .1s linear; }

/* ---------- header ---------- */
.post-header { position: sticky; top: 0; z-index: 60; height: 72px; backdrop-filter: blur(18px); background: rgba(255,255,255,0.92); border-bottom: 1px solid rgba(14,22,32,0.1); }
.post-header__inner { max-width: 1240px; height: 100%; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.post-logo { display: flex; align-items: baseline; gap: 10px; color: #0e1620; }
.post-logo__mark { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.post-logo__tag { font-size: 12px; font-weight: 600; color: #66727f; letter-spacing: 0.02em; }
.post-nav { display: flex; align-items: center; gap: 28px; }
.post-nav > a:not(.btn) { font-size: 15px; font-weight: 600; color: #33414f; }
.post-nav .btn--nav { padding: 11px 22px; font-size: 15px; }

/* ---------- hero ---------- */
.post-hero { padding: 76px 0 0; }
.post-hero__inner { max-width: 840px; }
.post-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 26px; }
.post-badge { padding: 7px 15px; border-radius: 999px; background: #e3f2fb; color: #0b6f9e; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.post-hero__date { font-size: 13px; font-weight: 600; color: #66727f; }
.post-hero__dot { width: 4px; height: 4px; border-radius: 50%; background: #c3ccd4; }
.post-hero h1 { font-size: clamp(38px,5.2vw,68px); line-height: 1.03; letter-spacing: -0.025em; font-weight: 800; margin: 0 0 28px; }
.post-hero__subtitle { font-size: 22px; line-height: 1.55; color: #4d5a67; margin: 0 0 36px; max-width: 34em; }
.post-byline { display: flex; align-items: center; gap: 14px; padding-bottom: 44px; border-bottom: 1px solid rgba(14,22,32,0.1); }
.post-avatar { width: 46px; height: 46px; border-radius: 50%; background: #0b6f9e; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; flex-shrink: 0; }
.post-avatar--lg { width: 76px; height: 76px; font-size: 24px; }
.post-byline__text { display: flex; flex-direction: column; gap: 2px; }
.post-byline__name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #0e1620; }
.post-byline__title { font-size: 14px; color: #66727f; font-weight: 500; }

/* ---------- layout ---------- */
.post-layout { max-width: 1240px; margin: 0 auto; padding: 0 32px 40px; display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 72px; align-items: start; }
.post-layout--single { grid-template-columns: minmax(0,1fr); padding-bottom: 0; }
.post-main { min-width: 0; }

/* ---------- article typography ---------- */
.post-content { min-width: 0; padding-top: 52px; font-size: 19px; line-height: 1.72; color: #33414f; }
.post-content > p { margin: 0 0 24px; }
.post-content h2 { font-size: clamp(28px,3.2vw,40px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; margin: 56px 0 20px; scroll-margin-top: 92px; color: #0e1620; }
.post-content > h2:first-child { margin-top: 0; }
.post-content h3 { font-size: 23px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 800; margin: 30px 0 10px; scroll-margin-top: 92px; color: #0e1620; }
.post-content strong { color: #0e1620; }
.post-content ul, .post-content ol { margin: 0 0 28px; padding-left: 0; list-style: none; }
.post-content ul > li, .post-content ol > li { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; line-height: 1.6; color: #33414f; margin-bottom: 10px; }
.post-content ul > li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #35a8e0; margin-top: 9px; flex-shrink: 0; }
.post-content ol { counter-reset: post-ol; }
.post-content ol > li { counter-increment: post-ol; }
.post-content ol > li::before { content: counter(post-ol); width: 24px; height: 24px; border-radius: 50%; background: #0e1620; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 0; }
.post-content img { border-radius: 16px; margin: 8px 0 28px; }
.post-content blockquote { margin: 0 0 28px; padding: 24px 28px; border-left: 3px solid #35a8e0; background: #f7fafc; border-radius: 0 16px 16px 0; font-size: 19px; color: #22303d; font-style: italic; }

/* auto-numbered "step" sections: any h3 immediately following an h2's
   siblings gets a big faded number, mirroring the design's step list —
   works for any post that structures a section as h2 + a run of h3s. */
.post-content { counter-reset: post-step; }
.post-content h2 { counter-reset: post-step; }
.post-content h3 { counter-increment: post-step; position: relative; padding-left: 52px; }
.post-content h3::before { content: counter(post-step, decimal-leading-zero); position: absolute; left: 0; top: -2px; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: #c3ccd4; line-height: 1.1; }

/* tables: styled to match the design's comparison table, no content changes needed */
.post-content table { width: 100%; border-collapse: collapse; border: 1px solid rgba(14,22,32,0.12); border-radius: 20px; overflow: hidden; margin: 0 0 32px; font-size: 17px; }
.post-content table tr:first-child { background: #ffffff; color: #0e1620; border-bottom: 2px solid #0e1620; }
.post-content table tr:first-child td { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.post-content table td { padding: 18px 22px; border-top: 1px solid rgba(14,22,32,0.1); color: #33414f; }
.post-content table tr:first-child td { border-top: none; }
.post-content table td:first-child { font-weight: 800; color: #0e1620; background: #f7fafc; }
.post-content table tr:first-child td:first-child { background: transparent; }

/* ---------- content modules (used by posts authored with these blocks) ---------- */
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: rgba(14,22,32,0.1); border: 1px solid rgba(14,22,32,0.1); border-radius: 20px; overflow: hidden; margin: 0 0 32px; }
.stat-pair__item { background: #f7fafc; padding: 30px 28px; }
.stat-pair__value { font-size: clamp(38px,4.4vw,54px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: #35a8e0; }
.stat-pair__item:nth-child(2) .stat-pair__value { color: #0b6f9e; }
.stat-pair__label { font-size: 15px; line-height: 1.5; color: #4d5a67; margin-top: 10px; font-weight: 600; }

.info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 0 0 60px; }
.info-card { border: 1px solid rgba(14,22,32,0.12); border-radius: 16px; padding: 24px 24px 26px; }
.info-card__label { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #0b6f9e; margin-bottom: 10px; }
.info-card__body { font-size: 17px; line-height: 1.6; color: #33414f; }

.checklist { display: flex; flex-direction: column; gap: 14px; padding: 30px 32px; border-radius: 20px; background: #f2f8fc; border: 1px solid rgba(53,168,224,0.28); margin: 0 0 60px; }
.checklist .point { font-size: 18px; line-height: 1.6; color: #22303d; }
.checklist .point span { margin-top: 9px; }

.numbered-list { display: flex; flex-direction: column; gap: 16px; margin: 0 0 60px; }
.numbered-list__item { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 20px; align-items: start; padding: 26px 28px; border-radius: 18px; border: 1px solid rgba(14,22,32,0.12); background: #ffffff; }
.numbered-list__num { width: 44px; height: 44px; border-radius: 50%; background: #0e1620; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; }
.numbered-list__item p { font-size: 18px; line-height: 1.65; color: #33414f; margin: 0; }

.faq-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 32px; }
.faq-item { border: 1px solid rgba(14,22,32,0.12); border-radius: 16px; padding: 22px 26px; background: #ffffff; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; list-style: none; cursor: pointer; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: #0e1620; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item__icon { position: relative; width: 20px; height: 20px; flex-shrink: 0; }
.faq-item__icon::before, .faq-item__icon::after { content: ''; position: absolute; top: 50%; left: 50%; background: #35a8e0; transform: translate(-50%,-50%); transition: transform .2s; }
.faq-item__icon::before { width: 14px; height: 2px; }
.faq-item__icon::after { width: 2px; height: 14px; }
.faq-item[open] .faq-item__icon::after { transform: translate(-50%,-50%) rotate(90deg) scale(0); }
.faq-item[open] summary { margin-bottom: 14px; }
.faq-item__body p { font-size: 17px; line-height: 1.65; color: #4d5a67; margin: 0; }

/* ---------- aside / TOC ---------- */
.post-aside { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; padding-top: 76px; }
.post-aside__label { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #66727f; margin-bottom: 16px; }
.post-toc { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid rgba(14,22,32,0.14); }
.post-toc a { padding: 9px 0 9px 16px; margin-left: -1px; font-size: 14px; line-height: 1.4; font-weight: 500; color: #66727f; border-left: 2px solid transparent; transition: color .2s, border-color .2s; }
.post-toc a.is-active { font-weight: 700; color: #0e1620; border-left-color: #35a8e0; }
.post-aside__cta { margin-top: 34px; padding: 24px; border-radius: 16px; background: #f7fafc; border: 1px solid rgba(14,22,32,0.1); }
.post-aside__cta-title { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; }
.post-aside__cta p { font-size: 14px; line-height: 1.55; color: #66727f; margin: 0 0 16px; }
.post-aside__cta .btn { padding: 11px 20px; font-size: 14px; }

/* ---------- CTA banner ---------- */
.post-cta-section { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.post-cta-banner { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 32px; align-items: center; padding: 44px 46px; border-radius: 24px; background: #0e1620; color: #ffffff; margin: 0 0 64px; }
.post-cta-banner__eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #35a8e0; margin-bottom: 14px; }
.post-cta-banner h3 { font-size: clamp(26px,2.8vw,34px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 12px; color: #fff; }
.post-cta-banner p { font-size: 17px; line-height: 1.6; color: rgba(255,255,255,0.72); margin: 0; max-width: 36em; }
.post-cta-banner .btn { white-space: nowrap; }

/* ---------- author box ---------- */
.post-author-section { max-width: 1240px; margin: 0 auto; padding: 0 32px 20px; }
.post-author-box { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 26px; align-items: start; padding: 32px 34px; border-radius: 20px; background: #f7fafc; border: 1px solid rgba(14,22,32,0.1); margin: 0 0 60px; }
.post-author-box__name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 10px; color: #0e1620; }
.post-author-box__title { font-weight: 500; color: #66727f; }
.post-author-box p { font-size: 18px; line-height: 1.68; color: #33414f; margin: 0; }

/* ---------- related reading ---------- */
.post-related { border-top: 1px solid rgba(14,22,32,0.1); background: #f7fafc; margin-top: 40px; }
.post-related .section-inner { padding: 72px 32px 80px; max-width: 1240px; }
.post-related h2 { font-size: clamp(24px,2.6vw,32px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 32px; color: #0e1620; }
.post-related__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.post-related__card { display: flex; flex-direction: column; gap: 14px; padding: 28px 26px 30px; border-radius: 18px; background: #ffffff; border: 1px solid rgba(14,22,32,0.1); color: #0e1620; }
.post-related__card:hover { border-color: #35a8e0; }
.post-related__date { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #0b6f9e; }
.post-related__title { font-size: 19px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 800; }

/* ---------- footer ---------- */
.post-footer { background: #0e1620; color: rgba(255,255,255,0.62); }
.post-footer__inner { max-width: 1240px; margin: 0 auto; padding: 44px 32px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; font-size: 14px; }
.post-footer__inner nav { display: flex; gap: 26px; }
.post-footer__inner a { color: rgba(255,255,255,0.62); }
.post-footer__inner a:hover { color: #35a8e0; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-aside { position: static; max-height: none; padding-top: 24px; }
  .post-nav > a:not(.btn) { display: none; }
  .stat-pair, .info-grid { grid-template-columns: 1fr; }
  .post-cta-banner { grid-template-columns: 1fr; text-align: left; }
  .post-related__grid { grid-template-columns: 1fr; }
}
