/* ============================================
   ŻŁOBEK NA SKRZYDŁACH — GLOBAL STYLES
   ============================================ */

:root {
    --gold: #E8A317;
    --gold-light: #F5C94C;
    --gold-dark: #C78B0A;
    --gold-bg: #FFF8E7;
    --gray: #6B6B6B;
    --gray-dark: #3D3D3D;
    --gray-light: #9A9A9A;
    --text: #2D2D2D;
    --text-light: #5A5A5A;
    --bg: #FFFFFF;
    --bg-alt: #FDF9F0;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 40px rgba(0,0,0,0.10);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

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

a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--gold);
}

h1, h2, h3, h4 {
    font-family: 'Quicksand', sans-serif;
    color: var(--gray-dark);
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: break-word;
}

h1:focus, h1:focus-visible {
    outline: none;
    box-shadow: none;
    border: none;
}

.highlight {
    color: var(--gold);
}

/* ========== REUSABLE ========== */

.section {
    padding: 80px 20px;
}

.section-alt {
    background: var(--bg-alt);
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--gold-bg);
    color: var(--gold-dark);
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 50px;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-header h2 {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 14px;
}

.section-desc {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    padding: 0 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gold);
    color: #fff;
    box-shadow: 0 4px 16px rgba(232,163,23,0.3);
}

.btn-primary:hover {
    background: var(--gold-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(232,163,23,0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.8);
    color: var(--gray-dark);
    border: 2px solid rgba(107,107,107,0.2);
}

.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

/* Blazor error boundary */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Wystąpił błąd."
}

/* ========== MOBILE GLOBALS ========== */
@media (max-width: 768px) {
    .section {
        padding: 60px 16px;
    }

    .section-header {
        margin-bottom: 36px;
    }

    .btn {
        padding: 11px 24px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 48px 14px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* ========== WCAG — ROZMIAR TEKSTU (widget w nawigacji) ========== */
html.text-size-small  { font-size: 87.5%; }  /* 14px */
html.text-size-medium { font-size: 100%; }   /* 16px (default) */
html.text-size-large  { font-size: 125%; }   /* 20px */

.wcag-nav-item {
    gap: 4px;
    padding: 0 8px;
}

.wcag-nav-label {
    color: #5A5A5A;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 6px;
    white-space: nowrap;
}

.wcag-btn {
    background: transparent;
    color: #5A5A5A;
    border: 1px solid rgba(107, 107, 107, 0.3);
    border-radius: 4px;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    margin-left: 2px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wcag-btn:hover,
.wcag-btn:focus-visible {
    background: #FFF8E7;
    border-color: #E8A317;
    color: #C78B0A;
    outline: none;
}

.wcag-btn.is-active {
    background: #E8A317;
    border-color: #E8A317;
    color: #fff;
}

.wcag-btn-sm { font-size: 12px; }
.wcag-btn-md { font-size: 15px; }
.wcag-btn-lg { font-size: 19px; }

.wcag-btn-contrast {
    font-size: 16px;
}

@media (max-width: 991.98px) {
    .wcag-nav-item {
        padding: 6px 14px;
        justify-content: flex-start;
    }
}

/* ========== PRZYCISK „WRÓĆ NA GÓRĘ" ========== */
.scroll-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(232, 163, 23, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition), background var(--transition);
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--gold-dark);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 26px rgba(232, 163, 23, 0.5);
}

.scroll-top:focus-visible {
    outline: 3px solid var(--gold-dark);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .scroll-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }
}

/* ========== WCAG — WYSOKI KONTRAST (czarne tło, żółty tekst) ========== */
/* Reset bazowy: wszystko czarne, żółty tekst i obramowania, bez cieni / gradientów / rozmyć.
   Klasa .high-contrast jest na <html>, więc obowiązuje na każdej podstronie. */
html.high-contrast,
html.high-contrast *,
html.high-contrast *::before,
html.high-contrast *::after {
    background-color: #000 !important;
    background-image: none !important;
    color: #FFFF00 !important;
    border-color: #FFFF00 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Linki — podkreślone, by odróżnić je od zwykłego tekstu; hover/focus = inwersja kolorów */
html.high-contrast a {
    color: #FFFF00 !important;
    text-decoration: underline !important;
}

html.high-contrast a:hover,
html.high-contrast a:focus-visible {
    background-color: #FFFF00 !important;
    color: #000 !important;
}

/* Przyciski, pola formularza, „pigułki", karty i kafelki — żółta ramka dla widoczności kształtu */
html.high-contrast .btn,
html.high-contrast button,
html.high-contrast input,
html.high-contrast textarea,
html.high-contrast select,
html.high-contrast .nav-cta,
html.high-contrast .nav-back,
html.high-contrast .section-tag,
html.high-contrast .hub-type,
html.high-contrast .hub-btn,
html.high-contrast .hub-content,
html.high-contrast .nowa-tile,
html.high-contrast .nowa-kind,
html.high-contrast .nowa-badge,
html.high-contrast .about-card,
html.high-contrast .offer-card,
html.high-contrast .review-card,
html.high-contrast .contact-card,
html.high-contrast .contact-form,
html.high-contrast .zapisy-info,
html.high-contrast .zapisy-download,
html.high-contrast .zapisy-email,
html.high-contrast .loc-hero-type,
html.high-contrast .pue-lead,
html.high-contrast .pue-fact,
html.high-contrast .pue-task,
html.high-contrast .pue-task-num,
html.high-contrast .pue-doc,
html.high-contrast .scroll-top,
html.high-contrast .wcag-btn {
    border: 2px solid #FFFF00 !important;
}

/* Stan hover / focus / aktywny — czytelna inwersja (czarny tekst na żółtym tle) */
html.high-contrast .btn:hover,
html.high-contrast .btn:focus-visible,
html.high-contrast button:hover,
html.high-contrast button:focus-visible,
html.high-contrast .hub-btn:hover,
html.high-contrast .zapisy-download:hover,
html.high-contrast .zapisy-email:hover,
html.high-contrast .pue-doc:hover,
html.high-contrast .scroll-top:hover,
html.high-contrast .scroll-top:focus-visible,
html.high-contrast .wcag-btn:hover,
html.high-contrast .wcag-btn:focus-visible,
html.high-contrast .wcag-btn.is-active {
    background-color: #FFFF00 !important;
    color: #000 !important;
    border-color: #FFFF00 !important;
}

/* Tekst w elementach po inwersji też musi być czarny (dot. zagnieżdżonych <span>) */
html.high-contrast .btn:hover *,
html.high-contrast .zapisy-download:hover *,
html.high-contrast .pue-doc:hover *,
html.high-contrast .wcag-btn:hover *,
html.high-contrast .wcag-btn:focus-visible *,
html.high-contrast .wcag-btn.is-active * {
    color: #000 !important;
}

/* Placeholder w polach formularza */
html.high-contrast ::placeholder {
    color: #CCCC00 !important;
    opacity: 1 !important;
}

/* Hero placówki — pełne czarne tło pod tekstem (jasna nakładka zasłania zdjęcie dla czytelności) */
html.high-contrast .loc-hero-overlay {
    background: #000 !important;
    opacity: 1 !important;
}

/* Pasek nawigacji w kontraście — czarne tło, żółte linki i przyciski.
   Style nawigacji są w scoped CSS z !important, więc potrzebne są bardziej
   specyficzne selektory (html.high-contrast .nav-* ) niż globalny reset. */
html.high-contrast .site-nav {
    background: #000 !important;
    border-bottom: 2px solid #FFFF00 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.high-contrast .nav-logo,
html.high-contrast .nav-logo:hover,
html.high-contrast .nav-link,
html.high-contrast .nav-cta,
html.high-contrast .nav-back {
    color: #FFFF00 !important;
    background-color: #000 !important;
}

html.high-contrast .nav-link:hover,
html.high-contrast .nav-link:focus-visible,
html.high-contrast .nav-cta:hover,
html.high-contrast .nav-cta:focus-visible,
html.high-contrast .nav-back:hover,
html.high-contrast .nav-back:focus-visible {
    color: #000 !important;
    background-color: #FFFF00 !important;
}

/* Hamburger (menu mobilne) — żółta ikona i ramka (reset wyłączał ikonę tła) */
html.high-contrast .navbar-toggler {
    border: 2px solid #FFFF00 !important;
}

html.high-contrast .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23FFFF00' stroke-width='2.5' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

html.high-contrast .site-footer {
    border-top: 2px solid #FFFF00 !important;
}

/* Treść stron placówek w kontraście — style są scoped (wyższa specyficzność niż
   globalny reset), więc celujemy w <main> z podwojoną klasą dla odpowiedniej wagi.
   <img> pozostają widoczne (reset zdejmuje tylko tła CSS, nie zawartość obrazków). */
html.high-contrast.high-contrast main,
html.high-contrast.high-contrast main *,
html.high-contrast.high-contrast main *::before,
html.high-contrast.high-contrast main *::after {
    background-color: #000 !important;
    background-image: none !important;
    color: #FFFF00 !important;
}

/* Hover karty kontaktu nie może rozjaśniać tła (scoped :hover ma (0,3,0)) */
html.high-contrast .contact-card:hover {
    background-color: #000 !important;
}

/* Oś czasu (plan dnia) — linia i kropki na żółto, by były widoczne */
html.high-contrast .timeline::before,
html.high-contrast .tl-item::before {
    background: #FFFF00 !important;
}

/* Strona /projekt-ue w kontraście — cała zawartość .pue-page na czarno-żółto */
html.high-contrast .pue-page,
html.high-contrast .pue-page *,
html.high-contrast .pue-page *::before,
html.high-contrast .pue-page *::after {
    background-color: #000 !important;
    background-image: none !important;
    color: #FFFF00 !important;
}

/* Selektory złożone scoped (np. .pue-section > h2) — wyższa specyficzność, by je przebić */
html.high-contrast .pue-section h2,
html.high-contrast .pue-section p,
html.high-contrast .pue-task p,
html.high-contrast .pue-task-head h3,
html.high-contrast .pue-lead em {
    color: #FFFF00 !important;
}

html.high-contrast .pue-section h2 {
    border-bottom-color: #FFFF00 !important;
}

html.high-contrast .pue-header {
    border-bottom: 2px solid #FFFF00 !important;
}

html.high-contrast .pue-back,
html.high-contrast .pue-hashtags a {
    text-decoration: underline !important;
}
