/* ================================================================
   MKS KORSZE — template.css
   Kolory: zieleń #006B3C | czerwień #C8102E | biel #FFFFFF
   Fonty: Oswald (nagłówki) | Source Serif 4 (treść) | Inter (UI)
================================================================ */

/* ── Zmienne ─────────────────────────────────────────────── */
:root {
    --green:       #006B3C;
    --green-dark:  #004d2b;
    --green-light: #e8f5ee;
    --red:         #C8102E;
    --red-dark:    #9e0d25;
    --white:       #ffffff;
    --gray-50:     #f9fafb;
    --gray-100:    #f3f4f6;
    --gray-200:    #e5e7eb;
    --gray-400:    #9ca3af;
    --gray-600:    #4b5563;
    --gray-800:    #1f2937;
    --gray-900:    #111827;

    --font-display: 'Oswald', sans-serif;
    --font-body:    'Source Serif 4', Georgia, serif;
    --font-ui:      'Inter', system-ui, sans-serif;

    --container:   1200px;
    --radius:      6px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
    --shadow-md:   0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.14);

    --header-h:    72px;
    --transition:  .2s ease;
}

/* ── Reset & base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--gray-800);
    background: var(--gray-50);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-dark); }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--header-h);
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--green);
    letter-spacing: .03em;
    text-transform: uppercase;
}

.logo-sub {
    font-family: var(--font-ui);
    font-size: .7rem;
    font-weight: 500;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* Nav */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.main-nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
}

.main-nav ul li a,
.main-nav ul li span {
    display: block;
    padding: 6px 14px;
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--gray-800);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
}

.main-nav ul li a:hover,
.main-nav ul li.active > a {
    background: var(--green);
    color: var(--white);
}

.main-nav ul li.active > a { background: var(--green-dark); }

/* Dropdown */
.main-nav ul li { position: relative; }

.main-nav ul li ul {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    gap: 0;
}

.main-nav ul li:hover > ul { display: flex; }

.main-nav ul li ul li a {
    padding: 10px 16px;
    border-radius: 0;
    font-size: .88rem;
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-100);
}

.main-nav ul li ul li:last-child a { border-bottom: none; }
.main-nav ul li ul li a:hover { background: var(--green-light); color: var(--green); }

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    transition: background var(--transition);
    margin-left: auto;
}

.nav-toggle:hover { background: var(--gray-100); }

.burger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-800);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

.nav-toggle.active .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active .burger-line:nth-child(2) { opacity: 0; }
.nav-toggle.active .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Pasek kolorów */
.header-stripe {
    display: flex;
    height: 4px;
}
.stripe-green { flex: 2; background: var(--green); }
.stripe-white { flex: 1; background: var(--white); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.stripe-red   { flex: 2; background: var(--red); }

/* ── HERO ────────────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, #008a4e 100%);
    color: var(--white);
    padding: 28px 0;
    border-bottom: 4px solid var(--red);
}

.hero-section .container {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
.site-main {
    padding: 36px 20px 48px;
}

.content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Styl modułu w sidebarze (mks_card) */
.mks-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.mks-card .module-title,
.mks-card h3 {
    font-family: var(--font-display);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--white);
    background: var(--green);
    padding: 10px 14px;
    margin: 0;
    border-bottom: 3px solid var(--red);
}

.mks-card .module-content { padding: 14px; }

/* ── ARTYKUŁY (Joomla blog/featured) ────────────────────── */

/* Nagłówek sekcji */
.blog-items { }

.blog-item {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    margin-bottom: 24px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.blog-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Featured — grid 2 kolumny */
.items-leading .blog-item { }

.items-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.items-row .blog-item { margin-bottom: 0; }

/* Obrazek artykułu */
.blog-item .item-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

/* Treść artykułu */
.blog-item .item-content { padding: 18px 20px 20px; }

/* Kategoria */
.blog-item .item-category a {
    font-family: var(--font-ui);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--red);
    display: inline-block;
    margin-bottom: 8px;
}

/* Tytuł */
.blog-item h2, .blog-item .page-header {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 10px;
    color: var(--gray-900);
}

.blog-item h2 a, .blog-item .page-header a {
    color: var(--gray-900);
    text-decoration: none;
}

.blog-item h2 a:hover { color: var(--green); }

/* Intro */
.blog-item .item-intro { font-size: .95rem; color: var(--gray-600); line-height: 1.6; }

/* Meta */
.blog-item .item-info,
.article-info-block {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    font-family: var(--font-ui);
    font-size: .78rem;
    color: var(--gray-400);
}

.blog-item .item-info .icon-calendar::before { content: "📅 "; }
.blog-item .item-info .icon-user::before    { content: "👤 "; }

/* Czytaj więcej */
.readmore a, .btn-read-more {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 18px;
    font-family: var(--font-display);
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--white);
    background: var(--green);
    border-radius: var(--radius);
    transition: background var(--transition);
}

.readmore a:hover { background: var(--green-dark); color: var(--white); }

/* Pojedynczy artykuł */
.item-page h1, .com-content-article h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.item-page .item-image, .com-content-article .item-image {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* ── BOTTOM SOCIAL ───────────────────────────────────────── */
.bottom-social {
    background: var(--gray-900);
    padding: 40px 0;
    border-top: 4px solid var(--red);
}

.bottom-social .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* ── SPONSORZY ───────────────────────────────────────────── */
.bottom-sponsors {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    padding: 24px 0;
}

.sponsors-label {
    font-family: var(--font-ui);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--gray-400);
    text-align: center;
    margin-bottom: 16px;
}

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
    background: var(--green-dark);
    color: rgba(255,255,255,.7);
    padding: 28px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.footer-logo img { filter: brightness(0) invert(1) opacity(.9); }

.footer-copy {
    font-family: var(--font-ui);
    font-size: .8rem;
    text-align: center;
}

.footer-modules a { color: rgba(255,255,255,.6); }
.footer-modules a:hover { color: var(--white); }

/* ── PAGINACJA ───────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.pagination li { list-style: none; }

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: .88rem;
    font-weight: 500;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}

.pagination li.active span,
.pagination li a:hover {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

/* ── ALERTY JOOMLA ───────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-family: var(--font-ui); font-size: .9rem; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
.alert-success { background: var(--green-light); color: var(--green-dark); border-left: 4px solid var(--green); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--red); }

/* ── TABELA LIGOWA (moduły w sidebarze) ──────────────────── */
.liga-tabela {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: .8rem;
}

.liga-tabela th {
    font-weight: 600;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-400);
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}

.liga-tabela th:first-child { text-align: left; padding-left: 6px; }

.liga-tabela td {
    padding: 7px 4px;
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
}

.liga-tabela td:first-child { text-align: left; padding-left: 6px; }
.liga-tabela td:nth-child(2) { text-align: left; }

.liga-tabela tr.nasz-klub td {
    background: var(--green-light);
    font-weight: 600;
    color: var(--green-dark);
}

.liga-tabela tr:last-child td { border-bottom: none; }

/* Pozycja */
.liga-tabela .poz { font-weight: 700; color: var(--gray-400); width: 20px; }
.liga-tabela .pkt { font-weight: 700; color: var(--green); }

/* Mecz wynik */
.liga-wynik {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-family: var(--font-ui);
    font-size: .82rem;
}

.liga-wynik:last-child { border-bottom: none; }
.liga-wynik .druzyna { flex: 1; }
.liga-wynik .wynik { font-weight: 700; font-family: var(--font-display); font-size: 1rem; color: var(--gray-900); min-width: 42px; text-align: center; }
.liga-wynik.wygrana .wynik { color: var(--green); }
.liga-wynik.przegrana .wynik { color: var(--red); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr 260px;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    :root { --header-h: 60px; }

    .logo-sub { display: none; }
    .logo-name { font-size: 1.15rem; }

    /* Nav mobile */
    .nav-toggle { display: flex; }

    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--white);
        border-top: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
        z-index: 999;
        flex-direction: column;
        padding: 12px 0;
    }

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

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 0 16px;
    }

    .main-nav ul li { width: 100%; }

    .main-nav ul li a,
    .main-nav ul li span {
        width: 100%;
        padding: 12px 16px;
        border-radius: 0;
        border-bottom: 1px solid var(--gray-100);
        font-size: 1rem;
    }

    .main-nav ul li ul {
        display: block;
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--gray-50);
    }

    .main-nav ul li ul li a { padding-left: 32px; font-size: .9rem; }

    /* Layout */
    .content-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-right {
        order: -1; /* sidebar nad treścią na mobile */
    }

    .items-row {
        grid-template-columns: 1fr;
    }

    .bottom-social .container {
        grid-template-columns: 1fr;
    }

    .hero-section .container {
        flex-direction: column;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body { font-size: 16px; }
    .site-main { padding: 20px 16px 32px; }
    .blog-item .item-content { padding: 14px 16px 16px; }
}
