/**
 * TCC Optical Authority Technology Preview 5 — CTA Closure Lock
 *
 * Contract:
 * - Single Post only.
 * - Article H1 and all core typography tokens are protected/read-only.
 * - Automatic offset is allowed only for the sidebar section heading.
 * - Offset is a runtime CSS variable, clamped by the JS engine.
 * - Disabling the feature removes the layer without changing source tokens.
 */

:root {
  --tcc-optical-sidebar-title-offset: 0px;
  --tcc-optical-sidebar-title-line-height: 1.18;
  --tcc-optical-sidebar-title-tracking: 0em;
}

/* Existing preview-safe spacing and alignment. */
body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled .tcc-single-editorial__header {
  margin-bottom: 20px;
}

body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled .tcc-single-editorial__sidebar-inner {
  margin-top: 0;
}

body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled .tcc-single-editorial__meta.tcc-single-editorial__eyebrow,
body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled .tcc-single-editorial__sidebar .tcc-single-editorial__eyebrow {
  min-height: 30px;
  align-items: center;
  box-sizing: border-box;
  vertical-align: top;
}

body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled .tcc-single-editorial__sidebar-title {
  margin-top: 10px !important;
  margin-bottom: 14px !important;
  line-height: var(--tcc-optical-sidebar-title-line-height, 1.18) !important;
  letter-spacing: var(--tcc-optical-sidebar-title-tracking, 0em) !important;
}

/* TP3: render-only optical offset. Main article H1 is intentionally absent. */
body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled.tcc-optical-auto-offset .tcc-single-editorial__sidebar-title {
  font-size: calc(28px + var(--tcc-optical-sidebar-title-offset, 0px)) !important;
}

body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled .tcc-single-editorial__related-list {
  row-gap: 12px;
}

body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled .tcc-single-editorial__all-posts {
  margin-top: 38px;
  margin-left: 0;
  align-self: flex-start;
}

body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled .tcc-single-editorial__share {
  margin-top: 28px;
}

/* Fail-safe: if protected typography changes, auto offset is neutralized. */
body.tcc-optical-regression-fail {
  --tcc-optical-sidebar-title-offset: 0px;
  --tcc-optical-sidebar-title-line-height: 1.18;
  --tcc-optical-sidebar-title-tracking: 0em;
}

@media (max-width: 767px) {
  body.single-post.tcc-tb-single-enabled.tcc-optical-authority-enabled.tcc-optical-auto-offset .tcc-single-editorial__sidebar-title {
    font-size: 24px !important;
  }
}

/* RC7.9.622 — Semantic / Design / Optical title-role foundation.
 * These variables define visual roles only. HTML heading levels remain semantic.
 * No existing locked page is changed by declaring these tokens.
 */
:root {
  --tcc-title-role-hero-scale: 1;
  --tcc-title-role-editorial-scale: .92;
  --tcc-title-role-document-scale: .86;
  --tcc-title-role-product-scale: .94;
  --tcc-title-role-archive-scale: .9;

  --tcc-title-role-document-h1-desktop: 27px;
  --tcc-title-role-document-h1-tablet: 25px;
  --tcc-title-role-document-h1-mobile: 22px;
  --tcc-title-role-document-h2-desktop: 22px;
  --tcc-title-role-document-h2-tablet: 20px;
  --tcc-title-role-document-h2-mobile: 18px;
  --tcc-title-role-document-h3-desktop: 20px;
}


/* RC43.60 — Search empty-state ZH optical balance consumer.
 * Architecture: Design Tokens -> Template Authority -> Optical Authority.
 * Scope: Search no-results heading, Simplified Chinese locale only.
 * Contract: a bounded visual correction; Homepage tokens remain read-only. */
:root {
  --tcc-optical-search-empty-zh-offset: -2px;
}
body.search.tcc-locale-zh.tcc-tb-archive-enabled .tcc-ta-search .tcc-ta-empty h2 {
  font-size: calc(var(--tcc-ds-section-title-desktop, 36px) + var(--tcc-optical-search-empty-zh-offset, -2px)) !important;
  line-height: 1.1 !important;
  letter-spacing: -.015em !important;
}
@media (max-width: 900px) {
  body.search.tcc-locale-zh.tcc-tb-archive-enabled .tcc-ta-search .tcc-ta-empty h2 {
    font-size: calc(var(--tcc-ds-section-title-tablet, 30px) - 1px) !important;
  }
}
@media (max-width: 640px) {
  body.search.tcc-locale-zh.tcc-tb-archive-enabled .tcc-ta-search .tcc-ta-empty h2 {
    font-size: var(--tcc-ds-section-title-mobile, 26px) !important;
  }
}
