/* ==========================================================================
   1. WCAG I SKALOWANIE
   ========================================================================== */
html { font-size: 16px; transition: font-size 0.2s; }
html.zoom-normal { font-size: 16px; }
html.zoom-large  { font-size: 20px; }
html.zoom-xlarge { font-size: 24px; }

body { font-family: 'Fira Sans', sans-serif; line-height: 1.6; color: #333; background: #f5f5f5; margin: 0; }
h1 { color: #cc0000 !important; font-size: 1.8rem; border-bottom: 2px solid #cc0000; padding-bottom: 0.5rem; }

/* ==========================================================================
   2. NAGŁÓWEK
   ========================================================================== */
.header .inner.wrapper--960 {
    display: flex !important; flex-wrap: wrap !important;
    justify-content: space-between !important; align-items: center !important;
    max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem;
}
.wcag-controls { display: flex !important; gap: 0.5rem; padding: 0.5rem; background: #eee; border-radius: 4px; margin-left: auto !important; order: 2; }
.logo-title, .entity-name { flex-basis: 100% !important; display: block !important; order: 3; }
.logo-title { font-size: 2.2rem; font-weight: 800; color: #cc0000; text-transform: uppercase; margin-top: 1rem; line-height: 1.1; }
.entity-name { font-size: 1.2rem; font-weight: 500; color: #444; margin-top: 0.2rem; }

.wcag-controls button { 
    cursor: pointer; border: 1px solid #ccc; background: #fff; 
    width: 2.5rem; height: 2.5rem; display: inline-flex; 
    align-items: center; justify-content: center; font-weight: bold; 
}
.wcag-controls button.z1::after { content: "A"; font-size: 0.9rem; }
.wcag-controls button.z2::after { content: "A"; font-size: 1.2rem; }
.wcag-controls button.z3::after { content: "A"; font-size: 1.5rem; }
.switch-highcontrast::before { content: "\25D1"; font-size: 1.2rem; }
.wcag-text-switch::before { content: "T"; font-size: 1.2rem; font-family: serif; }

/* ==========================================================================
   3. MENU I UKŁAD
   ========================================================================== */
#content .inner { display: flex; max-width: 60rem; margin: 1.5rem auto; background: #fff; padding: 1.5rem; box-shadow: 0 0 0.5rem rgba(0,0,0,0.1); }
aside#menu { flex: 0 0 16rem; margin-right: 2rem; }
#contents { flex: 1; min-width: 0; }

.menu { list-style: none; padding: 0; margin: 0; border: 1px solid #ddd; }
.menu li a { 
    display: block !important; padding: 0.75rem 1rem !important; 
    text-decoration: none !important; color: #444 !important; 
    background-color: #f9f9f9 !important; border-bottom: 1px solid #eee !important; 
}
.menu li a:hover, .menu li.selected a { background-color: #cc0000 !important; color: #ffffff !important; }

/* ==========================================================================
   4. TABELA ARCHIWUM (STONOWANA)
   ========================================================================== */
table.candytable { width: 100%; border-collapse: collapse; margin: 1rem 0; background: #fff; border: 1px solid #ddd; }
table.candytable thead tr { background-color: #444 !important; color: #ffffff !important; }
table.candytable thead td { padding: 0.8rem; font-weight: bold; color: #fff !important; font-size: 0.9rem; }
table.candytable tbody td { padding: 0.7rem 0.8rem; border: 1px solid #eee; color: #555; font-size: 0.9rem; }
table.candytable tbody tr:nth-child(even) { background-color: #fafafa; }
table.candytable td.controls a { color: #cc0000; font-weight: 600; text-decoration: none; }
table.candytable td.controls a:hover { text-decoration: underline; }

/* ==========================================================================
   5. RWD I TRYBY WCAG
   ========================================================================== */
@media (max-width: 850px) {
    .header .inner.wrapper--960, #content .inner { flex-direction: column !important; }
    aside#menu { width: 100%; margin-right: 0; margin-bottom: 2rem; }
}

/* KONTRASTY */
body.contrast-yb, body.contrast-yb * { background-color: #000 !important; color: #ff0 !important; border-color: #ff0 !important; }
body.contrast-bw, body.contrast-bw * { background-color: #fff !important; color: #000 !important; border-color: #000 !important; }

/* TRYB TEKSTOWY (TYLKO RAMKI DLA TABELI) */
body.text-only { background: #fff !important; color: #000 !important; }
body.text-only .header, body.text-only #content .inner { display: block !important; box-shadow: none !important; }
body.text-only table.candytable { border: 1px solid #000 !important; background: none !important; }
body.text-only table.candytable thead tr { background: none !important; border-bottom: 2px solid #000 !important; }
body.text-only table.candytable thead td { color: #000 !important; }
body.text-only table.candytable td { border: 1px solid #000 !important; color: #000 !important; }
body.text-only table.candytable tr { background: none !important; }