/* Guide pages (/poradnik, /uk/poradnyk, /ru/rukovodstvo, /en/guides). Loaded after site.css on those pages only.
   Same tokens as site.css: cream ground, ink text, Figtree, red only for source marks, marker yellow for the one total. */

.guide-wrap { padding-top: 8px; padding-bottom: 8px; }
@media (min-width: 900px) { .guide-wrap { padding-top: 16px; } }

/* Breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--faint); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); }

/* Head */
.guide-head { max-width: 860px; padding: 28px 0 8px; }
@media (min-width: 900px) { .guide-head { padding: 48px 0 16px; } }
.guide-kicker { margin: 0; font-size: 14px; font-weight: 600; line-height: 18px; color: var(--muted); }
.guide-head h1 { font-size: clamp(34px, 2.6vw + 24px, 60px); line-height: 1.04; }
.guide-head .lead { max-width: 40em; }
@media (min-width: 900px) { .guide-head .lead { max-width: 640px; } }

/* Layout: contents on the left from 1100 px, article on the right */
.guide-grid { display: block; margin-top: 24px; }
@media (min-width: 1100px) {
  .guide-grid { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: 64px; margin-top: 40px; }
  .toc { position: sticky; top: 24px; align-self: start; }
}
.toc { margin: 0 0 8px; padding: 18px 20px; border-radius: 20px; background: var(--paper); }
.toc p { margin: 0; font-size: 13px; font-weight: 700; line-height: 18px; color: var(--muted); }
.toc ol { margin: 10px 0 0; padding: 0 0 0 18px; font-size: 15px; line-height: 21px; }
.toc li + li { margin-top: 6px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1100px) { .toc { padding: 0; background: none; } }

/* Article text */
.prose { max-width: 720px; }
.prose h2 { margin: 48px 0 0; font-size: clamp(26px, 1vw + 22px, 34px); line-height: 1.12; letter-spacing: -0.03em; scroll-margin-top: 16px; }
.prose > h2:first-child { margin-top: 24px; }
.prose p, .prose li { font-size: 17px; line-height: 1.62; color: var(--ink); }
.prose p { margin: 14px 0 0; text-wrap: pretty; }
.prose ul { margin: 14px 0 0; padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { font-weight: 700; }

/* Every number links to its source: bold, a red dotted underline (the stamp red). */
a.fig { font-weight: 700; white-space: nowrap; text-decoration: underline dotted var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; color: var(--ink); }
a.fig:hover { text-decoration-style: solid; }
.fig-star { margin-left: 1px; font-size: 0.7em; font-weight: 700; color: var(--red); }

/* Tables in the text */
.table-wrap { margin: 18px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose table, .calc-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 21px; }
.prose table:not(.calc-table) { min-width: 420px; background: var(--paper); border-radius: 16px; overflow: hidden; }
.prose th, .prose td, .calc-table th, .calc-table td { padding: 12px 14px; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; }
.prose thead th, .calc-table thead th { font-size: 13px; font-weight: 700; color: var(--muted); }
.prose tbody th { font-weight: 600; }
.prose tbody tr:last-child th, .prose tbody tr:last-child td { border-bottom: 0; }
.prose td:not(:first-child), .calc-table td { white-space: nowrap; }
.prose td[colspan] { white-space: normal; color: var(--muted); }

/* Calculators */
.calc { margin: 22px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.calc > * { min-width: 0; }
.calc-field select, .calc-field input { min-width: 0; }
.calc-example { margin: 0; padding: 18px; border-radius: 20px; background: var(--paper); }
.calc-example figcaption { margin: 0 0 8px; font-size: 14px; line-height: 20px; color: var(--muted); }
.calc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.calc-table th[scope="row"] { font-weight: 500; }
.calc-table td { text-align: right; }
.calc-table thead th:not(:first-child) { text-align: right; }
.calc-table tr.total th, .calc-table tr.total td { border-bottom: 0; font-weight: 700; }
.calc-table tr.total b { padding: 1px 4px; background: var(--marker); border-radius: 4px; }
.calc-cmp { min-width: 440px; }
.calc-cmp .best { background: var(--tile); }
.calc-form { padding: 20px; border-radius: 22px; background: var(--ink); color: var(--bg); }
@media (min-width: 768px) { .calc-form { padding: 28px; } }
.calc-form[hidden] { display: none; }
.prose .calc-title, .calc-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--bg); }
.calc-fields { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 600px) { .calc-fields { grid-template-columns: 1fr 1fr; } }
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field[hidden] { display: none; }
.calc-field label { font-size: 13px; font-weight: 600; line-height: 18px; color: rgba(247, 243, 234, 0.8); }
.calc-field input, .calc-field select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #3a3835;
  border-radius: 12px;
  background: #2a2826;
  color: var(--bg);
  font: 600 16px/1 var(--font);
  font-feature-settings: "tnum" 1;
}
.calc-field input:focus-visible, .calc-field select:focus-visible { outline: 2px solid var(--bg); outline-offset: 2px; }
.calc-check { flex-direction: row; align-items: center; gap: 10px; align-self: end; min-height: 46px; }
.calc-check input { width: 20px; height: 20px; accent-color: var(--marker); }
.calc-check label { font-size: 15px; color: var(--bg); }
.calc-pit11 { grid-column: 1 / -1; display: grid; gap: 12px; margin: 4px 0 0; padding: 16px 0 0; border: 0; border-top: 1px solid #3a3835; }
@media (min-width: 600px) { .calc-pit11 { grid-template-columns: 1fr 1fr; } }
.prose .calc-pit11 legend, .calc-pit11 legend { padding: 0; font-size: 14px; font-weight: 600; color: var(--bg); }
.calc-out { margin-top: 18px; padding: 6px 16px 14px; border-radius: 16px; background: var(--paper); color: var(--ink); }
.calc-out:empty { display: none; }
.calc-note { margin: 10px 0 0 !important; font-size: 13px !important; line-height: 19px !important; color: var(--muted) !important; }
.calc-verdict { margin: 12px 0 0 !important; font-size: 15px !important; font-weight: 700; }

/* FAQ and sources inside the article */
.guide-faq .faq-list { margin-top: 16px; }
.guide-faq .faq-list p { font-size: 16px; }
.guide-sources { margin-top: 48px; padding: 22px; border-radius: 22px; background: var(--paper); }
.guide-sources h2 { margin: 0; font-size: 22px; }
.guide-sources p { font-size: 15px; line-height: 22px; color: var(--muted); }
.guide-sources ul { padding-left: 18px; }
.guide-sources li { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.guide-disclaimer { margin-top: 16px !important; font-size: 13px !important; }

/* Related guides and hub cards */
.related { margin: 64px 0 0; }
.related h2, .hub-group h2 { font-size: clamp(26px, 1vw + 22px, 34px); }
.related ul, .hub-list { display: grid; gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .related ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hub-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .hub-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.related a, .hub-list a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 22px; border-radius: 22px; background: var(--paper); text-decoration: none; transition: box-shadow 160ms var(--ease); }
.related a:hover, .hub-list a:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.related b, .hub-list b { font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.related span, .hub-list span { font-size: 15px; line-height: 22px; color: var(--muted); }
.hub-list em { align-self: flex-start; margin-top: auto; padding: 3px 9px; border-radius: 999px; background: var(--marker); font-size: 12px; font-style: normal; font-weight: 700; }
.related-hub { margin: 18px 0 0; font-size: 15px; font-weight: 600; }
.related-hub a { text-underline-offset: 3px; }
.hub-head { padding-bottom: 0; }
.hub-note { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.hub-group { margin-top: 48px; }
@media (min-width: 900px) { .hub-group { margin-top: 72px; } }

/* Call to action */
.guide-cta { margin-top: 72px; }
.cta-more { margin: 14px 0 0; font-size: 15px; font-weight: 600; }
.cta-more a { color: var(--bg); text-underline-offset: 3px; }
.store-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn-store { display: inline-flex; align-items: center; text-decoration: none; background: var(--bg); color: var(--ink); }

/* Phones: the three-column comparison fits without sideways scrolling. */
@media (max-width: 599px) {
  .calc-example { padding: 14px 12px; }
  .calc-out { padding: 4px 10px 12px; }
  .calc-cmp { min-width: 0; font-size: 13px; line-height: 18px; }
  .calc-cmp th, .calc-cmp td { padding: 10px 4px; }
  .prose .calc-cmp td { white-space: nowrap; }
  .calc-cmp th[scope="row"] { min-width: 72px; }
  .calc-cmp tr.total b { padding: 1px 2px; }
}

/* Phones: fit 3-column tables on screen instead of hiding the last column behind a sideways scroll. */
@media (max-width: 479px) {
  .prose table:not(.calc-table) { min-width: 0; font-size: 14px; line-height: 19px; }
  .prose table:not(.calc-table) th, .prose table:not(.calc-table) td { padding: 10px 8px; }
  .prose table:not(.calc-table) th:first-child, .prose table:not(.calc-table) td:first-child { padding-left: 12px; }
}
