/* grabski.info — vanilla CSS, mobile-first, zero zależności zewnętrznych */

:root {
    --color-bg: #f5f9fc;
    --color-text: #1c2b3a;
    --color-muted: #64798c;
    --color-accent: #2f6690;
    --color-accent-light: #4f88b8;
    --color-highlight: #b8863c;
    --color-border: #dde6ee;
    --color-card: rgba(255, 255, 255, 0.92);
    --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 14px;
    --max-width: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--color-accent); }
a:hover { color: var(--color-highlight); }

/* ── Tło animowane — na całą stronę, za treścią ──────────────────── */

.bg-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: block;
    z-index: 0;
    pointer-events: none;
    background: var(--color-bg);
}

/* ── Powłoka aplikacji: przyklejony nagłówek + stopka, ────────────
   przewijalny tylko środek. Dotyczy TYLKO strony publicznej
   (body.app-shell) — panel admina scrolluje normalnie. ──────────── */

:root {
    --header-h: 52px;
    --footer-h: 56px;
}

body.app-shell {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    height: calc(var(--header-h) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.site-header--admin {
    justify-content: space-between;
}

.admin-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    padding: 0.4rem 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.admin-link:hover {
    background: var(--color-card);
    color: var(--color-highlight);
}

.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(var(--footer-h) + env(safe-area-inset-bottom));
    padding: 0.6rem 1.25rem calc(0.6rem + env(safe-area-inset-bottom));
}

.scroll-area {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    z-index: 1;
}

/* ── Layout ───────────────────────────────────────────────────── */

main {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--header-h) + env(safe-area-inset-top) + 2rem) 1.25rem
             calc(var(--footer-h) + env(safe-area-inset-bottom) + 2rem);
}

.section {
    position: relative;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2.25rem 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 10px 30px rgba(28, 43, 58, 0.05);
}

@media (min-width: 600px) {
    .section { padding: 2.75rem 2.5rem; }
}

.section:last-child { margin-bottom: 0; }

.section-secondary {
    background: rgba(255, 255, 255, 0.72);
}

.section h2 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    margin: 0 0 1.5rem;
    color: var(--color-accent);
}

.section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--color-accent-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Fakty o wydarzeniu (Etap 1) ──────────────────────────────── */

.event-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1.25rem;
    margin: 0;
}

.event-facts dt {
    font-weight: 700;
    color: var(--color-muted);
}

.event-facts dd { margin: 0; }

.agenda {
    list-style: none;
    padding: 0;
    margin: 0;
}

.agenda li {
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--color-border);
}

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

/* ── Kontakt ──────────────────────────────────────────────────── */

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 1.1rem;
}

/* ── Galeria ──────────────────────────────────────────────────── */

.archives-list {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--color-border);
}

.archives-intro {
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.archives-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.archives-list a { font-weight: 600; }

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 540px) {
    .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 780px) {
    .gallery { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
}

.gallery-item {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: var(--color-border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gallery-item:hover img { transform: scale(1.04); }

/* ── Lightbox ─────────────────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 24, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    touch-action: pan-y;
}

.lightbox[hidden] { display: none; }

.lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0.6rem 0.9rem;
    border-radius: 50%;
}

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.25); }

/* ── Formularze ───────────────────────────────────────────────── */

.unlock-form,
.login-form,
.upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.25rem;
}

input[type="password"],
input[type="text"],
input[type="url"],
input[type="file"] {
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
    color: var(--color-text);
}

button {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: 10px;
    background: var(--color-accent);
    color: #fff;
    cursor: pointer;
}

button:hover { background: var(--color-accent-light); }

.form-error {
    color: #b3432f;
    font-weight: 600;
    width: 100%;
    margin: 0;
}

/* ── Stopka ───────────────────────────────────────────────────── */

.credit-panel {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.8rem;
    color: var(--color-muted);
    box-shadow: 0 6px 18px rgba(28, 43, 58, 0.05);
}

.credit-panel a {
    font-weight: 600;
    color: var(--color-accent);
}
