/* ==========================================================================
   ProgresNet – style strony
   ========================================================================== */

:root {
    --orange: #ef7d00;
    --orange-dark: #c96500;
    --orange-soft: #fff3e6;
    --ink: #1f2328;
    --ink-2: #4a5059;
    --muted: #6b7280;
    --line: #e6e8eb;
    --bg: #ffffff;
    --bg-alt: #f6f7f9;
    --dark: #23262b;
    --dark-2: #2e3238;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgb(16 24 40 / .05), 0 4px 16px rgb(16 24 40 / .06);
    --shadow-hover: 0 2px 4px rgb(16 24 40 / .06), 0 12px 32px rgb(16 24 40 / .12);
    --container: 1180px;
    --header-h: 72px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-dark); text-underline-offset: 3px; }
a:hover { color: var(--orange); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; color: #fff; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container.narrow { max-width: 860px; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- przyciski ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .8rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
    font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
    text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); color: #fff; }
.btn-outline { border-color: var(--orange); color: var(--orange-dark); background: transparent; }
.btn-outline:hover { background: var(--orange); color: #fff; }
.btn-ghost { border-color: rgb(255 255 255 / .55); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-block { width: 100%; }

.link-arrow { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: " →"; transition: margin .2s; }
.link-arrow:hover::after { margin-left: .25rem; }
.link-arrow-back::after { content: none; }
.link-arrow-back::before { content: "← "; }

.eyebrow {
    display: block; margin: 0 0 .6rem; font-size: .8rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--orange-dark);
}
.eyebrow-light { color: #ffd3a3; }

.chip { display: inline-block; padding: .2rem .65rem; border-radius: 999px; background: var(--bg-alt); color: var(--ink-2); font-size: .8rem; font-weight: 600; }
.chip-accent { background: var(--orange-soft); color: var(--orange-dark); }

/* ---------- nagłówek ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 2px 12px rgb(16 24 40 / .06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1rem; }
.brand img { width: 170px; height: auto; }

.main-nav { display: flex; align-items: center; gap: .25rem; }
.main-nav a {
    padding: .5rem .75rem; border-radius: 999px; color: var(--ink-2);
    font-weight: 600; font-size: .95rem; text-decoration: none; transition: color .2s, background .2s;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--orange-dark); background: var(--orange-soft); }
.main-nav a.nav-cta { background: var(--orange); color: #fff; margin-left: .5rem; padding-inline: 1.1rem; }
.main-nav a.nav-cta:hover { background: var(--orange-dark); }

.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { content: ""; left: 0; top: -7px; }
.nav-toggle-bar::after { content: ""; left: 0; top: 7px; }
.is-open .nav-toggle-bar { background: transparent; }
.is-open .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.is-open .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1040px) {
    .nav-toggle { display: block; }
    .main-nav {
        position: absolute; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
        padding: .75rem 1.25rem 1.25rem; background: #fff; border-bottom: 1px solid var(--line);
        box-shadow: 0 12px 24px rgb(16 24 40 / .08);
        visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s;
    }
    .is-open .main-nav { visibility: visible; opacity: 1; transform: none; }
    .main-nav a { padding: .8rem 1rem; border-radius: var(--radius-sm); }
    .main-nav a.nav-cta { margin: .5rem 0 0; text-align: center; }
}

/* ---------- hero ---------- */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(900px 500px at 85% 10%, rgb(239 125 0 / .45), transparent 60%),
        radial-gradient(700px 400px at 0% 100%, rgb(239 125 0 / .18), transparent 60%),
        linear-gradient(160deg, #2a2d33 0%, #1b1d21 100%);
}
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
    background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: center; padding-block: clamp(4rem, 9vw, 7.5rem); }
.hero h1 { color: #fff; }
.hero-lead { font-size: 1.2rem; color: #d7dae0; max-width: 40rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.hero-stats li {
    display: flex; align-items: baseline; gap: 1rem; padding: 1.1rem 1.4rem;
    border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius); background: rgb(255 255 255 / .05);
}
.hero-stats strong { font-size: 2.1rem; color: var(--orange); min-width: 4.2rem; }
.hero-stats span { color: #d7dae0; }

@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
    .hero-stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
    .hero-stats li { flex-direction: column; gap: .1rem; padding: .9rem; }
    .hero-stats strong { font-size: 1.6rem; min-width: 0; }
    .hero-stats span { font-size: .85rem; line-height: 1.3; }
}
@media (max-width: 520px) {
    .hero-inner > * { min-width: 0; }
    .hero-stats { grid-template-columns: 1fr; }
    .hero-stats li { flex-direction: row; align-items: center; gap: 1rem; padding: .7rem 1rem; }
    .hero-stats strong { min-width: 3.2rem; }
    .hero-stats span { font-size: .95rem; }
}

/* ---------- sekcje ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section-tight { padding-block: 2.5rem 4rem; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--dark); color: #e5e7eb; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 760px; margin-bottom: 2.5rem; }
.section-head-row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.section-head-row > div { max-width: 760px; }
.section-lead { color: var(--ink-2); font-size: 1.1rem; }
.empty { color: var(--muted); }
.more { text-align: center; margin: 2.5rem 0 0; }

.grid { display: grid; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1040px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- usługi ---------- */
.service { padding: 1.75rem; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.service:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.service p { color: var(--ink-2); font-size: 1rem; flex: 1; }
.service-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--orange-soft); margin-bottom: 1.1rem; }
.service-icon svg { width: 26px; height: 26px; fill: var(--orange); }

/* ---------- kafelki galerii ---------- */
.tile {
    position: relative; display: block; overflow: hidden; border-radius: var(--radius);
    border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
    transition: transform .2s, box-shadow .2s;
}
.tile img { aspect-ratio: 16 / 10.5; object-fit: cover; object-position: top; width: 100%; transition: transform .4s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); color: var(--ink); }
.tile:hover img { transform: scale(1.04); }
.tile-caption { display: block; padding: .8rem 1rem; font-size: .92rem; font-weight: 600; line-height: 1.35; border-top: 1px solid var(--line); }

/* ---------- gry ---------- */
.games { gap: 2.5rem; }
.game-media { display: block; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; background: var(--dark-2); }
.game-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s; }
.game-media:hover img { transform: scale(1.03); }
.game p { color: #c3c7ce; }

/* ---------- karty wpisów ---------- */
.article-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.article-card-media { display: block; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.article-card-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
.article-card-body { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.article-card--funding { border-top: 4px solid var(--orange); }
.article-card-program { font-size: .85rem; line-height: 1.45; color: var(--orange-dark); font-weight: 600; margin-bottom: .6rem; }
.article-card-title { font-size: 1.12rem; line-height: 1.35; }
.article-card-title a { color: var(--ink); text-decoration: none; }
.article-card-title a:hover { color: var(--orange-dark); }
.article-card-excerpt { color: var(--ink-2); font-size: .97rem; flex: 1; }
.article-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: auto; }
.article-card-meta .link-arrow { margin-left: auto; font-size: .95rem; }

/* ---------- logotypy UE ---------- */
.eu-block { margin-top: 3rem; padding: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.eu-logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.25rem 2.25rem; }
.eu-logos img { max-height: 56px; width: auto; }
.eu-links { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; font-size: .95rem; }
.eu-links summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.eu-links ul { columns: 2; margin: .75rem 0 0; padding-left: 1.2rem; }
@media (max-width: 640px) { .eu-links ul { columns: 1; } .eu-logos img { max-height: 44px; } }

/* ---------- kontakt ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact-list { margin: 2rem 0 0; display: grid; gap: 1.25rem; }
.contact-list div { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.contact-list dt { font-weight: 700; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; padding-top: .2rem; }
.contact-list dd { margin: 0; }
.contact-list a { font-weight: 600; text-decoration: none; }
.contact-form { padding: clamp(1.5rem, 3vw, 2.25rem); }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.field input, .field textarea {
    width: 100%; padding: .75rem .9rem; font: inherit; color: var(--ink);
    border: 1.5px solid #d4d7dc; border-radius: var(--radius-sm); background: #fff; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgb(239 125 0 / .15); }
.has-error input, .has-error textarea { border-color: #d92d20; }
.field-errors { list-style: none; margin: .35rem 0 0; padding: 0; color: #b42318; font-size: .9rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .form-row-2 { grid-template-columns: 1fr; } }
.form-note { font-size: .82rem; color: var(--muted); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-weight: 600; }
.alert-success { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.alert-error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }

/* ---------- podstrony ---------- */
.page-head { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding-block: 2.5rem 2.25rem; }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: .4rem; }
.page-head .section-lead { margin: 0; }
.breadcrumbs { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--muted); }

.prose { font-size: 1.08rem; }
.prose > * + * { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1em; }
.prose li + li { margin-top: .3rem; }
.prose img { border-radius: var(--radius-sm); }

.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0 0 2rem; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts div { background: #fff; padding: 1rem 1.25rem; }
.facts .facts-wide { grid-column: 1 / -1; }
.facts dt { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: .2rem 0 0; font-weight: 600; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

.block-title { font-size: 1.3rem; margin-top: 2.5rem; }

.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.downloads a {
    display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); background: #fff; transition: border-color .2s, background .2s;
}
.downloads a:hover { border-color: var(--orange); background: var(--orange-soft); }
.file-ext { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; background: var(--orange); color: #fff; font-size: .75rem; font-weight: 800; }
.file-name { flex: 1; font-weight: 600; word-break: break-word; }
.file-size { color: var(--muted); font-size: .9rem; white-space: nowrap; }

.doc-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.doc-gallery a { display: block; text-decoration: none; color: var(--ink-2); font-size: .88rem; text-align: center; }
.doc-gallery img {
    width: 100%; aspect-ratio: 1 / 1.35; object-fit: cover; object-position: top; margin-bottom: .4rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.doc-gallery a:hover img { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.back { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: 3rem; }
.pagination a, .pagination span { min-width: 2.6rem; padding: .5rem .85rem; border-radius: 999px; text-align: center; text-decoration: none; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); }
.pagination a:hover { border-color: var(--orange); color: var(--orange-dark); }
.pagination [aria-current] { background: var(--orange); border-color: var(--orange); color: #fff; }

.page-error { text-align: center; padding-block: 7rem; }

/* ---------- stopka ---------- */
.site-footer { background: var(--dark); color: #b9bec6; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding-block: 3.5rem 2.5rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.footer-logo { width: 150px; margin-bottom: 1rem; filter: brightness(0) invert(1); opacity: .9; }
.footer-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: #fff; margin-bottom: .9rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / .1); padding-block: 1.25rem; font-size: .85rem; }

/* ---------- lightbox ---------- */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(12 13 15 / .97); color: #fff; }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .75rem; max-width: calc(100vw - 7rem); pointer-events: none; }
.lightbox-figure img { max-height: calc(100dvh - 8rem); width: auto; max-width: 100%; border-radius: 6px; background: #fff; pointer-events: auto; }
.lightbox-figure figcaption { font-size: .95rem; color: #d0d4da; text-align: center; }
.lightbox-btn { position: absolute; border: 0; background: rgb(255 255 255 / .1); color: #fff; width: 52px; height: 52px; border-radius: 50%; font-size: 2rem; line-height: 1; cursor: pointer; transition: background .2s; }
.lightbox-btn:hover { background: var(--orange); }
.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.is-single .lightbox-prev, .lightbox.is-single .lightbox-next { display: none; }
.lightbox-original { position: absolute; bottom: 1rem; right: 1.25rem; color: #d0d4da; font-size: .85rem; }
@media (max-width: 640px) {
    .lightbox-figure { max-width: calc(100vw - 1rem); }
    .lightbox-prev, .lightbox-next { top: auto; bottom: 1rem; transform: none; }
    .lightbox-original { bottom: 1.9rem; left: 50%; right: auto; transform: translateX(-50%); }
}
