/*
 * POD ANIOŁEM — NAUKA I TECHNIKA / STEM
 * Cassiopeia, Joomla 5 / 6. Wersja 1.0, 2026-11-15.
 * Wgraj do media/templates/site/cassiopeia_stem/css/user.css.
 * Obrazy umieść w ../images/stem/. Szczegóły w INSTRUKCJA.md.
 * Cały styl jest przeznaczony dla osobnego szablonu potomnego.
 * Strony wybiera się w Przypisaniu menu, bez identyfikatorów artykułu w CSS.
 * Baner: Marka = Tak, Logo = puste, Tytuł = Nauka i technika,
 * Opis = Doświadczenia i majsterkowanie dla dzieci • Świetlica „Pod Aniołem”.
 * Bez zewnętrznych fontów, bibliotek i JavaScriptu.
 */

body.site {
  --stem-ink: #142c43;
  --stem-blue: #2155c9;
  --stem-muted: #4d6271;
  --stem-paper: #fffefa;
  --stem-cream: #f4f4ed;
  --stem-line: #d5dedf;
  --stem-lime: #daef75;
  --stem-orange: #f0a17c;
  --stem-width: 80rem;
  --stem-pad: clamp(1.125rem, 2.7vw, 2.75rem);
  --body-color: var(--stem-ink);
  --body-bg: var(--stem-cream);
  --link-color: var(--stem-blue);
  --link-color-rgb: 33, 85, 201;
  --link-hover-color: #153b8c;
  --link-hover-color-rgb: 21, 59, 140;
  --cassiopeia-font-family-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cassiopeia-font-family-headings: var(--cassiopeia-font-family-body);
  color: var(--stem-ink);
  font-family: var(--cassiopeia-font-family-body);
  font-size: 1rem;
  line-height: 1.65;
  background-color: var(--stem-cream);
  background-image: linear-gradient(#20466b0a 1px, transparent 1px), linear-gradient(90deg, #20466b0a 1px, transparent 1px);
  background-size: 32px 32px;
}

body.site :where(h1, h2, h3, h4) {
  color: var(--stem-ink);
  font-family: var(--cassiopeia-font-family-headings);
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
body.site :where(a) { text-underline-offset: .2em; }
body.site :where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #a55217;
  outline-offset: 4px;
}
body.site :where(img, video) { max-width: 100%; height: auto; }
body.site :where(.grid-child, main, .site-grid > *) { min-width: 0; }
body.site :where(p, li, dd, a) { overflow-wrap: anywhere; }

/* Oryginalny układ i pozycje Cassiopei; spójna, wyśrodkowana powierzchnia. */
body.site .container-header,
body.site .site-grid,
body.site .container-footer {
  width: min(100%, var(--stem-width));
  max-width: var(--stem-width);
  margin-inline: auto;
}
body.site .site-grid {
  grid-template-columns: [full-start] 0 [main-start] repeat(4, minmax(0, 1fr)) [main-end] 0 [full-end];
  gap: 0;
  background: var(--stem-paper);
}
body.site .site-grid > * { max-width: 100%; }
body.site .container-component { padding: 1.25rem var(--stem-pad) 3rem; }
body.site .container-component > :first-child { margin-top: 0; }
body.site .container-component > main { margin-top: .75rem; }
body.site .container-component .page-header { margin: 1.5rem 0 1.1rem; }
body.site .container-component .page-header h1 {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(1.85rem, 3.2vw, 2.9rem);
  letter-spacing: -.035em;
}
body.site .breadcrumb {
  padding: 0 !important;
  margin: 0 0 1rem;
  color: var(--stem-muted);
  background: transparent;
  font-size: .8rem;
}
body.site .breadcrumb > li { min-width: 0; }
body.site .breadcrumb .active { color: var(--stem-muted); }
body.site .pagenavigation { margin-top: 2.5rem; }
body.site .pagination { gap: .5rem; flex-wrap: wrap; }
body.site .pagenavigation a { min-height: 2.75rem; padding: .6rem 1rem; }

/* Tekst banera pochodzi z ustawień szablonu i pozostaje dostępny bez obrazu. */
body.site .container-header {
  background: var(--stem-cream);
  box-shadow: none;
  color: var(--stem-ink);
}
body.site .container-header > .grid-child {
  max-width: none;
  padding-inline: var(--stem-pad);
  padding-block: 0;
}
body.site .container-header .navbar-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 22rem;
  margin: 0;
  padding: 2.75rem 56% 2.75rem 0;
  color: var(--stem-ink);
  white-space: normal;
}
body.site .container-header .navbar-brand::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: .5rem -1rem .5rem 42%;
  background: url("../images/stem/warsztat.webp") center / contain no-repeat;
  pointer-events: none;
}
body.site .container-header .brand-logo {
  display: block;
  color: var(--stem-ink);
  font-size: clamp(2.25rem, 4.5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.05em;
  text-decoration: none;
  text-wrap: balance;
}
body.site .container-header .brand-logo:hover { color: var(--stem-blue); }
body.site .container-header .brand-logo img { max-height: none; width: 100%; }
body.site .container-header .site-description {
  max-width: 29ch;
  margin-top: 1.25rem;
  padding-left: 1rem;
  border-left: .25rem solid var(--stem-blue);
  color: var(--stem-muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.55;
}

/* Nawigacja zachowuje natywne menu rozwijane i przycisk mobilny Cassiopei. */
body.site .container-header .container-nav {
  padding-block: .5rem;
  background: var(--stem-ink);
  border-bottom: .3rem solid var(--stem-lime);
}
body.site .container-header .container-nav nav { width: 100%; margin: 0; }
body.site .container-header .navbar { padding: 0; }
body.site .container-header .mod-menu { gap: .1rem .85rem; flex-wrap: wrap; }
body.site .container-header .mod-menu > li + li { margin-left: 0; }
body.site .container-header .mod-menu > li > a,
body.site .container-header .mod-menu > li > span {
  padding-block: .65rem;
  color: #fff;
  font-size: .92rem;
}
body.site .container-header .metismenu > li.active > a,
body.site .container-header .metismenu > li > a:hover { color: var(--stem-lime); }
body.site .container-header .metismenu > li > ul { background: var(--stem-paper); }
body.site .container-header .metismenu > li > ul a { color: var(--stem-ink); }
body.site .container-header .navbar-toggler {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-color: #c2d0de;
  border-radius: .4rem;
  margin-block: .15rem;
}
body.site .container-header .mm-toggler {
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: #fff;
}
body.site .container-header .mm-toggler:focus-visible,
body.site .container-header .container-nav a:focus-visible,
body.site .container-header .navbar-toggler:focus-visible { outline-color: var(--stem-lime); }

/* Moduły boczne. Na telefonach trafiają pod artykuł zgodnie z Cassiopeią. */
body.site :is(.container-sidebar-right, .container-sidebar-left) {
  padding: 1.5rem 1.25rem 2rem;
  background: #f0f3f2;
}
body.site :is(.container-sidebar-right, .container-sidebar-left) > :first-child { margin-top: 0; }
body.site :is(.container-sidebar-right, .container-sidebar-left) .card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.site :is(.container-sidebar-right, .container-sidebar-left) .card-header {
  padding: .75rem 0;
  border-bottom: 2px solid #c7d4d7;
  background: transparent;
  font-size: 1.05rem;
}
body.site :is(.container-sidebar-right, .container-sidebar-left) .card-body { padding: 1rem 0; }
body.site :is(.container-sidebar-right, .container-sidebar-left) li { margin-bottom: .65rem; }
body.site :is(.container-sidebar-right, .container-sidebar-left) a { font-size: .91rem; }
body.site :is(.container-sidebar-right, .container-sidebar-left) :is(p, li)[style*="justify"] { text-align: start !important; }
body.site :is(.container-top-a, .container-top-b, .container-bottom-a, .container-bottom-b) {
  padding: 1rem var(--stem-pad);
}
body.site .container-footer {
  margin-top: 0;
  padding: 1.5rem var(--stem-pad);
  background: var(--stem-ink);
  color: #fff;
}
body.site .container-footer > .grid-child { padding: 0; }
body.site .container-footer a { color: #fff; }

/* Artykuł. Zwykły HTML pozostaje czytelny również po usunięciu tego CSS. */
.stem-article { color: var(--stem-ink, #142c43); }
.stem-article :where(p, ul, ol, dl) { margin-block: 0 1.1rem; }
.stem-article :where(p, li) { text-align: start; }
.stem-article :where(p) { max-width: 68ch; }
.stem-article :where(h2) {
  margin: 0 0 1rem;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  letter-spacing: -.025em;
}
.stem-article :where(h3) { margin: .4rem 0 .65rem; font-size: 1.2rem; }
.stem-article .stem-eyebrow {
  color: var(--stem-muted, #4d6271);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .8rem;
  line-height: 1.6;
  letter-spacing: .035em;
}
.stem-article .stem-lead {
  color: var(--stem-ink, #142c43);
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  font-weight: 580;
  line-height: 1.6;
}
.stem-article .stem-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 2.75rem;
  padding: 1.25rem 1.4rem;
  border-left: .3rem solid var(--stem-blue, #2155c9);
  background: #edf2fc;
}
.stem-article .stem-facts dt { margin-bottom: .3rem; font-size: .82rem; font-weight: 450; }
.stem-article .stem-facts dd { margin: 0; font-size: 1.1rem; font-weight: 750; line-height: 1.4; }
.stem-article .stem-section { margin-block: 2.5rem; }
.stem-article .stem-topics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  column-gap: 2rem;
  counter-reset: stem-topic;
  border-top: 1px solid var(--stem-line, #d5dedf);
}
.stem-article .stem-topic {
  position: relative;
  min-width: 0;
  padding: 1.5rem 0 .8rem;
  border-bottom: 1px solid var(--stem-line, #d5dedf);
  counter-increment: stem-topic;
}
.stem-article .stem-topic::before {
  content: counter(stem-topic, decimal-leading-zero);
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.1rem;
  margin-bottom: .3rem;
  border-radius: .3rem;
  color: var(--stem-ink, #142c43);
  background: var(--stem-lime, #daef75);
  font-family: ui-monospace, Consolas, monospace;
  font-size: .85rem;
  font-weight: 700;
}
.stem-article .stem-topic:nth-child(3n + 2)::before { background: #dbe6ff; }
.stem-article .stem-topic:nth-child(3n)::before { background: #f9dac7; }
.stem-article .stem-topic p { color: var(--stem-muted, #4d6271); font-size: .96rem; }
.stem-article .stem-lab {
  position: relative;
  margin-block: 2.75rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: .75rem;
  color: #fff;
  background-color: var(--stem-ink, #142c43);
  background-image: linear-gradient(#ffffff06 1px, transparent 1px), linear-gradient(90deg, #ffffff06 1px, transparent 1px);
  background-size: 24px 24px;
}
.stem-article .stem-lab h2 { color: #fff; }
.stem-article .stem-lab .stem-eyebrow { color: var(--stem-lime, #daef75); }
.stem-article .stem-lab > :last-child { margin-bottom: 0; }
.stem-article .stem-steps { padding-left: 1.5rem; }
.stem-article .stem-steps li { padding-left: .35rem; margin-bottom: 1rem; }
.stem-article .stem-steps li::marker { color: var(--stem-lime, #daef75); font-weight: 750; }
.stem-article .stem-steps strong { color: var(--stem-lime, #daef75); }
.stem-article .stem-invite {
  margin-top: 2.75rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-top: .35rem solid #b9ce56;
  background: #f0f6d8;
}
.stem-article .stem-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 1.5rem 0 0; }
.stem-article .stem-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .8rem 1.1rem;
  border: 2px solid transparent;
  border-radius: .4rem;
  color: #fff;
  background: var(--stem-blue, #2155c9);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.stem-article .stem-button:hover { background: #163a87; color: #fff; }
.stem-article .stem-text-link { display: inline-block; padding-block: .65rem; font-weight: 650; }

/* Obrazy i osadzenia w innych artykułach wybranych dla tego stylu. */
body.site main :where(figure, .com-content-article__body) { max-width: 100%; }
body.site main iframe[src*="youtube.com"],
body.site main iframe[src*="youtube-nocookie.com"],
body.site main iframe[src*="player.vimeo.com"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }

@media (max-width: 991.98px) {
  body.site .container-header .navbar-brand { min-height: 19rem; }
  body.site .container-header .navbar-collapse { width: 100%; }
  body.site .container-header .mod-menu > li { width: 100%; }
  body.site .container-header .mod-menu > li > a { flex: 1; min-height: 2.75rem; }
  body.site .container-header .mod-menu .mm-collapse { margin-block: .3rem; }
  body.site .container-component { padding-bottom: 2rem; }
  body.site :is(.container-sidebar-right, .container-sidebar-left) { padding-inline: var(--stem-pad); }
}
@media (max-width: 639.98px) {
  body.site .container-header .navbar-brand {
    min-height: 0;
    padding: 1.75rem 0 0;
  }
  body.site .container-header .brand-logo { max-width: 12ch; font-size: clamp(2.35rem, 9.5vw, 3.6rem); }
  body.site .container-header .site-description { max-width: 32ch; margin-top: 1rem; font-size: 1rem; }
  body.site .container-header .navbar-brand::after {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    max-height: 18rem;
    margin-top: .5rem;
    background-image: url("../images/stem/warsztat-maly.webp");
  }
  .stem-article .stem-facts { grid-template-columns: 1fr; }
  .stem-article .stem-section { margin-block: 2rem; }
}

/* Subtelna głębia bez JS. Tylko dekoracja porusza się względem treści.
 * Telefony, urządzenia dotykowe i reduced-motion używają tła statycznego. */
@media (min-width: 992px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.site { background-attachment: fixed; }
  .stem-article .stem-lab { background-attachment: fixed; }
}
@media (prefers-reduced-motion: reduce) {
  body.site, .stem-article .stem-lab { background-attachment: scroll; }
  body.site { scroll-behavior: auto; }
}

@media print {
  body.site { color: #000; background: #fff; font-size: 11pt; }
  body.site .site-grid { display: block; width: 100%; background: #fff; }
  body.site :is(.container-header, .container-sidebar-left, .container-sidebar-right, .container-footer, .pagenavigation, .mod-breadcrumbs__wrapper) { display: none; }
  body.site .container-component { padding: 0; }
  .stem-article :is(.stem-lab, .stem-invite, .stem-facts) { padding: 1rem; color: #000; background: #fff; border: 1px solid #777; }
  .stem-article .stem-lab :is(h2, strong, .stem-eyebrow) { color: #000; }
  .stem-article .stem-topics { display: block; }
  .stem-article .stem-topic { break-inside: avoid; }
  .stem-article .stem-button { background: #fff; color: #000; border-color: #000; }
}
