/*
Theme Name: ITC PW 2026
Theme URI: https://www.tele.pw.edu.pl/
Author: Instytut Telekomunikacji i Cyberbezpieczeństwa, Politechnika Warszawska
Author URI: https://www.tele.pw.edu.pl/
Description: Niezależny motyw WordPress dla Instytutu Telekomunikacji i Cyberbezpieczeństwa PW. Klasyczny serwis akademicki w stylu wizualnym Wydziału EiTI (elka.pw.edu.pl) - paleta cream/slate, typografia szeryfowa, czysta semantyka HTML, bez Elementora i bez page-builderów. Wspiera Classic Editor + Advanced Custom Fields.
Version: 1.13.26
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: itc-2026
Tags: education, university, classic
*/

/* =================================================================
   ITC PW 2026 - własny motyw WordPressa
   Style przeniesione 1:1 z mockup-itic-v6.html.
   Paleta i typografia zinspekcjonowane z DOM elka.pw.edu.pl.
   ================================================================= */

/* =================================================================
   FONTY - Adagio Slab (licencja PW, hostowane lokalnie)
   ================================================================= */
@font-face {
  font-family: "Adagio Slab";
  font-style:  normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/adagio/AdagioSlab-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Adagio Slab";
  font-style:  italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/adagio/AdagioSlab-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Adagio Slab";
  font-style:  normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/adagio/AdagioSlab-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Adagio Slab";
  font-style:  normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/adagio/AdagioSlab-Bold.woff2") format("woff2");
}

:root {
  --cream:        rgb(247, 245, 246);
  --slate:        rgb(60, 60, 76);
  --slate-soft:   rgba(60, 60, 76, 0.7);
  --slate-line:   rgba(60, 60, 76, 0.18);
  --slate-hover:  rgb(80, 80, 100);

  --pw-blue:      rgb(20, 123, 187);
  --elka-blue:    rgb(39, 130, 182);
  --elka-blue-h:  rgb(28, 100, 145);
  /* WCAG AA-compliant variant dla przyciskow z bialym tekstem (4.5:1 contrast) */
  --elka-blue-accessible: rgb(24, 87, 125);

  --num-1:        rgb(166, 166, 166);
  --num-2:        rgb(79, 98, 40);
  --num-3:        rgb(23, 55, 94);
  --num-4:        rgb(149, 55, 53);

  --line:         rgba(60, 60, 76, 0.14);
  --line-soft:    rgba(60, 60, 76, 0.08);
  --footer-bg:    rgb(228, 228, 228);

  --font-body:    "Adagio Slab", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-display: "Adagio Slab", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-meta:    "Source Sans 3", "Source Sans Pro", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --container: 1140px;
  --gutter: 30px;
}

/* =================================================================
   RESET / PODSTAWA
   ================================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { min-height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--slate);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Sticky footer: body jako flex-column, main rośnie aż do końca, footer zostaje na dole */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* Treść (main) wypełnia dostępną przestrzeń, popychając footer do dołu */
#main, main.entry-wrap {
  flex: 1 0 auto;
  background: var(--cream);
}
.site-footer {
  flex: 0 0 auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--elka-blue); text-decoration: none; }
a:hover { color: var(--elka-blue-h); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--elka-blue); outline-offset: 2px; border-radius: 2px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--slate); color: var(--cream);
  padding: 10px 16px; z-index: 9999;
  font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; outline: 2px solid #fff; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  word-wrap: normal !important;
}

/* =================================================================
   1. PASEK MENU GÓRNY (slate sticky)
   ================================================================= */
.topstrip {
  background: var(--slate);
  color: var(--cream);
  font-family: var(--font-meta);
  font-size: 14px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.topstrip .container {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

/* Menu główne - wp_nav_menu wyrenderuje <ul class="topnav-menu"> */
.topnav-menu,
.topnav-menu ul {
  list-style: none; padding: 0; margin: 0;
}
.topnav-menu {
  display: flex;
  align-items: stretch;
}
.topnav-menu > li {
  position: relative;
}
.topnav-menu > li > a {
  color: var(--cream);
  display: block;
  padding: 19px 14px 18px;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.topnav-menu > li > a:hover,
.topnav-menu > li.current-menu-item > a,
.topnav-menu > li.current-menu-parent > a {
  background: var(--slate-hover);
  text-decoration: none;
}
.topnav-menu .sub-menu {
  position: absolute; top: 100%; left: 0;
  background: var(--slate);
  list-style: none;
  padding: 4px 0; margin: 0;
  min-width: 240px;
  display: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  z-index: 110;
}
.topnav-menu > li:hover .sub-menu,
.topnav-menu > li:focus-within .sub-menu {
  display: block;
}
.topnav-menu .sub-menu a {
  color: var(--cream);
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  text-decoration: none;
  white-space: normal;
}
.topnav-menu .sub-menu a {
  padding: 9px 14px;
  font-size: 14.5px;
}
.topnav-menu .sub-menu a:hover { background: var(--slate-hover); }

.topstrip .right-utils {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px;
  padding: 0 4px;
}
.topstrip .right-utils a { color: rgba(247, 245, 246, 0.85); }
.topstrip .right-utils a:hover { color: var(--cream); text-decoration: none; }

/* Pole search inline w pasku górnym */
.topstrip .topnav-search {
  display: flex;
  align-items: stretch;
  background: rgba(247, 245, 246, 0.10);
  border: 1px solid rgba(247, 245, 246, 0.22);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.topstrip .topnav-search:focus-within {
  background: rgba(247, 245, 246, 0.18);
  border-color: rgba(247, 245, 246, 0.45);
}
.topstrip .topnav-search input[type=search] {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--cream);
  font-family: var(--font-meta);
  font-size: 13px;
  padding: 6px 10px;
  width: 160px;
  min-width: 0;
}
.topstrip .topnav-search input[type=search]::placeholder {
  color: rgba(247, 245, 246, 0.5);
}
.topstrip .topnav-search input[type=search]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.topstrip .topnav-search button {
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(247, 245, 246, 0.22);
  color: rgba(247, 245, 246, 0.75);
  cursor: pointer;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.topstrip .topnav-search button:hover {
  color: var(--cream);
  background: rgba(247, 245, 246, 0.12);
}
.topstrip .topnav-search svg {
  display: block;
}
.topstrip .lang {
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid rgba(247, 245, 246, 0.4);
  border-radius: 2px;
}

/* Mobile burger (hidden by default on desktop) */
.topnav-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--cream);
  padding: 12px 14px;
  cursor: pointer;
  font-size: 18px;
}

/* =================================================================
   2. SEKCJA TYTUŁOWA (logo PW + nazwa + logo ITC)
   ================================================================= */
.title-bar {
  padding: 28px 0 22px;
  background: var(--cream);
}
.title-bar .container {
  display: flex;
  align-items: center;
  gap: 26px;
}
.title-bar .pw-logo {
  flex: 0 0 auto;
  display: block;
}
.title-bar .pw-logo img {
  height: 88px;
  width: auto;
  display: block;
}
/* Fallback jeśli logo nie jest wgrane - kwadracik z tekstem PW */
.title-bar .pw-logo-fallback {
  width: 88px; height: 88px;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--cream);
  font-family: Georgia, serif;
  font-size: 18px;
  letter-spacing: .5px;
  text-align: center;
  line-height: 1.05;
}
.title-bar .pw-logo-fallback span {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  margin-top: 2px;
}
.title-bar .titles {
  flex: 1 1 auto;
  min-width: 0;
}
.title-bar .titles .pw {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--slate);
  margin: 0 0 4px;
  line-height: 1.2;
}
.title-bar .titles .pw a { color: inherit; text-decoration: none; }
.title-bar .titles .itc {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--pw-blue);
  margin: 0;
  line-height: 1.2;
}
.title-bar .titles .itc a { color: inherit; text-decoration: none; }
.title-bar .titles small {
  display: block;
  margin-top: 8px;
  color: var(--slate-soft);
  font-family: var(--font-meta);
  font-size: 13px;
  letter-spacing: .3px;
}
/* Logo ITC po prawej (opcjonalne) */
.title-bar .itc-logo {
  flex: 0 0 auto;
  margin-left: auto;
}
.title-bar .itc-logo img {
  height: 140px;
  width: auto;
  display: block;
}

/* =================================================================
   3. HERO (cream + tekst + obrazek/SVG)
   ================================================================= */
.hero {
  background: var(--cream);
  padding: 16px 0 40px;
  border-bottom: 1px solid var(--slate-line);
}
.hero .container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 44px;
  align-items: center;
}
.hero .hero-text h2 {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.3;
  font-weight: 400;
  color: var(--slate);
  margin: 0 0 14px;
}
.hero .hero-text h2 em {
  font-style: italic;
  color: var(--elka-blue);
}
.hero .hero-text p {
  font-size: 15.5px;
  color: var(--slate);
  margin: 0;
  line-height: 1.65;
}
.hero-figure {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #fff;
  border: 1px solid var(--slate-line);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(60, 60, 76, .08);
}
.hero-figure img,
.hero-figure svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =================================================================
   4. AKTUALNOŚCI (3 kolumny w stylu elka)
   ================================================================= */
.news-section {
  padding: 44px 0 26px;
}
.news-section .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-line);
}
.news-section .section-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--slate);
  margin: 0;
}
.news-section .section-head .see-all {
  font-family: var(--font-meta);
  font-size: 14px;
  font-weight: 600;
  color: var(--elka-blue);
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 22px;
}
.news-item {
  background: #fff;
  border: 1px solid var(--slate-line);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ============================================================
   Karta z obrazem wyróżniającym - obraz jako tło, narzucony
   kolor kategorii (efekt duotone). Tekst biały, czytelny.
   ============================================================ */
.news-item.has-thumb {
  color: #fff;
  border-color: transparent;
  /* Domyślny kolor (gdy kategoria 1 / brak klasy cat-X): bordowy */
  --cat-overlay: var(--num-4);
}
.news-item.has-thumb.cat-2 { --cat-overlay: var(--num-2); }   /* oliwkowy */
.news-item.has-thumb.cat-3 { --cat-overlay: var(--num-3); }   /* granatowy */
.news-item.has-thumb.cat-4 { --cat-overlay: var(--elka-blue); } /* niebieski */

/* Obraz w tle */
.news-item.has-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--thumb-url);
  background-size: cover;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}
/* Kolorowy overlay z koloru kategorii - 88% nieprzezroczysty,
   przepuszcza zarys obrazka (tekstura) ale dominuje kolor */
.news-item.has-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cat-overlay);
  opacity: 0.88;
  pointer-events: none;
  z-index: 0;
}
.news-item.has-thumb > * {
  position: relative;
  z-index: 1;
}
/* Białe teksty + lekki cień dla czytelności */
.news-item.has-thumb h3 a,
.news-item.has-thumb h3 a:hover { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.news-item.has-thumb p { color: rgba(255, 255, 255, 0.95); }
.news-item.has-thumb .cat-line .date { color: rgba(255, 255, 255, 0.85); }
/* Wyższa specyficzność (z .cat-X) - inaczej stare reguły wygrywają */
.news-item.has-thumb .cat-line .cat,
.news-item.has-thumb.cat-1 .cat-line .cat,
.news-item.has-thumb.cat-2 .cat-line .cat,
.news-item.has-thumb.cat-3 .cat-line .cat,
.news-item.has-thumb.cat-4 .cat-line .cat {
  background: rgba(255, 255, 255, 0.95);
  color: var(--cat-overlay);
}
.news-item.has-thumb .more-link,
.news-item.has-thumb.cat-1 .more-link,
.news-item.has-thumb.cat-2 .more-link,
.news-item.has-thumb.cat-3 .more-link,
.news-item.has-thumb.cat-4 .more-link {
  background: rgba(255, 255, 255, 0.95);
  color: var(--cat-overlay);
}
.news-item.has-thumb .more-link:hover {
  background: #fff;
}
.news-item .cat-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--font-meta);
  font-size: 12px;
}
.news-item .cat-line .cat {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
  color: var(--slate);
  background: var(--num-1);
}
.news-item.cat-2 .cat-line .cat { background: var(--num-2); color: #fff; }
.news-item.cat-3 .cat-line .cat { background: var(--num-3); color: #fff; }
.news-item.cat-4 .cat-line .cat { background: var(--num-4); color: #fff; }
.news-item .cat-line .date {
  color: var(--slate-soft);
  font-size: 12.5px;
}
.news-item h3 {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.35;
  font-weight: 400;
  margin: 0 0 8px;
}
.news-item h3 a {
  color: var(--elka-blue);
  text-decoration: none;
}
.news-item h3 a:hover {
  color: var(--elka-blue-h);
  text-decoration: underline;
}
.news-item p {
  margin: 0 0 14px;
  font-size: 14.5px;
  color: var(--slate);
  line-height: 1.55;
  flex: 1;
}
.news-item .more-link {
  align-self: flex-start;
  display: inline-block;
  background: var(--num-1);
  color: var(--slate);
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 400;
  padding: 6px 12px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.news-item .more-link:hover {
  background: var(--num-4);
  color: #fff;
  text-decoration: none;
}
.news-item.cat-2 .more-link { background: var(--num-2); color: #fff; }
.news-item.cat-3 .more-link { background: var(--num-3); color: #fff; }
.news-item.cat-4 .more-link { background: var(--num-4); color: #fff; }
.news-item.cat-2 .more-link:hover,
.news-item.cat-3 .more-link:hover,
.news-item.cat-4 .more-link:hover {
  filter: brightness(0.85);
  text-decoration: none;
}

/* =================================================================
   5. UŻYTECZNE LINKI (4 karty)
   ================================================================= */
.useful {
  padding: 30px 0 56px;
  background: var(--cream);
}
.useful .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.useful .card {
  background: #fff;
  border: 1px solid var(--slate-line);
  border-top: 4px solid var(--num-4);
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, border-color .15s;
}
.useful .card.olive { border-top-color: var(--num-2); }
.useful .card.navy  { border-top-color: var(--num-3); }
.useful .card.elka  { border-top-color: var(--elka-blue); }
.useful .card:hover { box-shadow: 0 4px 14px rgba(60, 60, 76, .08); }
.useful .card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--slate);
  margin: 0 0 8px;
}
.useful .card p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--slate);
  flex: 1;
  line-height: 1.5;
}
.useful .card .go {
  align-self: flex-start;
  display: inline-block;
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 600;
  background: var(--num-4);
  color: #fff;
  padding: 6px 12px;
  text-decoration: none;
}
.useful .card.olive .go { background: var(--num-2); }
.useful .card.navy  .go { background: var(--num-3); }
.useful .card.elka  .go { background: var(--elka-blue); }
.useful .card .go:hover { filter: brightness(0.88); text-decoration: none; }

/* =================================================================
   6. STRONA WPISU (single.php) i STRONA STATYCZNA (page.php)
   ================================================================= */
.entry-wrap {
  background: var(--cream);
  padding: 32px 0 60px;
}
.entry-wrap .container {
  display: grid;
  grid-template-columns: minmax(0, 760px) 1fr;
  gap: 48px;
}
.entry {
  background: #fff;
  border: 1px solid var(--slate-line);
  padding: 28px 36px 36px;
}
.entry > header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--slate-line);
}
.entry .cat-line {
  font-family: var(--font-meta);
  font-size: 12.5px;
  color: var(--slate-soft);
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.entry .cat-line .cat {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
  color: var(--slate);
  background: var(--num-1);
}
.entry .cat-line .cat.c-2 { background: var(--num-2); color: #fff; }
.entry .cat-line .cat.c-3 { background: var(--num-3); color: #fff; }
.entry .cat-line .cat.c-4 { background: var(--num-4); color: #fff; }
.entry h1.entry-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  color: var(--slate);
  margin: 0 0 6px;
  line-height: 1.25;
}
.entry .byline {
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--slate-soft);
}
.entry-content {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--slate);
}
.entry-content p { margin: 0 0 1em; }
.entry-content h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--slate);
  margin: 28px 0 10px;
}
.entry-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--slate);
  margin: 24px 0 8px;
}
.entry-content ul, .entry-content ol { padding-left: 22px; margin: 0 0 1em; }
.entry-content li { margin-bottom: 4px; }
.entry-content blockquote {
  border-left: 3px solid var(--elka-blue);
  margin: 18px 0;
  padding: 4px 0 4px 18px;
  color: var(--slate-soft);
  font-style: italic;
}
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.entry-content img { margin: 1em 0; }
.entry-content figure { margin: 1em 0; }
.entry-content figcaption {
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--slate-soft);
  margin-top: 6px;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-meta);
  font-size: 14px;
  margin: 1em 0;
}
.entry-content th, .entry-content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--slate-line);
  text-align: left;
}
.entry-content th { background: #f0eeef; }

.entry-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-line);
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--slate-soft);
}
.entry-footer a.back {
  color: var(--elka-blue);
  font-weight: 600;
}

/* Sidebar w single/page (boczny pasek) */
.entry-sidebar {
  font-family: var(--font-meta);
  font-size: 14px;
}
.entry-sidebar .widget {
  background: #fff;
  border: 1px solid var(--slate-line);
  padding: 16px 18px 18px;
  margin-bottom: 20px;
}
.entry-sidebar .widget h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--slate);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--slate-line);
}
.entry-sidebar ul { list-style: none; padding: 0; margin: 0; }
.entry-sidebar li { padding: 5px 0; border-bottom: 1px dotted var(--line-soft); }
.entry-sidebar li:last-child { border-bottom: 0; }
.entry-sidebar a { color: var(--slate); }
.entry-sidebar a:hover { color: var(--elka-blue); text-decoration: underline; }

/* =================================================================
   7. ARCHIWUM (kategorie, tagi, wyszukiwanie)
   ================================================================= */
.archive-wrap {
  padding: 32px 0 60px;
}
.archive-wrap .archive-head {
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-line);
}
.archive-wrap .archive-head h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--slate);
  margin: 0 0 4px;
}
.archive-wrap .archive-head p {
  font-family: var(--font-meta);
  font-size: 14px;
  color: var(--slate-soft);
  margin: 0;
}
.archive-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.archive-list .news-item { /* re-use news-item style */ }

/* Paginacja */
.pagination {
  margin-top: 30px;
  font-family: var(--font-meta);
  font-size: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  display: inline-block;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--slate-line);
  color: var(--slate);
  text-decoration: none;
}
.pagination .page-numbers.current {
  background: var(--slate);
  color: var(--cream);
  border-color: var(--slate);
}
.pagination .page-numbers:hover {
  background: var(--slate-hover);
  color: var(--cream);
  text-decoration: none;
}

/* =================================================================
   8. SEARCH FORM
   ================================================================= */
.search-form {
  display: flex;
  gap: 6px;
}
.search-form .search-field {
  flex: 1 1 auto;
  padding: 8px 12px;
  font-family: var(--font-meta);
  font-size: 14px;
  border: 1px solid var(--slate-line);
  background: #fff;
  color: var(--slate);
  border-radius: 0;
}
.search-form .search-field:focus {
  outline: 2px solid var(--elka-blue);
  outline-offset: -2px;
}
.search-form .search-submit {
  flex: 0 0 auto;
  background: var(--slate);
  color: var(--cream);
  border: 0;
  padding: 8px 16px;
  font-family: var(--font-meta);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.search-form .search-submit:hover { background: var(--slate-hover); }

/* =================================================================
   9. 404
   ================================================================= */
.error-404 {
  padding: 80px 0 100px;
  text-align: center;
}
.error-404 h1 {
  font-family: var(--font-display);
  font-size: 80px;
  color: var(--num-4);
  margin: 0;
  line-height: 1;
}
.error-404 p {
  font-family: var(--font-meta);
  font-size: 16px;
  color: var(--slate-soft);
  margin: 12px 0 24px;
}

/* =================================================================
   10. FOOTER
   ================================================================= */
footer.site-footer {
  background: var(--footer-bg);
  color: var(--slate);
  padding: 36px 0 0;
  font-family: var(--font-meta);
  font-size: 14px;
}
footer.site-footer .container {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
}
footer.site-footer h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: .8px;
}
footer.site-footer p { margin: 0 0 6px; line-height: 1.55; }
footer.site-footer ul { list-style: none; padding: 0; margin: 0; }
footer.site-footer li { margin-bottom: 6px; }
footer.site-footer a { color: var(--slate); }
footer.site-footer a:hover { color: var(--elka-blue-h); }
footer.site-footer .institute-name {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--pw-blue);
  margin-bottom: 8px;
  font-size: 16px;
}
footer.site-footer .reg {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #b8b8b8;
  font-size: 13px;
  color: var(--slate-soft);
}
footer.site-footer .reg b { color: var(--slate); }

footer.site-footer .meta-line {
  border-top: 1px solid #c8c8c8;
  margin-top: 28px;
  padding: 14px 0 18px;
  font-size: 12px;
  color: var(--slate-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  grid-column: 1 / -1;
}
footer.site-footer .meta-line .legal a {
  color: var(--slate-soft);
  margin-left: 14px;
}

/* =================================================================
   11. RESPONSIVE
   ================================================================= */
@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; gap: 28px; }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .useful .container { grid-template-columns: 1fr 1fr; }
  footer.site-footer .container { grid-template-columns: 1fr 1fr; }
  .entry-wrap .container { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topnav-toggle { display: block; }
  .topstrip .container { flex-wrap: wrap; padding: 0 var(--gutter); }
  .topnav-menu {
    flex-direction: column;
    width: 100%;
    display: none;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .topnav-menu.is-open { display: flex; }
  .topnav-menu > li { width: 100%; }
  .topnav-menu .sub-menu {
    position: static;
    display: block;
    background: rgba(0,0,0,.15);
    box-shadow: none;
    padding-left: 14px;
  }
  .topstrip .right-utils {
    width: 100%;
    justify-content: flex-end;
    padding: 8px var(--gutter);
    border-top: 1px solid rgba(255,255,255,.1);
  }
}

@media (max-width: 720px) {
  .title-bar .container { gap: 16px; flex-wrap: wrap; }
  .title-bar .pw-logo img { height: 64px; }
  .title-bar .pw-logo-fallback { width: 64px; height: 64px; flex: 0 0 64px; font-size: 14px; }
  .title-bar .titles .pw { font-size: 21px; }
  .title-bar .titles .itc { font-size: 22px; }
  .title-bar .itc-logo { order: 0; margin-left: 0; }
  .hero { padding: 16px 0 24px; }
  .hero .hero-text h2 { font-size: 22px; }
  .news-section, .useful { padding: 28px 0; }
  .news-grid,
  .useful .container,
  .archive-list,
  footer.site-footer .container { grid-template-columns: 1fr; }
  .entry { padding: 22px 20px 26px; }
  .entry h1.entry-title { font-size: 24px; }
}

/* =================================================================
   12. ADMIN BAR offset (jeśli zalogowany)
   ================================================================= */
@media screen and (min-width: 783px) {
  .admin-bar .topstrip { top: 32px; }
}
@media screen and (max-width: 782px) {
  .admin-bar .topstrip { top: 46px; }
}

/* =================================================================
   13. WORDPRESS CORE CLASSES (alignment, captions, embeds)
   ================================================================= */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }
.alignwide { max-width: 1140px; margin: 1em auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--slate-soft);
  margin-top: 6px;
  text-align: center;
}
.gallery { display: grid; gap: 8px; }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery br { display: none; }

.sticky::before {
  content: "Wyróżnione";
  display: inline-block;
  background: var(--num-4);
  color: #fff;
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
}

/* =================================================================
   14. SECTION NAV - kontekstowe boczne menu (jak elka, dopracowane)
   Aktywuje się gdy <main> ma klasę .has-section-nav.
   Layout: treść lewo, aside po prawej (260px sticky).
   ================================================================= */
.entry-wrap.has-section-nav .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 36px;
  align-items: start;
}

.section-nav {
  position: sticky;
  top: 80px;
  align-self: start;
  background: #fff;
  border: 1px solid var(--slate-line);
  border-top: 4px solid var(--num-3);
  padding: 0;
  font-family: var(--font-meta);
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(60,60,76,.04);
}
.admin-bar .section-nav { top: 110px; }

.section-nav__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--slate);
  margin: 0;
  padding: 14px 18px 12px;
  background: var(--cream);
  border-bottom: 1px solid var(--slate-line);
  letter-spacing: .01em;
}
.section-nav__title a {
  color: var(--slate);
  text-decoration: none;
  display: block;
}
.section-nav__title a:hover { color: var(--elka-blue); text-decoration: none; }

.section-nav__list {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}
.section-nav__list li {
  margin: 0;
  padding: 0;
  border: 0;
}
.section-nav__list li > a {
  display: block;
  padding: 8px 16px 8px 18px;
  color: var(--elka-blue);
  text-decoration: none;
  border-left: 3px solid transparent;
  line-height: 1.4;
  font-size: 13.5px;
  transition: background .12s, border-color .12s, color .12s;
}
.section-nav__list li > a:hover {
  background: var(--cream);
  color: var(--elka-blue-h);
  text-decoration: none;
  border-left-color: var(--slate-line);
}
.section-nav__list li.is-current > a {
  background: var(--cream);
  color: var(--num-4);
  border-left-color: var(--num-4);
  font-weight: 700;
}

/* Section nav - mobile: nad treścią, mniej dramatyczne */
@media (max-width: 1024px) {
  .entry-wrap.has-section-nav .container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .section-nav {
    position: static;
    order: -1;
    border-top-width: 4px;
  }
}

/* =================================================================
   15. PRACOWNICY - tabelka (responsive)
   ================================================================= */
.pracownicy-table { width: 100%; }
@media (max-width: 720px) {
  .pracownicy-table thead { display: none; }
  .pracownicy-table tbody td {
    display: block;
    padding: 4px 0 !important;
    border: 0 !important;
  }
  .pracownicy-table tbody tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--slate-line);
  }
  /* v1.13.26 mobile labels - pokazujemy "FUNKCJA:", "ZAKŁAD:" itd. */
  .pracownicy-table tbody td.pracownicy-cell[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-meta);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--slate);
    margin-bottom: 2px;
    opacity: .75;
  }
  /* Komórka nazwiska - bez labela (link jest już oczywisty + większy) */
  .pracownicy-table tbody td.pracownicy-cell--name::before { display: none; }
  .pracownicy-table tbody td.pracownicy-cell--name { padding-bottom: 8px !important; }
  /* Puste komórki - ukrywamy całą sekcję na mobile */
  .pracownicy-table tbody td.pracownicy-cell.is-empty { display: none; }
}
.zaklad-group { margin-bottom: 30px; }
/* === KONIEC PLIKU v1.1.0 === */

/* =================================================================
   16. DROPDOWN MENU - submenu na pasku slate (dla aktualnych ogłoszeń)
   Bazowe style sub-menu już są (sekcja 1). Tutaj dopracowanie:
   szerokie pozycje, ładniejsza siatka.
   ================================================================= */
.topnav-menu .sub-menu {
  min-width: 320px !important;
  max-width: 420px;
  padding: 6px 0 !important;
}
.topnav-menu .sub-menu li.menu-item-ogloszenie a {
  padding: 10px 16px !important;
  border-bottom: 1px solid rgba(247,245,246,0.08);
  font-size: 13.5px;
  white-space: normal;
  line-height: 1.4;
}
.topnav-menu .sub-menu li.menu-item-ogloszenie:last-child a {
  border-bottom: 0;
}

/* =================================================================
   17. PROJEKTY - meta box po prawej (na single-projekt) responsive
   ================================================================= */
@media (max-width: 900px) {
  .projekt-grid {
    grid-template-columns: 1fr !important;
  }
  .projekt-meta {
    order: -1;
  }
}

/* Karty projektów na page-projekty - hover */
.projekty-grid article {
  transition: box-shadow .15s, transform .15s;
}
.projekty-grid article:hover {
  box-shadow: 0 6px 18px rgba(60, 60, 76, 0.10);
}

/* =================================================================
   18. OGŁOSZENIA - lista (zwykłe akapity)
   ================================================================= */
.ogloszenia-list li:hover {
  border-color: var(--num-4) !important;
  background: var(--cream) !important;
}

/* =================================================================
   19. PRACOWNICY - toolbar filtra (przyciski zakładów + search)
   ================================================================= */
.pracownicy-filters .pracownik-filter-btn:hover {
  background: var(--cream) !important;
  border-color: var(--num-3) !important;
}
.pracownicy-filters .pracownik-filter-btn.is-active,
.pracownicy-filters .pracownik-filter-btn[data-zaklad=""] {
  /* default state ustawiony inline w PHP, JS przełącza */
}
.pracownicy-filters .pracownicy-search:focus {
  outline: 2px solid var(--elka-blue);
  outline-offset: -2px;
  border-color: var(--elka-blue) !important;
}
.pracownicy-table .pracownik-row:hover td {
  background: var(--cream) !important;
}

/* =================================================================
   17. MOBILE DRAWER MENU (SOTA, v1.10.26)

   Off-canvas drawer slide-in z prawej, overlay z blur, animowany burger
   (3 paski -> X), akordeon submenu, body scroll lock, focus trap (JS),
   Escape close, click-outside close, prefers-reduced-motion respect.
   ================================================================= */

/* --- BURGER (3 paski animowane w X) --- */
.topnav-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--cream);
  padding: 10px 14px;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  font-family: var(--font-meta);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  z-index: 1101;
  position: relative;
}
.topnav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
}
.topnav-toggle-bars .bar {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
}
.topnav-toggle.is-open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topnav-toggle.is-open .bar:nth-child(2) { opacity: 0; }
.topnav-toggle.is-open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.topnav-toggle-label { line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  .topnav-toggle-bars .bar { transition: none; }
}

/* --- OVERLAY (backdrop) --- */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1099;
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}
.mobile-overlay.is-open { pointer-events: auto; }
.mobile-overlay.is-open {
  display: block;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .mobile-overlay { transition: none; }
}

/* --- BODY scroll-lock when drawer open --- */
body.menu-open { overflow: hidden; }

/* --- DRAWER (mobile, max-width: 900px) --- */
@media (max-width: 900px) {
  /* Pokaz burger jako flex */
  .topnav-toggle { display: inline-flex; }

  /* Topstrip layout: tylko burger po lewej + search po prawej. Reszta w drawerze. */
  .topstrip { padding: 0; }
  .topstrip .container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
    min-height: 56px;
  }
  .topstrip .right-utils {
    width: auto;
    border-top: none;
    padding: 0;
    margin-left: auto;
  }
  .topstrip .topnav-search input[type=search] { width: 130px; }

  /* DRAWER container = .topnav-container (output wp_nav_menu wrappera) */
  .topnav-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 88vw;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: rgb(60, 60, 76);
    transform: translateX(105%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .topnav-container.is-open { transform: translateX(0); }
  @media (prefers-reduced-motion: reduce) {
    .topnav-container { transition: none; }
  }

  /* Header drawera (etykieta MENU) - przybity sticky na gorze */
  .topnav-container::before {
    content: 'Menu';
    display: block;
    padding: 22px 24px 14px;
    font-family: var(--font-meta);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(247, 245, 246, 0.5);
    border-bottom: 1px solid rgba(247, 245, 246, 0.12);
  }

  /* Lista menu */
  .topnav-menu {
    flex-direction: column;
    width: 100%;
    display: flex !important;
    border-top: none;
    padding: 8px 0;
    margin: 0;
  }
  .topnav-menu > li { width: 100%; position: relative; }
  .topnav-menu > li > a {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    border-bottom: 1px solid rgba(247, 245, 246, 0.06);
  }
  .topnav-menu > li > a:hover,
  .topnav-menu > li.current-menu-item > a,
  .topnav-menu > li.current-menu-parent > a {
    background: rgba(247, 245, 246, 0.06);
  }

  /* Submenu - chevron toggle, akordeon (collapsed by default) */
  .topnav-menu > li.menu-item-has-children > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .topnav-menu > li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.22s ease;
    flex-shrink: 0;
    opacity: 0.7;
  }
  .topnav-menu > li.menu-item-has-children.is-open > a::after {
    transform: rotate(-135deg);
  }
  @media (prefers-reduced-motion: reduce) {
    .topnav-menu > li.menu-item-has-children > a::after { transition: none; }
  }

  .topnav-menu .sub-menu {
    position: static;
    display: none;
    background: rgba(0, 0, 0, 0.18);
    box-shadow: none;
    padding: 4px 0 8px !important;
    margin: 0;
    min-width: 0 !important;
    max-width: none !important;
  }
  .topnav-menu > li.menu-item-has-children.is-open > .sub-menu {
    display: block;
  }
  .topnav-menu .sub-menu a {
    padding: 10px 24px 10px 40px !important;
    font-size: 14.5px !important;
    border-bottom: 1px solid rgba(247, 245, 246, 0.04);
  }
}

/* === KONIEC SEKCJI 17 (mobile drawer) === */

/* === FIX v1.10.28: topstrip nad overlay gdy menu otwarte ===
   Drawer jest dzieckiem .topstrip ktora ma sticky z-index: 100. To tworzy
   stacking context, ktorego drawer (z-index lokalny 1200) nie moze przebic
   na poziomie globalnym. Overlay (z-index 1099 na body) jest GLOBALNIE wyzej
   niz cale stacking context topstrip → klikiny przez overlay zamykaly menu.
   Rozwiazanie: gdy menu otwarte, topstrip dostaje z-index 1300 → caly stacking
   context wskakuje nad overlay → drawer w nim jest klikalny. */
@media (max-width: 900px) {
  body.menu-open .topstrip { z-index: 1300; }
  body.menu-open .title-bar { pointer-events: none; }
  body.menu-open #main { pointer-events: none; }
  body.menu-open .site-footer { pointer-events: none; }
}

/* === FIX v1.10.29: lepsza klikalnosc menu mobile ===
   touch-action: manipulation - eliminuje 300ms tap delay i double-tap zoom na linkach
   chevron wiekszy + bardziej zauwazalny - jasniejsza wskazowka ze pozycja rozwija */
@media (max-width: 900px) {
  .topnav-menu a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(247, 245, 246, 0.1);
  }
  .topnav-menu > li.menu-item-has-children > a::after {
    width: 10px;
    height: 10px;
    border-right-width: 2.5px;
    border-bottom-width: 2.5px;
    opacity: 0.85;
    margin-left: 14px;
  }
  /* Aktualne (rozwijane) li ma subtelnie inne tlo dla wskazania ze klik = toggle */
  .topnav-menu > li.menu-item-has-children > a:active {
    background: rgba(247, 245, 246, 0.08);
  }
}

/* === FIX v1.10.30: osobny przycisk chevron, link rodzica nawiguje naturalnie ===
   Wzorzec: link rodzica idzie do strony rodzica (np. /projekty/, /badania/),
   osobny przycisk chevron OBOK linku rozwija/zwija submenu. JS dynamicznie
   injectuje przycisk dla kazdego rodzica z dziecmi. */
@media (max-width: 900px) {
  /* Wylaczamy stary chevron jako pseudo-element na linku */
  .topnav-menu > li.menu-item-has-children > a::after { display: none; }

  /* Wiersz rodzica: link rosnie, button po prawej */
  .topnav-menu > li.menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .topnav-menu > li.menu-item-has-children > a {
    flex: 1 1 auto;
  }
  .topnav-menu > li.menu-item-has-children > .sub-menu {
    flex-basis: 100%;
  }

  /* Przycisk chevron - 56x56 target (>= 44 wymagane przez Apple HIG / WCAG 2.5.5) */
  .topnav-menu .submenu-toggle {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(247, 245, 246, 0.06);
    color: var(--cream);
    width: 56px;
    min-height: 100%;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(247, 245, 246, 0.1);
    transition: background 0.15s ease;
  }
  .topnav-menu .submenu-toggle:hover,
  .topnav-menu .submenu-toggle:focus-visible {
    background: rgba(247, 245, 246, 0.08);
    outline: none;
  }
  .topnav-menu .submenu-toggle:active {
    background: rgba(247, 245, 246, 0.12);
  }
  .topnav-menu .submenu-toggle .chevron {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transform-origin: center;
    transition: transform 0.22s ease;
    opacity: 0.85;
  }
  .topnav-menu > li.menu-item-has-children.is-open .submenu-toggle .chevron {
    transform: rotate(-135deg) translate(-2px, -2px);
  }
  @media (prefers-reduced-motion: reduce) {
    .topnav-menu .submenu-toggle .chevron { transition: none; }
  }
}

/* === FIX v1.10.31: ukryj chevron-button na desktopie ===
   JS injectuje przycisk submenu-toggle dla kazdego rodzica zawsze, niezaleznie
   od viewport. Bez ukrycia na desktopie pokazywal sie jako maly chevron pod
   linkiem rodzica. Poprawka: domyslnie display: none, mobile media query
   nadpisuje na inline-flex. */
.topnav-menu .submenu-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

/* === FIX v1.10.32: agresywny reset hover na mobile ===
   Stary :hover .sub-menu z desktopu (sekcja 1, specyficznosc 0,3,1) lapal
   tap event'y na mobile i otwieral submenu BEZ klikniecia na chevron-button.
   Submenu nagle "wyskakiwalo" pod taping rodzica → przesuwalo sasiadow w dol
   → klik laduje w nie tej pozycji.

   Naprawa: w mobile media query nadpisz hover/focus-within na display: none.
   Plus !important na zmianie display by zniwelowac kazda sumaryczna kaskady. */
@media (max-width: 900px) {
  .topnav-menu > li:hover .sub-menu,
  .topnav-menu > li:focus-within .sub-menu {
    display: none !important;
  }
  .topnav-menu > li.menu-item-has-children > .sub-menu {
    display: none !important;
  }
  .topnav-menu > li.menu-item-has-children.is-open > .sub-menu {
    display: block !important;
  }
}

/* === FIX v1.10.33: chevron-button widocznosc na mobile (cascade fix) ===
   Globalny default .submenu-toggle { display: none } z v1.10.31 lezy PÓŹNIEJ
   w pliku niz mobile media query z v1.10.30, wiec wygrywa na mobile.
   Naprawa: na koncu pliku jeszcze raz mobile reguly z !important (zawsze wygryw). */
@media (max-width: 900px) {
  .topnav-menu .submenu-toggle {
    display: inline-flex !important;
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(247, 245, 246, 0.06);
    color: var(--cream);
    width: 56px;
    min-height: 100%;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(247, 245, 246, 0.1);
    transition: background 0.15s ease;
  }
}

/* === FIX v1.10.34: prostszy layout li mobile (block + absolute chevron) ===
   Poprzedni layout: li display:flex + chevron min-height:100% + sub-menu flex-basis:100%
   powodowal ze li puchnal do wysokosci submenu, chevron rosl razem z li, a stary
   :hover absolute z desktopu probowal sie przebic. Efekt: nakladajace sie pozycje.

   Nowy layout: li display:block (relative), chevron position:absolute right, sub-menu
   position:static block w normalnym flow. Wszystko !important zeby pokonac kazda
   poprzednia regule. */
@media (max-width: 900px) {
  .topnav-menu > li.menu-item-has-children {
    display: block !important;
    position: relative !important;
  }
  .topnav-menu > li.menu-item-has-children > a {
    display: block !important;
    padding-right: 70px !important;
  }
  .topnav-menu > li.menu-item-has-children > a::after {
    display: none !important;
  }
  .topnav-menu .submenu-toggle {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 56px !important;
    height: 100% !important;
    min-height: 0 !important;
    z-index: 2;
  }
  .topnav-menu > li.menu-item-has-children > .sub-menu {
    position: static !important;
    flex-basis: auto !important;
    width: 100%;
    box-shadow: none !important;
  }
}

/* === FIX v1.10.35: chevron-button przyklejony do linku rodzica ===
   Aktualnie chevron mial height: 100% wysokosci li - z otwartym submenu
   chevron rosnal razem z submenu i nakladal sie na linki dzieci.

   Naprawa: chevron ma fixed wysokosc dopasowana do linku rodzica (50px),
   przyklejony do top: 0. Plus tlo slate zakrywa co jest pod (linie border
   submenu nie przebijaja sie przez chevron). */
@media (max-width: 900px) {
  .topnav-menu .submenu-toggle {
    height: 50px !important;
    background: rgb(60, 60, 76) !important;
    z-index: 3 !important;
  }
  .topnav-menu .submenu-toggle:hover,
  .topnav-menu .submenu-toggle:focus-visible {
    background: rgb(80, 80, 100) !important;
  }
}

/* === FIX v1.10.36: logo ITiC widoczne obok PW na mobile ===
   Wczesniej w max-width: 720px logo ITiC bylo ukryte (display: none).
   User chce je obok PW (jak godlo PW pozostaje widoczne).
   Layout: PW (64px) + tytul (rosnie) + ITiC (48px).
   Plus order: gdy flex-wrap, ITiC ma byc przed tytulem zeby nie laczyly sie. */
@media (max-width: 720px) {
  .title-bar .container {
    flex-wrap: nowrap !important;
    gap: 12px;
  }
  .title-bar .titles { flex: 1 1 auto; min-width: 0; }
  .title-bar .pw-logo { flex: 0 0 auto; }
  .title-bar .pw-logo img { height: 56px; }
  .title-bar .pw-logo-fallback { width: 56px; height: 56px; flex: 0 0 56px; }
  .title-bar .itc-logo {
    display: block !important;
    flex: 0 0 auto;
    margin-left: 0;
  }
  .title-bar .itc-logo img {
    height: 56px;
    width: auto;
  }
  .title-bar .titles .pw { font-size: 18px; }
  .title-bar .titles .itc { font-size: 19px; line-height: 1.15; }
  .title-bar .titles small { font-size: 12px; }
}
@media (max-width: 480px) {
  /* Bardzo wąski ekran - tytuly maja prawo zawijac, logo ITiC jeszcze mniejsze */
  .title-bar .pw-logo img { height: 48px; }
  .title-bar .pw-logo-fallback { width: 48px; height: 48px; flex: 0 0 48px; }
  .title-bar .itc-logo img { height: 44px; }
  .title-bar .titles .pw { font-size: 16px; }
  .title-bar .titles .itc { font-size: 17px; }
}

/* === FIX v1.10.37: hero SVG max-width na srednich ekranach ===
   Przy 720-1024px (tablet) hero przechodzi na 1-kolumne i SVG rozciaga sie
   na pelna szerokosc = wyglada nadmiernie. Ograniczamy do 480px wycentrowane. */
@media (max-width: 1024px) {
  .hero .hero-figure {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  .hero .hero-figure svg {
    max-width: 100%;
    height: auto;
    display: block;
  }
}
@media (max-width: 720px) {
  .hero .hero-figure { max-width: 360px; }
}

/* =================================================================
   HERO v8 - graph view (stonowany, akademicki)
   ================================================================= */
.hero-figure {
  /* Brak ramki/tla/shadow - graph lezy bezposrednio na tle strony */
  aspect-ratio: 1 / 1 !important;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.hero-graph {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
.hero-graph .grid { opacity: 0.06; }

/* Sparks - bardzo subtelne, prawie niewidoczne */
.hero-graph .spark {
  fill: rgba(60, 60, 76, 0.4);
  opacity: 0.10;
  animation: heroGraphTwinkle 5s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

/* Center glow + rings - subtelne */
.hero-graph .center-glow {
  opacity: 0.5;
}
.hero-graph .center-ring {
  fill: none;
  stroke: rgba(60, 60, 76, 0.10);
  stroke-width: 1;
}

/* Centralna kapsulka ITiC - prosta, bez shadow */
.hero-graph .center-core {
  /* zadne drop-shadow ani animacja */
}

/* Wezly - klikalne ale stonowane */
.hero-graph .node {
  cursor: grab;
  outline: none;
  pointer-events: all;
}
.hero-graph .node.is-dragging { cursor: grabbing; }
.hero-graph .node-hit { fill: transparent; pointer-events: all; }

.hero-graph .link {
  /* slate przy 0.22 alpha - korzysta z palety motywu */
  stroke: rgba(60, 60, 76, 0.22);
  stroke-width: 1.1;
  opacity: 0.7;
  transition: stroke 0.25s, stroke-width 0.25s, opacity 0.25s;
  pointer-events: none;
}

.hero-graph .orb {
  fill: none;
  stroke: var(--slate-line);
  stroke-width: 0.7;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.25s, stroke 0.25s;
}

.hero-graph .dot {
  transition: filter 0.25s, transform 0.25s;
  transform-origin: center;
  transform-box: fill-box;
  pointer-events: none;
}
.hero-graph .ico {
  pointer-events: none;
  transform-origin: center;
  transform-box: fill-box;
}
.hero-graph .lbl {
  font-family: var(--font-meta);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  fill: var(--slate-soft);
  pointer-events: none;
  transition: fill 0.25s, font-size 0.25s;
}

/* Pakiety - kolory z palety motywu (elka-blue + num-4 bordowy) */
.hero-graph .packet {
  fill: rgba(39, 130, 182, 0.65);  /* var(--elka-blue) z alpha */
  stroke: none;
  opacity: 0.55;
  pointer-events: none;
}
.hero-graph .packet.packet--soft {
  fill: rgba(149, 55, 53, 0.50);   /* var(--num-4) bordowy z alpha */
  opacity: 0.40;
}

/* Tone-* uzywaja zmiennych palety motywu (--num-*, --elka-blue) */
.hero-graph .node.tone-core   .dot { fill: var(--num-3); }     /* granat - zycie/wydarzenia */
.hero-graph .node.tone-accent .dot { fill: var(--elka-blue); } /* niebieski elka - brand */
.hero-graph .node.tone-warm   .dot { fill: var(--num-2); }     /* oliwka - badania/projekty */
.hero-graph .node.tone-bordo  .dot { fill: var(--num-4); }     /* bordo - aktualnosci */

/* Hover - subtelne podswietlenie */
.hero-graph .node:hover .link,
.hero-graph .node:focus-visible .link,
.hero-graph .node.is-active .link {
  stroke: var(--elka-blue);
  stroke-width: 1.7;
  opacity: 1;
}
.hero-graph .node:hover .dot,
.hero-graph .node:focus-visible .dot,
.hero-graph .node.is-active .dot {
  transform: scale(1.10);
}
.hero-graph .node:hover .lbl,
.hero-graph .node:focus-visible .lbl,
.hero-graph .node.is-active .lbl {
  fill: var(--slate);
  font-size: 12.5px;
}

@keyframes heroGraphTwinkle {
  0%, 100% { opacity: 0.06; }
  50%      { opacity: 0.20; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-graph .spark { animation: none; }
}

/* =================================================================
   v1.13.21 - WCAG AA accessibility additions
   ================================================================= */

/* Przyciski z bialym tekstem na niebieskim - WCAG AA contrast */
.useful .card.elka .go,
.itc-card-more,
.repo-pw-btn,
.button-primary,
.entry-content .button {
  background: var(--elka-blue-accessible);
  color: #fff;
}
.useful .card.elka .go:hover,
.itc-card-more:hover,
.repo-pw-btn:hover,
.projekt-card-more:hover {
  background: var(--elka-blue-h);
  color: #fff;
  text-decoration: none;
}

/* Linki w tresci - delikatnie ciemniejsze + bardziej widoczne podkreslenie */
.entry-content a,
.page-content a {
  color: var(--elka-blue-h);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

/* Global focus-visible - widoczny outline dla wszystkich elementow interaktywnych */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--elka-blue-h);
  outline-offset: 3px;
}

/* =================================================================
   PRINT CSS - czysty wydruk dla pracownikow / projektow / dokumentow
   ================================================================= */
@media print {
  /* Ukryj nawigacje, stopke, hero, drawer mobile */
  .site-header,
  .site-footer,
  .mobile-drawer,
  .section-nav,
  .hero,
  .hero-figure,
  .hero-graph,
  .pracownicy-filters,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-family: var(--font-body);
    font-size: 11pt;
    line-height: 1.45;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }

  .container,
  .content-area,
  .site-main,
  .entry-wrap {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Karty/sekcje na druku - bez kolorowych ramek */
  .itc-card,
  .zaklad-card,
  .projekt-card,
  .kolo-card,
  .dyrekcja-card {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  /* Naglowki - czarna typografia */
  h1, h2, h3, h4, .entry-title {
    color: #000 !important;
  }

  /* Linki tel: i mailto: - pokaz adres */
  a[href^="tel:"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    color: #555;
    font-size: 9pt;
  }
}
