/* Shared styles for the static content pages (O projekcie, Dołącz, FAQ,
   Kontakt, Do pobrania, Regulamin, Prywatność) — "memorial book on dark".
   All colors/spacing come from the design tokens in style.css. */

.content-page {
    max-width: 72ch;
    margin: 0 auto;
    padding: var(--sp-12) var(--sp-6) var(--sp-16);
    color: var(--text-primary);
    line-height: 1.75;
}

/* h1 font comes from the global Cinzel rule; here only rhythm + bronze rule */
.content-page h1 {
    margin-bottom: 0;
}

.content-page h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 2px;
    background: var(--bronze);
    margin-top: var(--sp-3);
    margin-bottom: var(--sp-6);
}

.content-page h2 {
    color: var(--bronze);
    margin: var(--sp-12) 0 var(--sp-4);
}

.content-page p {
    margin-bottom: var(--sp-4);
}

/* Direct-child scope: keeps .download-list (tab panels) and .faq-item ul out */
.content-page > ul {
    margin: 0 0 var(--sp-4) var(--sp-6);
}

/* Deklaracja dostępności: the ministry structure puts h3 subsections inside
   <section> blocks; give them a rhythm, and no gap after a bare h2. */
.a11y-declaration h3 {
    margin: var(--sp-8) 0 var(--sp-3);
}

.a11y-declaration h2 + h3 {
    margin-top: 0;
}

/* Links inside .content-page inherit the global bronze/underline style */

.placeholder-note {
    font-size: var(--text-s);
    color: var(--text-muted);
    font-style: italic;
}

/* "How to join" step tiles */
.step-tiles {
    display: flex;
    gap: var(--sp-4);
    flex-wrap: wrap;
    margin: var(--sp-6) 0;
}

.step-tile {
    flex: 1 1 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-m);
    padding: var(--sp-6) var(--sp-4);
    box-shadow: var(--shadow-2);
}

.step-tile-nr {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    background: var(--gradient-flame);
    color: var(--bg-page);
    font-weight: 700;
    font-size: var(--text-m);
    margin-bottom: var(--sp-3);
}

.step-tile h3 {
    font-size: var(--text-base);
    margin-bottom: var(--sp-2);
    color: var(--text-primary);
}

.step-tile p {
    font-size: var(--text-s);
    margin-bottom: 0;
}

@media (max-width: 599px) {
    .step-tiles {
        flex-direction: column;
    }

    .step-tile {
        flex-basis: auto;
    }
}

/* FAQ accordion (native details/summary) */
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-2);
    margin-bottom: var(--sp-3);
    padding: 0;
    overflow: hidden; /* keep the [open] left rule inside the rounded corners */
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    cursor: pointer;
    padding: var(--sp-4) var(--sp-6);
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--text-primary);
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

/* The card clips overflow (rounded corners + flame rule), so draw the
   global amber focus ring inside the summary instead of outside it */
.faq-item summary:focus-visible {
    outline-offset: -4px;
    border-radius: var(--radius-s);
}

/* Bronze chevron — points down when closed, up when open */
.faq-item summary::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-right: 2px;
    border-right: 2px solid var(--bronze);
    border-bottom: 2px solid var(--bronze);
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.faq-item[open] > summary::after {
    transform: rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
    .faq-item summary::after {
        transition: none;
    }
}

.faq-item summary:hover {
    color: var(--flame-bright);
}

.faq-item[open] summary {
    box-shadow: inset 3px 0 0 var(--flame);
    border-bottom: 1px solid var(--border-hairline);
}

.faq-item .faq-answer {
    padding: var(--sp-4) var(--sp-6);
}

.faq-item .faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-item ul,
.faq-item ol {
    margin: 0 0 var(--sp-4) var(--sp-6);
}

/* Downloads */
.download-list {
    list-style: none;
    margin-bottom: var(--sp-6);
}

.download-list li {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-1);
    padding: var(--sp-3) var(--sp-4);
    margin-bottom: var(--sp-2);
}

/* File links: global bronze -> flame hover; glyph follows via currentColor */
.download-list li > a svg {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    margin-right: var(--sp-2);
}

.download-desc {
    color: var(--text-muted);
    font-size: var(--text-s);
}

/* Downloads: edition tabs. Without JS the tab strip hides and the panels
   simply stack, each keeping its heading visible. */
.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: var(--sp-6) 0;
}

.tab-list [role="tab"] {
    background: var(--bg-surface);
    color: var(--bronze);
    border: 1px solid var(--bronze);
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: background-color 0.2s, color 0.2s;
}

.tab-list [role="tab"]:hover,
.tab-list [role="tab"][aria-selected="true"] {
    background: var(--bronze);
    color: var(--bg-page);
}

html:not(.js) .tab-list { display: none; }
html:not(.js) .tab-panel[hidden] { display: block; }

/* With JS the selected pill already names the section; keep the h2 for
   screen readers and the no-JS fallback only. */
html.js .tab-panel-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Vimeo embeds — 16:9 responsive frame on a card mat */
.video-embed {
    margin: var(--sp-6) 0;
}

.video-frame {
    position: relative;
    padding: 56.25% 0 0 0;
    background: #000;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-m);
    overflow: hidden;
    box-shadow: var(--shadow-2);
}

.video-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-embed figcaption {
    margin-top: var(--sp-2);
    font-size: var(--text-s);
    color: var(--text-muted);
}

/* Contact */
.contact-block {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-left: 3px solid var(--bronze);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-1);
    padding: var(--sp-6);
    margin: var(--sp-6) 0;
}

.contact-block p {
    margin-bottom: var(--sp-2);
}

.contact-block p:last-child {
    margin-bottom: 0;
}

/* Mobile density */
@media (max-width: 599px) {
    .content-page {
        padding: var(--sp-8) var(--sp-4) var(--sp-12);
    }

    .faq-item summary,
    .faq-item .faq-answer {
        padding: var(--sp-4);
    }

    .contact-block {
        padding: var(--sp-4);
    }
}

/* Touch ergonomics: 44px tap floor for the edition tabs; desktop pointer
   keeps the current compact pills. */
@media (pointer: coarse) {
    .tab-list [role="tab"] {
        min-height: 44px;
        padding: 10px 18px;
    }
}

/* =========================================================================
   Accessible pin list (/lista-pinezek/) — the map's text alternative.
   Deliberately plain: this page's job is to be readable and navigable, so it
   reuses the .content-page rhythm rather than inventing new chrome.
   ========================================================================= */
.pin-filters {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-m);
    padding: var(--sp-4);
    margin-bottom: var(--sp-6);
}
.pin-filters h2 { margin-top: 0; }

.pin-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-4);
}
.pin-filter { display: flex; flex-direction: column; gap: 4px; }
.pin-filter label { font-size: var(--text-s); font-weight: 700; }
.pin-filter input,
.pin-filter select {
    padding: 10px 12px;
    font-family: var(--font);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-inset);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
}
/* Same reasoning as .form-card: the author border flips to --flame (8.5:1),
   which is the load-bearing focus cue, so dropping the UA outline is safe. */
.pin-filter input:focus,
.pin-filter select:focus {
    outline: none;
    border-color: var(--flame);
    box-shadow: var(--glow-focus);
}
.pin-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
}

.pin-list-count {
    font-weight: 700;
    color: var(--bronze);
}

.pin-entry {
    border-top: 1px solid var(--border-hairline);
    padding-top: var(--sp-6);
    margin-top: var(--sp-6);
}
.pin-entry h2 { margin-top: 0; }
.pin-entry h3 {
    font-family: var(--font-display);
    font-size: var(--text-m);
    margin: var(--sp-4) 0 var(--sp-2);
}
.pin-entry h4 {
    font-size: var(--text-base);
    color: var(--bronze);
    margin: var(--sp-3) 0 var(--sp-1);
}

.pin-facts { margin: 0 0 var(--sp-4); }
.pin-facts dt {
    color: var(--bronze);
    font-size: var(--text-s);
    font-weight: 700;
    margin-top: var(--sp-2);
}
.pin-facts dd { margin: 0; }

.pin-photos {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    align-items: flex-start;
}
.pin-photos h3 { flex-basis: 100%; margin-bottom: 0; }
.pin-photos figure { margin: 0; }
.pin-photos img {
    max-width: 260px;
    height: auto;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-s);
}

.pin-pagination { margin-top: var(--sp-8); }
.pin-pagination ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    align-items: center;
}

/* Format + size sit inside the download link so they are part of its
   accessible name (WCAG 2.4.4). */
.download-meta {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin-left: 6px;
    white-space: nowrap;
}

/* Full text of a graphic-only download (poster, infographic) — WCAG 1.1.1. */
.download-alt {
    margin-top: var(--sp-3);
}
.download-alt summary {
    cursor: pointer;
    color: var(--bronze);
    font-size: var(--text-s);
}
.download-alt-body {
    margin-top: var(--sp-2);
    padding-left: var(--sp-4);
    border-left: 2px solid var(--border-strong);
    color: var(--text-primary);
    font-size: var(--text-s);
}
.download-alt-body p { margin: 0 0 var(--sp-2); }

/* Polityka prywatności: the cookie table. Real table semantics are kept
   (WCAG 1.3.1); on narrow screens the wrapper scrolls sideways instead of
   squeezing the columns, and is focusable so keyboard users can scroll it. */
.table-wrap {
    overflow-x: auto;
    margin: 0 0 var(--sp-4);
}

.table-wrap:focus-visible {
    outline-offset: 4px;
}

.content-page table {
    width: 100%;
    min-width: 34rem;
    border-collapse: collapse;
    font-size: var(--text-s);
    line-height: 1.5;
}

.content-page th,
.content-page td {
    text-align: left;
    vertical-align: top;
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--border-hairline);
}

.content-page th {
    color: var(--bronze);
    font-weight: 700;
}

.content-page td:first-child {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.content-page td small {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Phones: stack each row into a labelled block instead of side-scrolling a
   three-column table (the retention column would otherwise sit off-screen).
   The cell label comes from data-label; the name cell heads its block. */
@media (max-width: 599px) {
    .content-page table {
        min-width: 0;
    }

    .content-page thead {
        display: none;
    }

    .content-page tr {
        display: block;
        padding: var(--sp-3) 0;
        border-bottom: 1px solid var(--border-hairline);
    }

    .content-page td {
        display: block;
        padding: 2px 0;
        border-bottom: 0;
    }

    .content-page td::before {
        content: attr(data-label) ": ";
        color: var(--bronze);
        font-weight: 700;
        font-family: var(--font-body);
    }

    .content-page td:first-child::before {
        content: none;
    }

    .content-page td:first-child {
        font-size: var(--text-base);
        padding-bottom: var(--sp-1);
    }
}

/* =========================================================================
   Regulamin (/regulamin/) — reproduced legal documents.

   The page quotes three source documents verbatim inside <section
   class="legal-doc">; everything here exists to make that reproduction
   readable without a boxed-card treatment, which would be oppressive over
   ~2000 words. Two rules matter for maintenance:
     - .doc-note is the *site's* editorial voice and must stay visually
       distinct from the quoted text (bronze rule + inset ground);
     - the § headings are centred with the number on its own line because
       that is how they sit in the source document.
   Polish legal enumerations are "1." / "a)" / "1)", so the ol markers come
   from @counter-style rather than list-style-type's dot suffix. Native
   markers are kept (no list-style:none) so list semantics survive.
   ========================================================================= */
@counter-style legal-lit {
    system: alphabetic;
    symbols: "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m"
             "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z";
    suffix: ") ";
}

@counter-style legal-pkt {
    system: numeric;
    symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
    suffix: ") ";
}

/* One hairline above each quoted document, so the three are clearly separate */
.content-page h2.doc-heading {
    padding-top: var(--sp-8);
    border-top: 1px solid var(--border-hairline);
}

/* Attribution line of each source document (top-right block in the scan) */
.legal-doc .doc-source {
    margin: 0 0 var(--sp-6);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border-hairline);
    font-size: var(--text-s);
    line-height: 1.5;
    color: var(--text-muted);
    text-align: right;
}

.legal-doc h3 {
    font-family: var(--font-display);
    font-size: var(--text-m);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: center;
    margin: var(--sp-12) 0 var(--sp-6);
}

.legal-doc h3:first-of-type {
    margin-top: var(--sp-8);
}

.legal-doc .par-nr {
    display: block;
    margin-bottom: var(--sp-1);
    font-size: var(--text-base);
    letter-spacing: 0.08em;
    color: var(--bronze);
}

.legal-doc ol,
.legal-doc ul {
    margin: 0 0 var(--sp-4);
    padding-left: 2.75em;
}

.legal-doc ol.ust { list-style-type: decimal; }
.legal-doc ol.lit { list-style-type: legal-lit; }
.legal-doc ol.pkt { list-style-type: legal-pkt; }
.legal-doc ul     { list-style-type: disc; }

.legal-doc li {
    margin-bottom: var(--sp-2);
}

.legal-doc li:last-child {
    margin-bottom: 0;
}

/* A nested list belongs to the sentence above it, not to the next item */
.legal-doc li > ol,
.legal-doc li > ul {
    margin-top: var(--sp-2);
    margin-bottom: 0;
}

.legal-doc ::marker {
    color: var(--bronze);
}

.legal-doc .doc-signature {
    margin: var(--sp-12) 0 0;
    font-size: var(--text-s);
    line-height: 1.6;
    color: var(--text-muted);
    text-align: right;
}

/* The site speaking in its own voice, outside the quotation */
.content-page .doc-note {
    margin: var(--sp-8) 0 var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    border-left: 3px solid var(--bronze);
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
    background: var(--bg-inset);
    font-size: var(--text-s);
    color: var(--text-muted);
}

@media (max-width: 599px) {
    .legal-doc ol,
    .legal-doc ul {
        padding-left: 2em;
    }

    .legal-doc h3 {
        margin: var(--sp-8) 0 var(--sp-4);
    }
}
