/* Page text rendered from Markdown (.markdown-body), as nested CSS. Colours come from the tokens in
   style.css. Only selectors the renderer, the templates or yt.js emit (tests/test_css.py). */
.markdown-body {
  max-width: 48rem; overflow-wrap: break-word;
  & > :first-child { margin-top: 0; }
  & > :last-child { margin-bottom: 0; }

  & a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
  & a:hover { color: var(--accent-hover); }

  & :is(h1, h2, h3, h4, h5, h6) { margin: 1.6em 0 .5em; line-height: 1.25; }
  & h1 { font-size: 1.75rem; }
  & h2 { font-size: 1.375rem; padding-bottom: .2em; border-bottom: 1px solid var(--line); }
  & h3 { font-size: 1.125rem; }
  & h4 { font-size: 1rem; }
  & :is(h5, h6) { font-size: .875rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

  & :is(p, ul, ol, blockquote, pre, table) { margin: 0 0 1em; }
  & :is(ul, ol) { padding-left: 1.5em; }
  & li + li { margin-top: .25em; }
  & li > p { margin-bottom: .5em; }
  & li > :is(ul, ol) { margin: .25em 0 0; }
  & blockquote { padding: 0 1em; border-left: 4px solid var(--line); color: var(--muted); }
  & hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }

  /* inline code may wrap; code blocks and tables scroll sideways inside their box */
  & code { font-size: .9em; padding: .1em .35em; background: var(--code-bg); border-radius: 4px; overflow-wrap: anywhere; }
  & pre { padding: .7em 1em; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; font-size: .875rem; line-height: 1.45; }
  & pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
  & pre.mermaid { background: none; border: 0; text-align: center; }
  & table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
  & :is(th, td) { padding: .4em .8em; border: 1px solid var(--line); }
  & th { background: var(--head-bg); }
  & tr:nth-child(2n) td { background: var(--row-alt); }

  /* ::: center | left | right */
  & .align-center { text-align: center; }
  & .align-right { text-align: right; }
  & .align-left { text-align: left; }

  /* images and YouTube via the image syntax: ![caption](url "title" =SIZE) */
  & img { max-width: 100%; height: auto; }
  & .md-figure { margin: 1em 0; }
  & .md-figure img { display: block; border-radius: 6px; }
  & .align-center :is(.md-figure img, .md-youtube) { margin-inline: auto; }
  & .align-right .md-figure img { margin-left: auto; }
  & figcaption { margin-top: .3em; color: var(--muted); font-size: .85em; line-height: 1.3; }
  & figcaption > :last-child { margin-bottom: 0; }
  & .md-youtube { max-width: 720px; }
  & a.yt { color: var(--yt-text); text-decoration: none; }

  /* callouts: ::: note | tip | warning | quote; the kind only sets --c */
  & .callout { --c: var(--note); margin: 1em 0; padding: .6em 1em; border-left: 4px solid var(--c); border-radius: 4px; background: color-mix(in srgb, var(--c) 10%, var(--card)); }
  & .callout::before { display: block; margin-bottom: .2em; color: var(--c); font-size: .8em; font-weight: bold; letter-spacing: .05em; text-transform: uppercase; }
  & .callout-note::before { content: "Megjegyzés"; }
  & .callout-tip { --c: var(--tip); }
  & .callout-tip::before { content: "Tipp"; }
  & .callout-warning { --c: var(--warning); }
  & .callout-warning::before { content: "Fontos"; }
  & .callout-quote { --c: var(--quote); font-style: italic; }
  & .callout-quote::before { content: "Idézet"; font-style: normal; }

  /* ::: columns {count= spacing= width= decorated=}: the renderer sets --deco and grid-template-columns */
  & .columns { display: grid; gap: 2em; margin: 1em 0; }
  & .columns-1 { grid-template-columns: minmax(0, 1fr); }
  & .columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  & .columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  & .columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  & .columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  & .columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  & .column { min-width: 0; }
  & .columns-gap-small { gap: 1em; }
  & .columns-gap-large { gap: 3em; }
  & .columns-decorated > .column { padding: .6em 1em; border: 1px solid var(--deco); border-top-width: 4px; border-radius: 4px; background: color-mix(in srgb, var(--deco) 10%, var(--card)); }
  & .columns-decorated.columns-gap-small { row-gap: 1.5em; }
  & :is(.column, .callout) > :first-child { margin-top: 0; }
  & :is(.column, .callout) > :last-child { margin-bottom: 0; }
  @media (max-width: 40rem) {
    & .columns { grid-template-columns: minmax(0, 1fr) !important; } /* beats the inline width=[…] */
  }

  /* the Adatkezelés page (website/web/privacy.py) */
  & h2[id] { scroll-margin-top: 4.5rem; }
  & .privacy-short { padding: .6em 1em; border-left: 4px solid var(--accent); border-radius: 4px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
  & :is(.privacy-toc, .privacy-note) { color: var(--muted); font-size: .9em; }

  /* link components: [Label](button:…), [File](download:…) */
  & a.button { display: inline-block; margin: .25em 0; padding: .45em 1.2em; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: bold; text-decoration: none; }
  & a.button:hover { background: var(--accent-hover); color: var(--on-accent); }
  & a.download { display: inline-block; margin: .2em 0; padding: .3em .8em; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--text); text-decoration: none; }
  & a.download::before { content: "\2193\00a0"; color: var(--accent); }
  & a.download:hover { border-color: var(--accent); }

  /* I14: the ::: toc list; the reader's marks as in the menu */
  & .toc .lock { color: var(--lock); font-size: .75em; }
  & .toc .draft { color: var(--draft); font-size: .85em; }
  & .toc .pill { font-size: .75em; vertical-align: .1em; }
}

/* YouTube facade (a.yt; yt.js swaps in div.yt.yt-playing with the iframe); dark in every palette.
   I9: the still (img.yt-poster from /yt/<id>.webp) keeps its shape (4:3: dark bars at the sides), a
   round play button in the middle, the label and the note on a dark gradient at the bottom.
   B5: a narrow box (phones, =300, =medium) puts the label under the button and the note alone at the
   bottom, so both stay inside; the box is a size container, so this follows its width, not the page's. */
.yt { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--yt-bg); color: var(--yt-text); text-align: center; container-type: inline-size; }
.yt .yt-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.yt .yt-label { position: absolute; inset: 0; display: grid; place-items: center; }
.yt .yt-play { display: grid; place-items: center; width: 4.25rem; height: 4.25rem; padding-left: .3rem; box-sizing: border-box; border-radius: 50%; background: var(--yt-play); font-size: 1.9rem; line-height: 1; transition: background .15s, transform .15s; }
.yt:is(:hover, :focus-visible) .yt-play { background: var(--accent); color: var(--on-accent); transform: scale(1.08); }
.yt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.yt .yt-text { position: absolute; inset: auto 0 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .8rem; padding: 1.6rem .8rem .5rem; background: linear-gradient(transparent, var(--yt-scrim)); font-size: .85rem; line-height: 1.4; text-align: left; text-shadow: 0 1px 2px var(--yt-scrim); }
.yt .yt-note { font-size: .7rem; opacity: .85; }
@container (max-width: 32rem) {
  .yt .yt-label { display: flex; flex-direction: column; align-items: center; }
  .yt .yt-play { margin-top: auto; width: 3.25rem; height: 3.25rem; font-size: 1.5rem; }
  .yt .yt-text { display: contents; }
  .yt .yt-cta { margin: .3rem .5rem 0; }
  .yt .yt-note { align-self: stretch; margin-top: auto; padding: 1rem .6rem .4rem; background: linear-gradient(transparent, var(--yt-scrim)); line-height: 1.3; }
}
@container (max-width: 14rem) { .yt .yt-cta { display: none; } }
@container (max-width: 10rem) { .yt .yt-note { display: none; } .yt .yt-play { margin: auto; } }
@media (prefers-reduced-motion: reduce) { .yt .yt-play { transition: none; } }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
