/* Wspólna skala Roboto Flex. Punkty odniesienia: 390 i 1440 px przy 1rem = 16px. */
:root {
  --type-display: clamp(3.5rem, calc(2.8964rem + 2.4762vw), 5.125rem);
  --type-h1: clamp(3rem, calc(2.6286rem + 1.5238vw), 4rem);
  --type-h2: clamp(2.5rem, calc(2.3143rem + .7619vw), 3rem);
  --type-h3: clamp(2rem, calc(1.9071rem + .381vw), 2.25rem);
  --type-h4: clamp(1.75rem, calc(1.6571rem + .381vw), 2rem);
  --type-lead: 1.5rem;
  --type-large: 1.25rem;
  --type-body: 1rem;
  --type-small: .875rem;
  --leading-h1: 1.12;
  --leading-h2: 1.15;
  --leading-h3: 1.2;
  --leading-h4: 1.25;
  --leading-body: 1.45;
}
@media (max-width:700px) {
  :root { --leading-h1: 1.15 }
}

@media (max-width:700px) {
  .mobile-heading-line {display:block}
}
/* Te same bloki mogą pochodzić ze statycznego wzorca, post-content lub edytora. */
:where(.festival-prose, .wp-block-post-content, .editor-styles-wrapper) {
  font-family:var(--body-font);
  font-weight:400;
  font-size:var(--type-body);
  line-height:var(--leading-body);
}
:where(.festival-prose, .wp-block-post-content, .editor-styles-wrapper) :where(h1,h2,h3,h4,h5,h6) {
  font-family:var(--display-font);
  font-weight:600;
  font-variation-settings:"wdth" var(--display-width);
  font-optical-sizing:auto;
  text-wrap:wrap;
  overflow-wrap:break-word;
  letter-spacing:0;
}
:where(.festival-prose, .wp-block-post-content, .editor-styles-wrapper) {
  & :where(h1) {font-size:var(--type-h1);line-height:var(--leading-h1);font-variation-settings:"wdth" 60;text-transform:uppercase}
  & :where(h2) {font-size:var(--type-h2);line-height:var(--leading-h2);text-transform:uppercase}
  & :where(h3) {font-size:var(--type-h3);line-height:var(--leading-h3)}
  & :where(h4) {font-size:var(--type-h4);line-height:var(--leading-h4);text-transform:uppercase}
  & :where(h5) {font-size:var(--type-lead);font-weight:500;line-height:1.35;font-variation-settings:"wdth" 100}
  & :where(h6) {font-size:var(--type-body);line-height:var(--leading-body);font-variation-settings:"wdth" 100;text-transform:uppercase}
  & :where(p,ul,ol) {font-size:var(--type-body);line-height:var(--leading-body)}
  & :where(ul,ol) {padding-inline-start:1.4em}
  & :where(figcaption,cite) {font-size:var(--type-small);line-height:1.5}
  & :where(.wp-block-image img) {display:block;max-width:100%;height:auto}
  & :where(.wp-block-image figcaption) {margin-block:.75rem 0}
  & :where(.wp-block-quote) {border-inline-start:2px solid currentColor;padding-inline-start:1.25rem}
  & :where(.wp-block-quote p,.is-style-lead) {font-size:var(--type-lead);font-weight:500;line-height:1.35}
  & :where(.wp-block-table) {overflow-x:auto}
  & :where(.wp-block-table table) {width:100%;border-collapse:collapse;text-align:start}
  & :where(.wp-block-table th,.wp-block-table td) {padding:.625rem .75rem;border-block-end:1px solid currentColor}
  & :where(.wp-block-table th) {font-weight:600}
  & :where(.wp-block-buttons) {display:flex;flex-wrap:wrap;gap:1rem 1.5rem}
}

/* Opt-in art direction for a photo block. Natural-size images keep their proportions. */
@media (max-width:700px) {
  :is(.wp-site-blocks,.editor-styles-wrapper,.festival-home,.race-view,.info-page) img[data-mobile-focus] {
    object-position:var(--festival-mobile-focus);
  }
  .festival-home :is(.home-card-photo,.home-people-photo) img[data-mobile-focus] {
    inset:0;width:100%;height:100%;object-fit:cover;
  }
}

/* Rytm bez dodatkowego odstępu na początku i końcu kontenera.
   Reguły dotyczą rodzeństwa w przepływie tekstu; siatki i rzędy zachowują własny gap. */
:where(.festival-prose,.wp-block-post-content,.editor-styles-wrapper,
  :is(.wp-block-post-content,.editor-styles-wrapper) :is(.is-layout-flow,.is-layout-constrained,.wp-block-group,.wp-block-group__inner-container,.wp-block-column,.block-editor-block-list__layout)):where(:not(.is-layout-flex,.is-layout-grid)) {
  & > :where(h1,h2,h3,h4,h5,h6,p,ul,ol,figure,blockquote,.wp-block-buttons,.wp-block-button) {margin-block:0}
  & > :where(p,ul,ol) + :where(p,ul,ol) {margin-block-start:1rem}
  & > :where(h1,h2,h3,h4,h5,h6) + :where(h1,h2,h3,h4,h5,h6),
  & > :where(h1,h2) + :where(p,ul,ol,figure) {margin-block-start:1.5rem}
  & > :where(h3,h4,h5,h6) + :where(p,ul,ol) {margin-block-start:1rem}
  & > :where(p,ul,ol,figure,blockquote,.wp-block-buttons,.wp-block-button) + :where(h1,h2,h3,h4,h5,h6) {margin-block-start:2.5rem}
  & > :where(p,ul,ol,figure) + :where(.wp-block-buttons,.wp-block-button,.festival-button) {margin-block-start:2.5rem}
  & > :where(.wp-block-buttons,.wp-block-button) + :where(p,ul,ol) {margin-block-start:1.5rem}
  & > :where(p,ul,ol) + :where(figure,blockquote),
  & > :where(figure,blockquote) + :where(p,ul,ol) {margin-block-start:2rem}
}
