/* ==========================================================================
   1. RESET I STYLE PODSTAWOWE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #f4f6f7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.2s, color 0.2s;
}

/* Link szybkiego dostępu (skipping) dla osób poruszających się klawiaturą */
.skip-link {
    position: absolute;
    top: -100px;
    left: 10px;
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.skip-link:focus {
    top: 10px;
}

/* Ukrywanie elementów przeznaczonych wyłącznie dla czytników ekranu */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   2. NAGŁÓWEK, LOGO SVG I NAWIGACJA
   ========================================================================== */
header {
    background-color: #1a5276;
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Nowe style integracji Logo SVG z napisem tekstowym */
.header-logo-svg-link {
    display: inline-flex;
    align-items: center;
}

.header-logo-svg {
    height: 55px;
    width: auto;
    display: block;
    object-fit: contain;
}

.logo {
    font-size: 1.5em;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo span {
    color: #5dade2;
}

/* Panel Dostępności Cyfrowej */
.accessibility-panel {
    display: flex;
    gap: 5px;
    align-items: center;
}

.accessibility-panel button {
    background-color: #2980b9;
    color: white;
    border: 1px solid #3498db;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.9em;
}

.accessibility-panel button:hover, 
.accessibility-panel button:focus {
    background-color: #1f618d;
    outline: 2px solid #fff;
}

/* Menu Nawigacyjne witryny */
nav {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    position: relative;
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: white;
    left: 0;
}
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 10px;
}

.nav-link {
    color: #eaf2f8;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}

.nav-link:hover, .nav-link:focus {
    background-color: #2980b9;
    color: white;
}

.nav-link.active {
    background-color: #196f3d;
    color: white;
}

/* ==========================================================================
   3. KONTENER GŁÓWNY I WIDOKI STRON
   ========================================================================== */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
}

main:focus {
    outline: none;
}

.page-view {
    display: none;
}

.page-view.active-view {
    display: block;
}

.card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin: 0 auto;
    max-width: 800px;
}

h1 {
    color: #1a5276;
    margin-bottom: 20px;
    font-size: 2em;
}

.home-intro {
    font-size: 1.1em;
    color: #566573;
    margin-bottom: 35px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.status-badge {
    display: inline-block;
    background-color: #ebf5fb;
    color: #2e86de;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   4. AKTUALNOŚCI (SIATKA KAFELKOWA I ARTYKUŁY) - NAPRAWIONE OBRAZKI I PRZYCISKI
   ========================================================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.news-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0; /* Wyzerowane dopasowanie dla estetycznego kadru */
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
}

/* Kontener obrazka w kafelku - zapobiega rozjeżdżaniu na szerokość */
.news-card-image-wrapper {
    width: 100%;
    height: 190px;
    overflow: hidden;
    background-color: #eaeded;
}

.news-card-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-img {
    transform: scale(1.03);
}

/* Wewnętrzny padding tekstu w kafelku */
.news-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.news-card-meta {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 600;
}

.news-date {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 15px;
    text-align: left;
    font-weight: 600;
}

.news-card-title {
    font-size: 1.25em;
    color: #1a5276;
    margin-bottom: 12px;
    line-height: 1.4;
}

.news-card-excerpt {
    font-size: 0.95em;
    color: #4a5568;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* ZMIANA: Nowy, ładniejszy przycisk czytaj więcej */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #1a5276;
    color: #ffffff;
    border: none;
    padding: 11px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95em;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    width: 100%;
    position: relative;
    box-shadow: 0 2px 4px rgba(26, 82, 118, 0.15);
}

.btn-read-more::after {
    content: '→';
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.btn-read-more:hover {
    background-color: #154360;
    box-shadow: 0 4px 8px rgba(21, 67, 96, 0.25);
    color: white;
}

.btn-read-more:hover::after {
    transform: translateX(4px);
}

.btn-read-more:focus {
    background-color: #154360;
    color: white;
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

.btn-read-more:active {
    transform: scale(0.98);
}

/* Kontener obrazka w rozwinięciu artykułu - zapobiega rozciąganiu */
.news-full-image-wrapper {
    width: 100%;
    max-height: 380px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 25px;
    background-color: #eaeded;
}

.news-full-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

/* Podstawowy styl przycisku powrotu w rozwinięciu newsa */
.btn-back-to-home {
    background-color: #1a5276;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 25px;
    transition: background-color 0.2s;
}

.btn-back-to-home:hover, .btn-back-to-home:focus {
    background-color: #154360;
}

/* ==========================================================================
   5. PROFILE USŁUG, TABELE TARYFOWE I DANE BANKOWE
   ========================================================================== */
.card-offer {
    max-width: 900px;
}

.offer-intro {
    margin-bottom: 20px;
    font-weight: 500;
    color: #333;
}

/* Dane konta bankowego */
.bank-account-box {
    background-color: #eef7fc;
    border-left: 4px solid #1a5276;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 30px;
    text-align: left;
}

.bank-account-title {
    color: #1a5276;
    display: block;
    margin-bottom: 5px;
}

.bank-account-number {
    font-family: monospace;
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
    letter-spacing: 0.5px;
}

/* Nagłówki sekcji tabel */
.table-section-title {
    font-size: 1.3em;
    text-align: left;
    margin: 25px 0 10px 0;
    padding-bottom: 5px;
}

.title-individual {
    color: #1a5276;
    border-bottom: 2px solid #1a5276;
}

.title-others {
    color: #196f3d;
    border-bottom: 2px solid #196f3d;
}

/* Responsywność i podstawowa struktura tabel */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 35px;
    -webkit-overflow-scrolling: touch;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    line-height: 1.5;
}

.table-custom th {
    padding: 10px 12px;
    border: 1px solid #ddd;
    font-weight: bold;
}

.table-custom td {
    padding: 10px 12px;
    border: 1px solid #ddd;
}

/* Kolorystyka nagłówków tabel */
.table-individual thead tr {
    background-color: #1a5276;
    color: #ffffff;
}

.table-others thead tr {
    background-color: #196f3d;
    color: #ffffff;
}

/* Formatowanie i klasy pomocnicze dla komórek */
.table-custom .text-right {
    text-align: right;
}

.table-custom .text-center {
    text-align: center;
}

.table-custom .text-bold {
    font-weight: bold;
}

.table-custom .row-striped {
    background-color: #f9f9f9;
}

/* ==========================================================================
   6. PODSTRONA RODO
   ========================================================================== */
.rodo-content {
    line-height: 1.7;
    color: #2c3e50;
}

.rodo-subheading {
    font-size: 1.2em;
    color: #1a5276;
    margin: 25px 0 10px 0;
    border-bottom: 1px solid #d5dbdb;
    padding-bottom: 4px;
    font-weight: 700;
}

.rodo-list {
    margin: 10px 0 20px 25px;
}

.rodo-list li {
    margin-bottom: 8px;
}

/* ==========================================================================
   7. STOPKA STRONY
   ========================================================================== */
footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    font-size: 0.9em;
    border-top: 4px solid #1a5276;
}

/* ==========================================================================
   8. TRYB WYSOKIEGO KONTRASTU (WCAG - CZARNO-ŻÓŁTY) - DOPASOWANY DO ZMIAN
   ========================================================================== */
body.high-contrast {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

body.high-contrast header, 
body.high-contrast footer {
    background-color: #000000 !important;
    border-bottom: 2px solid #ffff00 !important;
    border-top: 2px solid #ffff00 !important;
}

body.high-contrast .card,
body.high-contrast .news-card,
body.high-contrast .contact-info-container,
body.high-contrast .opening-hours-container,
body.high-contrast .emergency-banner,
body.high-contrast .bank-account-box {
    background-color: #000000 !important;
    border: 2px solid #ffff00 !important;
    color: #ffff00 !important;
}

body.high-contrast table,
body.high-contrast th,
body.high-contrast td {
    border: 1px solid #ffff00 !important;
    background-color: #000000 !important;
    color: #ffff00 !important;
}

body.high-contrast th {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

body.high-contrast a,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast strong,
body.high-contrast .logo span,
body.high-contrast .news-card-title,
body.high-contrast .rodo-subheading {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

body.high-contrast button,
body.high-contrast .btn-read-more,
body.high-contrast .btn-back-to-home,
body.high-contrast .nav-link {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
    box-shadow: none !important;
}

body.high-contrast button:hover, 
body.high-contrast button:focus,
body.high-contrast .btn-read-more:hover,
body.high-contrast .btn-read-more:focus,
body.high-contrast .btn-back-to-home:hover,
body.high-contrast .btn-back-to-home:focus,
body.high-contrast .nav-link.active {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

body.high-contrast .btn-read-more::after {
    content: ' →' !important;
}

body.high-contrast .btn-read-more:hover::after {
    transform: none !important;
}

/* Ramki i maskowanie kontenerów obrazków w trybie wysokiego kontrastu */
body.high-contrast .news-card-image-wrapper,
body.high-contrast .news-full-image-wrapper {
    border-bottom: 2px solid #ffff00 !important;
}

/* Inwersja/wymuszenie widoczności logo SVG w trybie wysokiego kontrastu */
body.high-contrast .header-logo-svg {
    filter: brightness(0) saturate(100%) invert(93%) sepia(91%) saturate(2288%) hue-rotate(359deg) brightness(104%) contrast(105%);
}

/* ==========================================================================
   9. RWD (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 10px;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-link {
        display: block;
        padding: 12px;
        width: 100%;
    }

    .card {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .header-logo-svg {
        height: 42px;
    }
    .logo {
        font-size: 1.3em;
    }
}