/* WordPress-only styles: blog, policies, editor content, admin bar. The rest is site.css (from the prototype). */

/* Category chips */
.cat-chips { margin-top: 4px; }
.cat-chips .chip { text-decoration: none; min-height: 40px; padding: 8px 14px; }
.cat-chips .chip span { color: var(--muted); font-weight: 600; }
.cat-chips .chip[aria-current="page"] { background: var(--ink); color: var(--bg); }
.cat-chips .chip[aria-current="page"] span { color: inherit; opacity: .8; }

/* Post list */
.post-list .articles { row-gap: 36px; }
@media (max-width: 860px) { .post-list .articles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .post-list .articles { grid-template-columns: 1fr; } }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }

/* Article */
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; color: var(--muted); font-weight: 700; }
.post-cover { margin: 0; border-radius: var(--r-card); overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-blue); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(32px, 5vw, 64px); align-items: start; }
.post-layout > .toc { position: sticky; top: calc(var(--head-h, 88px) + 20px); order: 2; } /* below the sticky header */
@media (max-width: 960px) { .post-layout { grid-template-columns: 1fr; } .post-layout > .toc { position: static; order: 0; } }
.toc { background: var(--bg-blue); border-radius: var(--r-card); padding: 20px 22px; display: grid; gap: 10px; }
.toc h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--pink-ink); }
.toc ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 16px; font-weight: 700; }
.toc a { text-decoration: none; }
.toc a:hover { color: var(--pink-ink); text-decoration: underline; }

/* Text written in the editor (posts, policies) */
.prose { max-width: 72ch; display: grid; gap: 18px; min-width: 0; }
.prose > * { margin: 0; }
.prose h2 { font-size: clamp(26px, 3.4vw, 34px); margin-top: 28px; scroll-margin-top: calc(var(--head-h, 88px) + 24px); } /* anchor jumps land below the header */
.prose h3 { margin-top: 12px; }
.prose p, .prose li { font-size: 18px; }
.prose ul, .prose ol { padding-left: 24px; display: grid; gap: 8px; }
.prose a:not(.btn) { color: var(--pink-ink); font-weight: 700; } /* buttons keep their own colours */
.prose figure { margin: 4px 0; }
.prose img { max-width: 100%; height: auto; border-radius: 16px; display: block; }
.prose .wp-block-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.prose figcaption { font-size: 15px; color: var(--muted); margin-top: 8px; }
.prose blockquote { margin: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--pink); }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose .wp-block-table { overflow-x: auto; }
.prose .faq details > *:not(summary) { color: var(--muted); font-size: 17px; padding-bottom: 14px; }
.prose .faq summary { font-size: 18px; }

/* CTA at the end of an article */
.post-cta { background: var(--bg-pink); border-radius: var(--r-card); padding: clamp(24px, 4vw, 40px); display: grid; gap: 14px; }
.post-cta h2 { font-size: clamp(26px, 3.4vw, 34px); }

/* 404 */
.nf .cta-row { margin-top: 8px; }

/* Logged-in admin bar (32px) sits above the sticky header */
body.admin-bar .post-layout > .toc { top: calc(var(--head-h, 88px) + 52px); }
/* Logged-in admin bar must not cover the sticky header */
body.admin-bar .mnav { top: calc(var(--mnav-top, 0px)); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Pages built from blocks (tools/blocks.py): core block styles must not change the prototype layout */
.wp-block-image { margin: 0; }
.wp-block-group > .wp-block-image:only-child { height: 100%; }
.wp-block-group > .wp-block-image:only-child img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wp-block-image img { vertical-align: bottom; }
.wp-block-buttons { display: contents; } /* the buttons sit directly in the prototype's .cta-row / grid */
:where(.wp-block-list) { margin: 0; } /* zero specificity: list classes of the prototype keep their margins */
.faq .wp-block-details > *:not(summary) { color: var(--muted); font-size: 17px; padding: 0 0 16px; margin: 0; }

/* Quiz block on a page (kinderki/quiz): the exit-window quiz in a form card */
.quiz-box { max-width: 600px; }
.quiz-box h2 { font-size: 26px; margin: 0; }

/* Quiz look (inc/quiz.php, assets/js/site.js): header with a photo of children and a «Hello!» bubble, emoji answer
   tiles, progress dots, summary cards, the «call me back» form on a pink block. Header and teaser: questions only.
   Two classes per rule where editor text (.prose) styles the same tags. */
.quiz-head { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.exit-in > .quiz-head { order: -1; } /* above the teaser line of the exit window */
.quiz-head .quiz-photo { width: 64px; height: 64px; flex: none; border-radius: 50%; object-fit: cover; object-position: 62% 35%; background: var(--bg-pink); box-shadow: 0 8px 20px rgba(47, 57, 110, .16); }
.quiz-head .bubble, .quiz-yay .bubble { position: relative; font-size: 26px; padding: 8px 16px 10px; }
.quiz-head .bubble::after, .quiz-yay .bubble::after { left: -6px; bottom: auto; top: calc(50% - 7px); }
.quiz-at-res .quiz-head, .quiz-at-res .exit-in > .eyebrow { display: none; }
.quiz-top { display: block; }
.quiz-top .quiz-dots { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.quiz-dots li { width: 10px; height: 10px; border-radius: 999px; background: var(--card); border: 2px solid var(--field-line); transition: width .25s ease, background-color .25s ease; }
.quiz-dots li.done { background: var(--pink-ink); border-color: var(--pink-ink); }
.quiz-dots li.now { width: 28px; background: var(--pink-ink); border-color: var(--pink-ink); }
.quiz-step h2:focus { outline: none; }
.quiz-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quiz-opts button { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; font: 800 16px/1.25 var(--font-body); border-radius: 16px; background: var(--card); transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.quiz-opts button:hover { transform: translateY(-2px); }
.quiz-opts button[aria-pressed="true"] { background: var(--bg-pink); border-color: var(--pink-ink); box-shadow: inset 0 0 0 1px var(--pink-ink); }
.quiz-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--bg-blue); font-size: 22px; line-height: 1; }
.quiz-opts button[aria-pressed="true"] .quiz-ico { background: var(--card); }
@keyframes kk-quiz-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes kk-quiz-in-back { from { opacity: 0; transform: translateX(-24px); } }
.quiz-step.quiz-in { animation: kk-quiz-in .3s ease both; }
.quiz-step.quiz-in-back { animation: kk-quiz-in-back .3s ease both; }

/* Quiz summary: title in the hand font, answer cards on light blue, rating line, the form on a pink block */
.quiz-step.quiz-res > h2 { font: 700 38px/1 var(--font-hand); color: var(--pink-ink); padding-right: 28px; }
.quiz-note { margin: -6px 0 0; font-size: 15px; font-weight: 800; color: var(--muted); }
.quiz-res .quiz-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.quiz-cards li { display: flex; align-items: flex-start; gap: 14px; background: var(--bg-blue); border-radius: 16px; padding: 14px 16px; }
.quiz-cards li p { margin: 0; font-size: 16px; line-height: 1.5; }
.quiz-cards .quiz-ico { background: var(--card); }
.quiz-lead { background: var(--bg-pink); border-radius: var(--r-card); padding: 20px; display: grid; gap: 14px; }
.quiz-lead .quiz-call { margin: 0; font-size: 16px; font-weight: 700; }
.quiz-lead:has(> .quiz-form[hidden]) > .quiz-call { display: none; }
.quiz-form { display: grid; gap: 12px; }
.quiz-res .thanks { box-shadow: none; padding: 0; background: transparent; gap: 10px; }
.quiz-yay { display: flex; align-items: center; gap: 18px; margin-bottom: 4px; }
.quiz-res .thanks .ok { width: 72px; height: 72px; font-size: 38px; background: var(--card); box-shadow: var(--shadow); }
.quiz-yay .bubble { font-size: 30px; }
.quiz-res .cta-row .btn { min-height: 46px; padding: 10px 20px; font-size: 16px; }
@media (max-width: 480px) { .quiz-opts button { font-size: 15px; padding: 10px 12px; gap: 10px; } .quiz-lead { padding: 16px; } }

/* Exit window on a phone (assets/js/site.js): a non-modal panel at the bottom, at most 45% of the screen, more for the
   quiz summary with its form; the call bar and the back-to-top button step aside while it is open */
dialog.exit.exit--panel { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 45vh; max-height: 45dvh; overflow-y: auto; overscroll-behavior: contain; z-index: 60; border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.28); padding-bottom: env(safe-area-inset-bottom, 0px); }
dialog.exit.exit--panel.quiz-at-res { max-height: 80vh; max-height: 80dvh; }
.exit--panel .exit-in { padding: 16px 16px 18px; gap: 10px; }
.exit--panel .exit-x { top: 4px; right: 4px; }
.exit--panel h2 { font-size: 20px; }
.exit--panel .lead { font-size: 15px !important; }
.exit--panel .quiz-opts { grid-template-columns: 1fr 1fr; gap: 8px; }
.exit--panel .quiz-opts button { min-height: 52px; padding: 8px 10px; gap: 8px; font-size: 15px; }
.exit--panel .quiz-ico { width: 32px; height: 32px; border-radius: 10px; font-size: 18px; }
/* the panel header is the bubble only */
.exit--panel .quiz-head { min-height: 0; margin-bottom: 2px; }
.exit--panel .quiz-photo { display: none; }
.exit--panel .quiz-head .bubble { font-size: 20px; padding: 5px 12px 7px; animation: none; }
.exit--panel .quiz-head .bubble::after { width: 10px; height: 10px; left: 14px; top: auto; bottom: -4px; }
.exit--panel .quiz-step.quiz-res > h2 { font-size: 32px; }
.exit--panel .quiz-cards li { padding: 12px; gap: 10px; }
.exit--panel .quiz-cards li p { font-size: 15px; }
.exit--panel .quiz-lead { padding: 14px; }
.exit--panel .quiz-yay .bubble { font-size: 24px; }
.exit--panel .thanks .ok { width: 56px; height: 56px; font-size: 30px; }
body.exit-panel-open .mbar, body.exit-panel-open .to-top { display: none; }
.exit--panel .consent { font-size: 15px; }
