/* ATAK Plugin Market — jeden arkusz stylów, bez frameworka. Ciemny motyw domyślny, jasny z ustawień systemu. */

:root {
    color-scheme: dark;
    --bg: #0f1216;
    --surface: #171b21;
    --surface-2: #1e232b;
    --border: #2a313b;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --accent: #4da3ff;
    --accent-text: #0f1216;
    --ok: #4cc38a;
    --warn: #e5b454;
    --radius: 10px;
    --gutter: 16px;
    --max: 1100px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #f6f7f9;
        --surface: #ffffff;
        --surface-2: #eef1f5;
        --border: #d7dce3;
        --text: #161a20;
        --muted: #5b6573;
        --accent: #0b66c3;
        --accent-text: #ffffff;
        --ok: #1d7a4f;
        --warn: #8a5a00;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

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

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 1.5em 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-top: .75em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

code { font-family: var(--mono); font-size: .9em; }

.container {
    width: 100%;
    max-width: calc(var(--max) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 46em; }
.empty { color: var(--muted); padding: 2rem 0; }

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

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--gutter); top: 8px; z-index: 10; background: var(--surface); padding: .5rem .75rem; border-radius: var(--radius); }

/* Nagłówek */

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.25rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.site-name { color: var(--text); font-weight: 700; text-decoration: none; font-size: 1.1rem; }

.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

.site-header .search { flex: 1 1 220px; margin-left: auto; }

.lang-switch { font-size: .9rem; white-space: nowrap; }

/* Wyszukiwarka i formularze */

.search { display: flex; gap: .5rem; max-width: 640px; }
.search input { flex: 1; min-width: 0; }

input[type="search"], select {
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .5rem .75rem;
    min-height: 2.5rem;
}

button, .install-button {
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: transparent;
    color: var(--accent);
    padding: .5rem 1rem;
    min-height: 2.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

button[type="submit"], .install-button--primary { background: var(--accent); color: var(--accent-text); }
.install-button small { font-weight: 400; opacity: .8; }

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .75rem;
    align-items: end;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}
.filters label { display: grid; gap: .25rem; font-size: .875rem; color: var(--muted); }
.filters select { width: 100%; }

/* Strona główna */

.hero { padding: 2rem 0 1rem; }
.hero h1 { margin-top: 0; }
.hero .search { margin-top: 1.25rem; }

.category-tiles {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .75rem;
}
.category-tiles a {
    display: block;
    padding: .9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}
.category-tiles a:hover { border-color: var(--accent); }

.more { font-weight: 600; }

/* Karty wtyczek */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.plugin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.plugin-card:hover { border-color: var(--accent); }
.plugin-card__link { display: flex; align-items: center; gap: .75rem; color: var(--text); text-decoration: none; }
.plugin-card h3 { margin: 0; }
.plugin-card__icon { width: 48px; height: 48px; border-radius: 10px; flex: none; background: var(--surface-2); }
.plugin-card__icon--empty { display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.plugin-card__summary { margin: 0; color: var(--muted); font-size: .95rem; }

.badges { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.badge {
    display: inline-block;
    font-size: .75rem;
    line-height: 1.4;
    padding: .15rem .5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}
.badge--ok { color: var(--ok); border-color: currentColor; }
.badge--warn { color: var(--warn); border-color: currentColor; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 1.5rem 0; }

/* Strona wtyczki */

.plugin-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem 1.25rem;
    align-items: center;
    padding: 1.5rem 0;
}
.plugin-header__icon { width: 96px; height: 96px; border-radius: 18px; background: var(--surface-2); }
.plugin-header h1 { margin: 0; }
.plugin-header .summary { margin: .25rem 0; font-size: 1.125rem; }
.plugin-header .install-buttons, .plugin-header .install-none { grid-column: 1 / -1; }
.install-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.install-none { margin: 0; color: var(--muted); }

@media (max-width: 480px) {
    .plugin-header { grid-template-columns: 1fr; }
    .plugin-header__icon { width: 72px; height: 72px; }
    .install-button { width: 100%; justify-content: center; }
}

.screenshots { display: grid; gap: 1.5rem; margin: 1rem 0 2rem; }
.screenshots figure { margin: 0; }
.screenshots img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.screenshots figcaption { color: var(--muted); font-size: .9rem; margin-top: .5rem; }

.plugin-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.plugin-body > *, .screenshots > *, .card-grid > * { min-width: 0; }
@media (min-width: 900px) {
    .plugin-body { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}

.prose { max-width: 46em; }
.prose h2:first-child { margin-top: 0; }
.prose pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.prose img { border-radius: var(--radius); margin: 1rem 0; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: .4rem .6rem; }

.plugin-facts { display: grid; gap: 1rem; }
.plugin-facts > section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.plugin-facts h2 { margin: 0 0 .75rem; font-size: 1.05rem; }

.version-matrix table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.version-matrix th, .version-matrix td { text-align: left; padding: .4rem .25rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.version-matrix td .badge { margin: 0 .2rem .2rem 0; }

.verification p { margin: 0 0 .5rem; font-size: .9rem; }
.verification summary { cursor: pointer; font-size: .9rem; }
.verification__checks { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .9rem; }

.scan-card__verdict { margin: 0; font-weight: 600; }

.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem .75rem; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }

.translation-missing {
    margin: 1rem 0 0;
    padding: .75rem 1rem;
    border: 1px solid var(--warn);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface);
}

.related-posts ul { padding-left: 1.25rem; }

.breadcrumbs { margin: 1rem 0 0; font-size: .9rem; }

/* Blog */

.post-list { display: grid; gap: 1rem; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.post-card h2 { margin: 0; font-size: 1.2rem; }
.post-card p { margin: .25rem 0 0; }

.post-cover { width: 100%; border-radius: var(--radius); margin: 1rem 0; }
.post-plugins__list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.post-plugins__list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
}
.post-plugins__list p { margin: 0; }

/* 404 */

.not-found .search { margin: 1rem 0; }
.suggestions { padding-left: 1.25rem; }
.suggestions li { margin: .35rem 0; }

/* Stopka */

.site-footer { margin-top: 3rem; border-top: 1px solid var(--border); background: var(--surface); font-size: .9rem; }
.site-footer__inner { padding-top: 1.25rem; padding-bottom: 1.5rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.site-footer p { margin: .5rem 0; }

@media (prefers-reduced-motion: no-preference) {
    a, button, .plugin-card, .category-tiles a { transition: border-color .15s, color .15s, background-color .15s; }
}

.preview-banner { margin: 0 0 1rem; padding: .6rem .9rem; border: 2px dashed currentColor; border-radius: .5rem; font-weight: 600; }
