/*
Theme Name: SMS Rekord
Theme URI: https://sms.rekord.com.pl
Author: Szymon Łosik
Description: Motyw szkół SMS Rekord Bielsko-Biała. Klasyczny motyw: newsy jako wpisy, dokumenty jako osobny typ treści z plikiem PDF, brak page buildera i wtyczek. Zielono-biały layout wg prototypu.
Version: 1.0.4
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sms-rekord
*/

/* =========================================================================
   1. LAYOUT WITRYNY — scalony z prototypu sms-rekord-html/style.css
      (pełna wersja z wszystkimi media queries) + poprawki hero/logo
      z późniejszej iteracji.
   ========================================================================= */

:root {
  --green-950: #003f29;
  --green-900: #005334;
  --green-800: #00643d;
  --green-700: #08754b;
  --green-100: #dfeee6;
  --green-50: #f2f8f5;
  --ink: #171c19;
  --muted: #5c655f;
  --line: #dfe4e1;
  --paper: #ffffff;
  --soft: #f6f8f7;
  --shadow: 0 14px 38px rgba(9, 46, 30, .10);
  --radius: 14px;
  --container: 1380px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.container { width: min(var(--container), calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 999; padding: 10px 14px; background: #fff; border: 2px solid var(--green-800); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.header-inner { min-height: 108px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.brand img { width: 58px; height: 68px; object-fit: cover; object-position: center; border-radius: 42% 42% 50% 50%; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-family: "Barlow Condensed", sans-serif; font-size: 32px; text-transform: uppercase; color: var(--green-900); letter-spacing: -.02em; }
.brand-copy small { margin-top: 5px; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: #313a34; }
.brand-copy em { margin-top: 7px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--green-700); font-style: normal; font-weight: 700; }
.brand .brand-logo { width: auto; height: 62px; border-radius: 0; object-fit: contain; }
.footer-brand .brand-logo { height: 50px; padding: 8px 12px; background: #fff; border-radius: 8px; box-sizing: content-box; }
.primary-nav { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 1.8vw, 30px); margin-left: auto; }
.primary-nav a { position: relative; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 16px; text-transform: uppercase; white-space: nowrap; }
.primary-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -9px; height: 2px; background: var(--green-700); transition: right .2s ease; }
.primary-nav a:hover::after, .primary-nav a:focus-visible::after { right: 0; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-radius: 5px; font-family: "Barlow Condensed", sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, .club-link:focus-visible, .primary-nav a:focus-visible { outline: 3px solid rgba(8,117,75,.25); outline-offset: 4px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--green-700), var(--green-950)); box-shadow: 0 9px 20px rgba(0,83,52,.18); }
.btn-primary:hover { box-shadow: 0 13px 28px rgba(0,83,52,.28); }
.btn-outline { border-color: #8da99b; color: var(--green-950); background: rgba(255,255,255,.78); }
.btn-light { color: var(--green-950); background: #fff; }
.btn-small { min-height: 44px; padding-inline: 17px; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }
.club-link { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 16px; border: 1px solid #9db3a8; border-radius: 5px; color: var(--green-950); font-family: "Barlow Condensed", sans-serif; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.club-dot { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--green-900); color: #fff; font-size: 12px; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 5px; background: var(--green-900); padding: 11px; }
.menu-toggle span:not(.sr-only) { display: block; height: 2px; background: #fff; margin: 5px 0; }

.hero { position: relative; overflow: hidden; background: linear-gradient(90deg, #fff 0 41%, #edf1ef 41% 100%); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(115deg, rgba(0,83,52,.035) 1px, transparent 1px); background-size: 46px 46px; opacity: .35; pointer-events: none; }
.hero-bg-mark { position: absolute; left: 30%; top: -155px; color: rgba(0,83,52,.055); font-family: "Barlow Condensed", sans-serif; font-size: 680px; line-height: 1; font-weight: 700; transform: skewX(-13deg); user-select: none; }
.hero-grid { min-height: 438px; display: grid; grid-template-columns: 42% 58%; position: relative; z-index: 1; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 55px 48px 55px 0; }
.eyebrow { margin: 0 0 15px; color: #68706b; font-family: "Barlow Condensed", sans-serif; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.green { color: var(--green-700); }
.hero h1 { margin: 0; font-family: "Barlow Condensed", sans-serif; font-size: clamp(48px, 4.1vw, 72px); line-height: .98; letter-spacing: -.035em; }
.hero h1 span { color: var(--green-900); }
.hero-lead { max-width: 570px; margin: 28px 0 0; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-media { position: relative; min-width: 0; display: flex; align-items: center; padding: 42px 0 42px 34px; }
.hero-photo { position: relative; z-index: 2; width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; box-shadow: 0 22px 50px -18px rgba(0,40,26,.4); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.hero-accent { position: absolute; z-index: 1; top: 8%; bottom: 8%; left: 6px; width: 46px; background: rgba(0,62,41,.93); transform: skewX(-13deg); box-shadow: 0 0 0 14px rgba(0,62,41,.14); }

.pillars { background: #fff; border-top: 1px solid #ecefed; border-bottom: 1px solid #ecefed; }
.pillars-grid { display: grid; grid-template-columns: repeat(6, 1fr); }
.pillar { min-height: 106px; display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 15px; padding: 22px 18px; border-right: 1px solid var(--line); }
.pillar:last-child { border-right: 0; }
.icon-wrap { display: grid; place-items: center; }
.icon-wrap svg { width: 42px; height: 42px; fill: none; stroke: var(--green-800); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pillar h2 { margin: 0 0 4px; color: var(--green-950); font-family: "Barlow Condensed", sans-serif; font-size: 18px; text-transform: uppercase; }
.pillar p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.content-section { padding: 38px 0 56px; background: linear-gradient(180deg, #fafcfa, #fff); }
.split-layout { display: grid; grid-template-columns: 1fr 1.02fr; gap: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2, .about-copy h2, .recruitment h2 { margin: 0; color: var(--green-900); font-family: "Barlow Condensed", sans-serif; font-size: 34px; line-height: 1; }
.section-heading a { color: var(--green-800); font-family: "Barlow Condensed", sans-serif; font-size: 14px; text-transform: uppercase; font-weight: 600; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.news-card { overflow: hidden; background: #fff; border: 1px solid #e8ece9; border-radius: 7px; box-shadow: 0 8px 20px rgba(22,48,35,.07); transition: transform .2s ease, box-shadow .2s ease; }
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.news-card > img, .news-card > .news-thumb { display: block; width: 100%; aspect-ratio: 1.55; object-fit: cover; }
.news-body { position: relative; min-height: 155px; padding: 14px 14px 35px; }
.tag { display: inline-flex; padding: 2px 7px; border-radius: 3px; color: var(--green-900); background: var(--green-100); font-family: "Barlow Condensed", sans-serif; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.news-body time { display: block; margin-top: 8px; color: #7b837e; font-size: 10px; }
.news-body h3 { margin: 8px 0 0; font-family: "Barlow Condensed", sans-serif; font-size: 17px; line-height: 1.2; }
.news-body > a { position: absolute; right: 13px; bottom: 9px; color: var(--green-800); font-size: 22px; }
.about-card { display: grid; grid-template-columns: 46% 54%; grid-template-rows: auto auto; border-left: 1px solid #edf0ee; padding-left: 40px; }
.about-copy { padding-right: 28px; align-self: center; }
.about-copy > p:not(.eyebrow) { margin: 19px 0 22px; color: var(--muted); font-size: 14px; }
.about-photo { min-height: 215px; overflow: hidden; border-radius: 80px 0 0 18px; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 14px; color: #fff; background: linear-gradient(135deg, var(--green-700), var(--green-950)); border-radius: 7px; }
.stats div { padding: 15px 12px; text-align: center; border-right: 1px solid rgba(255,255,255,.18); }
.stats div:last-child { border-right: 0; }
.stats strong { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 31px; line-height: 1; }
.stats span { display: block; margin-top: 8px; font-family: "Barlow Condensed", sans-serif; font-size: 12px; text-transform: uppercase; }

.recruitment { color: #fff; background: var(--green-900); }
.recruitment-inner { min-height: 220px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.recruitment .eyebrow, .recruitment h2 { color: #fff; }
.recruitment h2 { font-size: 46px; }
.recruitment p:last-child { margin-bottom: 0; color: rgba(255,255,255,.82); }

.site-footer { padding: 52px 0 22px; color: rgba(255,255,255,.82); background: #062c20; }
.footer-grid { display: grid; grid-template-columns: 1.4fr .8fr .6fr; gap: 48px; }
.footer-brand .brand-copy strong { color: #fff; }
.footer-brand .brand-copy small { color: rgba(255,255,255,.72); }
.site-footer h2 { margin: 0 0 13px; color: #fff; font-family: "Barlow Condensed", sans-serif; font-size: 23px; text-transform: uppercase; }
.site-footer p { max-width: 420px; }
.site-footer a { display: block; margin: 4px 0; }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 35px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.footer-bottom a { display: inline; }

/* ===== DOKUMENTY (hub) ===== */
.documents { padding: 56px 0; background: var(--soft); border-top: 1px solid #ecefed; }
.documents > .container > .section-heading { margin-bottom: 8px; }
.documents .lead { margin: 0 0 26px; color: var(--muted); font-size: 15px; max-width: 640px; }
.docs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.doc-cat { background: #fff; border: 1px solid #e8ece9; border-radius: 9px; padding: 20px 20px 8px; box-shadow: 0 8px 20px rgba(22,48,35,.05); }
.doc-cat h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 9px; color: var(--green-900); font-family: "Barlow Condensed", sans-serif; font-size: 19px; text-transform: uppercase; }
.doc-cat h3 .bar { width: 8px; height: 20px; border-radius: 3px; background: linear-gradient(var(--green-700), var(--green-950)); }
.doc-cat ul { margin: 0; padding: 0; list-style: none; }
.doc-cat li { border-top: 1px solid #eef1ef; }
.doc-cat li:first-child { border-top: 0; }
.doc-cat a { display: flex; gap: 9px; align-items: flex-start; padding: 11px 0; font-size: 13.5px; font-weight: 500; color: #29342d; }
.doc-cat a:hover { color: var(--green-800); }
.doc-cat a::before { content: "PDF"; flex: 0 0 auto; margin-top: 1px; font-family: "Barlow Condensed", sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .05em; color: #fff; background: var(--green-800); padding: 2px 5px; border-radius: 3px; }
.doc-cat a.doc::before { content: "DOC"; background: #4a6b8a; }

/* ===== ERASMUS ===== */
.erasmus { padding: 56px 0; background: #fff; border-top: 1px solid #ecefed; }
.erasmus-grid { display: grid; grid-template-columns: 360px 1fr; gap: 40px; align-items: center; }
.erasmus-grid img { width: 100%; border: 1px solid var(--line); border-radius: 10px; }
.erasmus h2 { margin: 0 0 14px; color: var(--green-900); font-family: "Barlow Condensed", sans-serif; font-size: 32px; text-transform: uppercase; }
.erasmus p { margin: 0 0 9px; color: #3a463d; font-size: 15px; }
.erasmus .proj { color: var(--green-800); font-style: italic; font-weight: 500; }
.erasmus .small { font-size: 13px; color: var(--muted); }
@media (max-width: 980px) { .docs-grid { grid-template-columns: 1fr 1fr; } .erasmus-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .docs-grid { grid-template-columns: 1fr; } }

@media (max-width: 1280px) {
  .container { width: min(1180px, calc(100% - 40px)); }
  .header-actions .club-link { display: none; }
  .primary-nav { gap: 17px; }
  .pillar { grid-template-columns: 43px 1fr; padding-inline: 12px; }
  .icon-wrap svg { width: 36px; height: 36px; }
  .pillar h2 { font-size: 16px; }
  .about-card { padding-left: 28px; }
}

@media (max-width: 1050px) {
  .header-inner { min-height: 88px; }
  .brand-copy strong { font-size: 27px; }
  .menu-toggle { display: block; margin-left: auto; }
  .primary-nav { position: fixed; left: 0; right: 0; top: 88px; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 14px 24px 24px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 12px 0; border-bottom: 1px solid #eef1ef; }
  .header-actions { display: none; }
  .hero-grid { min-height: auto; grid-template-columns: 1fr; }
  .hero-copy { padding: 48px 0 34px; }
  .hero-media { padding: 0 0 24px; }
  .hero-photo { aspect-ratio: 16 / 10; }
  .pillars-grid { grid-template-columns: repeat(3, 1fr); }
  .pillar:nth-child(3) { border-right: 0; }
  .pillar:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .split-layout { grid-template-columns: 1fr; }
  .about-card { border-left: 0; padding-left: 0; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 28px, var(--container)); }
  .brand img { width: 48px; height: 56px; }
  .brand .brand-logo { height: 48px; }
  .brand-copy strong { font-size: 24px; }
  .brand-copy small { font-size: 8px; }
  .brand-copy em { display: none; }
  .hero { background: #fff; }
  .hero-grid { min-height: unset; }
  .hero-copy { padding: 42px 0 30px; }
  .hero h1 { font-size: clamp(43px, 13vw, 58px); }
  .hero-lead { margin-top: 20px; font-size: 15px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { width: 100%; }
  .pillars-grid { grid-template-columns: 1fr 1fr; }
  .pillar, .pillar:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .pillar:nth-child(even) { border-right: 0; }
  .pillar:nth-last-child(-n+2) { border-bottom: 0; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card { display: grid; grid-template-columns: 39% 61%; }
  .news-card > img, .news-card > .news-thumb { height: 100%; aspect-ratio: auto; min-height: 150px; }
  .news-body { min-height: 150px; }
  .about-card { grid-template-columns: 1fr; }
  .about-copy { padding-right: 0; }
  .about-photo { min-height: 230px; margin-top: 26px; border-radius: 24px; }
  .stats { grid-column: auto; grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.18); }
  .recruitment-inner { min-height: 280px; flex-direction: column; align-items: flex-start; justify-content: center; }
  .recruitment h2 { font-size: 40px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 470px) {
  .brand-copy small { display: none; }
  .pillars-grid { grid-template-columns: 1fr; }
  .pillar, .pillar:nth-child(even), .pillar:nth-child(3), .pillar:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .pillar:last-child { border-bottom: 0; }
  .news-card { grid-template-columns: 1fr; }
  .news-card > img, .news-card > .news-thumb { aspect-ratio: 1.7; min-height: 0; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

/* =========================================================================
   2. DODATKI WORDPRESSA
      Klasy, które generuje edytor bloków i core — bez nich treść wpisana
      przez sekretariat wygląda inaczej niż na prototypie.
   ========================================================================= */

/* Klasa a11y wymagana przez core (np. w formularzu szukania i paginacji). */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  position: fixed; left: 12px; top: 12px; z-index: 999; width: auto; height: auto;
  clip: auto; padding: 10px 14px; background: #fff; border: 2px solid var(--green-800);
  border-radius: 8px;
}

/* Menu z wp_nav_menu() jest listą <ul><li>. Prototyp miał gołe <a>, więc
   zdejmujemy znaczniki listy i przenosimy układ flex na <ul>. */
.primary-nav .nav-list {
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.8vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.primary-nav .nav-list li { list-style: none; }
.primary-nav .nav-list .current-menu-item > a::after,
.primary-nav .nav-list .current_page_item > a::after { right: 0; }

.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links li { list-style: none; }

/* Rozwijane podmenu — bez JS. :focus-within otwiera je z klawiatury, więc
   Tab przechodzi przez pozycje działu tak samo jak myszka. */
.primary-nav .nav-list > li { position: relative; }
.primary-nav .nav-list ul.sub-menu {
  position: absolute;
  top: 100%;
  left: -14px;
  z-index: 120;
  min-width: 250px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease;
}
.primary-nav .nav-list > li:hover > ul.sub-menu,
.primary-nav .nav-list > li:focus-within > ul.sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.primary-nav .nav-list ul.sub-menu a {
  display: block;
  padding: 9px 18px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
}
.primary-nav .nav-list ul.sub-menu a::after { content: none; }
.primary-nav .nav-list ul.sub-menu a:hover { color: var(--green-800); background: var(--green-50); }
/* Strzałka przy pozycjach, które mają dzieci. */
.primary-nav .nav-list > li.menu-item-has-children > a::before {
  content: "";
  position: absolute;
  right: -12px;
  top: 50%;
  width: 5px; height: 5px;
  margin-top: -4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: .55;
}
.primary-nav .nav-list > li.menu-item-has-children > a { position: relative; }

/* Lista podstron na stronie działu */
.subpages { margin: 30px 0 0; padding: 22px 24px; background: var(--green-50); border: 1px solid #e2ebe6; border-radius: 10px; }
.subpages h2 { margin: 0 0 12px; color: var(--green-900); font-family: "Barlow Condensed", sans-serif; font-size: 21px; text-transform: uppercase; }
.subpages ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 22px; margin: 0; padding: 0; list-style: none; }
.subpages li { border-top: 1px solid #e2ebe6; }
.subpages li:first-child, .subpages li:nth-child(2) { border-top: 0; }
.subpages a { display: block; padding: 10px 0; font-weight: 500; color: #29342d; }
.subpages a:hover { color: var(--green-800); }
@media (max-width: 620px) {
  .subpages ul { grid-template-columns: 1fr; }
  .subpages li:nth-child(2) { border-top: 1px solid #e2ebe6; }
}

/* Galeria — shortcode [gallery] z rdzenia WordPressa */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery .gallery-item { margin: 0 !important; width: auto !important; }
.gallery .gallery-icon img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 0 !important;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(22,48,35,.08);
  transition: transform .2s ease;
}
.gallery .gallery-icon img:hover { transform: translateY(-3px); }
.gallery .gallery-caption { margin: 6px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
@media (max-width: 900px) { .gallery, .gallery-columns-3 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .gallery, .gallery-columns-3, .gallery-columns-2 { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 1050px) {
  .primary-nav .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  /* Na mobile żadnych rozwijanek — podmenu po prostu widoczne i wcięte. */
  .primary-nav .nav-list ul.sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    padding: 0 0 6px 14px;
    border: 0;
    box-shadow: none;
    background: transparent;
  }
  .primary-nav .nav-list ul.sub-menu a { padding: 8px 0; border-bottom: 1px solid #eef1ef; }
  .primary-nav .nav-list > li.menu-item-has-children > a::before { content: none; }
}

/* Pasek admina nie może zasłaniać przyklejonego nagłówka. */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

/* Nagłówek podstrony */
.page-head { padding: 34px 0 0; }
.page-head .section-heading { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.page-head h1 {
  margin: 0; color: var(--green-900); font-family: "Barlow Condensed", sans-serif;
  font-size: 38px; line-height: 1.05;
}
.narrow { max-width: 860px; }
.narrow-article { max-width: 820px; }

/* Treść z edytora */
.prose { margin-top: 20px; color: var(--ink); font-size: 16px; }
.prose > *:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose figure, .prose blockquote { margin: 0 0 18px; }
.prose h2 {
  margin: 34px 0 12px; color: var(--green-900); font-family: "Barlow Condensed", sans-serif;
  font-size: 27px; line-height: 1.15; text-transform: uppercase;
}
.prose h3 {
  margin: 26px 0 10px; color: var(--green-950); font-family: "Barlow Condensed", sans-serif;
  font-size: 21px; line-height: 1.2;
}
.prose a { color: var(--green-800); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--green-950); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose blockquote {
  padding: 4px 0 4px 18px; border-left: 4px solid var(--green-100);
  color: var(--muted); font-style: italic;
}
.prose img, .prose figure img { border-radius: 10px; }
.prose figcaption { margin-top: 6px; color: var(--muted); font-size: 13px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th, .prose td { padding: 9px 11px; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--green-50); color: var(--green-900); }
.prose hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }

/* Wyrównania z edytora klasycznego/blokowego */
.alignleft { float: left; margin: 4px 22px 14px 0; }
.alignright { float: right; margin: 4px 0 14px 22px; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide { width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* Kafel zastępczy dla wpisów bez zdjęcia.
   Zamiast powielać jedno zdjęcie stockowe pod 175 wpisami — markowy blok
   w kolorach szkoły, z motywem skośnego „R" z hero. */
.news-thumb--empty {
  /* Blok, nie grid: kafel rozciąga się do wysokości wiersza siatki, więc
     centrowanie dawałoby rok raz wyżej, raz niżej. Pozycjonujemy na sztywno. */
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, var(--green-800), var(--green-950));
}
.news-thumb--empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(115deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 26px 26px;
}
.news-thumb-mark {
  position: absolute;
  right: -6px;
  bottom: -34px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 132px;
  font-weight: 700;
  line-height: 1;
  color: rgba(255,255,255,.10);
  transform: skewX(-13deg);
  user-select: none;
}
.news-thumb-year {
  position: absolute;
  left: 18px;
  top: 14px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .12em;
  color: rgba(255,255,255,.82);
}

/* Karta newsa: tytuł jest linkiem (w prototypie była tylko strzałka) */
.news-body h3 a:hover { color: var(--green-800); }
.news-body p.excerpt { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* Meta wpisu */
.entry-meta { margin: 0 0 8px; color: var(--green-700); font-family: "Barlow Condensed", sans-serif; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; }
.entry-figure { margin: 20px 0; }
.entry-figure img { width: 100%; border-radius: 10px; }

/* Paginacja */
.pagination { margin-top: 34px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 5px; background: #fff;
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
}
.pagination .page-numbers:hover { border-color: var(--green-700); color: var(--green-900); }
.pagination .page-numbers.current { color: #fff; background: var(--green-800); border-color: var(--green-800); }
.pagination .page-numbers.dots:hover { border-color: var(--line); }

/* Hub dokumentów: „stan na” obok nazwy pliku */
.doc-cat a small { color: var(--muted); font-weight: 400; }
.doc-cat .empty { padding: 11px 0; color: var(--muted); font-size: 13px; }

/* Kontakt/dane w stopce i na podstronach */
.contact-list { display: grid; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }

/* 404 */
.error-404 { padding: 60px 0 70px; text-align: center; }
.error-404 h1 { margin: 0 0 10px; color: var(--green-900); font-family: "Barlow Condensed", sans-serif; font-size: 84px; line-height: 1; }
.error-404 p { margin: 0 0 24px; color: var(--muted); }

/* =========================================================================
   TREŚĆ Z IMPORTU (Joomla) — ZAPORA NA INLINE STYLE
   Stary CMS zapisywał w treści style typu
   <table style="float: left; width: 720px; height: 438px;">
   albo <img style="float: left; width: 457px; height: 304px;">.
   Float wypada z flow → .prose zapada się do zera, a tabela ląduje
   NA stopce (ciemny tekst na ciemnej zieleni = nieczytelne).
   Neutralizujemy to tu, a nie w bazie, bo dotyczy całego importu.
   ========================================================================= */

/* Blok w treści nigdy nie wypada z flow. */
.prose > table,
.prose > table[style],
.prose > figure[style],
.prose > div[style] { float: none !important; }

/* Sztywne wymiary z Joomli (width/height w px oraz atrybuty width/height). */
.prose table[style],
.prose table[width],
.prose table[height] {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  margin-inline: 0 !important;
}
.prose table td[style], .prose table th[style],
.prose table td[width], .prose table th[width],
.prose table tr[style], .prose table tr[height] {
  width: auto !important;
  height: auto !important;
}

/* Ramki i kolory z atrybutów border/frame — spójne z resztą motywu. */
.prose table[border] th, .prose table[border] td { border: 1px solid var(--line) !important; }

/* Obrazki z inline float: zostawiamy oblewanie na desktopie, ale
   pilnujemy skali i marginesu, żeby nie rozpychały kolumny. */
.prose img[style] {
  max-width: 100% !important;
  height: auto !important;
}
.prose img[style*="float: left"], .prose img[style*="float:left"] { margin: 4px 22px 14px 0 !important; }
.prose img[style*="float: right"], .prose img[style*="float:right"] { margin: 4px 0 14px 22px !important; }

/* Gdyby cokolwiek jednak pływało — kontener domyka się sam. */
.prose::after { content: ""; display: table; clear: both; }
.entry-content::after { content: ""; display: table; clear: both; }

/* Mobile: szeroka tabela przewija się w poziomie zamiast rozpychać layout. */
@media (max-width: 720px) {
  .prose table { display: block; width: 100% !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prose img[style] { float: none !important; margin: 0 0 14px !important; }
}

/* ===== OKRUSZKI ===== */
/* Znaczniki BreadcrumbList idą w JSON-LD (mu-plugins/sms-seo.php), tu jest
   sama warstwa wizualna — separator z ::before, żeby nie wchodził do treści
   kopiowanej ze strony ani do czytnika ekranu. */
.breadcrumbs { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before { content: "›"; margin: 0 8px; color: #9aa8a0; }
.breadcrumbs a { color: var(--green-800); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; text-underline-offset: 2px; }
.breadcrumbs [aria-current="page"] { color: var(--muted); }
