:root{
--primary:#8b0000;
--bg:#eef2f7;
--card:#ffffff;
--border:#d8dee8;
--text:#222;
}

/* =========================
   BODY
========================= */

body{
margin:0;
font-family:Segoe UI, Arial, sans-serif;
background-image:url('background.png');
background-repeat:repeat-y;
background-position:center top;
background-size:100% auto;
color:var(--text);
}

/* =========================
   HEADER
========================= */

header{
background:linear-gradient(
to right,
#ffffff 0%,
#ffffff 30%,
#f4b6bf 45%,
#e30613 70%,
#c4001a 100%
);
border-bottom:1px solid #ddd;
}

/* górny pasek */

.header-top{
display:flex;
justify-content:space-between;
align-items:center;
padding:4px 20px;
font-size:14px;
}

.header-tools{
display:flex;
gap:6px;
}

.tool-btn{
border:1px solid #ccc;
background:white;
padding:4px 10px;
border-radius:4px;
cursor:pointer;
}

.tool-btn:hover{
background:#eee;
}

/* główny header */

.header-main{
display:flex;
align-items:center;
justify-content:space-between;
padding:6px 20px;
}

/* logo bip */

.logo-bip img{
height:65px;
}

/* tytuł */

.header-title{
flex:1;
text-align:center;
}

.header-title h3{
margin:0;
font-size:20px;
line-height:1.2;
}

/* prawa część */

.header-right{
display:flex;
align-items:center;
gap:15px;
}

.header-right img{
height:80px;
}

/* wyszukiwarka */

.header-search{
padding:6px 20px;
background:#fafafa;
border-top:1px solid #eee;
}

.header-search form{
display:flex;
max-width:400px;
}

.header-search input{
flex:1;
padding:6px;
border:1px solid #ccc;
border-right:none;
}

.header-search button{
background:white;
color:black;
border:none;
padding:6px 14px;
cursor:pointer;
}

/* =========================
   LAYOUT
========================= */

.wrapper{
max-width:1300px;
margin:auto;
}

.container{
display:flex;
gap:20px;
padding:20px;
}

/* =========================
   MENU
========================= */

nav{
background:var(--card);
border:1px solid var(--border);
padding:15px;
border-radius:6px;
width:260px;
}

nav h3{
margin-top:0;
}

nav ul{
list-style:none;
padding:0;
}

nav li{
margin-bottom:6px;
}

nav a{
display:block;
padding:7px;
border-radius:4px;
text-decoration:none;
color:var(--text);
}

nav a:hover{
background:#f0f3f7;
}

.menu-separator{
border-top:1px solid #ddd;
margin:10px 0;
list-style:none;
}

/* =========================
   CONTENT
========================= */

main{
background:var(--card);
border:1px solid var(--border);
padding:25px;
border-radius:6px;
flex:1;
}

h2{
margin-top:0;
border-bottom:2px solid var(--primary);
padding-bottom:3px;
}

/* =========================
   TREŚĆ
========================= */

.bip-content{
background:white;
padding:20px;
border:1px solid #ddd;
margin-bottom:10px;
line-height:1.4;
}

/* =========================
   ARTYKUŁY
========================= */

.bip-article{
background:white;
border:1px solid #ddd;
padding:15px;
margin-bottom:12px;
}

.bip-article h3{
margin:0 0 5px 0;
}

.bip-article a{
text-decoration:none;
color:#c0001a;
}

.bip-article-meta{
font-size:13px;
color:#666;
}

/* =========================
   METRYKA
========================= */

.bip-metryka{
background:#fafafa;
border:1px solid #ddd;
padding:15px;
margin-top:20px;
}

/* =========================
   HISTORIA
========================= */

.bip-history table{
width:100%;
border-collapse:collapse;
background:white;
}

.bip-history th{
background:#f0f0f0;
padding:8px;
border:1px solid #ddd;
}

.bip-history td{
padding:8px;
border:1px solid #ddd;
}

/* =========================
   REJESTR
========================= */

.rejestr{
width:100%;
border-collapse:collapse;
margin-top:20px;
background:white;
}

.rejestr th{
background:#f0f0f0;
padding:8px;
border:1px solid #ddd;
}

.rejestr td{
padding:8px;
border:1px solid #ddd;
text-decoration:none;
text-color:black;
}

/* =========================
   PAGINACJA
========================= */

.pagination{
margin-top:20px;
}

.pagination a{
padding:6px 10px;
margin:2px;
border:1px solid #ccc;
text-decoration:none;
color:black;
}

.pagination a.active{
background:#c0001a;
color:white;
}

/* =========================
   SITEMAP
========================= */

.sitemap{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
gap:15px;
margin-top:20px;
}

.sitemap-category{
background:white;
border:1px solid #ddd;
padding:15px;
}

.count{
color:#888;
margin-left:5px;
}

/* =========================
   FOOTER
========================= */

footer{
margin-top:20px;
background:#333;
color:white;
padding:15px;
text-align:center;
}

/* =========================
   TRYB KONTRASTU
========================= */

body.contrast{
background:#000;
color:#fff;
}

body.contrast header{
background:#000;
}

body.contrast nav,
body.contrast main,
body.contrast .bip-content,
body.contrast .bip-article,
body.contrast .bip-metryka{
background:#000;
color:#fff;
border-color:#555;
}

body.contrast table{
background:#000;
color:#fff;
}

body.contrast th{
background:#222;
}

body.contrast td{
border-color:#555;
}

body.contrast a{
color:#ffff00;
}

/* =========================
   RESPONSYWNOŚĆ
========================= */

@media (max-width:900px){

.container{
flex-direction:column;
}

nav{
width:100%;
}

nav ul{
display:flex;
flex-wrap:wrap;
gap:6px;
}

nav a{
background:#f2f2f2;
padding:6px 10px;
}

}

@media (max-width:600px){

.header-main{
flex-direction:column;
text-align:center;
gap:10px;
}

.header-right{
justify-content:center;
}

.logo-bip img{
height:45px;
}

.header-right img{
height:60px;
}

.header-search form{
flex-direction:column;
gap:6px;
align-items:center;
}

.header-search input{
width:90%;
}

nav ul{
flex-direction:column;
}

nav a{
background:none;
border-bottom:1px solid #ddd;
}

}
/* NAPRAWA HEADERA DESKTOP */

.header-main{
display:flex;
align-items:center;
justify-content:space-between;
padding:5px 20px;
}

.logo-bip{
margin-right:10px;
}

.header-title{
flex:1;
text-align:center;
}

.header-title h3{
margin:0;
font-size:20px;
line-height:1.2;
}

.header-right{
display:flex;
align-items:center;
gap:15px;
}

.header-right img{
height:60px;
}

.header-right a{
text-decoration:none;
display:inline-block;
}
/* =========================
   HEADER JEDNA LINIA
========================= */

header{
background:linear-gradient(
to right,
#ffffff 0%,
#ffffff 30%,
#f4b6bf 45%,
#e30613 70%,
#c4001a 100%
);
padding:4px 15px;
}

.header-top{
display:none;
}

/* główny pasek */

.header-main{
display:flex;
align-items:center;
gap:15px;
}

/* logo BIP */

.logo-bip img{
height:70px;
}

/* tytuł */

.header-title{
white-space:nowrap;
}

.header-title h3{
margin:0;
font-size:16px;
line-height:1.1;
}

/* prawa strona */

.header-right{
display:flex;
align-items:center;
gap:10px;
}

.header-right img{
height:60px;
}

/* wyszukiwarka */

.header-search{
margin-left:auto;
background:none;
border:none;
padding:0;
}

.header-search form{
display:flex;
}

.header-search input{
height:28px;
padding:4px 8px;
border:1px solid #ccc;
}

.header-search button{
height:30px;
background:white;
color:black;
border:none;
padding:0 10px;
cursor:pointer;
}

/* narzędzia */

.header-tools{
display:flex;
gap:6px;
margin-left:10px;
}

.tool-btn{
padding:3px 8px;
font-size:13px;
}
/* =========================
   HEADER – JEDNA LINIA
========================= */

header{
background:linear-gradient(
to right,
#ffffff 0%,
#fffafa 20%,
#ffe5e5 40%,
#ff8a8a 60%,
#ff7575 70%,
#ff4d4d 80%,
#ff4d4d 90%,
#ff4d4d 100%
);
padding:4px 15px;
}

/* całość w jednej linii */

header{
display:flex;
align-items:center;
gap:15px;
flex-wrap:nowrap;
}

/* ukrywamy podział sekcji */

.header-top,
.header-main,
.header-search{
display:contents;
}

/* data */

.header-date{
font-size:13px;
color:#444;
white-space:nowrap;
}

/* tools */

.header-tools{
display:flex;
gap:5px;
}

.tool-btn{
padding:3px 8px;
font-size:13px;
border:1px solid #ccc;
background:white;
cursor:pointer;
border-radius:4px;
}

/* logo BIP */

.logo-bip img{
height:70px;
}

/* tytuł */

.header-title{
white-space:nowrap;
}

.header-title h3{
margin:0;
font-size:26px;
line-height:1.1;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
color:#2c2c2c;
letter-spacing: 2px;
}
.header-title h4{
margin:0;
font-size:18px;
line-height:1.1;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
color:#2c2c2c;
letter-spacing: 2px;
}

/* loga po prawej */

.header-right{
display:flex;
align-items:center;
gap:10px;
}

.header-right img{
height:60px;
}

/* wyszukiwarka */

.header-search form{
display:flex;
margin-left:auto;
}

.header-search input{
height:20px;
padding:4px 8px;
border:1px solid #ccc;
}

.header-search button{
height:28px;
background:white;
color:black;
border:none;
padding:0 10px;
margin-left: 5px;
cursor:pointer;
}
/* =========================
   MOBILE HEADER FIX
========================= */

@media (max-width:1400px){

header{
flex-wrap:wrap;
justify-content:center;
text-align:center;
padding:8px;
gap:8px;
background:#ffe5e5 !important;
}

/* data */

.header-date{
width:100%;
text-align:center;
}

/* narzędzia */

.header-tools{
width:100%;
justify-content:center;
}

/* logo bip */

.logo-bip{
width:100%;
display:flex;
justify-content:center;
}

.logo-bip img{
height:70px;
}

/* tytuł */

.header-title{
width:100%;
}

.header-title h3{
font-size:14px;
}

/* loga szkoły */

.header-right{
width:100%;
justify-content:center;
}

/* wyszukiwarka */

.header-search{
width:100%;
}

.header-search form{
width:100%;
max-width:350px;
margin:auto;
}

.header-search input{
flex:1;
}
}
/* =========================
   SITEMAP – NOWOCZEŚNIEJSZY STYL
========================= */

.sitemap{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
gap:20px;
margin-top:25px;
}

/* karta kategorii */

.sitemap-category{
background:white;
border:1px solid #ddd;
border-radius:8px;
padding:16px;
transition:0.2s;
box-shadow:0 2px 6px rgba(0,0,0,0.05);
}

.sitemap-category:hover{
box-shadow:0 4px 12px rgba(0,0,0,0.1);
transform:translateY(-2px);
}

/* nagłówek kategorii */

.sitemap-category h3{
margin:0 0 10px 0;
font-size:18px;
border-bottom:1px solid #eee;
padding-bottom:6px;
}

.sitemap-category h3 a{
text-decoration:none;
color:#c0001a;
}

/* licznik */

.count{
font-size:13px;
color:#777;
margin-left:6px;
}

/* lista artykułów */

.sitemap-category ul{
list-style:none;
padding:0;
margin:0;
}

.sitemap-category li{
padding:4px 0;
border-bottom:1px solid #f2f2f2;
}

.sitemap-category li:last-child{
border-bottom:none;
}

.sitemap-category li a{
text-decoration:none;
color:#333;
font-size:14px;
}

.sitemap-category li a:hover{
color:#c0001a;
}

/* link zobacz wszystkie */

.more{
margin-top:10px;
font-size:14px;
}

.more a{
text-decoration:none;
color:#666;
}

.more a:hover{
color:#c0001a;
}

/* MOBILE */

@media (max-width:600px){

.menu-separator{
border-top:0px solid #ddd;
margin:0;
list-style:none;
}
.sitemap{
grid-template-columns:1fr;
}

.sitemap-category{
padding:14px;
}

}
/* =========================
   REDAKCJA BIP
========================= */

.bip-list{
width:100%;
border-collapse:collapse;
margin-top:15px;
background:white;
border-radius:6px;
overflow:hidden;
box-shadow:0 2px 6px rgba(0,0,0,0.05);
}

.bip-list th{
background:#f4f4f4;
padding:10px;
text-align:left;
border-bottom:1px solid #ddd;
font-weight:600;
}

.bip-list td{
padding:10px;
border-bottom:1px solid #eee;
}

.bip-list tr:last-child td{
border-bottom:none;
}

.bip-list tr:hover{
background:#fafafa;
}

/* =========================
   HISTORIA ZMIAN
========================= */

.bip-history table{
width:100%;
border-collapse:collapse;
margin-top:15px;
background:white;
border-radius:6px;
overflow:hidden;
box-shadow:0 2px 6px rgba(0,0,0,0.05);
}

.bip-history th{
background:#f4f4f4;
padding:8px;
text-align:left;
border-bottom:1px solid #ddd;
}

.bip-history td{
padding:8px;
border-bottom:1px solid #eee;
}

.bip-history tr:last-child td{
border-bottom:none;
}

.bip-history tr:hover{
background:#fafafa;
}

/* =========================
   METRYKA
========================= */

.bip-metryka{
background:#fafafa;
border:1px solid #ddd;
padding:15px;
margin-top:25px;
border-radius:6px;
}

/* =========================
   INFORMACJA AUTOMATYCZNA
========================= */

.bip-note{
margin-top:10px;
font-size:13px;
color:#666;
font-style:italic;
}
/* =========================
   ZAŁĄCZNIKI BIP
========================= */

.bip-attachments{
margin-top:25px;
padding:15px 20px;
background:#f8f8f8;
border:1px solid #d9d9d9;
border-left:5px solid #c0001a;
}

.bip-attachments h3{
margin-top:0;
font-size:18px;
}

.bip-attachments ul{
list-style:none;
padding:0;
margin:10px 0 0 0;
}

.bip-attachments li{
padding:6px 0;
border-bottom:1px solid #e6e6e6;
}

.bip-attachments li:last-child{
border-bottom:none;
}

.bip-attachments a{
text-decoration:none;
color:#003366;
font-weight:500;
}

.bip-attachments a:hover{
text-decoration:underline;
}
/* =========================
   COOKIE BAR
========================= */

#cookie-bar{
position:fixed;
bottom:0;
left:0;
width:100%;
background:#222;
color:white;
padding:15px;
font-size:14px;
display:none;
z-index:9999;
}

.cookie-content{
max-width:1100px;
margin:auto;
display:flex;
justify-content:space-between;
align-items:center;
gap:20px;
}

#cookie-bar button{
background:#c0001a;
color:white;
border:none;
padding:8px 16px;
cursor:pointer;
font-weight:600;
}

#cookie-bar button:hover{
background:#a00015;
}
/* =========================
   BREADCRUMBS
========================= */

.bip-breadcrumbs{
font-size:14px;
margin-bottom:15px;
color:#555;
}

.bip-breadcrumbs a{
text-decoration:none;
color:#003366;
}

.bip-breadcrumbs a:hover{
text-decoration:underline;
}
.contrast .header-title h3{
margin:0;
line-height:1.1;
color:white;
letter-spacing: 2px;
}
.contrast .header-title h4{
margin:0;
line-height:1.1;
color:white;
letter-spacing: 2px;
}
.bip-empty{
padding:20px;
background:#f5f5f5;
border:1px solid #ddd;
border-radius:6px;
text-align:center;
color:#555;
font-style:italic;
}
/* MOBILE – poprawa tabel */

@media (max-width:768px){

table{
display:block;
width:100%;
overflow-x:auto;
white-space:nowrap;
}

th, td{
padding:8px;
font-size:14px;
}

}
/* ===== MOBILE TABLE FIX ===== */

@media (max-width:768px){

table{
width:100%;
border-collapse:collapse;
}

table thead{
display:none;
}

table tr{
display:block;
margin-bottom:12px;
border:1px solid #ddd;
border-radius:6px;
padding:10px;
background:#fff;
}

table td{
display:block;
text-align:left;
padding:6px 0;
border:none;
}

}
/* MENU MOBILE */

@media (max-width:768px){

.main-menu{
width:100%;
}

.main-menu ul{
display:block;
padding:0;
margin:0;
}

.main-menu li{
margin-bottom:6px;
width:100%;
}

.main-menu a{
display:block;
width:100%;
box-sizing:border-box;
background:#f5f5f5;
border:1px solid #ddd;
padding:8px;
border-radius:4px;

font-size:14px;
line-height:1.3;
word-break:break-word;
}

}
.bip-content ul{
margin:6px 0 6px 20px;
padding:0;
}

.bip-content li{
margin:4px 0;
line-height:1.5;
}
.bip-content ol{
margin:10px 0 10px 25px;
padding:0;
}

.bip-content ol li{
margin:4px 0;
}
.bip-content{
background:white;
padding:20px;
border:1px solid #ddd;
margin-bottom:10px;
line-height:1.6;
font-size:15px;
}
.bip-content p{
margin:6px 0 !important;
padding:0 !important;
line-height:1.5;
}
.bip-content p:empty{
display:none;
}
.bip-content{
font-size:15px;
line-height:1.6;
}
.bip-content p{
margin:4px 0;
padding:0;
line-height:1.5;
}

.bip-content p:empty{
display:none;
}

.bip-content br{
display:none;
}

.bip-content ul{
margin:6px 0 6px 20px;
}

.bip-content li{
margin:3px 0;
}
.bip-content ul{
margin:8px 0;
padding-left:28px;
list-style:none;
}

.bip-content li{
position:relative;
margin:6px 0;
line-height:1.5;
}

/* czerwone kwadraty */

.bip-content li::before{
content:"";
width:7px;
height:7px;
background:#c0001a;
position:absolute;
left:-16px;
top:8px;
}
/* =========================
   NAGŁÓWKI W TREŚCI BIP
========================= */

.bip-content h1{
font-size:26px;
margin:18px 0 10px 0;
color:#2c2c2c;
border-bottom:3px solid #c0001a;
padding-bottom:6px;
font-weight:600;
}

.bip-content h2{
font-size:22px;
margin:16px 0 8px 0;
color:#333;
border-bottom:2px solid #e5e5e5;
padding-bottom:4px;
font-weight:600;
}

.bip-content h3{
font-size:18px;
margin:14px 0 6px 0;
color:#c0001a;
font-weight:600;
}
/* usuwa duży odstęp nad pierwszym nagłówkiem w artykule */

.bip-content h1:first-child,
.bip-content h2:first-child,
.bip-content h3:first-child{
margin-top:0;
}