/* ===== THEME: Light / Dark ===== */
:root{
  --color-bg-dark: #55ab4c;
  --color-bg-light:#ffffff;
  --color-accent:   #2e8b57;
  --color-accent-hover:#36a568;
  --color-text:     #1f2937;
  --color-text-light:#f9fafb;
  --color-border: rgba(0,0,0,.08);
  --color-border-contrast: rgba(255,255,255,.12);

  --masthead-h: 64px;
  --footer-h: 110px;
  --sidebar-w: 300px; /* poszerzony sidebar */
}
:root[data-theme="dark"]{
  --color-bg-dark:#0b1422;
  --color-bg-light:#0f1720;
  --color-accent:#36a568;
  --color-accent-hover:#4fbf80;
  --color-text:#e5e7eb;
  --color-text-light:#f3f4f6;
  --color-border: rgba(255,255,255,.12);
  --color-border-contrast: rgba(255,255,255,.2);
}

/* Mapowanie (dla topbaru i stopki) */
:root{
  --topbar-bg: var(--color-bg-dark);
  --topbar-link: var(--color-text-light);
  --topbar-link-hover:#fff;
  --topbar-underline: var(--color-accent);
  --topbar-border: var(--color-border-contrast);

  --footer-bg: #215e33;
  --footer-text: #cbd5e1;
  --footer-link: #bdccec;
}
:root[data-theme="dark"]{
  --footer-bg: #0b1422;
  --footer-text: #e5e7eb;
  --footer-link: #dbe2e9;
}

/* ===== BAZA ===== */
body{ background:var(--color-bg-light); color:var(--color-text); }
a{ color:var(--color-accent); }
a:hover{ color:var(--color-accent-hover); }

/* Baner */
.school-banner{ text-align:center; background:#fff; }
.school-banner__img{ max-width:100%; height:auto; display:block; margin:0 auto; }

/* Pasek pod banerem */
.school-toolbar{ background:var(--color-bg-dark); color:var(--color-text-light); border-bottom:1px solid var(--color-border-contrast); }
.school-toolbar a{ color:var(--color-text-light); }

/* ===== SIDEBAR ===== */
.pf-c-page__sidebar{
  width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  min-width: 240px;
  position: relative;
  align-self: stretch;
  overflow-x: hidden;
  padding-bottom: 8px;
  background: inherit;
  box-sizing: border-box;
}
.pf-c-page__sidebar .pf-c-drawer__content{
  background:#215e33; border-right:1px solid var(--color-border-contrast); padding:.75rem; min-height:100%;
}
:root[data-theme="dark"] .pf-c-page__sidebar .pf-c-drawer__content{ background:#0d1520; }

.school-sidenav{ font-size:15px; width:100%; box-sizing:border-box; color:var(--color-text-light); }
.school-sidenav .pf-c-nav__list{ margin:.25rem 0; padding:0 6px 0 0; }
.school-sidenav .pf-c-nav__item{ list-style:none; }
.school-sidenav .pf-c-nav__link{
  display:flex; align-items:center; gap:.4rem;
  padding:.45rem .6rem; border-radius:.35rem; text-decoration:none;
  color:inherit; white-space: normal; word-break: break-word; line-height: 1.4;
  overflow:hidden; text-overflow:ellipsis;
  transition:background .15s,color .15s;
}
.school-sidenav .pf-c-nav__link:hover{ background:rgba(255,255,255,.06); color:#fff; }
.school-sidenav .pf-c-nav__item.pf-m-current > .pf-c-nav__link{
  background:rgba(255,255,255,.08); color:#fff; box-shadow:inset 2px 0 0 #60a5fa;
}

.school-sidenav .school-subnav{ margin:.2rem 0 .4rem .35rem; padding:.25rem 0 .25rem .6rem; border-left:2px solid var(--color-border-contrast); }
.school-sidenav [data-accordion="panel"][hidden]{ display:none !important; }

:root[data-theme="dark"] .school-sidenav .pf-c-nav__link:hover{ background:rgba(142,229,176,.12); }

.school-sidenav .school-acc__row{ display:flex; align-items:center; justify-content:space-between; gap:.35rem; position: relative; }
.school-sidenav .school-acc__toggle{
  appearance:none; background:transparent; border:0; padding:.25rem; margin:0;
  cursor:pointer; line-height:1; border-radius:.35rem; color:inherit; flex:0 0 auto;
  position: relative; z-index: 2; pointer-events: auto;
}
.school-sidenav .school-acc__toggle:focus-visible{ outline:2px solid var(--color-accent); outline-offset:2px; }
.school-sidenav .school-acc__caret{
  display:inline-block; width:.65rem; height:.65rem;
  border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  transform:rotate(-45deg); transition:transform .18s ease, opacity .18s ease; opacity:.95;
}
.school-sidenav .is-open > .school-acc__row .school-acc__caret{ transform:rotate(45deg); }

.school-sidenav .pf-c-nav__link .nav-icon{
  display:inline-flex; align-items:center; justify-content:center; width:1.25rem; height:1.25rem; opacity:.9;
}
.school-sidenav .pf-m-current > .pf-c-nav__link .nav-icon{ opacity:1; }

.pf-c-page__sidebar::-webkit-scrollbar{ width:8px; }
.pf-c-page__sidebar::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.18); border-radius:4px; }
:root[data-theme="dark"] .pf-c-page__sidebar::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.28); }

@media (max-width: 900px){
  .pf-c-page__sidebar{ position: static; max-height:none; width:100%; max-width:100%; min-width:0; }
}

/* ===== TREŚĆ ===== */
.pf-c-page__main{ min-width:0; }
.pf-c-page__main-section{ max-width:1200px; margin:0 auto; padding: 0 16px; }
.pf-c-page__main .pf-c-card{ max-width:none; border-radius:.5rem; }

/* ===== STOPKA ===== */
.school-footer{
  background: var(--footer-bg);
  color: var(--footer-text);
  border-top: 1px solid var(--color-border-contrast);
}
.school-footer a{ color: var(--footer-link); text-decoration:none; }
.school-footer a:hover{ text-decoration:underline; }

.school-footer__inner{
  max-width:1200px; margin:0 auto; padding:12px 16px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:24px;
}
.school-footer__col{ flex:1 1 0; }
.school-footer__left{ text-align:left; }
.school-footer__right{ text-align:right; }
.school-footer .moduletable{ margin:0; padding:0; }
.school-footer svg{ vertical-align:middle; }

.school-footer__copy{
  max-width:1200px; margin:4px auto 0; padding:8px 16px 12px; text-align:center;
  opacity:.9; border-top:1px solid var(--color-border-contrast);
}
@media (max-width: 768px){
  .school-footer__inner{ flex-direction:column; align-items:flex-start; }
  .school-footer__right{ text-align:left; }
}

/* Przełącznik motywu */
.school-toolbar .pf-c-masthead__content{ position:relative; }
.theme-switch{ position:absolute; right:12px; top:8px; }
.theme-switch__btn{
  background:transparent; border:1px solid var(--topbar-border);
  color:var(--topbar-link); padding:.25rem .45rem; border-radius:.35rem;
  cursor:pointer; line-height:1; font-size:16px;
}
.theme-switch__btn:hover{ background:rgba(255,255,255,.08); color:#fff; }

/* === Aktualności: siatka i karty === */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.news-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.news-card h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.news-card img { max-width: 100%; border-radius: 6px; margin-bottom: .5rem; }
.news-card .readmore {
  display: inline-block; margin-top: .5rem; color: #2563eb; font-weight: 600; text-decoration: none;
}
.news-card .readmore:hover { text-decoration: underline; }

/* UŁOŻENIE STRONY Z BANEREM + HERO */
.school-banner{ grid-area: banner; }
.pf-c-page__header{ grid-area: header; }
.pf-c-page__sidebar{ grid-area: sidebar; }
.pf-c-page__main{ grid-area: main; }
.pf-c-page__footer{ grid-area: footer; }

.pf-c-page{
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "banner"
    "header"
    "hero"
    "sidebar"
    "main"
    "footer";
}
@media (min-width: 900px){
  .pf-c-page{
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-areas:
      "banner banner"
      "header header"
      "hero   hero"
      "sidebar main"
      "footer  footer";
  }
}

/* porządek warstw */
.pf-c-page__sidebar{ z-index: 0; }
.pf-c-page__main{ z-index: 1; }

/* Schowanie Page Heading generowanego przez Joomla */
h1.pf-c-title.pf-m-xl { display: none !important; }
.pf-article-meta { display: none !important; }

/* ===== HERO / SLIDER (fade) ===== */
.school-hero{
  grid-area: hero;
  position: relative;
  height: clamp(280px, 42vh, 520px);
  overflow: hidden;
  background: #0f1720;
  border-bottom: 1px solid var(--color-border-contrast);
  margin-bottom: 24px; /* odstęp pod sliderem */
}
.school-hero .hero-track{
  position: relative; width: 100%; height: 100%;
  border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.school-hero .hero-slide{
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .6s ease;
  pointer-events: none;
}
.school-hero .hero-slide.is-active{ opacity: 1; pointer-events: auto; }
.school-hero .hero-slide img{
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.school-hero .hero-caption{
  position: absolute; left: 6%; bottom: 10%;
  background: rgba(0,0,0,.4);
  color: #fff; padding: .6rem .9rem; border-radius: .5rem;
  max-width: min(680px, 86%);
}
.school-hero .hero-arrow{
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: rgba(0,0,0,.45); color:#fff; font-size: 22px; line-height: 1;
}
.school-hero .hero-prev{ left: 10px; }
.school-hero .hero-next{ right: 10px; }

.school-hero .hero-dots{
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: flex; gap: 8px;
}
.school-hero .hero-dots button{
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid #fff; background: transparent; cursor: pointer;
}
.school-hero .hero-dots button.is-active{ background: #fff; }

/* Skip link */
.skip-link{
  position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  left:12px; top:12px; width:auto; height:auto; z-index:1100;
  padding:.5rem .75rem; background:#fff; color:#111; border-radius:.35rem;
  box-shadow:0 2px 10px rgba(0,0,0,.2);
}
:root[data-theme="dark"] .skip-link:focus{ background:#0b1422; color:#fff; }

/* Odstępy między sekcjami */
.school-toolbar { margin-bottom: 12px; }
.school-footer { margin-top: 20px; }

/* === A11y panel: pozycja === */
.a11y-root[data-a11y] {
  position: fixed;
  left: 16px;
  bottom: 140px;  /* ↑ dostosuj, żeby nie kolidował z cookie-banerem */
  z-index: 10050;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}

/* === Przycisk główny z ikoną SVG === */
.a11y-root[data-a11y] .a11y-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  color: var(--color-accent); /* kolor kółka z ikony (SVG używa currentColor) */
}
.a11y-root[data-a11y] .a11y-toggle::before {
  content: "";
  width: 100%;
  height: 100%;
  background: url("../images/a11y-base.svg") no-repeat center / contain;
  display: block;
}
.a11y-root[data-a11y] .a11y-toggle:focus-visible {
  outline: 3px solid #ffd24d;
  outline-offset: 3px;
}

/* === Panel wysuwany === */
.a11y-root[data-a11y] .a11y-panel {
  position: absolute;
  left: 64px;
  bottom: 0;
  min-width: 240px;
  max-width: 320px;
  padding: .75rem;
  background: #fff;
  color: #111;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  transform: translateX(-8px);
  opacity: 1;
  transition: transform .18s ease, opacity .18s ease;
}
.a11y-root[data-a11y] .a11y-panel[hidden] {
  display: block;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-16px);
}

/* === Przyciski w panelu === */
.a11y-root[data-a11y] .a11y-btn {
  display: block;
  width: 100%;
  margin: .25rem 0;
  padding: .6rem .75rem;
  font: inherit;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  text-align: left;
  cursor: pointer;
}
.a11y-root[data-a11y] .a11y-btn:hover,
.a11y-root[data-a11y] .a11y-btn:focus-visible {
  background: #eef2ff;
  border-color: #c7d2fe;
  outline: none;
}

/* === Tryb wysoki kontrast === */
.a11y-contrast,
.a11y-contrast body {
  background: #000 !important;
  color: #fff !important;
}
.a11y-contrast a {
  color: #7cc7ff !important;
  text-decoration: underline;
}
.a11y-contrast img {
  filter: contrast(120%) brightness(90%);
}
.a11y-contrast .a11y-panel {
  background: #111;
  color: #fff;
  border-color: #333;
}
.a11y-contrast .a11y-btn {
  background: #1a1a1a;
  border-color: #333;
}

/* === Animacje OFF (systemowe preferencje) === */
@media (prefers-reduced-motion: reduce) {
  .a11y-root[data-a11y] .a11y-panel { transition: none; }
}
/* Ikona dostępności – jasny motyw */
.a11y-root[data-a11y] .a11y-toggle::before {
  content: "";
  width: 100%;
  height: 100%;
  display: block;
  background: url("../images/a11y-light.svg") no-repeat center / contain;
}

/* Ikona dostępności – ciemny motyw */
:root[data-theme="dark"] .a11y-root[data-a11y] .a11y-toggle::before {
  background-image: url("../images/a11y-dark.svg");
}