/* Vaikų krautuvė: guides hub (patarimai), guide article (patarimas) and legal pages
   Loaded after css/styles.css */

:root {
  --prose: 72ch;
  --toc-top: 144px; /* sticky header (topbar 48 + main 72) + breathing room */
}

/* ---------- Shared page head ---------- */
.page-head { padding: 12px 0 40px; }
.page-head .h1 { max-width: 20ch; }
.page-head__lead { max-width: 62ch; margin-top: 20px; font-size: 18px; color: var(--c-navy-soft); }

/* ---------- Hub: filter chips ---------- */
.gfilter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 32px; }
.gfilter__label { margin-right: 6px; font-size: 15px; font-weight: 700; }
.gfilter .chip { border: 0; }
.gfilter .chip .pbadge { width: 26px; height: 26px; border-radius: 9px; }
.gfilter .chip .pbadge .icon { width: 15px; height: 15px; }
.gfilter .chip.is-active .pbadge { transform: rotate(0); }

/* ---------- Hub: guide grid ---------- */
.ggrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.gcard { position: relative; display: flex; flex-direction: column; border-radius: var(--radius-l); background: var(--c-white); box-shadow: 0 0 0 1px var(--c-line); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.gcard:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(31, 42, 68, .04), 0 18px 40px rgba(31, 42, 68, .12); }
.gcard__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--c-sand); }
.gcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gcard:hover .gcard__media img { transform: scale(1.04); }
.gcard__topic { position: absolute; top: 14px; left: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .95); font-size: 14px; font-weight: 700; color: var(--c-navy); }
.gcard__body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 20px 22px 22px; }
.gcard__title { font-family: var(--font-display); font-size: 21px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.gcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.gcard:hover .gcard__title a { color: var(--c-tomato-dark); }
.gcard__text { color: var(--c-navy-soft); }
.gcard__meta { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font-size: 14px; font-weight: 600; color: var(--c-muted); }
.gcard__meta .icon { width: 16px; height: 16px; }

/* Featured guide: full row, image + text side by side */
.gcard--feature { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--t-sun); box-shadow: inset 0 0 0 2px rgba(168, 106, 0, .1); }
.gcard--feature .gcard__media { aspect-ratio: auto; min-height: 400px; }
.gcard--feature .gcard__body { justify-content: center; gap: 16px; padding: 48px 52px; }
.gcard--feature .gcard__title { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.12; }
.gcard--feature .gcard__text { font-size: 18px; }
.gcard--feature .gcard__meta { margin-top: 8px; color: var(--c-navy-soft); }
.gcard__badge { align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--c-navy); color: var(--c-white); font-size: 14px; font-weight: 700; }
.gcard__cta { position: relative; z-index: 2; align-self: flex-start; margin-top: 10px; }
.gcard[hidden] { display: none; }

/* Hub: help strip */
.ghub { padding-bottom: 150px; }
.ghelp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; margin-top: 56px; padding: 28px 32px; border-radius: var(--radius-l); background: var(--c-white); box-shadow: 0 0 0 1px var(--c-line); }
.ghelp__title { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.ghelp__text { margin-top: 4px; color: var(--c-navy-soft); }
.ghelp__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Article + legal: 2-column layout with sticky TOC ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 64px; align-items: start; padding-bottom: 88px; }
.toc { position: sticky; top: var(--toc-top); max-height: calc(100vh - var(--toc-top) - 24px); overflow-y: auto; padding: 22px 20px; border-radius: var(--radius); background: var(--c-white); box-shadow: 0 0 0 1px var(--c-line); }
.toc__title { margin-bottom: 10px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
/* TOC is a <details>: always open + not clickable on desktop, collapsible "Turinys" block ≤900px (see responsive) */
summary.toc__title { display: block; list-style: none; pointer-events: none; }
summary.toc__title::-webkit-details-marker { display: none; }
.toc__chev { display: none; }
.toc ol { display: grid; gap: 2px; counter-reset: toc; }
.toc a { display: block; padding: 7px 10px; margin-inline: -10px; border-radius: 10px; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--c-navy-soft); transition: background-color .2s var(--ease), color .2s var(--ease); }
.toc a:hover { background: var(--c-cream); color: var(--c-navy); }
.toc a[aria-current="true"] { background: var(--c-tomato-tint); color: var(--c-tomato-dark); }
.toc--num li { counter-increment: toc; }
.toc--num a { display: grid; grid-template-columns: 26px minmax(0, 1fr); }
.toc--num a::before { content: counter(toc) "."; color: var(--c-muted); font-variant-numeric: tabular-nums; }

/* ---------- Prose (article + legal body) ---------- */
.prose { min-width: 0; font-size: 17px; line-height: 1.75; }
/* Text stays at a readable measure; tables, product rows and FAQ may use the full column */
.prose > :where(p, h2, h3, ul, ol, .callout, .tldr), .legal > section { max-width: var(--prose); }
.nowrap { white-space: nowrap; }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: 56px; scroll-margin-top: var(--toc-top); font-family: var(--font-display); font-size: clamp(26px, 2.2vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.prose h3 { margin-top: 32px; scroll-margin-top: var(--toc-top); font-size: 20px; font-weight: 750; }
.prose > h2:first-child, .prose > section:first-child > h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--c-navy-soft); }
.prose strong { color: var(--c-navy); font-weight: 700; }
.prose a:where(:not(.btn, .chip, .link-arrow)) { color: var(--c-navy); font-weight: 650; text-decoration: underline; text-decoration-color: var(--c-tomato); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose a:where(:not(.btn, .chip, .link-arrow)):hover { color: var(--c-tomato-dark); }
.prose ul.bullets { display: grid; gap: 8px; padding-left: 4px; }
.prose ul.bullets li { position: relative; padding-left: 22px; }
.prose ul.bullets li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 8px; height: 8px; border-radius: 50%; background: var(--c-tomato); }
.prose ol.steps { display: grid; gap: 8px; counter-reset: step; }
.prose ol.steps li { position: relative; padding-left: 36px; counter-increment: step; }
.prose ol.steps li::before { content: counter(step); position: absolute; left: 0; top: .2em; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--t-sky); color: var(--t-sky-ink); font-size: 14px; font-weight: 800; line-height: 1; }

/* ---------- Article ---------- */
.art-head { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 8px 0 56px; }
.art-head .h1 { font-size: clamp(34px, 3.6vw, 52px); max-width: 18ch; }
.art-head__lead { margin-top: 20px; max-width: 54ch; font-size: 18px; color: var(--c-navy-soft); }
.art-head__topic { margin-bottom: 18px; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 24px; font-size: 15px; color: var(--c-muted); }
.byline__who { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--c-navy); }
.byline__who img { width: 36px; height: 36px; padding: 5px; border-radius: 50%; background: var(--t-peach); }
.byline__item { display: inline-flex; align-items: center; gap: 6px; }
.byline__item .icon { width: 16px; height: 16px; }
.art-hero { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--c-sand); box-shadow: var(--shadow); }
.art-hero img { width: 100%; height: 100%; object-fit: cover; }

/* "Trumpai" direct answer box (first thing AI/skimmers read) */
.tldr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; padding: 26px 28px; border-radius: var(--radius-l); background: var(--t-mint); }
.prose .tldr { margin-top: 0; }
.tldr .pbadge { --pb: var(--c-white); box-shadow: 0 4px 12px rgba(63, 125, 92, .15); }
.prose .tldr .tldr__title { margin-top: 10px; }
.tldr__title { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--c-navy); }
.tldr p { margin-top: 6px; color: var(--c-navy); }
.tldr ul { display: grid; gap: 6px; margin-top: 10px; }
.tldr li { position: relative; padding-left: 26px; color: var(--c-navy); }
.tldr li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 8px; border-left: 2.5px solid var(--t-mint-ink); border-bottom: 2.5px solid var(--t-mint-ink); transform: rotate(-45deg); }

/* Comparison table */
.gtable-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--c-line); background: var(--c-white); }
.gtable { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.gtable caption { padding: 16px 18px 0; text-align: left; font-size: 14px; color: var(--c-muted); caption-side: bottom; padding-bottom: 14px; }
.gtable th, .gtable td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-line); }
.gtable thead th { background: var(--c-navy); color: var(--c-white); font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.gtable tbody th { font-weight: 800; color: var(--c-navy); white-space: nowrap; }
.gtable td { color: var(--c-navy-soft); }
.gtable tbody tr:nth-child(even) { background: var(--c-cream); }
.gtable tbody tr:last-child th, .gtable tbody tr:last-child td { border-bottom: 0; }
.gtable--groups td:nth-child(2), .gtable--groups td:nth-child(3) { white-space: nowrap; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.tag--back { background: var(--t-sky); color: var(--t-sky-ink); }
.tag--front { background: var(--t-peach); color: var(--t-peach-ink); }

/* Callout (tip / warning) */
.callout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px 22px; border-radius: var(--radius); background: var(--t-peach); }
.callout p { color: var(--c-navy); }
.callout--sky { background: var(--t-sky); }

/* Checklist */
.checklist { display: grid; gap: 10px; padding: 24px; border-radius: var(--radius-l); background: var(--c-white); box-shadow: 0 0 0 1px var(--c-line); }
.checklist li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--c-navy); }
.checklist li > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; margin-top: 1px; border-radius: 9px; background: var(--t-mint); color: var(--t-mint-ink); }
.checklist .icon { width: 16px; height: 16px; stroke-width: 2.6; }

/* Recommended products inside the article */
.art-products { max-width: none; }
.prose .art-products .products { margin-top: 20px; }
.art-products__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.products--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
.prose .card p, .prose .card li { color: inherit; }
.prose .card__meta { color: var(--c-muted); }
.prose .card__ship { color: var(--c-sage); }
.prose .card__title { margin-top: 0; font-size: 16px; line-height: 1.4; letter-spacing: 0; font-family: var(--font-sans); font-weight: 650; }
.prose .card .card__title a { font-weight: 650; text-decoration: none; color: var(--c-navy); }
.prose .card .card__title a:hover { color: var(--c-tomato); }
.prose .card > * + *, .prose .card__body > * { margin-top: 0; }
.prose .price__was { color: var(--c-muted); }

/* FAQ (same look as homepage .qa, own copy so home.css is not needed) */
.qa-list { display: grid; gap: 12px; }
.qa { --qa: #F9E3DA; --qa-ink: var(--c-tomato-dark); border-radius: 22px; background: var(--c-white); box-shadow: 0 0 0 1px var(--c-line); transition: box-shadow .25s var(--ease); }
.qa--sun { --qa: #FBEBC8; --qa-ink: #A86A00; }
.qa--mint { --qa: #DDEBDF; --qa-ink: var(--c-sage); }
.qa--sky { --qa: #DCE6F2; --qa-ink: #3B5F8F; }
.qa[open] { box-shadow: 0 0 0 2px var(--qa), var(--shadow); }
.qa summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px 18px 16px 22px; cursor: pointer; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary { -webkit-tap-highlight-color: transparent; }
.qa__q { font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--c-navy); }
.qa__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--qa); color: var(--qa-ink); transition: transform .25s var(--ease); }
.qa[open] .qa__icon { transform: rotate(45deg); }
.prose .qa p { margin: 0; padding: 0 22px 20px; }

/* Related guides (below the article, full width) */
.related { padding-block: 72px 96px; background: var(--c-sand); }
.related .ggrid { margin-top: 32px; }
.related .gcard__title { font-size: 19px; }

/* ---------- Legal ---------- */
.legal-head { padding: 8px 0 40px; }
.legal-page .doc-layout { padding-bottom: 160px; }
.legal-head .h1 { font-size: clamp(34px, 3.6vw, 50px); }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 15px; color: var(--c-muted); }
.legal-meta strong { color: var(--c-navy); font-weight: 650; }
.legal-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 12px 18px; border-radius: 14px; background: var(--t-sun); color: #6E4600; font-size: 15px; font-weight: 700; text-decoration: none; }
.legal-note::before { content: "!"; width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--c-sun); color: var(--c-navy); font-weight: 800; line-height: 1; }
.legal { counter-reset: lsec; }
.legal > section { counter-increment: lsec; }
.legal > section + section { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--c-line); }
.legal h2 { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: baseline; margin-top: 0; font-size: clamp(22px, 1.9vw, 27px); }
.legal h2::before { content: counter(lsec) "."; color: var(--c-tomato); font-variant-numeric: tabular-nums; }
.legal ol.clauses { counter-reset: cl; display: grid; gap: 12px; margin-top: 16px; }
.legal ol.clauses > li { position: relative; padding-left: 48px; counter-increment: cl; }
.legal ol.clauses > li::before { content: counter(lsec) "." counter(cl) "."; position: absolute; left: 0; top: 0; font-size: 15px; font-weight: 700; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.legal dl { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 10px 20px; padding: 20px 22px; border-radius: var(--radius); background: var(--c-white); box-shadow: 0 0 0 1px var(--c-line); font-size: 16px; }
.legal dt { font-weight: 700; color: var(--c-navy); }
.legal dd { margin: 0; color: var(--c-navy-soft); }
.legal .gtable { min-width: 560px; }
.legal-foot { margin-top: 56px; padding: 22px 24px; border-radius: var(--radius); background: var(--c-white); box-shadow: 0 0 0 1px var(--c-line); font-size: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .doc-layout { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 40px; }
  .gcard--feature .gcard__body { padding: 36px; }
  /* Byline: author on its own line, so no "·" is left dangling at a line end */
  .byline__who { flex-basis: 100%; }
  .byline > [aria-hidden="true"]:nth-child(2) { display: none; }
}
@media (max-width: 900px) {
  :root { --toc-top: 136px; }
  .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gcard--feature { grid-template-columns: minmax(0, 1fr); }
  .gcard--feature .gcard__media { min-height: 0; aspect-ratio: 16 / 9; }
  .art-head { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .art-hero { margin: 0; aspect-ratio: 16 / 10; }
  /* TOC → collapsible "Turinys" block above the text */
  .toc { position: static; max-height: none; padding: 0; overflow: visible; }
  summary.toc__title { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; margin: 0; padding: 0 20px; pointer-events: auto; cursor: pointer; font-size: 15px; color: var(--c-navy); -webkit-tap-highlight-color: transparent; }
  summary.toc__title:focus-visible { outline: 2px solid var(--c-tomato); outline-offset: -2px; border-radius: var(--radius); }
  .toc__chev { display: block; flex: none; width: 22px; height: 22px; color: var(--c-navy); stroke-width: 2.4; transition: transform .25s var(--ease); }
  .toc__box[open] .toc__chev { transform: rotate(180deg); }
  .toc__box ol { padding: 0 20px 14px; }
  .toc a { min-height: 44px; display: flex; align-items: center; margin-inline: -10px; font-size: 16px; }
  .toc--num a { display: grid; align-content: center; }
  .ghelp { grid-template-columns: auto minmax(0, 1fr); }
  .ghelp__actions { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ggrid { grid-template-columns: minmax(0, 1fr); }
  /* Hub topic chips: one swipeable row instead of 4 wrapped lines */
  .gfilter { flex-wrap: nowrap; margin: 0 calc(var(--gutter) * -1) 24px; padding: 2px var(--gutter) 6px; overflow-x: auto; scrollbar-width: none; }
  .gfilter::-webkit-scrollbar { display: none; }
  .gfilter > * { flex: none; white-space: nowrap; }
  .gfilter .chip { min-height: 44px; }
  .products--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .products--3 > li:nth-child(3) { display: none; }
  .gcard--feature .gcard__body { padding: 24px 22px 26px; }
  .prose { font-size: 16px; }
  .tldr, .callout { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .legal h2 { grid-template-columns: 38px minmax(0, 1fr); }
  .legal ol.clauses > li { padding-left: 44px; }
  .legal ol.clauses > li::before { top: 2px; font-size: 14px; }
  .legal > section + section { margin-top: 32px; padding-top: 28px; }
  .legal dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .legal dd + dt { margin-top: 10px; }
  .ghelp { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .ghelp__actions .btn { flex: 1 1 auto; }
  .art-head { padding-bottom: 36px; }
  .art-head .h1 { font-size: 30px; }
  .art-head__lead { font-size: 17px; }
  .art-hero { border-radius: 22px; }
  .prose h2 { margin-top: 44px; }
  .checklist { padding: 20px 18px; }
  .qa summary { padding: 14px 14px 14px 18px; min-height: 56px; }
  .prose .qa p { padding: 0 18px 18px; }
  .legal-head .h1 { font-size: 30px; }
  .legal-foot { padding: 20px 18px; }

  /* Comparison tables → one readable card per row (labels come from data-label) */
  .gtable-wrap { overflow: visible; border-radius: 0; box-shadow: none; background: transparent; }
  .gtable, .legal .gtable { min-width: 0; display: flex; flex-direction: column; font-size: 15px; }
  .gtable caption { order: 1; }
  .gtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .gtable tbody { display: grid; gap: 12px; }
  .gtable tr { display: block; padding: 14px 18px; border-radius: var(--radius); background: var(--c-white); box-shadow: 0 0 0 1px var(--c-line); }
  .gtable tbody tr:nth-child(even) { background: var(--c-white); }
  .gtable th, .gtable td { display: block; padding: 0; border: 0; }
  .gtable tbody th { padding-bottom: 8px; font-size: 17px; white-space: normal; }
  .gtable--groups tbody th::before { content: "Grupė "; }
  .gtable td { display: flow-root; padding: 8px 0 8px 130px; border-top: 1px dashed var(--c-line); }
  .gtable td::before { content: attr(data-label); float: left; width: 118px; margin: 1px 0 0 -130px; font-size: 14px; font-weight: 650; line-height: 1.35; color: var(--c-muted); }
  .gtable--groups td:nth-child(2), .gtable--groups td:nth-child(3) { white-space: normal; }
  .gtable tbody tr:last-child td { border-top: 1px dashed var(--c-line); }
  .gtable tbody tr td:last-child { padding-bottom: 0; }
  .gtable caption { display: block; padding: 10px 2px 0; }

  /* Related guides: compact rows (image left, text right) instead of 3 tall cards */
  .related { padding-block: 48px 64px; }
  .related .ggrid { gap: 12px; margin-top: 20px; }
  .related .gcard { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  .related .gcard__media { aspect-ratio: auto; min-height: 112px; }
  .related .gcard__topic { display: none; }
  .related .gcard__body { gap: 6px; padding: 14px 16px; }
  .related .gcard__title { font-size: 17px; }
  .related .gcard__text { display: none; }
  .related .gcard__meta { padding-top: 0; }
}
