/* =====================================================================
   parseta.pl - main.css
   Mobile-first, RWD, WCAG 2.2 AA (kontrast >= 4.5:1, widoczny focus,
   docelowe obszary klikalne >= 24x24px, obsluga prefers-reduced-motion).
   ===================================================================== */

:root {
    --color-primary: #06526e;      /* ciemny bloekit rzeki - kontrast AA na bieli */
    --color-primary-dark: #043b4e;
    --color-accent: #2f8f5b;       /* zielen - las/przyroda */
    --color-text: #1a2226;
    --color-text-muted: #4b565c;
    --color-bg: #ffffff;
    --color-bg-alt: #f2f6f7;
    --color-border: #d7dee0;
    --color-focus: #ffb703;        /* zolty - wysoki kontrast na ciemnym i jasnym tle */

    --font-base: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1200px;
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2.5rem;
    --radius: 6px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-base);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 1rem;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--color-primary-dark); }

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    background: var(--color-primary-dark);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    z-index: 1000;
    transition: top 0.2s ease-in-out;
}
.skip-link:focus {
    top: 0.5rem;
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

/* Visible, high-contrast focus indicator everywhere (WCAG 2.4.11 / 2.4.7) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Layout helpers ---------- */
.news-section__inner,
.content-area,
.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-2);
}

/* ---------- Header ---------- */
/* Tlo ujednolicone z panelem menu i stopka (var(--color-primary-dark)) -
   kontrast bialego tekstu > 10:1, bezpiecznie powyzej wymagan WCAG AA. */
.site-header {
    background: var(--color-primary-dark);
    border-bottom: 1px solid #032e3d;
    position: sticky;
    top: 0;
    z-index: 750;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100px;
    gap: var(--space-2);
    width: 100%;
    padding: 0 var(--space-3);
    box-sizing: border-box;
}
.site-header__logo { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: #fff; margin-left: var(--space-2); }
.site-header__title { display: flex; flex-direction: column; line-height: 1.1; }
.site-header__title strong { text-transform: uppercase; letter-spacing: 0.03em; font-size: 36px; }

/* Homepage: header becomes a transparent overlay on top of the hero image -
   only the "Menu" button remains visible, logo/title are hidden here since
   the site name and claim are already shown centered in the hero itself. */
.page-home .site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: transparent;
    border-bottom: none;
    z-index: 900;
}
.page-home .site-header__logo { display: none; }
.page-home .site-header__inner { justify-content: flex-end; }
.page-home .nav-toggle {
    background: rgba(4, 59, 78, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0 1rem;
}
.page-home .nav-toggle:hover { background: rgba(4, 59, 78, 0.55); }

/* Once the hero has fully scrolled out of view, the header switches to its
   normal solid appearance: background color returns, logo + site name
   become visible again, and the transitions make the swap feel smooth. */
.page-home .site-header {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.page-home .site-header.is-scrolled {
    background: var(--color-primary-dark);
    border-bottom: 1px solid #032e3d;
}
.page-home .site-header.is-scrolled .site-header__logo {
    display: flex;
}
.page-home .site-header.is-scrolled .site-header__inner {
    justify-content: space-between;
}
.page-home .site-header.is-scrolled .nav-toggle {
    background: transparent;
    text-shadow: none;
}
.page-home .site-header.is-scrolled .nav-toggle__icon,
.page-home .site-header.is-scrolled .nav-toggle__icon::before,
.page-home .site-header.is-scrolled .nav-toggle__icon::after {
    filter: none;
}

/* "Menu" toggle button - min. 44x44px target (WCAG 2.5.8), styled like a ribbon/tab */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 44px;
    padding: 0 1rem;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.nav-toggle:hover { background: rgba(255,255,255,0.15); }
.nav-toggle__label { line-height: 1; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; }
.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    position: relative;
    transition: transform 0.2s ease;
}
.nav-toggle__icon::before { content: ""; position: absolute; top: -6px; }
.nav-toggle__icon::after { content: ""; position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { transform: translateY(-6px) rotate(-45deg); }

/* Main nav: always an off-canvas panel sliding in from the right,
   on every viewport size - matching the layout of the original parseta.pl site. */
.main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 85vw);
    background: var(--color-primary-dark);
    box-shadow: -2px 0 24px rgba(0,0,0,0.3);
    /* Odstep od gory wiekszy niz wysokosc naglowka (ok. 100px), zeby
       pierwszy link nigdy fizycznie nie nachodzil na obszar naglowka/
       przycisku - to naprawia problem z klikalnoscia bez zabawy w
       z-index (patrz komentarz nizej przy .nav-toggle). */
    padding: 140px var(--space-2) var(--space-2);
    transform: translateX(100%);
    transition: transform 0.25s ease-in-out;
    overflow-y: auto;
    z-index: 700;
}
.main-nav.is-open { transform: translateX(0); }

.main-nav__list { list-style: none; margin: 0; padding: 0; }
.main-nav__item { border-bottom: 1px solid rgba(255,255,255,0.15); }
.main-nav__link {
    display: block;
    padding: var(--space-2) var(--space-1);
    text-decoration: none;
    color: #fff;
    min-height: 44px;
}
.main-nav__link:hover,
.main-nav__item.is-active .main-nav__link { color: var(--color-focus); font-weight: 600; }
.main-nav__submenu { list-style: none; margin: 0 0 var(--space-1); padding-left: var(--space-2); }
.main-nav__sublink { display: block; padding: var(--space-1); color: rgba(255,255,255,0.75); text-decoration: none; min-height: 44px; }
.main-nav__sublink:hover { color: var(--color-focus); }

/* Dimmed backdrop shown behind the open nav panel */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 600;
}


/* ---------- Hero (homepage only) - full viewport, configurable background ---------- */
.page-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary-dark);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #fff;
    text-align: center;
    overflow: hidden;
}

/* Darkening overlay so the centered text stays readable over any photo */
.page-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4,59,78,0.35), rgba(4,59,78,0.35));
}

.page-hero__content {
    position: relative;
    z-index: 1;
    padding: 0 var(--space-2);
}
.page-hero__title-wrap {
    display: inline-block;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.6);
}
.page-hero__title {
    color: #fff;
    font-size: clamp(2rem, 6vw, 3.5rem);
    letter-spacing: 0.25em;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
}
.page-hero__claim {
    color: #fff;
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: var(--space-2) 0 0;
    opacity: 0.9;
}

/* Scroll-down cue, anchored to the bottom of the hero */
.page-hero__scroll {
    position: absolute;
    left: 50%;
    bottom: var(--space-3);
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.page-hero__scroll-arrow {
    font-size: 1.5rem;
    line-height: 1;
    animation: hero-scroll-bounce 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .page-hero__scroll-arrow { animation: none; }
}
@keyframes hero-scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

.content-area a.button {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    min-height: 44px;
}
.content-area a.button:hover { background: #256e46; }

/* ---------- Content area (subpage) ---------- */
.content-area { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Kontrast na stronie szczegolow aktualnosci (domyslny szablon News/Detail.html
   rozszerzenia news, nie nadpisany przez nas) - data przyciemniona, tytul
   klasyczny czarny/ciemny, zamiast domyslnych, zbyt jasnych kolorow. */
.content-area time { color: var(--color-text-muted); }
.content-area h1,
.content-area h2,
.content-area h3 { color: var(--color-text); }

/* Teaser na stronie szczegolow aktualnosci (<div class="teaser-text">) mial
   nieusuwalny, ustawiony inline kolor o zbyt niskim kontrascie - ukrywamy
   go calkowicie, tresc glowna (bodytext) i tak jest widoczna ponizej. */
.content-area .teaser-text { display: none; }

/* ---------- News section (homepage) ---------- */
.news-section { padding: var(--space-4) 0; background: var(--color-bg-alt); }

/* The grid targets .articles (our custom List.html override's direct
   wrapper around the flat list of .article items, see
   Resources/Private/Extensions/News/Templates/News/List.html) - applying
   it to a higher-level wrapper would make that wrapper count as a single
   grid item, leaving the other columns empty. */
.news-section__list { margin-top: var(--space-3); }
.news-section__list .articles {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}
@media (min-width: 700px) {
    .news-section__list .articles { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
    .news-section__list .articles { grid-template-columns: repeat(3, 1fr); }
}

/* "Wczytaj wiecej" - custom partial (Resources/Private/Extensions/News/Partials/List/Pagination.html)
   replaces classic pagination with a single load-more trigger. */
.news-section__list .news-load-more-wrap {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: var(--space-2);
}
.news-section__list .news-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
}
.news-section__list .news-load-more:hover {
    background: var(--color-primary);
    color: #fff;
}
.news-section__list .news-load-more[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* Generic card look applied directly to EXT:news' own item markup
   (<div class="article articletype-0">), since its default templates
   don't use our custom .news-teaser classes. */
.news-section__list .article {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-2);
    overflow: hidden;
    min-height: 320px;
    box-sizing: border-box;
}
.news-section__list .article img { border-radius: var(--radius); margin-bottom: var(--space-1); width: 100%; height: 160px; object-fit: cover; }
.news-section__list .article h3,
.news-section__list .article h2 { margin-top: 0; font-size: 1.1rem; }
.news-section__list .article a { text-decoration: none; color: var(--color-primary-dark); }
.news-section__list .article time {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Kept for optional manual use (e.g. content elements styled by hand to
   look like a news card) even though EXT:news' own markup doesn't use it. */
.news-teaser {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.news-teaser__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.news-teaser__body { padding: var(--space-2); flex: 1; display: flex; flex-direction: column; }
.news-teaser__date { color: var(--color-text-muted); font-size: 0.875rem; margin: 0 0 0.25rem; }
.news-teaser__title { margin: 0 0 0.5rem; font-size: 1.1rem; }
.news-teaser__title a { text-decoration: none; color: var(--color-primary-dark); }
.news-teaser__excerpt { color: var(--color-text-muted); flex: 1; }
.news-teaser__more { margin-top: var(--space-1); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-primary-dark); color: #fff; padding: var(--space-3) 0; margin-top: var(--space-4); }
.site-footer a { color: #fff; }
.site-footer__inner { display: flex; flex-direction: column; gap: var(--space-2); align-items: center; text-align: center; }
.social-links ul { list-style: none; display: flex; gap: var(--space-2); margin: 0; padding: 0; }
.social-links a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 50%;
}
.site-footer__copy { margin: 0; font-size: 0.875rem; }

@media (min-width: 700px) {
    .site-footer__inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* Ensure sufficient color contrast for links on dark background already
   satisfied (#fff on #043b4e = contrast ratio > 10:1). */

/* ----------------------------------------------------------------------
   Dodatkowe style numerowanych list <ol> (dostepne w RTE jako "Styl" na
   zaznaczonej liscie). Domyslny styl (bez klasy) to nadal cyfry arabskie
   z kropka - to wbudowany domyslny wyglad przegladarki, bez zmian.
   ---------------------------------------------------------------------- */

/* Domyslny/podstawowy styl (jawnie wybieralny w RTE jako "reset"),
   przydatny zeby wrocic do wygladu wyjsciowego po wybraniu innego stylu. */
ol.list-decimal { list-style-type: decimal; }

/* Liczby rzymskie + kropka (np. "I.", "II.", "III.") - przegladarka sama
   dodaje kropke jako domyslny sufiks dla list-style-type: upper-roman. */
ol.list-roman { list-style-type: upper-roman; }

/* Liczby arabskie + nawias zamkniety (np. "1)", "2)") - brak wbudowanego
   list-style-type dla nawiasu, wiec znacznik budujemy recznie przez
   ::marker i wbudowany licznik "list-item". */
ol.list-decimal-paren { list-style-type: decimal; }
ol.list-decimal-paren > li::marker { content: counter(list-item) ") "; }

/* Male litery + kropka (np. "a.", "b.") - podobnie jak liczby rzymskie,
   przegladarka sama dodaje kropke dla list-style-type: lower-alpha. */
ol.list-alpha { list-style-type: lower-alpha; }

/* Male litery + nawias zamkniety (np. "a)", "b)") */
ol.list-alpha-paren { list-style-type: lower-alpha; }
ol.list-alpha-paren > li::marker { content: counter(list-item, lower-alpha) ") "; }

/* Zagniezdzanie list (przyciski "Zwieksz/Zmniejsz wciecie" w RTE) - kazdy
   poziom zagniezdzenia dostaje odpowiedni odstep i (dla list numerowanych)
   inny typ znacznika, zeby wizualnie odroznic poziomy hierarchii. */
ol ol, ul ul, ol ul, ul ol { margin-top: 0.25rem; margin-bottom: 0.25rem; }
ol ol { list-style-type: lower-alpha; }
ol ol ol { list-style-type: lower-roman; }

/* Uwaga: wciecie tekstu akapitow (poza listami) CKEditor5 zapisuje jako
   bezposredni inline styl "margin-left" na akapicie - przegladarka
   renderuje to automatycznie, bez potrzeby dodatkowego CSS. */

/* ----------------------------------------------------------------------
   Pozostale znaczniki generowane przez przyciski paska narzedzi RTE, ktore
   nie mialy jeszcze zadnego stylu (audyt: blockQuote, insertTable,
   horizontalLine, bulletedList, insertimage bez wybranego stylu).
   ---------------------------------------------------------------------- */

/* Cytat blokowy (przycisk "Cytat blokowy" / blockQuote) */
.content-area blockquote {
    margin: var(--space-3) 0;
    padding: var(--space-2) var(--space-3);
    border-left: 4px solid var(--color-primary);
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    font-style: italic;
}

/* Tabela (przycisk "Wstaw tabele" / insertTable) - przewijana w poziomie
   na waskich ekranach, zeby nie rozsadzala ukladu strony. */
.content-area table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-3) 0;
    display: block;
    overflow-x: auto;
}
.content-area table th,
.content-area table td {
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.content-area table th {
    background: var(--color-bg-alt);
    font-weight: 600;
    color: var(--color-text);
}

/* Linia poziomna (przycisk "Wstaw linie poziomna" / horizontalLine) */
.content-area hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-4) 0;
}

/* Lista wypunktowana (przycisk "Lista wypunktowana" / bulletedList) -
   bez wlasnej klasy stylu (ten przycisk nie ma opcji w menu "Styl"). */
.content-area ul:not([class]) {
    padding-left: 1.25rem;
}
.content-area ul:not([class]) li {
    margin-bottom: 0.25rem;
}

/* Obrazek wstawiony bez wybranego stylu wyrownania (domyslny odstep,
   zeby nie "kleil sie" bezposrednio do tekstu nad/pod nim). */
.content-area img:not([class]) {
    margin: var(--space-2) 0;
    border-radius: var(--radius);
}

/* Wyrownanie tekstu (przycisk "Wyrownanie" w RTE) - klasy odpowiadajace
   konfiguracji editor.config.alignment.options w Configuration/RTE/Default.yaml. */
.content-area .text-left { text-align: left; }
.content-area .text-center { text-align: center; }
.content-area .text-right { text-align: right; }
.content-area .text-justify { text-align: justify; }

/* Style wyrownania obrazkow wstawianych przez RTE (rte_ckeditor_image) -
   odpowiadaja stylom z Configuration/RTE/Default.yaml. */
.content-area img.image-left {
    float: left;
    margin: 0.25rem var(--space-2) var(--space-2) 0;
    max-width: 50%;
    height: auto;
}
.content-area img.image-right {
    float: right;
    margin: 0.25rem 0 var(--space-2) var(--space-2);
    max-width: 50%;
    height: auto;
}
.content-area img.image-full-width {
    display: block;
    width: 100%;
    height: auto;
    margin: var(--space-2) 0;
}

/* Osadzona mapa (np. iframe/div z id="mapa" wklejony recznie w tresci) */
#mapa {
    width: 100%;
    height: 800px;
}

