/* Kalendarz Polska (pl-PL) - Modern Responsive Stylesheet with 4 Theme Palettes */
:root,
html[data-theme="crimson-pl"] {
    --primary: #dc143c;
    --primary-dark: #9e0b28;
    --primary-light: #fff1f2;
    --accent: #0284c7;
    --handlowa-bg: #ecfdf5;
    --handlowa-text: #047857;
    --handlowa-border: #6ee7b7;
}
html[data-theme="amber-gold"] {
    --primary: #d97706;
    --primary-dark: #92400e;
    --primary-light: #fffbeb;
    --accent: #0f766e;
}
html[data-theme="baltic-blue"] {
    --primary: #0369a1;
    --primary-dark: #075985;
    --primary-light: #f0f9ff;
    --accent: #dc143c;
}
html[data-theme="emerald-forest"] {
    --primary: #047857;
    --primary-dark: #065f46;
    --primary-light: #ecfdf5;
    --accent: #b45309;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.65;
}
a { color: var(--primary-dark); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary); }
.container { max-width: 1260px; margin: 0 auto; padding: 0 18px; }

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff !important;
}
.brand-title { font-size: 1.35rem; font-weight: 800; display: block; letter-spacing: -0.3px; }
.brand-sub { font-size: 0.78rem; opacity: 0.9; display: block; }
.main-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.main-nav a {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
}
.main-nav a:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* Month Quickbar */
.month-quickbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
}
.month-quickbar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
}
.mq-label { font-weight: 700; color: #475569; margin-right: 4px; white-space: nowrap; }
.month-quickbar a {
    padding: 4px 10px;
    border-radius: 6px;
    color: #334155;
    font-weight: 600;
}
.month-quickbar a:hover, .month-quickbar a.active {
    background: var(--primary);
    color: #fff;
}

/* Layout */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 26px;
    margin: 26px auto;
    align-items: start;
}
@media (max-width: 980px) {
    .page-layout { grid-template-columns: 1fr; }
}

/* Hero Banner */
.hero-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15,23,42,0.03);
}
.hero-box h1 {
    margin: 0 0 10px;
    font-size: 1.85rem;
    color: #0f172a;
    line-height: 1.25;
}
.hero-desc { margin: 0 0 16px; color: #475569; font-size: 1rem; }
.year-switcher { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.year-btn {
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    background: #f1f5f9;
    color: #334155;
}
.year-btn.active, .year-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Legend Bar */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #475569;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ev-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-red { background: #dc143c; }
.dot-green { background: #059669; }
.dot-amber { background: #d97706; }

/* 12-Month Grid */
.months-grid-12 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}
@media (max-width: 1100px) { .months-grid-12 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .months-grid-12 { grid-template-columns: 1fr; } }

.mini-month-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.mini-month-header {
    background: var(--primary-light);
    padding: 10px 14px;
    text-align: center;
    font-weight: 800;
    font-size: 1.02rem;
    border-bottom: 1px solid #e2e8f0;
}
.mini-month-header a { color: var(--primary-dark); }
.mini-cal-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; text-align: center; }
.mini-cal-table th {
    padding: 6px 2px;
    font-size: 0.75rem;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
}
.mini-cal-table th.wknd-sun { color: #dc143c; }
.mini-cal-table td { padding: 3px; }
.mini-cal-table td a {
    display: block;
    padding: 5px 2px;
    border-radius: 6px;
    color: #1e293b;
    font-weight: 600;
}
.mini-cal-table td a:hover { background: #f1f5f9; }
.mini-cal-table td.is-sunday a { color: #dc143c; }
.mini-cal-table td.is-holiday a {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}
.mini-cal-table td.is-handlowa a {
    background: #d1fae5;
    color: #065f46;
    font-weight: 800;
    outline: 1px solid #34d399;
}
.mini-cal-table td.is-observance a {
    background: #fef3c7;
    color: #92400e;
}
.mini-cal-table td.is-today a {
    background: var(--primary) !important;
    color: #fff !important;
}
.mini-month-events {
    padding: 10px 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.78rem;
    background: #fcfcfd;
    margin-top: auto;
}
.mini-ev-item { margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-ev-item.muted { color: #94a3b8; }

/* Large Month Calendar */
.large-cal-wrap { overflow-x: auto; background: #fff; border-radius: 14px; border: 1px solid #e2e8f0; margin-bottom: 24px; }
.large-cal-table { width: 100%; border-collapse: collapse; min-width: 720px; table-layout: fixed; }
.large-cal-table th {
    background: #f8fafc;
    padding: 12px 8px;
    font-size: 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}
.large-cal-table th.wknd-sun { color: #dc143c; }
.large-day-cell {
    border: 1px solid #f1f5f9;
    vertical-align: top;
    padding: 8px;
    height: 112px;
}
.large-day-cell.is-sunday { background: #fffafa; }
.large-day-cell.is-holiday { background: #fff1f2; }
.large-day-cell.is-handlowa { background: #f0fdf4; }
.large-day-cell.is-today { outline: 2px solid var(--primary); }
.cell-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.cell-day-num { font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.is-sunday .cell-day-num, .is-holiday .cell-day-num { color: #dc143c; }
.cell-nameday { font-size: 0.72rem; color: #64748b; margin-bottom: 5px; line-height: 1.25; }
.cell-events { display: flex; flex-direction: column; gap: 3px; }
.cell-ev-badge {
    display: block;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    line-height: 1.25;
}
.badge-hol { background: #fecdd3; color: #881337; }
.badge-handlowa { background: #bbf7d0; color: #065f46; }
.badge-obs { background: #fde68a; color: #78350f; }

/* Cards & Tables */
.content-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}
.content-card h2 { margin-top: 0; font-size: 1.4rem; color: #0f172a; }
.data-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.92rem; }
.data-table th, .data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}
.data-table th { background: #f8fafc; font-weight: 700; color: #334155; }
.badge-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-blue { background: #e0f2fe; color: #075985; }

/* Sidebar */
.widget-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.highlight-card {
    border-top: 4px solid var(--primary);
}
.widget-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
}
.widget-title { margin: 0 0 10px; font-size: 1.1rem; }
.widget-sub { font-size: 0.84rem; color: #64748b; margin: 0 0 12px; }
.imieniny-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.imieniny-label { display: block; font-size: 0.78rem; color: #92400e; }
.imieniny-names { font-size: 0.95rem; color: #78350f; }
.moon-mini-row { font-size: 0.85rem; color: #475569; margin-bottom: 12px; }
.btn-block {
    display: block;
    text-align: center;
    background: var(--primary);
    color: #fff !important;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
}
.sidebar-list { list-style: none; padding: 0; margin: 0 0 12px; }
.sidebar-list li { padding: 7px 0; border-bottom: 1px dashed #e2e8f0; font-size: 0.88rem; }
.sidebar-list li a { display: flex; align-items: center; justify-content: space-between; }
.widget-more-link { font-size: 0.84rem; font-weight: 700; }

.tool-links-stack { display: flex; flex-direction: column; gap: 10px; }
.tool-Quick-btn {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.tool-Quick-btn strong { display: block; color: #0f172a; font-size: 0.9rem; }
.tool-Quick-btn span { font-size: 0.78rem; color: #64748b; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
    font-size: 0.78rem;
    padding: 5px 10px;
    background: #f1f5f9;
    border-radius: 6px;
    color: #334155;
    font-weight: 600;
}
.tag-chip:hover { background: var(--primary); color: #fff; }

/* Footer */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 44px 0 28px;
    margin-top: 48px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 7px; font-size: 0.88rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.partner-links {
    padding: 12px 0;
    border-top: 1px solid #1e293b;
    font-size: 0.82rem;
    text-align: center;
}
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 0.84rem;
    color: #94a3b8;
}
