/* Dynamic Modern Theme for Trzebież */
:root {
    --color-navy: #000090;
    --color-navy-hover: #0000c0;
    --color-bg-light: #eaf0f8;
    --color-text: #1a1a2e;
    --color-border: #000090;
    --font-primary: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
    background: url('/assets/img/kompas.gif') repeat fixed var(--color-bg-light);
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
    padding: 20px 10px;
}

.site-wrap {
    max-width: 1120px;
    margin: 0 auto;
    background: #ffffff;
    border: 3px solid var(--color-navy);
    box-shadow: 0 8px 24px rgba(0, 0, 144, 0.15);
    border-radius: 6px;
    overflow: hidden;
}

/* Header & Nav */
.site-header {
    background: linear-gradient(180deg, #ffffff 0%, #f0f4f9 100%);
    border-bottom: 2px solid var(--color-navy);
    padding: 24px 30px 16px 30px;
    text-align: center;
}

.site-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--color-navy);
    text-decoration: none;
    letter-spacing: 0.5px;
    display: inline-block;
}

.site-title span {
    font-size: 1.2rem;
    font-style: italic;
    color: #4a5568;
    margin-left: 10px;
}

.site-nav {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
}

.site-nav a {
    color: var(--color-navy);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 14px;
    border: 1px solid var(--color-navy);
    border-radius: 4px;
    background: #ffffff;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a.active {
    background: var(--color-navy);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 144, 0.25);
}

/* Main Content Area */
.site-main {
    padding: 32px 40px;
    background: #ffffff;
}

.page-title {
    color: var(--color-navy);
    font-size: 1.8rem;
    border-bottom: 2px solid var(--color-navy);
    padding-bottom: 8px;
    margin-bottom: 24px;
}

/* Article formatting */
.content-body {
    text-align: justify;
    line-height: 1.75;
    font-size: 1.05rem;
}

.content-body p {
    margin-bottom: 1.2rem;
}

.content-body h1,
.content-body h2,
.content-body h3 {
    color: var(--color-navy);
    margin: 1.5rem 0 0.8rem 0;
}

/* Image float and natural dimensions */
.content-body img,
.img-float-left,
.img-float-right,
.img-center {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
    border: 2px solid var(--color-navy);
    border-radius: 3px;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.content-body img:hover,
.img-float-left:hover,
.img-float-right:hover,
.img-center:hover {
    transform: scale(1.02);
    box-shadow: 4px 6px 12px rgba(0, 0, 144, 0.25);
}

.img-float-left {
    float: left;
    margin: 0.4rem 1.5rem 1rem 0;
}

.img-float-right {
    float: right;
    margin: 0.4rem 0 1rem 1.5rem;
}

.img-center {
    display: block;
    margin: 1.2rem auto;
}

/* Clearfix for floats */
.content-body::after,
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Footer */
.site-footer {
    border-top: 1px solid #d0d7de;
    background: #f8fafc;
    padding: 16px 30px;
    text-align: center;
    font-size: 0.88rem;
    color: #64748b;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 30, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.lightbox-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-modal img {
    max-width: 92vw;
    max-height: 90vh;
    border: 4px solid #ffffff;
    box-shadow: 0 12px 36px rgba(0,0,0,0.5);
    border-radius: 4px;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #ffffff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px 5px;
    }

    .site-main {
        padding: 20px 16px;
    }

    .img-float-left,
    .img-float-right {
        float: none !important;
        display: block !important;
        margin: 1rem auto !important;
    }
}

/* ===== Banner + layout z lewym menu (wzorzec trzebiez.pl) ===== */
.site-banner { position: relative; border-bottom: 3px solid var(--color-navy); background: #000a3c; line-height: 0; overflow: hidden; }
.banner-img { width: 100%; height: auto; display: block; }
.banner-mewa { position: absolute; right: 14px; top: 10px; width: 56px; height: 56px; opacity: .9; }
.nav-toggle { display: none; }
.layout { display: flex; align-items: flex-start; }
.sidebar { width: 240px; flex-shrink: 0; background: #f0f4f9; border-right: 2px solid var(--color-navy); padding: 18px 14px; align-self: stretch; }
.side-nav h2, .side-box h2 { font-size: .95rem; color: #fff; background: var(--color-navy); padding: 6px 10px; margin-bottom: 8px; border-radius: 3px; display: flex; align-items: center; gap: 6px; }
.side-nav a, .side-box a { display: block; color: var(--color-navy); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 5px 10px; border-left: 3px solid transparent; line-height: 1.35; }
.side-nav a:hover, .side-nav a.active, .side-box a:hover { background: #fff; border-left-color: #e6b800; text-decoration: underline; }
.side-nav a.active { background: #fff; }
.side-box { margin-top: 22px; }
.side-box a { font-weight: 400; font-size: .82rem; color: #333; }
.layout .site-main { flex: 1; min-width: 0; }
.site-header { display: none; }
@media (max-width: 800px) {
  .nav-toggle { display: block; position: absolute; left: 10px; bottom: 10px; line-height: 1.2; background: #fff; color: var(--color-navy); border: 2px solid var(--color-navy); border-radius: 4px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
  .layout { flex-direction: column; }
  .sidebar { display: none; width: 100%; border-right: 0; border-bottom: 2px solid var(--color-navy); }
  body.nav-open .sidebar { display: block; }
}
/* stare tabele z importu: nie rozpychaj strony */
.content-body table { max-width: 100%; }
.content-body td, .content-body th { font-family: inherit; font-size: inherit; color: inherit; }

.content-body table { border-collapse: separate; border-spacing: 6px; }
.content-body td { vertical-align: top; }
.content-body td[align=CENTER], .content-body td[align=center] { text-align: center; }
.content-body a img { cursor: zoom-in; }
.home-lead { font-size: 1.12rem; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 1.4rem 0; }
.home-card { display: block; padding: 14px 16px; border: 2px solid var(--color-navy); border-radius: 6px; background: #f6f9fd; text-decoration: none; color: var(--color-navy); transition: transform .15s, box-shadow .15s; }
.home-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,144,.18); background: #fff; }
.home-card strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.home-card span { font-size: .88rem; color: #444; }
.home-news { background: #fffbea; border: 2px solid #e6b800; border-radius: 6px; padding: 14px 18px; }
.home-news h2 { margin-top: 0; }
.home-news li { margin: 4px 0; }
.home-card span { text-align: left; display: block; }
