/* ---------------------------------------------------------------------
   Design tokens
   ------------------------------------------------------------------ */
:root {
    --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-text: #17181a;
    --color-muted: #6b7280;
    --color-border: #e6e7eb;
    --color-hero-bg: #eef0f3;

    --color-accent: #3452d9;
    --color-accent-dark: #2338a6;

    --color-footer-bg: #141416;
    --color-footer-text: #b7b8bd;
    --color-footer-border: #2a2b2e;

    --radius-card: 14px;
    --radius-pill: 999px;
    --shadow-card: 0 1px 2px rgba(20, 20, 24, 0.04);

    --container-width: 1180px;
}

* { box-sizing: border-box; }

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

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    line-height: 1.2;
    margin: 0 0 0.6em;
}

a { color: var(--color-accent-dark); }

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

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* ---------------------------------------------------------------------
   Header - mobile-first: brand + hamburger, nav collapses into a panel
   ------------------------------------------------------------------ */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.3rem;
    text-decoration: none;
    color: var(--color-text);
    margin-right: auto;
}

.brand-logo {
    width: 24px;
    height: 24px;
    flex: none;
}

.nav-toggle {
    margin-left: auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
}

.main-nav {
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    padding-top: 0.9rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--color-border);
}

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

.main-nav a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.98rem;
    font-weight: 500;
}

.main-nav a:hover { color: var(--color-accent); }

.nav-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1.5px solid var(--color-text);
    border-radius: var(--radius-pill);
    padding: 0.45rem 0.95rem;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-auth-btn:hover { background: var(--color-text); color: #fff; }

@media (min-width: 760px) {
    .nav-toggle { display: none; }

    .header-inner { flex-wrap: nowrap; }

    .main-nav {
        flex-basis: auto;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 1.6rem;
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }
}

/* ---------------------------------------------------------------------
   Messages
   ------------------------------------------------------------------ */
.messages { margin-top: 1rem; }
.message {
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #eef1fb;
    border: 1px solid var(--color-border);
    font-size: 0.9rem;
}
.message-error { background: #fbe9e7; }
.message-success { background: #e7f6ec; }

/* ---------------------------------------------------------------------
   Generic building blocks (used across blog/pages/maps/contact/accounts)
   ------------------------------------------------------------------ */
main.container { padding-top: 1.75rem; padding-bottom: 3.5rem; min-height: 55vh; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
}

.btn {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--font-sans);
}
.btn:hover { background: var(--color-accent-dark); }

.btn-outline {
    display: inline-block;
    border: 1.5px solid var(--color-text);
    color: var(--color-text);
    background: transparent;
    padding: 0.6rem 1.3rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}
.btn-outline:hover { background: var(--color-text); color: #fff; }

input, textarea, select {
    font: inherit;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    color: var(--color-text);
    width: 100%;
}

.form-row { margin-bottom: 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; }
.form-row label { font-size: 0.88rem; color: var(--color-muted); }
.errorlist { color: #b3261e; font-size: 0.85rem; padding-left: 1rem; margin: 0.2rem 0; }

.muted { color: var(--color-muted); font-size: 0.85rem; }

.tag {
    display: inline-block;
    background: #eef0f3;
    color: var(--color-text);
    border-radius: var(--radius-pill);
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
    margin: 0 0.3rem 0.3rem 0;
    text-decoration: none;
}
.tag:hover { background: var(--color-accent); color: #fff; }

.inline-fields { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Uniwersalny efekt powiększenia obrazu ze śledzeniem kursora - dowolny
   <div class="hover-zoom"><img ...></div>. Punkt powiększenia (transform-
   origin) jest aktualizowany w JS (static/js/hover_zoom.js) na podstawie
   pozycji myszki nad kontenerem.
   ------------------------------------------------------------------ */
.hover-zoom {
    position: relative;
    overflow: hidden;
}

.hover-zoom img {
    transition: transform 0.2s ease-out;
    will-change: transform;
}

.hover-zoom:hover img {
    transform: scale(1.8);
}
.inline-fields input { width: auto; flex: 1; min-width: 0; }

/* Fallback simple grid (home page, static pages list) */
.post-list, .page-list { display: flex; flex-direction: column; gap: 1rem; }
.post-card img, .page-card img { max-width: 100%; border-radius: 8px; }

/* ---------------------------------------------------------------------
   Blog: hero
   ------------------------------------------------------------------ */
.hero {
    background: var(--color-hero-bg);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    margin: 0.5rem 0 2.5rem;
}

.hero h1 {
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.6rem, 5vw, 2.75rem);
    margin-bottom: 0.75rem;
}

.hero p {
    color: var(--color-muted);
    font-size: 1rem;
    max-width: 62ch;
    margin-bottom: 1.4rem;
}

@media (min-width: 760px) {
    .hero { padding: 3rem 2.75rem; }
}

/* ---------------------------------------------------------------------
   Blog: post grid (horizontal cards) - stacked on mobile, side-by-side up
   ------------------------------------------------------------------ */
.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 700px) {
    .post-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
}

.post-card-h {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: inherit;
}

.post-card-h .thumb {
    flex: none;
    background: var(--color-hero-bg);
}

.post-card-h .thumb img {
    width: 100%;
    height: 100%;
    min-height: 190px;
    object-fit: cover;
}

.post-card-h .body {
    padding: 1.1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
}

@media (min-width: 700px) {
    .post-card-h { flex-direction: row; }
    .post-card-h .thumb { flex: 0 0 42%; }
    .post-card-h .body { padding: 1.1rem 1.25rem; }
}

.badge {
    display: inline-block;
    align-self: flex-start;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.65rem;
}

.post-card-h h3 {
    font-size: 1.15rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-bottom: 0.55rem;
}
.post-date svg { flex: none; opacity: 0.7; }

.post-excerpt {
    font-size: 0.9rem;
    color: #474a52;
    margin-bottom: 0.85rem;
}

.read-more {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    margin-top: auto;
}
.read-more:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------
   Data table (kontakt: lista wiadomości, mapa: lista znalezisk)
   ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    min-width: 640px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
    overflow-wrap: break-word;
}
.data-table th { color: var(--color-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tbody tr:hover { background: var(--color-hero-bg); }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1.5px solid var(--color-text);
    border-radius: 50%;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}
.icon-btn:hover { background: var(--color-text); color: #fff; }
.icon-btn svg { width: 15px; height: 15px; }

.status-badge {
    display: inline-block;
    border-radius: var(--radius-pill);
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef0f3;
    color: var(--color-text);
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Pagination
   ------------------------------------------------------------------ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-link, .page-current, .page-arrow, .page-ellipsis {
    min-width: 38px;
    height: 38px;
    padding: 0 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.9rem;
    background: #fff;
}

.page-current { background: var(--color-accent); border-color: var(--color-accent); color: #fff; font-weight: 700; }
.page-ellipsis { border-color: transparent; color: var(--color-muted); }
.page-link:hover, .page-arrow:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ---------------------------------------------------------------------
   "More posts" section (vertical cards)
   ------------------------------------------------------------------ */
.section-title {
    font-style: italic;
    font-weight: 700;
    text-align: center;
    font-size: clamp(1.3rem, 3vw, 1.75rem);
    margin: 1rem 0 1.75rem;
}

.more-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 620px) {
    .more-posts-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
    .more-posts-grid { grid-template-columns: repeat(3, 1fr); }
}

.more-post-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-card);
}

.more-post-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

.more-post-card .body {
    padding: 1rem 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.more-post-card h4 { font-size: 1.02rem; margin-bottom: 0.5rem; }
.more-post-card p { font-size: 0.85rem; color: #474a52; flex: 1; margin-bottom: 1rem; }

.btn-pill-block {
    display: block;
    text-align: center;
    border: 1.5px solid var(--color-text);
    border-radius: var(--radius-pill);
    padding: 0.55rem 1rem;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-pill-block:hover { background: var(--color-text); color: #fff; }

/* ---------------------------------------------------------------------
   Blog post detail
   ------------------------------------------------------------------ */
.post-detail-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin-bottom: 0.5rem;
}
.post-content { font-size: 1.02rem; }
.post-content img { border-radius: 10px; margin: 1rem 0; }
.post-content p { margin: 0 0 1.1em; }

/* ---------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    margin-top: 3rem;
    padding-top: 2.5rem;
}

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 700px) {
    .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
}

.footer-brand {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.6rem;
}

.footer-col h4 {
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.9rem;
}

.footer-col a {
    display: block;
    color: var(--color-footer-text);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid var(--color-footer-border);
    margin-top: 2rem;
    padding: 1.1rem 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: #86878c;
}
