/* ==========================================================================
   SteadyBars — secondary page layouts (installation terms, guides, blog).
   Loaded after styles.css; relies on its tokens. Home page never loads this.
   ========================================================================== */

/* Current-section underline in the header nav (e.g. Blog on blog pages) */
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   Page hero (dark band under the solid header)
   -------------------------------------------------------------------------- */
.page-hero {
  background: linear-gradient(150deg, var(--ink), var(--ink-3) 70%, var(--ink));
  color: #fff; padding: calc(var(--header-h) + 3rem) 0 3rem;
}
.page-hero .eyebrow { color: var(--blue-glow); }
.page-hero .eyebrow::before { background: linear-gradient(90deg, transparent, var(--orange-glow)); }
.page-hero h1 { color: #fff; font-size: var(--step-4); margin-bottom: .7rem; max-width: 22ch; }
.page-hero .lede { color: rgba(255, 255, 255, .8); font-size: var(--step-1); max-width: 62ch; line-height: 1.55; }
.page-hero .meta { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.4rem; font-size: .84rem; color: rgba(255, 255, 255, .72); font-weight: 600; }
.page-hero .meta b { color: #fff; font-weight: 800; }

.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; font-size: .8rem; font-weight: 700; color: rgba(255, 255, 255, .7); margin-bottom: 1.2rem; }
.crumbs a { color: #fff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs li + li::before { content: '/'; margin-right: .4rem; color: rgba(255, 255, 255, .4); }

/* --------------------------------------------------------------------------
   Document layout: sticky table of contents + long-form content
   -------------------------------------------------------------------------- */
.doc { padding-block: clamp(2.5rem, 5vw, 4rem); }
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 1rem); }
.toc h2 { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-family: var(--font-body); font-weight: 800; margin-bottom: .8rem; }
.toc ol { list-style: none; display: grid; gap: .1rem; border-left: 2px solid var(--line); }
.toc a {
  display: block; padding: .45rem .9rem; margin-left: -2px; border-left: 2px solid transparent;
  font-size: .9rem; font-weight: 600; color: var(--body); text-decoration: none;
  transition: color .2s, border-color .2s;
}
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--blue-dk); border-left-color: var(--orange); font-weight: 800; }

.prose { max-width: 72ch; }
.prose > section { scroll-margin-top: calc(var(--header-h) + 1.5rem); padding-top: .5rem; }
.prose > section + section { margin-top: 2.6rem; }
.prose h2 { font-size: var(--step-2); margin-bottom: .9rem; }
.prose h3 { font-size: var(--step-1); margin: 1.6rem 0 .5rem; }
.prose h4 { font-size: 1.02rem; margin: 1.2rem 0 .4rem; color: var(--ink-3); }
.prose p, .prose li { font-size: 1.05rem; line-height: 1.7; color: var(--body); }
.prose p + p, .prose ul + p, .prose ol + p { margin-top: .9rem; }
.prose ul, .prose ol { padding-left: 1.35rem; display: grid; gap: .45rem; margin-top: .6rem; }
.prose li::marker { color: var(--orange-dk); font-weight: 800; }
.prose a { color: var(--blue-dk); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--orange-dk); }
/* Buttons inside prose keep their own colours (the rule above would otherwise
   paint white-on-orange button text blue). */
.prose a.btn, .prose a.btn:hover { text-decoration: none; font-weight: 800; }
.prose a.btn-primary, .prose a.btn-primary:hover,
.prose a.btn-blue, .prose a.btn-blue:hover,
.prose a.btn-ghost-light, .prose a.btn-ghost-light:hover { color: #fff; }
.prose a.btn-white, .prose a.btn-white:hover,
.prose a.btn-ghost-dark, .prose a.btn-ghost-dark:hover { color: var(--ink); }
.prose strong { color: var(--ink); }
.prose .updated { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin-bottom: 1.2rem; }
.prose figure { margin: 1.4rem 0; }
.prose figcaption { font-size: .84rem; color: var(--body); margin-top: .5rem; }
.prose img { border-radius: var(--r-md); }

/* "The short version" summary and callouts */
.summary {
  background: var(--blue-wash); border: 1px solid rgba(59, 112, 232, .25); border-radius: var(--r-lg);
  padding: 1.4rem 1.6rem; margin-bottom: 2.4rem;
}
.summary h2 { font-size: 1.05rem; margin-bottom: .7rem; color: var(--blue-dk); font-family: var(--font-body); letter-spacing: .02em; }
.summary ul { display: grid; gap: .5rem; padding-left: 1.2rem; }
.summary li { font-size: 1rem; }

.note {
  border-left: 4px solid var(--blue); background: var(--surface-2); border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1rem 1.2rem; margin: 1.2rem 0;
}
.note.warn { border-left-color: var(--orange); background: var(--orange-wash); }
.note.legal { border-left-color: var(--ink-3); }
.note p, .note li { font-size: .98rem; }
.note b { color: var(--ink); }

/* Tables */
/* Tables scroll sideways on phones; the wrapper is focusable (tabindex="0")
   so keyboard users can scroll it. */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.table-wrap:focus-visible { outline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
.prose caption { text-align: left; padding: .9rem 1rem .4rem; font-weight: 800; color: var(--ink); font-family: var(--font-display); }
.prose th, .prose td { text-align: left; padding: .8rem 1rem; border-top: 1px solid var(--line); vertical-align: top; color: var(--body); }
.prose th { background: var(--surface-2); color: var(--ink); font-weight: 800; font-size: .84rem; letter-spacing: .04em; text-transform: uppercase; }
.prose tbody tr:nth-child(even) td { background: #FAFBFD; }
.prose td b { color: var(--ink); }
.cite { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* Definition-style rows (spec / what's included) */
.kv { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; gap: .6rem 1.2rem; margin: 1rem 0; }
.kv dt { font-weight: 800; color: var(--ink); font-size: .95rem; }
.kv dd { color: var(--body); font-size: .98rem; }

/* CTA block */
.cta-box {
  background: linear-gradient(135deg, var(--ink-3), var(--ink)); color: #fff; border-radius: var(--r-lg);
  padding: clamp(1.6rem, 4vw, 2.4rem); margin-top: 3rem;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1.4rem; align-items: center;
}
.cta-box h2 { color: #fff; font-size: var(--step-2); margin-bottom: .5rem; }
.cta-box h2 em { font-style: normal; color: var(--orange-glow); }
.cta-box p { color: rgba(255, 255, 255, .78); font-size: 1rem; }
.cta-box .cta-col { display: grid; gap: .7rem; }
.cta-box :focus-visible { outline-color: #fff; }

/* --------------------------------------------------------------------------
   Blog index
   -------------------------------------------------------------------------- */
.blog-hero { padding-bottom: 3.4rem; }
.blog-hero h1 { max-width: none; }

.blog-wrap { padding-block: clamp(2.2rem, 5vw, 3.6rem); }
.blog-section-label { font-size: .74rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--blue-dk); margin-bottom: 1rem; }

/* Featured ("Latest") post */
.featured {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-md); margin-bottom: 3rem;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.featured:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.featured .media { aspect-ratio: 4 / 3; background: var(--surface-3); }
.featured .media img { width: 100%; height: 100%; object-fit: cover; }
.featured .body { padding: clamp(1.4rem, 3vw, 2.4rem); display: flex; flex-direction: column; justify-content: center; }
.featured h2 { font-size: var(--step-3); margin: .7rem 0 .8rem; }
.featured h2 a { color: inherit; text-decoration: none; }
.featured h2 a:hover { color: var(--orange-dk); }
.featured p { color: var(--body); font-size: 1.05rem; line-height: 1.6; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tag {
  display: inline-flex; align-items: center; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: .3rem .7rem; border-radius: var(--r-pill); color: var(--blue-dk); background: var(--blue-wash);
}
.tag.finish { color: #fff; background: var(--orange-btn); } /* white on #C9501C = 4.5:1 at 11.5px */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; font-size: .84rem; color: var(--muted); font-weight: 600; margin-top: 1.1rem; }
.post-meta .sep { color: var(--line-strong); }
.read-more { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.2rem; font-weight: 800; color: var(--blue-dk); text-decoration: none; }
.read-more:hover { color: var(--orange-dk); }
.read-more svg { transition: transform .3s var(--ease-back); }
.read-more:hover svg { transform: translateX(4px); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.6rem; }
.filters button {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--ink-3);
  font-weight: 800; font-size: .86rem; padding: .55rem 1rem; border-radius: var(--r-pill); cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease-back);
}
.filters button:hover { border-color: var(--ink); transform: translateY(-2px); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters button .count { font-size: .74rem; font-weight: 700; color: var(--muted); }
.filters button[aria-pressed="true"] .count { color: var(--orange-glow); }
.blog-status { font-size: .84rem; color: var(--muted); margin-bottom: 1rem; min-height: 1.2em; }

/* Card grid */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.2vw, 1.5rem); }
.post-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--blue-lt); }
.post-card .media { aspect-ratio: 16 / 10; background: var(--surface-3); overflow: hidden; }
.post-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.post-card:hover .media img { transform: scale(1.04); }
.post-card .body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: var(--step-1); margin: .7rem 0 .5rem; line-height: 1.2; }
.post-card h3 a { color: inherit; text-decoration: none; }
.post-card h3 a::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.post-card { position: relative; }
.post-card h3 a:hover { color: var(--orange-dk); }
.post-card p { color: var(--body); font-size: .96rem; line-height: 1.6; flex: 1; }
.post-card .post-meta { margin-top: .9rem; font-size: .8rem; }
.post-card .tags a, .post-card .post-meta a { position: relative; z-index: 1; }
.blog-empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; background: var(--surface-2); border-radius: var(--r-md); }

/* Coming-soon placeholder cards (posts awaiting import) */
.post-card.pending .media { display: grid; place-items: center; color: var(--blue-dk); background: linear-gradient(160deg, var(--blue-wash), var(--surface-2)); }
.post-card.pending .media svg { width: 44px; height: 44px; opacity: .6; }

/* --------------------------------------------------------------------------
   Blog post
   -------------------------------------------------------------------------- */
.post-hero .tags { margin-bottom: 1rem; }
.post-hero h1 { max-width: 26ch; }
.post-hero .post-meta { color: rgba(255, 255, 255, .75); margin-top: 1.4rem; font-size: .9rem; }
.post-hero .post-meta .sep { color: rgba(255, 255, 255, .3); }
.byline { display: inline-flex; align-items: center; gap: .55rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--blue), var(--orange)); color: #fff; font-weight: 900; font-size: .85rem;
}
.post-figure { margin: -2.2rem auto 2.4rem; max-width: 900px; padding-inline: var(--gutter); position: relative; z-index: 1; }
.post-figure img { width: 100%; height: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: #fff; }
.post-figure figcaption { text-align: center; font-size: .84rem; color: var(--body); margin-top: 1rem; }
.post-body { padding-block: 0 clamp(2.5rem, 5vw, 4rem); }
.post-body .prose { margin-inline: auto; max-width: 70ch; }
.post-body .prose > h2 { font-size: var(--step-2); margin: 2.2rem 0 .8rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.post-body .prose > h3 { margin-top: 1.6rem; }
.post-body .prose p + p { margin-top: 1rem; }
.keytake { background: var(--surface-2); border-radius: var(--r-lg); padding: 1.3rem 1.5rem; margin: 1.6rem 0 2rem; border: 1px solid var(--line); }
.keytake h2 { font-size: .8rem !important; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-dk); font-family: var(--font-body); margin: 0 0 .6rem !important; }
.keytake ul { margin: 0; }
.pros-cons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.pros-cons > div { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem 1.2rem; }
.pros-cons h3 { margin: 0 0 .5rem !important; font-size: 1rem !important; }
.pros-cons .pros h3 { color: var(--green); }
.pros-cons .cons h3 { color: var(--orange-dk); }
.pros-cons ul { margin: 0; }

/* Native <details> FAQ inside posts — no JS needed */
.post-faq details { border-bottom: 1px solid var(--line); }
.post-faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem .2rem; font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; color: var(--ink);
}
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after { content: '+'; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-weight: 800; color: var(--ink-3); transition: transform .3s var(--ease-back), background-color .3s; }
.post-faq details[open] summary::after { content: '−'; background: var(--orange); border-color: var(--orange); color: #fff; }
.post-faq summary:hover { color: var(--orange-dk); }
.post-faq details p { padding: 0 2.6rem 1.1rem .2rem; }

.author-card {
  display: flex; gap: 1.1rem; align-items: flex-start; margin-top: 2.6rem; padding: 1.3rem 1.4rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.author-card .avatar { width: 52px; height: 52px; font-size: 1.15rem; }
.author-card b { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; }
.author-card p { font-size: .95rem; margin-top: .25rem; }

.more-posts { padding-block: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.more-posts h2 { font-size: var(--step-2); margin-bottom: 1.2rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .doc-layout { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: 1.6rem; }
  .toc ol { display: flex; flex-wrap: wrap; gap: .3rem; border-left: 0; }
  .toc a { border-left: 0; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: .4rem .8rem; font-size: .82rem; margin: 0; }
  .toc a.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
  .featured { grid-template-columns: 1fr; }
  .cta-box { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .post-grid { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: .2rem .6rem; }
  .kv dd { margin-bottom: .6rem; }
  .post-figure { margin-top: -1.4rem; }
}

/* Print: long documents (terms, guides) should print cleanly */
@media print {
  .toc, .cta-box, .site-footer, .mobile-menu { display: none !important; }
  .page-hero { background: none; color: #000; padding-top: 1rem; }
  .page-hero h1, .page-hero .lede { color: #000; }
  .doc-layout { grid-template-columns: 1fr; }
  .prose a { color: #000; text-decoration: none; }
  .prose a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: .8em; }
}
