/* ============================================================
   CMS — Szkoła Polska w Nicei
   Styl strony publicznej (responsywny, WCAG)
   ============================================================ */

:root {
    --red: #D4213D;
    --red-hover: #A71A30;
    --blue: #1D3557;
    --blue-soft: #457B9D;
    --navy: #001A29;

    --bg: #F0F4F8;
    --surface: #FFFFFF;
    --text: #11151C;
    --muted: #5C677D;
    --border: #E3E8EF;

    --focus: #FFB703;

    --font-head: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', system-ui, sans-serif;

    --radius: 20px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(29, 53, 87, 0.07);
    --shadow-hover: 0 18px 45px rgba(29, 53, 87, 0.13);
    --transition: 0.25s ease;
}

/* Wysoki kontrast (WCAG) */
body.high-contrast {
    --red: #FFFF00;
    --red-hover: #FFFFFF;
    --blue: #00FFFF;
    --blue-soft: #00FFFF;
    --navy: #000000;
    --bg: #000000;
    --surface: #121212;
    --text: #FFFFFF;
    --muted: #DDDDDD;
    --border: #FFFF00;
    --focus: #00FF00;
    --shadow: none;
    --shadow-hover: none;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    font-size: 16px;
    overflow-x: hidden;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--text); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
    position: absolute; top: -60px; left: 0; background: var(--focus); color: #000;
    padding: 12px 24px; z-index: 9999; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 0; }

.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;
}

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

/* ---------------- Panel dostępności ---------------- */
.accessibility-panel {
    background: var(--navy); color: #fff; padding: 0.4rem 5%;
    display: flex; justify-content: flex-end; align-items: center; gap: 1.25rem;
    font-size: 0.85rem;
}
.acc-group { display: flex; align-items: center; gap: 0.4rem; }
.acc-btn {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.35); color: #fff;
    padding: 0.3rem 0.7rem; min-width: 38px; min-height: 38px; border-radius: 8px;
    cursor: pointer; font-weight: 700; transition: var(--transition);
}
.acc-btn:hover { background: #fff; color: var(--navy); }
body.high-contrast .accessibility-panel { background: #000; border-bottom: 2px solid var(--red); }

/* ---------------- Nagłówek ---------------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--surface); border-bottom: 3px solid var(--red);
    box-shadow: var(--shadow);
}
.header-inner {
    max-width: 1200px; margin: 0 auto; padding: 0.8rem 5%;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo:hover { text-decoration: none; }
.site-logo-img { height: 46px; width: auto; object-fit: contain; border-radius: 6px; }
.logo-text { font-family: var(--font-head); font-size: 1.35rem; font-weight: 800; color: var(--blue); }
body.high-contrast .site-logo-img { filter: grayscale(100%); border: 1px solid var(--red); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle .bar { display: block; width: 26px; height: 3px; background: var(--blue); margin: 5px 0; border-radius: 2px; transition: var(--transition); }
body.high-contrast .nav-toggle .bar { background: var(--red); }

.primary-nav ul { list-style: none; display: flex; gap: 0.5rem; align-items: center; }
.primary-nav a {
    display: flex; align-items: center; justify-content: center; text-align: center;
    padding: 0.6rem 1rem; color: var(--text); font-weight: 600;
    border-radius: 30px; transition: var(--transition); text-decoration: none; font-size: 0.95rem;
}
.primary-nav a:hover { background: rgba(212, 33, 61, 0.08); color: var(--red); text-decoration: none; }
.primary-nav a.active { background: var(--red); color: #fff; }
body.high-contrast .primary-nav a.active { background: var(--red); color: #000; }

/* ---------------- Hero ---------------- */
.hero {
    background:
        radial-gradient(circle at 85% 20%, rgba(69, 123, 157, 0.16), transparent 45%),
        linear-gradient(135deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff; text-align: center; padding: 6rem 5%;
}
.hero-content { max-width: 860px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: 3rem; margin-bottom: 1.25rem; }
.hero-subtitle { font-size: 1.25rem; color: rgba(255,255,255,0.9); margin-bottom: 2.25rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
body.high-contrast .hero { background: #000; border-bottom: 2px solid var(--red); }

/* ---------------- Przyciski ---------------- */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.6rem;
    border-radius: 40px; font-weight: 700; font-size: 1rem; border: 2px solid transparent;
    cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-hover); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #14263d; }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.hero .btn-outline { color: #fff; border-color: #fff; }
.hero .btn-outline:hover { background: #fff; color: var(--blue); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-danger { background: #b00020; color: #fff; }
.btn-block { width: 100%; justify-content: center; }
body.high-contrast .btn-red, body.high-contrast .btn-blue { background: var(--red); color: #000; }

.btn-text {
    display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700;
    color: var(--red); text-decoration: none;
}
.btn-text:hover { text-decoration: underline; }

/* ---------------- Sekcje i karty ---------------- */
main { display: block; }
.section { max-width: 1200px; margin: 0 auto; padding: 3.5rem 5%; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section-title { font-size: 2.2rem; color: var(--blue); }
.section-subtitle { color: var(--muted); max-width: 560px; }
.link-more { font-weight: 700; color: var(--red); white-space: nowrap; }

.card {
    background: var(--surface); border-radius: var(--radius); padding: 2.5rem;
    box-shadow: var(--shadow); border: 1px solid var(--border);
}
body.high-contrast .card { border: 2px solid var(--border); box-shadow: none; }

/* ---------------- Strona (hero podstrony) ---------------- */
.page-hero {
    background: linear-gradient(135deg, var(--blue) 0%, var(--navy) 100%);
    color: #fff; padding: 4rem 5%; text-align: center;
}
.page-hero-inner { max-width: 860px; margin: 0 auto; }
.page-hero h1 { color: #fff; font-size: 2.6rem; margin-bottom: 0.75rem; }
.page-hero p { color: rgba(255,255,255,0.9); font-size: 1.15rem; }
body.high-contrast .page-hero { background: #000; border-bottom: 2px solid var(--red); }

/* ---------------- Siatka funkcji (home) ---------------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature-card {
    background: var(--surface); border-radius: var(--radius); padding: 2rem;
    box-shadow: var(--shadow); border: 1px solid var(--border); text-decoration: none;
    color: var(--text); transition: var(--transition); display: block;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); text-decoration: none; }
.feature-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px;
    border-radius: 14px; background: rgba(212, 33, 61, 0.1); color: var(--red); font-size: 1.5rem; margin-bottom: 1rem;
}
.feature-card h3 { margin-bottom: 0.5rem; color: var(--blue); }
.feature-card p { color: var(--muted); font-size: 0.95rem; }

/* ---------------- Aktualności ---------------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.news-card {
    background: var(--surface); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; flex-direction: column;
    transition: var(--transition);
}
.news-card:hover { box-shadow: var(--shadow-hover); }
.news-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--border); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.news-card:hover .news-thumb img { transform: scale(1.05); }
.news-card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.news-card-body h3 { font-size: 1.25rem; }
.news-card-body h3 a { color: var(--text); }
.news-card-body h3 a:hover { color: var(--red); text-decoration: none; }
.news-card-body p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.news-card-body .btn-text { margin-top: 0.5rem; }

.news-meta { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
.badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.7rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge-event { background: rgba(212, 33, 61, 0.12); color: var(--red); }
.badge-news { background: rgba(69, 123, 157, 0.14); color: var(--blue-soft); }
.badge-muted { background: #e6e9ee; color: #5c677d; }

/* Lista aktualności */
.news-list { display: flex; flex-direction: column; gap: 1.25rem; }
.news-row {
    background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
    box-shadow: var(--shadow); display: grid; grid-template-columns: 260px 1fr; overflow: hidden;
}
.news-row-thumb { display: block; min-height: 180px; background: var(--border); }
.news-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-row-body { padding: 1.75rem; display: flex; flex-direction: column; gap: 0.6rem; }
.news-row-body h2 { font-size: 1.5rem; }
.news-row-body h2 a { color: var(--text); }
.news-row-body h2 a:hover { color: var(--red); text-decoration: none; }
.news-row-body p { color: var(--muted); }

/* Artykuł */
.article { max-width: 900px; }
.article-cover { margin-bottom: 2rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.article-cover img { width: 100%; }
.article-head { margin-bottom: 2rem; }
.article-head h1 { font-size: 2.5rem; margin: 1rem 0 0.5rem; }
.article-category { color: var(--muted); }
.back-link { margin-bottom: 1.5rem; }

/* ---------------- Galeria ---------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.gallery-item {
    margin: 0; border-radius: var(--radius-sm); overflow: hidden; position: relative;
    box-shadow: var(--shadow); background: var(--surface);
}
.gallery-link { display: block; text-decoration: none; color: inherit; }
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: var(--transition); }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item figcaption {
    padding: 0.6rem 0.9rem; font-size: 0.85rem; color: var(--muted); background: var(--surface);
}

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center; padding: 3rem;
}
.lightbox[hidden] { display: none; }
.lightbox-figure { max-width: 90vw; max-height: 85vh; text-align: center; }
.lightbox-figure img { max-width: 100%; max-height: 78vh; margin: 0 auto; object-fit: contain; }
.lightbox-figure figcaption { color: #fff; margin-top: 1rem; font-size: 1rem; }
.lightbox-close {
    position: absolute; top: 1rem; right: 1.5rem; background: none; border: 0; color: #fff;
    font-size: 2.5rem; cursor: pointer; line-height: 1;
}
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15);
    border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1.25rem;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* Albumy galerii */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.album-card {
    background: var(--surface); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); border: 1px solid var(--border); text-decoration: none;
    color: var(--text); transition: var(--transition); display: block;
}
.album-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); text-decoration: none; }
.album-cover { position: relative; aspect-ratio: 16/10; background: var(--border); overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--blue-soft); font-size: 2.5rem; }
.album-count {
    position: absolute; bottom: 0.75rem; right: 0.75rem; background: rgba(16, 26, 43, 0.78);
    color: #fff; padding: 0.2rem 0.7rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}
.album-card-body { padding: 1.25rem; }
.album-card-body h3 { color: var(--blue); margin-bottom: 0.3rem; font-size: 1.2rem; }
.album-card-body p { color: var(--muted); font-size: 0.9rem; }

/* ---------------- Kontakt ---------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.5rem; align-items: start; }
.contact-info h2 { margin-bottom: 1rem; color: var(--blue); }
.contact-details { list-style: none; margin-top: 1.5rem; }
.contact-details li { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem; }
.contact-details i { color: var(--red); margin-top: 0.3rem; }
.contact-form-card h2 { margin-bottom: 1rem; color: var(--blue); }

/* Formularze */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.9rem; }
.form-group input, .form-group textarea {
    width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 10px;
    font-family: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
}
.form-group input:focus, .form-group textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.req { color: var(--red); }
.form-hint { font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 1rem 1.25rem; border-radius: 10px; margin-bottom: 1.25rem; }
.alert-success { background: #e8f6ef; color: #1e7e50; border: 1px solid #bfe6d2; }
.alert-error { background: #fdecea; color: #b00020; border: 1px solid #f5c2c9; }
.alert ul { padding-left: 1.25rem; }

.empty-state { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty-state i { font-size: 3rem; color: var(--blue-soft); margin-bottom: 1rem; display: block; }
.empty-state h1 { font-size: 1.6rem; color: var(--text); margin-bottom: 0.5rem; }

/* ---------------- Treść strony (rich-content) ---------------- */
.rich-content { line-height: 1.8; }
.rich-content h2 { color: var(--blue); font-size: 1.9rem; margin: 1.75rem 0 1rem; }
.rich-content h3 { color: var(--blue); font-size: 1.4rem; margin: 1.5rem 0 0.75rem; }
.rich-content p { margin-bottom: 1.1rem; }
.rich-content ul { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.rich-content li { margin-bottom: 0.4rem; }
.rich-content img { border-radius: var(--radius-sm); margin: 1rem 0; }
.rich-content a { color: var(--red); font-weight: 600; }
.rich-content blockquote {
    border-left: 4px solid var(--red); padding: 0.75rem 1.25rem; margin: 1.25rem 0;
    background: rgba(212, 33, 61, 0.05); border-radius: 0 8px 8px 0;
}
.rich-content table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; }
.rich-content th, .rich-content td { border: 1px solid var(--border); padding: 0.6rem 0.9rem; text-align: left; }
.rich-content th { background: rgba(69, 123, 157, 0.1); }

/* ---------------- Stopka ---------------- */
.site-footer { background: var(--navy); color: #cdd5e0; margin-top: 4rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 3rem 5% 1.5rem; }
.funding-info {
    border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 1.25rem;
    display: flex; justify-content: center; margin-bottom: 2.5rem; background: #fff;
}
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 2rem; }
.footer-col h3 { color: #fff; font-size: 1.4rem; margin-bottom: 0.75rem; }
.footer-col h4 { color: #fff; font-size: 1.05rem; margin-bottom: 0.9rem; }
.footer-tagline { color: #9fb0c4; font-size: 0.95rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { color: #cdd5e0; }
.footer-col a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 0.6rem; align-items: flex-start; }
.footer-contact i { color: var(--red); margin-top: 0.25rem; }
.social-links { display: flex; gap: 0.6rem; margin-top: 1rem; }
.social-links a {
    width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1);
    display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: var(--transition);
}
.social-links a:hover { background: var(--red); text-decoration: none; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15); margin-top: 2.5rem; padding-top: 1.25rem;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem;
    color: #9fb0c4;
}
.footer-bottom a { color: #9fb0c4; }
body.high-contrast .site-footer { background: #000; border-top: 2px solid var(--red); }

/* ---------------- Responsywność ---------------- */
@media (max-width: 992px) {
    .feature-grid, .news-grid, .album-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 2.4rem; }
}

@media (max-width: 768px) {
    .accessibility-panel { justify-content: center; }
    .nav-toggle { display: block; }
    .primary-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--surface); border-bottom: 3px solid var(--red); box-shadow: var(--shadow);
    }
    .primary-nav.open { display: block; }
    .primary-nav ul { flex-direction: column; align-items: stretch; padding: 1rem 5%; }
    .primary-nav a { border-radius: 10px; padding: 0.75rem 1rem; }
    .hero { padding: 4rem 5%; }
    .hero h1 { font-size: 2rem; }
    .feature-grid, .news-grid, .gallery-grid, .album-grid { grid-template-columns: 1fr; }
    .news-row { grid-template-columns: 1fr; }
    .news-row-thumb { min-height: 200px; }
    .section { padding: 2.5rem 5%; }
    .form-row { grid-template-columns: 1fr; }
    .section-title { font-size: 1.8rem; }
    .footer-cols { grid-template-columns: 1fr; }
    .card { padding: 1.75rem; }
}
