/* Shared styles for tool pages — aligned with hub.css tokens */

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand-red, #E11D48);
  background: var(--brand-red-light, #FFF1F2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
  white-space: nowrap;
  line-height: 1.2;
  max-width: 100%;
  box-sizing: border-box;
}

body.audience-public .badge {
  color: var(--brand-teal, #0D9488);
  background: var(--brand-teal-light, #CCFBF1);
}

h1.title {
  font-family: 'e-UkraineHead', system-ui, sans-serif;
  font-size: clamp(1.4rem, 3.2vw, 1.9rem);
  font-weight: 800;
  line-height: 1.22;
  margin: 0 0 10px;
  letter-spacing: -.02em;
  color: var(--text-dark, #0F172A);
}

.meta, .lead {
  font-size: .9rem;
  color: var(--text-muted, #64748B);
  margin-bottom: 20px;
  line-height: 1.55;
}

.article {
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-subtle, #E2E8F0);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-subtle, 0 4px 24px -8px rgba(15, 23, 42, .06));
  overflow: visible;
}

.article img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: .92rem;
}

.article th,
.article td {
  border: 1px solid var(--border-subtle, #E2E8F0);
  padding: 10px 12px;
  text-align: left;
}

.article th {
  background: #F8FAFC;
  font-weight: 600;
}

.article h2 {
  font-size: 1.25rem;
  margin: 1.6em 0 .55em;
  font-weight: 700;
  letter-spacing: -.01em;
}

.article h3 {
  font-size: 1.05rem;
  margin: 1.3em 0 .45em;
  font-weight: 700;
}

.article p {
  margin: 0 0 1em;
  line-height: 1.6;
}

.article ul, .article ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

.article a {
  color: var(--brand-red, #E11D48);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1em 0;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, #E2E8F0);
}

.table-scroll table {
  margin: 0;
  border: none;
}

.scheme-block {
  background: linear-gradient(160deg, #F8FAFC 0%, #FFF 100%);
  border: 1.5px solid var(--border-subtle, #E2E8F0);
  border-radius: 16px;
  padding: 16px;
  margin: 24px 0 28px;
  text-align: center;
  overflow: visible;
}

.scheme-block img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0 auto;
  box-shadow: 0 2px 12px rgba(15, 23, 42, .06);
}

.scheme-block svg {
  max-width: 100%;
  height: auto;
}

.scheme-caption {
  font-size: 12.5px;
  color: var(--text-muted, #64748B);
  margin: 12px 0 0;
  font-weight: 600;
  line-height: 1.4;
}

.article .scheme-block + h2,
.article .scheme-block + h3 {
  margin-top: 8px;
}

.article .callout,
.article .note,
.article .alert {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 1em 0;
  border: 1px solid var(--border-subtle, #E2E8F0);
  background: #F8FAFC;
}

@media (max-width: 640px) {
  .wrap { padding: 16px 14px 48px; }
  .article { padding: 18px 14px; border-radius: 16px; }
  h1.title { font-size: 1.35rem; }
  .scheme-block { padding: 10px; margin: 16px 0 20px; border-radius: 12px; }
  .scheme-block img { border-radius: 8px; }
}

/* ---- micro UI: progress, breadcrumb, read-time, back-to-top ---- */
.hub-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 400;
  background: linear-gradient(90deg, var(--brand-red, #E11D48), #BE123C 60%, var(--brand-teal, #0D9488));
  pointer-events: none;
  transition: width .08s linear;
}

.hub-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted, #64748B);
  margin: 0 0 14px;
  font-weight: 500;
}
.hub-breadcrumb a {
  color: var(--text-muted, #64748B);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.hub-breadcrumb a:hover {
  color: var(--brand-red, #E11D48);
  border-bottom-color: currentColor;
}
.hub-breadcrumb .sep {
  opacity: .45;
  user-select: none;
}
.hub-breadcrumb .current {
  color: var(--text-dark, #0F172A);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-read-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 12.5px;
  color: var(--text-muted, #64748B);
  margin: -6px 0 18px;
  font-weight: 600;
}
.hub-read-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hub-read-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #CBD5E1;
}

#scrollTopBtn {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 350;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle, #E2E8F0);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px -6px rgba(15,23,42,.18);
  color: var(--text-dark, #0F172A);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: .2s ease;
  font-family: inherit;
}
#scrollTopBtn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#scrollTopBtn:hover {
  border-color: var(--brand-red, #E11D48);
  color: var(--brand-red, #E11D48);
  box-shadow: 0 10px 28px -6px rgba(225,29,72,.22);
}
#scrollTopBtn svg { display: block; }

/* Soft fade on article first scheme for breathing room */
.article > .scheme-block:first-child {
  margin-top: 4px;
}

/* Heading accent bar for long articles */
.article h2 {
  position: relative;
  padding-left: 14px;
}
.article h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .28em;
  bottom: .28em;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--brand-red, #E11D48), #FB7185);
  opacity: .85;
}

body.audience-public .article h2::before {
  background: linear-gradient(180deg, var(--brand-teal, #0D9488), #5EEAD4);
}

@media (max-width: 640px) {
  #scrollTopBtn { right: 12px; bottom: 16px; width: 40px; height: 40px; border-radius: 12px; }
  .hub-breadcrumb { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-progress { transition: none; }
  #scrollTopBtn { transition: none; }
}

/* Embedded mode: hide chrome extras */
body.is-embedded .hub-progress,
body.is-embedded #scrollTopBtn,
body.is-embedded .hub-breadcrumb { display: none !important; }

/* Related materials under article */
.related-materials {
  margin-top: 28px;
  padding-top: 8px;
}
.related-materials h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  padding-left: 0;
}
.related-materials h2::before { display: none; }
.related-materials .cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.related-materials .hub-card {
  background: #fff;
  border: 1px solid var(--border-subtle, #E2E8F0);
  border-left: 4px solid var(--card-accent, #CBD5E1);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 0;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-subtle, 0 4px 18px -4px rgba(15,23,42,.06));
}
.related-materials .card-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  margin: 0 !important;
  line-height: 1.35;
  color: var(--text-dark, #0F172A);
}
.related-materials .card-footer-action {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-red, #E11D48);
}

.disclaimer {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--text-muted, #64748B);
  line-height: 1.5;
  padding: 12px 14px;
  background: #F8FAFC;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, #E2E8F0);
}

/* Prevent content-blocks from blowing up page title */
h1.title {
  font-size: clamp(1.4rem, 3.2vw, 1.9rem) !important;
  font-weight: 800 !important;
  margin: 0 0 10px !important;
  line-height: 1.25 !important;
  overflow: visible !important;
  white-space: normal !important;
  word-break: break-word;
}
.wrap, .article, .disclaimer {
  border-radius: 12px;
}
.scheme-block {
  border-radius: 18px !important;
  overflow: hidden;
}
.scheme-block img {
  display: block;
  width: 100%;
  height: auto;
}
.scheme-caption {
  display: block;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748B;
  font-weight: 600;
  text-align: center;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  white-space: normal;
  overflow: visible;
}
.badge {
  border-radius: 999px !important;
}
body, .title, .article {
  font-family: 'e-Ukraine', 'e-UkraineHead', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
}

/* Global safety net: no unbounded icons/SVGs */
.article svg:not([width]):not([height]),
main svg:not([width]):not([height]),
.wrap svg:not([width]):not([height]) {
  max-width: 64px;
  max-height: 64px;
}

/* When an SVG is meant to be a large illustration it must sit in .svg-wrapper or .scheme-block */
.scheme-block svg,
.svg-wrapper svg,
figure svg {
  max-width: 100% !important;
  max-height: none !important;
}

/* Content layout helpers that appear outside .article on some pages */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 12px 0 20px;
}
.content-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 16px;
}
.box-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0F172A;
  margin: 4px 0 6px;
}
.box-desc {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.55;
  margin: 0;
}
.guide-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px -6px rgba(15, 23, 42, 0.06);
}
.axis-branch {
  position: relative;
  padding-left: 28px;
  margin: 24px 0;
  border-left: 2px solid #E2E8F0;
}
.axis-node {
  position: absolute;
  left: -7px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #E11D48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}


/* --- polish pass --- */
.wrap { max-width: 880px; }
.article { overflow-x: hidden; }
.article img, .article figure { max-width: 100%; }
.article table { font-size: .88rem; }
.article th, .article td { vertical-align: top; }
.article-toc { margin: 0 0 22px; padding: 16px 18px; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 14px; }
.article-toc-title { font-weight: 800; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: #475569; margin-bottom: 8px; }
.article-toc ol { margin: 0; padding-left: 1.2em; }
.article-toc a { color: #0F172A; text-decoration: none; }
.article-toc a:hover { color: #E11D48; }
.scheme-block { margin: 0 0 22px; }
.scheme-caption { font-size: .82rem; color: #475569; margin-top: 8px; }
@media (max-width: 640px) {
  .article { padding: 20px 16px; border-radius: 16px; }
  .wrap { padding: 16px 14px 48px; }
  h1.title { font-size: 1.35rem; }
}


/* hero contrast lock */
.article .hero-card,
.article .tool-card.hero-card {
  background: linear-gradient(135deg, #ECFEFF 0%, #F0FDFA 55%, #F8FAFC 100%) !important;
  color: #0F172A !important;
  border: 1px solid #99F6E4 !important;
  border-left: 6px solid #0D9488 !important;
}
.article .hero-card .title,
.article .hero-card h1,
.article .hero-card h2,
.article .hero-card .section-title {
  color: #0F172A !important;
}
.article .hero-card .subtitle,
.article .hero-card p {
  color: #334155 !important;
}

/* ========== Tool toolbar: поділитись / слухати / розмір тексту ========== */
.hub-tool-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px}
.hub-tool-btn{display:inline-flex;align-items:center;gap:7px;background:#fff;border:1.5px solid var(--border-subtle,#E2E8F0);color:#334155;font-family:inherit;font-size:12px;font-weight:700;padding:8px 14px;border-radius:999px;cursor:pointer;transition:.18s ease}
.hub-tool-btn:hover{border-color:var(--brand-red,#E11D48);color:var(--brand-red,#E11D48);transform:translateY(-1px)}
.hub-tool-btn.is-on{background:#0F172A;border-color:#0F172A;color:#fff}
.hub-tool-btn svg{flex-shrink:0}
/* розмір тексту статей */
body.hub-fs-1 .article{font-size:1.07em}
body.hub-fs-2 .article{font-size:1.15em}
@media print{.hub-tool-actions{display:none!important}}

/* ========== Print: чистий аркуш для плакатів і матеріалів ========== */
@media print {
  .hdr, .wip-banner, .ft, .hub-progress, .scrollTop-btn, #scrollTopBtn,
  .hub-breadcrumb, .hub-toc, .reader-panel, .bg-ambient-layer { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: 100%; padding: 0; margin: 0; }
  .article { border: none; box-shadow: none; border-radius: 0; padding: 0; }
  .article .scheme-block img, .scheme-block img { max-width: 100%; page-break-inside: avoid; }
  .badge, .meta, .disclaimer { color: #000; }
  a { text-decoration: none; color: #000; }
  @page { margin: 12mm; }
}
