@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=Lato:wght@300;400;700&display=swap');

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

:root {
    --ziel-ciemna:   #3a5626;
    --ziel-glowna:   #4e6b36;
    --ziel-srednia:  #5e7e42;
    --tlo:           #eef5e8;
    --tlo-karta:     #f7faf4;
    --zloto:         #c9a227;
    --tekst-ciemny:  #2b3e1e;
    --tekst-mid:     #4a6035;
    --biel:          #ffffff;
    --cien-karta:    0 2px 12px rgba(58,86,38,0.10);
    --cien-duzy:     0 6px 28px rgba(58,86,38,0.16);
    --radius:        10px;
}

body {
    font-family: 'Lato', Arial, sans-serif;
    background-color: var(--tlo);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(94,126,66,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(58,86,38,0.06) 0%, transparent 50%);
    min-height: 100vh;
    padding: 0;
    color: var(--tekst-ciemny);
}

.page-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 20px 40px;
}

/* NAGŁÓWEK */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ziel-ciemna);
    padding: 0 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 120px;
    box-shadow: 0 2px 16px rgba(30,50,15,0.22);
    /* pełna szerokość ekranu niezależnie od wrappera */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    cursor: pointer;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 5%, var(--zloto) 40%, var(--zloto) 60%, transparent 95%);
    opacity: 0.5;
}

.logo-box {
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(201,162,39,0.4);
    padding: 6px 18px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--biel);
    border-radius: 6px;
    letter-spacing: 1px;
    flex-shrink: 0;
    white-space: nowrap;
}

.main-nav { display: flex; flex-direction: row; gap: 6px; align-items: center; }

.nav-btn {
    display: block;
    background-color: transparent;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    text-align: center;
    padding: 8px 20px;
    font-family: 'Lato', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.nav-btn:hover {
    background-color: rgba(255,255,255,0.12);
    color: var(--biel);
    border-color: rgba(201,162,39,0.35);
}
.nav-btn.active {
    background-color: rgba(201,162,39,0.15);
    border-color: rgba(201,162,39,0.55);
    color: var(--biel);
}

/* KARTA KALENDARZA */
.calendar-card {
    background: var(--tlo-karta);
    border-radius: var(--radius);
    box-shadow: var(--cien-karta);
    border: 1px solid rgba(94,126,66,0.18);
    overflow: hidden;
    margin-top: 32px;
}

/* NAWIGACJA MIESIĄC / ROK */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 20px 32px 18px;
    border-bottom: 1px solid rgba(94,126,66,0.12);
    background: var(--ziel-ciemna);
}

.cal-nav-year,
.cal-nav-month {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cal-nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(201,162,39,0.25);
    color: rgba(255,255,255,0.8);
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}
.cal-nav-btn:hover {
    background: rgba(201,162,39,0.2);
    border-color: rgba(201,162,39,0.6);
    color: var(--biel);
    transform: scale(1.1);
}

.cal-year-label {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.55);
    min-width: 48px;
    text-align: center;
}

.cal-month-label {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--biel);
    min-width: 200px;
    text-align: center;
    letter-spacing: 0.5px;
}

.cal-nav-year::after {
    content: '';
    width: 1px;
    height: 26px;
    background: rgba(255,255,255,0.12);
    margin-left: 26px;
}

/* CIAŁO */
.calendar-body {
    display: flex;
}

.cal-grid-section {
    flex: 1;
    min-width: 0;
    border-right: 1px solid rgba(94,126,66,0.12);
}

/* SIATKA DNI */
.calendar-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(88px, 1fr);
}

/* Nagłówki dni */
.weekday-header {
    text-align: center;
    padding: 10px 4px;
    font-family: 'Lato', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--tekst-mid);
    border-bottom: 1px solid rgba(94,126,66,0.15);
    border-right: 1px solid rgba(94,126,66,0.08);
    background: rgba(238,245,232,0.6);
}
.weekday-header:last-child { border-right: none; }

/* Komórka dnia */
.day-cell {
    padding: 9px 9px 7px;
    border-bottom: 1px solid rgba(94,126,66,0.08);
    border-right: 1px solid rgba(94,126,66,0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    transition: background-color 0.14s;
}
.day-cell:nth-child(7n) { border-right: none; }

.day-cell.empty { background: transparent; }

.day-number {
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--tekst-mid);
    line-height: 1;
}

/* Dzisiaj */
.day-cell.today .day-number {
    background: var(--zloto);
    color: var(--biel);
    font-weight: 700;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Dzień z wydarzeniem */
.day-cell.has-event {
    cursor: pointer;
    background: rgba(94,126,66,0.03);
}
.day-cell.has-event:hover {
    background: rgba(201,162,39,0.06);
}

/* Pill wydarzenia */
.event-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(94,126,66,0.1);
    border-left: 2px solid rgba(94,126,66,0.5);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.63rem;
    font-weight: 600;
    color: var(--tekst-ciemny);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: background 0.14s;
}

.event-pill:hover { background: rgba(94,126,66,0.18); }

/* Kolory pill według tagu */
.event-pill.tag-zawody    { background: rgba(200,70,70,0.12);  border-left-color: rgba(200,70,70,0.7); color: #7a2020; }
.event-pill.tag-szkolenie { background: rgba(60,120,200,0.12); border-left-color: rgba(60,120,200,0.7); color: #1a3a80; }
.event-pill.tag-impreza   { background: rgba(120,60,180,0.12); border-left-color: rgba(120,60,180,0.7); color: #4a1a80; }
.event-pill.tag-warsztaty { background: rgba(60,160,120,0.12); border-left-color: rgba(60,160,120,0.7); color: #1a5a45; }
.event-pill.tag-polkolonie{ background: rgba(200,120,40,0.12); border-left-color: rgba(200,120,40,0.7); color: #6b3a00; }

/* "+N więcej" */
.event-more {
    font-size: 0.58rem;
    color: var(--tekst-mid);
    padding-left: 4px;
    font-weight: 600;
    opacity: 0.7;
}

/* PANEL BOCZNY */
.sidebar-events {
    width: 272px;
    flex-shrink: 0;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tekst-ciemny);
    letter-spacing: 0.3px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(201,162,39,0.25);
}

.events-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Karta w sidebarze */
.event-card {
    display: flex;
    background-color: var(--biel);
    border-radius: 6px;
    border-left: 3px solid rgba(94,126,66,0.4);
    box-shadow: var(--cien-karta);
    overflow: hidden;
    color: var(--tekst-ciemny);
    transition: background-color 0.15s, transform 0.15s;
    cursor: pointer;
}
.event-card:hover {
    background-color: rgba(238,245,232,0.8);
    transform: translateX(2px);
}
.event-card.highlight { border-left-color: #b87333; }

.event-date {
    background-color: var(--ziel-glowna);
    color: var(--biel);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 50px;
    padding: 8px 6px;
    flex-shrink: 0;
}
.event-card.highlight .event-date { background-color: #b87333; }

.event-date .day  { font-size: 1.15rem; font-weight: 700; line-height: 1; }
.event-date .month{ font-size: 0.63rem; text-transform: uppercase; margin-top: 2px; font-weight: 600; opacity: 0.85; }

.event-content { padding: 9px 10px; flex-grow: 1; min-width: 0; }

.event-tag {
    font-size: 0.57rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ziel-srednia);
    display: block;
    margin-bottom: 3px;
}

.event-name {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--tekst-ciemny);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-time {
    font-size: 0.68rem;
    color: var(--tekst-mid);
    margin: 0;
    opacity: 0.75;
}

.event-desc { display: none; }

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(20,35,10,0.55);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--tlo-karta);
    color: var(--tekst-ciemny);
    margin: auto;
    padding: 34px 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 460px;
    position: relative;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
    border: 1px solid rgba(201,162,39,0.3);
    border-top: 3px solid var(--zloto);
    animation: modalIn 0.22s cubic-bezier(0.22,0.61,0.36,1) both;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--tekst-ciemny);
    margin-bottom: 6px;
    line-height: 1.25;
}

.modal-content hr {
    margin: 12px 0;
    border: 0;
    border-top: 1px solid rgba(94,126,66,0.18);
}

.modal-content p {
    margin-bottom: 8px;
    font-size: 0.93rem;
    color: rgba(42,62,26,0.82);
    line-height: 1.5;
}

.modal-content strong { color: var(--ziel-glowna); }

.close-btn {
    position: absolute;
    right: 16px; top: 12px;
    font-size: 22px;
    color: rgba(42,62,26,0.35);
    cursor: pointer;
    transition: color 0.18s, transform 0.18s;
    line-height: 1;
}
.close-btn:hover { color: var(--tekst-ciemny); transform: scale(1.15); }

/* RESPONSYWNOŚĆ */
@media (max-width: 900px) {
    .calendar-body { flex-direction: column; }
    .cal-grid-section { border-right: none; border-bottom: 1px solid rgba(94,126,66,0.12); }
    .sidebar-events { width: 100%; }
    .cal-nav { gap: 20px; flex-wrap: wrap; }
    .cal-month-label { min-width: 160px; font-size: 1.2rem; }
}

@media (max-width: 600px) {
    .calendar-grid-wrapper { grid-auto-rows: minmax(60px, 1fr); }
    .day-number { font-size: 0.75rem; }
    .event-pill { display: none; }
    .day-cell.has-event::after {
        content: '';
        position: absolute;
        bottom: 5px; right: 5px;
        width: 6px; height: 6px;
        border-radius: 50%;
        background: var(--zloto);
    }
    .main-header { padding: 0 20px; height: 90px; width: 100vw; margin-left: calc(-50vw + 50%); }
    .logo-box { padding: 5px 12px; height: 60px; font-size: 1rem; }
    .nav-btn { padding: 6px 12px; font-size: 0.72rem; letter-spacing: 1.5px; }
}

/* LOGO IMG */
.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 160px;
    width: 160px;
    object-fit: cover;
    cursor: default;
    border-radius: 50%;
    border: 2px solid rgba(201,162,39,0.5);
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s;
}

.logo-img:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}