/* ============================================
   WSPÓLNE STYLE (ładowane jako ostatnie w base.html)
   Jedno miejsce na kolory, fokus, menu mobilne, ruch,
   układ sekcji i czytelność tekstu dla wszystkich stron.
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* --- Kolory: 3 barwy marki + neutralne --------------------
   granat  - tło nagłówka, stopki i tabliczek z tekstem
   niebieski - tła drugiego planu, ramki
   złoto   - tekst na granacie, akcent (kontrast 8.42:1)   */
:root {
    --granat: #0e3457;
    --granat-ciemny: #141527;
    --granat-jasny: #31425d;
    --niebieski: #729fb6;
    --niebieski-jasny: #B3D0DE;
    --zloto: #E5D283;
    --tabliczka: rgba(14, 52, 87, 0.88);
    --zloto-ciemne: #8A6A16;

    /* stare nazwy używane w plikach stron */
    --main-color: var(--granat-ciemny);
    --bg-color: var(--niebieski);
    --second-bg-color: var(--niebieski-jasny);
    --text-color: var(--zloto);
}

header {
    background: var(--granat);
}

/* --- Fokus klawiatury -------------------------------------
   Ciemna linia + złota obwódka: widoczne i na granacie,
   i na złotych boksach z tekstem.                          */
:focus-visible {
    outline: 3px solid var(--granat-ciemny);
    box-shadow: 0 0 0 6px var(--zloto);
    border-radius: 4px;
}

a[href],
button,
label[for],
summary {
    cursor: pointer;
}

/* --- Menu mobilne -----------------------------------------
   Checkbox był display:none, więc nie dało się go osiągnąć
   Tabem. Teraz jest niewidoczny, ale fokusowalny.          */
@media (max-width: 1250px) {
    #menu-toggle {
        display: block;
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    #menu-toggle:focus-visible + .menu-button-container {
        outline: 3px solid var(--zloto);
        outline-offset: 4px;
        border-radius: 4px;
    }

    .menu-button-container {
        min-width: 44px;
        min-height: 44px;
    }

    /* przy otwieraniu menu od razu widoczne dla Taba,
       przy zamykaniu chowa się dopiero po wysunięciu */
    #menu-toggle ~ .menu {
        transition: left 1s, visibility 0s 1s;
    }

    #menu-toggle:checked ~ .menu {
        transition: left 1s, visibility 0s;
    }

    #menu-toggle ~ .menu a,
    #menu-toggle:checked ~ .menu a {
        transition: height 1s, padding 1s, color 0.3s, text-decoration 0.3s;
    }

    #menu-toggle ~ .menu a,
    #menu-toggle:checked ~ .menu a {
        background-color: var(--granat);
        border-color: var(--granat-jasny);
    }
}

/* --- Ruch -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* --- Zdjęcie główne (hero) jako <img> w HTML --------------- */
.main_page_onas,
.main_page_index {
    position: relative;
}

.hero_img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.main_page_onas > :not(.hero_img),
.main_page_index > :not(.hero_img) {
    position: relative;
    z-index: 1;
}

/* --- Sekcje tekst + zdjęcie ---------------------------------
   Wysokość wynika z treści, a nie ze sztywnego 110vh/170vh.  */
.storyteller_left,
.storyteller_right {
    height: auto;
    min-height: min(72vh, 680px);
}

/* height:auto, żeby flex rozciągnął boksy na całą wysokość sekcji
   (rozciąganie nie działa przy height:100% z plików stron) */
.storyteller_left > .text_box,
.storyteller_left > .photo_box,
.storyteller_left > .photo_box2,
.storyteller_right > .text_box,
.storyteller_right > .photo_box,
.storyteller_right > .photo_box2 {
    height: auto;
}

@media (max-width: 480px), (max-height: 500px) {
    .storyteller_left,
    .storyteller_right {
        height: auto;
        min-height: 0;
    }

    .storyteller_left .photo_box,
    .storyteller_right .photo_box,
    .photo_box2 {
        height: auto;
    }

    /* zdjęcie dostaje wysokość wprost: procent z boksu bez stałej
       wysokości dałby zero */
    .storyteller_left .photo_box > *,
    .storyteller_right .photo_box > *,
    .photo_box2 > a > div {
        height: auto;
        min-height: 60vh;
    }

    .storyteller_left .text_box,
    .storyteller_right .text_box {
        height: auto;
        padding: 32px 16px;
    }
}

/* --- Tabliczka z napisem na zdjęciu ------------------------ */
.etykieta {
    background: var(--tabliczka);
    color: var(--zloto);
    padding: 0.25em 0.6em;
    border-radius: 12px;
    line-height: 1.1;
}

/* --- Stopka ------------------------------------------------ */
.footer-col h2 {
    font-size: 22px;
    color: var(--zloto);
    text-transform: none;
    margin-bottom: 35px;
    font-weight: 500;
    position: relative;
    text-align: center;
}

.footer-col h2::before {
    content: '';
    position: absolute;
    left: 5%;
    bottom: -10px;
    background-color: var(--niebieski);
    height: 2px;
    width: 90%;
}

.footer-credits {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--zloto);
}

.footer-col .social-links a {
    width: 44px;
    height: 44px;
    line-height: 44px;
}

/* --- Czytelność tekstu --------------------------------------
   MedievalSharp zostaje na nagłówkach, menu, tytułach i inicjałach.
   Dłuższe bloki tekstu: Lora (pełne polskie znaki). Sekcje mają
   już wysokość z treści, więc tekst nie musi być pomniejszany.  */
.text_box,
.text_box *,
.pomoc_text,
.pomoc_text *,
.text_container p,
.text_container p *,
.turniej_text,
.turniej_text *,
.turniej_funding,
.partner_subtitle,
.partner_subtitle *,
.footer-footer,
.footer-footer *,
.wstep,
.wstep *,
.panel,
.panel *,
.oferta_lista,
.oferta_lista *,
.karty_naglowek p {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

.text_box .projekt_link_title,
.text_box .projekt_link_title *,
.text_box .czytaj_wiecej_btn,
.tekst h2,
.panel h2,
.oferta_lista h2,
.panel .przycisk,
.panel .kontakt_wartosc {
    font-family: MedievalSharp, serif;
}

/* --- Przyciemnienie pod tytułem na zdjęciu ------------------
   Cel: czytelność złotego tytułu na jasnych zdjęciach (R-25),
   nie ozdoba. Owal ciemności tylko wokół tytułu.             */
.main_page_onas::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 75% 38% at 50% 50%,
        rgba(10, 16, 32, 0.68) 0%,
        rgba(10, 16, 32, 0.6) 55%,
        rgba(10, 16, 32, 0) 100%);
}

.title_onas,
.main_page_index .title {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* --- Pergamin: jasne boksy tekstu --------------------------
   Złoto zostaje akcentem (tytuły, ramki, inicjały, przyciski),
   a długi tekst stoi na jasnym tle z granatowym tekstem
   (15.3:1).                                                  */
:root {
    --pergamin: #F4ECD8;
}

.storyteller_left > .text_box,
.storyteller_right > .text_box {
    background-color: var(--pergamin);
    color: var(--granat-ciemny);
}

.storyteller_left > .text_box .projekt_link_title,
.storyteller_left > .text_box .projekt_link_title * {
    color: var(--granat) !important;
}

/* Boksy z tekstem podzielonym na akapity */
.text_box.tekst {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    padding: clamp(28px, 4vw, 56px);
    font-size: clamp(1.02rem, 0.9rem + 0.35vw, 1.2rem);
    line-height: 1.65;
}

.tekst p,
.tekst ul {
    max-width: 62ch;
    margin: 0 0 1em;
}

.tekst > :last-child {
    margin-bottom: 0;
}

.tekst h2 {
    margin: 0 0 0.6em;
    color: var(--granat);
    font-size: 1.6em;
    font-weight: 400;
    line-height: 1.15;
}

.tekst a:not(.czytaj_wiecej_btn):not(.projekt_link_title) {
    color: var(--granat);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* „Przykładowe imprezy”: lista zamiast zdania z przecinkami */
.imprezy_tytul {
    margin: 1.4em 0 0.5em;
    font-weight: 700;
}

.imprezy {
    padding-left: 1.2em;
    list-style: none;
}

.imprezy li {
    position: relative;
    margin-bottom: 0.35em;
}

.imprezy li::before {
    content: '';
    position: absolute;
    left: -1em;
    top: 0.62em;
    width: 0.4em;
    height: 0.4em;
    transform: rotate(45deg);
    background: var(--zloto-ciemne);
}

/* --- Wstęp z inicjałem ----------------------------------------
   Motyw tożsamości: inicjał jak w kronikach (MedievalSharp, złoto).
   Jeden na stronę, zawsze na początku pierwszego akapitu.      */
.wstep {
    max-width: 46rem;
    margin: clamp(48px, 7vw, 88px) auto;
    padding: 0 16px;
}

.wstep p {
    margin: 0;
    color: var(--pergamin);
    font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
    line-height: 1.55;
}

/* akapit obejmuje cały inicjał, nawet gdy ma tylko jedną linię */
.inicjal {
    display: flow-root;
}

.inicjal::first-letter {
    float: left;
    padding: 0.08em 0.12em 0 0;
    color: var(--zloto);
    font-family: MedievalSharp, serif;
    font-size: 3.4em;
    line-height: 0.8;
}

/* --- Rytm sekcji -------------------------------------------
   Sekcje jako osobne karty z odstępem i różnymi proporcjami
   (tekst/zdjęcie 56/44, potem zdjęcie/tekst 58/42).          */
.column > .storyteller_left,
.column > .storyteller_right {
    border-radius: 16px;
    overflow: hidden;
}

.column > .storyteller_left + .storyteller_left,
.column > .storyteller_left + .storyteller_right,
.column > .storyteller_right + .storyteller_left,
.column > .storyteller_right + .storyteller_right {
    margin-top: clamp(32px, 5vw, 64px);
}

@media (min-width: 900px) {
    .storyteller_left > .text_box { width: 56%; }
    .storyteller_left > .photo_box { width: 44%; }
    .storyteller_right > .photo_box { width: 58%; }
    .storyteller_right > .text_box { width: 42%; }
}

/* --- Przyciski ------------------------------------------------ */
.przycisk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 22px;
    border: 2px solid var(--zloto);
    border-radius: 8px;
    background: var(--granat);
    color: var(--zloto);
    font-family: MedievalSharp, serif;
    font-size: 1.05rem;
    text-decoration: none;
}

.przycisk:hover {
    background: var(--zloto);
    color: var(--granat);
}

.hero_przycisk,
.czytaj_wiecej_btn,
.back_button,
.turniej_back_btn,
.partner_pauza,
.przycisk,
.kontakt_przycisk {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 1251px) {
    .menu a {
        transition: color 0.2s ease, text-decoration-color 0.2s ease;
    }
}

/* --- Karty ze zdjęciem (Cztery epoki, rodzaje oferty) -------- */
.karty_sekcja {
    padding: clamp(48px, 7vw, 96px) 16px;
    background: var(--granat);
    color: var(--pergamin);
}

.karty_naglowek {
    max-width: 46rem;
    margin: 0 auto clamp(28px, 4vw, 48px);
    text-align: center;
}

.karty_naglowek h2 {
    margin: 0 0 12px;
    color: var(--zloto);
    font-family: MedievalSharp, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
}

.karty_naglowek p {
    margin: 0;
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
    line-height: 1.5;
}

.karty {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 28px);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.karta {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--granat-jasny);
    border-radius: 16px;
    overflow: hidden;
    background: var(--granat-ciemny);
}

.karta_foto {
    position: relative;
    margin: 0;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

/* zdjęcie absolutnie, żeby pionowe zdjęcie nie rozpychało karty */
.karta_foto img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Napis na dole zdjęcia: gradient od 45% do niemal pełnej
   ciemności tam, gdzie stoi tekst (>= 9:1 przy białym tle). */
.karta_foto figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 72px 18px 16px;
    background: linear-gradient(to bottom,
        rgba(10, 16, 32, 0) 0%,
        rgba(10, 16, 32, 0.9) 55%,
        rgba(10, 16, 32, 0.94) 100%);
}

.karta_epoka {
    display: block;
    color: var(--zloto);
    font-family: MedievalSharp, serif;
    font-size: clamp(1.7rem, 2.4vw, 2.2rem);
    line-height: 1.05;
}

.karta_podpis {
    display: block;
    margin-top: 4px;
    color: var(--pergamin);
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
}

.karta_linki {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 12px 18px 16px;
    list-style: none;
}

.karta_linki a {
    display: inline-block;
    padding: 8px 0;
    color: var(--zloto);
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.karta_linki a:hover {
    color: var(--niebieski-jasny);
}

@media (max-width: 1100px) {
    .karty { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .karty { grid-template-columns: minmax(0, 1fr); }
    .karta_foto { aspect-ratio: 4 / 3; }
}


/* --- Kursor: miecz ------------------------------------------
   Smaczek tematyczny (prośba właściciela strony). Czubek ostrza
   to punkt kliknięcia (2,2). Na linkach i przyciskach zostaje
   łapka (cursor: pointer), żeby było widać, co jest klikalne. */
html,
body {
    cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2732%27%20height%3D%2732%27%20viewBox%3D%270%200%2032%2032%27%3E%3Cg%20stroke%3D%27%23141527%27%20stroke-width%3D%271.3%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%202%20L7.5%203.8%20L21.6%2017.9%20L17.9%2021.6%20L3.8%207.5%20Z%27%20fill%3D%27%23D9DEE6%27%2F%3E%3Cpath%20d%3D%27M4.2%204.2%20L19.8%2019.8%27%20stroke%3D%27%238C96A6%27%20stroke-width%3D%270.8%27%2F%3E%3Cpath%20d%3D%27M14.6%2024.6%20L24.6%2014.6%20L26.6%2016.6%20L16.6%2026.6%20Z%27%20fill%3D%27%23E5D283%27%2F%3E%3Cpath%20d%3D%27M20.6%2022.8%20L22.8%2020.6%20L27.2%2025%20L25%2027.2%20Z%27%20fill%3D%27%236B4A2B%27%2F%3E%3Ccircle%20cx%3D%2727.6%27%20cy%3D%2727.6%27%20r%3D%272.6%27%20fill%3D%27%23E5D283%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 2 2, auto;
}

/* --- Panel z tekstem (Dołącz, Wsparcie, Kontakt) ------------
   Zwykły blok w układzie strony zamiast karty pozycjonowanej
   absolutnie na niewidocznych boksach 100vh.                */
.panel {
    max-width: 48rem;
    margin: clamp(48px, 7vw, 88px) auto;
    padding: clamp(24px, 4vw, 48px);
    border: 2px solid var(--niebieski-jasny);
    border-radius: 20px;
    background: var(--granat);
    color: var(--pergamin);
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem);
    line-height: 1.6;
}

.panel p,
.panel ul {
    margin: 0 0 1em;
}

.panel > :last-child {
    margin-bottom: 0;
}

.panel h2 {
    margin: 0 0 0.8em;
    color: var(--zloto);
    font-family: MedievalSharp, serif;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    font-weight: 400;
}

.panel a:not(.przycisk):not(.kontakt_przycisk) {
    color: var(--zloto);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.panel .imprezy li::before {
    background: var(--zloto);
}

.panel_cta {
    margin-top: 1.5em;
    text-align: center;
}

/* tytuł projektu w nagłówku karty nie powiększa się podwójnie */
.tekst h2 .projekt_link_title {
    font-size: inherit;
}

.storyteller_left > .text_box .projekt_link_title:hover {
    text-decoration: underline;
}

/* --- Zdjęcie główne podstron i strzałka „dalej” -------------
   Zdjęcie niższe (78vh), żeby spod niego wystawał początek
   treści. Strzałka przewija do treści; jedno delikatne
   podskoczenie po wczytaniu (2 razy), potem stoi.           */
.main_page_onas {
    height: 78vh;
}

.main_page_onas > .dalej {
    position: absolute;
    left: 50%;
    bottom: clamp(16px, 4vh, 36px);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-left: -26px;
    border: 2px solid var(--zloto);
    border-radius: 50%;
    background: rgba(10, 16, 32, 0.55);
    color: var(--zloto);
    animation: dalej_podskok 1.6s ease-in-out 0.8s 2;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dalej:hover {
    background: var(--zloto);
    color: var(--granat);
}

@keyframes dalej_podskok {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

.kotwica {
    scroll-margin-top: 10vh;
}

/* --- Przełącznik języka PL / EN w nagłówku -------------------
   Desktop: logo | menu | PL EN.  Telefon: logo | PL EN | menu.  */
header .menu {
    order: 2;
    margin-left: auto;
    margin-right: 16px;
}

.jezyki {
    order: 3;
    display: flex;
    gap: 4px;
    margin-right: 4vw;
}

.jezyki a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--pergamin);
    font-family: 'Lora', Georgia, serif;
    font-size: 0.95rem;
    text-decoration: none;
}

.jezyki a svg {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.jezyki a:hover {
    border-color: var(--niebieski-jasny);
}

.jezyki a[aria-current="page"] {
    border-color: var(--zloto);
    color: var(--zloto);
}

@media (max-width: 1250px) {
    .jezyki {
        order: 2;
        margin-left: auto;
        margin-right: 8px;
    }

    header .menu-button-container {
        order: 3;
    }
}

@media (max-width: 380px) {
    .jezyki a span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* --- Cięcie mieczem przy kliknięciu ---------------------------
   Smuga rysuje się od lewej (0.12 s) i gaśnie, lekko przesuwając
   się w kierunku cięcia. Kąt i odbicie losowe (zmienne z JS).   */
.ciecie {
    position: fixed;
    z-index: 9999;
    width: 150px;
    height: 112px;
    margin: -56px 0 0 -75px;
    pointer-events: none;
    transform: rotate(var(--kat, 0deg)) scaleX(var(--odbicie, 1));
    filter: drop-shadow(0 0 4px rgba(229, 210, 131, 0.8));
    animation: ciecie 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.ciecie svg {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes ciecie {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 1;
    }
    30% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 0;
        translate: 10px -6px;
    }
}
