/* PluginsXIV - one stylesheet, shared by every page.
 *
 * Shared from the start, deliberately. The sibling site duplicates its CSS into each page's inline
 * <style> and has been carrying an open note to extract it ever since; there is no reason to repeat
 * that here, and a directory whose pages must stay visually consistent is the worst candidate for it.
 *
 * No build step. What is in this folder is what gets served. */

:root {
    --bg: #0f1115;
    --panel: #161a21;
    --panel-2: #1c222b;
    --line: #262d38;
    --ink: #e8ecf2;
    --ink-dim: #98a3b3;
    --ink-faint: #6c7685;

    /* One accent, used for links and focus only. A directory that tints things for decoration makes
     * its own status colours unreadable, and the status colours here carry real meaning. */
    --accent: #6ea8fe;

    --ok: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;

    --radius: 10px;
    --page: 1080px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

code, .mono {
    font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
    font-size: 0.92em;
}

.wrap {
    max-width: var(--page);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- header ---- */

.top {
    border-bottom: 1px solid var(--line);
    background: rgba(15, 17, 21, 0.92);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
}

.top .wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 60px;
}

.brand {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    font-size: 17px;
    white-space: nowrap;
}

.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }

.top nav {
    margin-left: auto;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.top nav a { color: var(--ink-dim); font-size: 14px; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }

/* ---- generic blocks ---- */

main { padding: 34px 0 80px; }

h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 34px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 15px; margin: 0 0 6px; }

.lede { color: var(--ink-dim); margin: 0 0 26px; max-width: 62ch; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); font-size: 13px; }

/* ---- status pills ---- */

.pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pill-listed   { color: var(--ok);   border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.pill-changed  { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.pill-rejected,
.pill-delisted { color: var(--bad);  border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.pill-pending  { color: var(--ink-dim); border-color: var(--line); background: var(--panel-2); }

/* ---- search ---- */

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

input[type="search"], input[type="text"], input[type="url"], input[type="password"], textarea, select {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    padding: 9px 12px;
    font: inherit;
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: transparent;
}

.controls input[type="search"] { flex: 1 1 260px; width: auto; }
.controls select { flex: 0 0 auto; width: auto; }

textarea { resize: vertical; min-height: 90px; }

button {
    background: var(--accent);
    color: #0b1220;
    border: 0;
    border-radius: 8px;
    padding: 9px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: default; filter: none; }

button.ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
}

button.danger { background: var(--bad); color: #2a0b0b; }

/* ---- plugin cards ---- */

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

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    gap: 12px;
    /* Top-aligned, not centred. The sibling site spent three separate fixes on an icon that moved
     * whenever the text beside it wrapped, because it was centred against a variable-height block.
     * Pinning the heights of whatever had just wrapped only ever ruled out one cause at a time. */
    align-items: flex-start;
}

.card img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--panel-2);
    flex: 0 0 48px;
    object-fit: cover;
}

.card .body { min-width: 0; flex: 1; }
.card h3 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card h3 a { color: var(--ink); }

.card p {
    margin: 4px 0 0;
    color: var(--ink-dim);
    font-size: 13.5px;
    /* Two lines, then ellipsis. Punchlines in real manifests run from empty to a paragraph, and
     * letting them size the card gives a grid of wildly uneven boxes. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card .meta { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- key/value rows ---- */

.rows { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; align-items: baseline; }
.rows dt { color: var(--ink-dim); font-size: 13px; }
.rows dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---- callouts ---- */

.note {
    border-left: 3px solid var(--line);
    padding: 12px 14px;
    background: var(--panel);
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
}

.note-warn { border-left-color: var(--warn); }
.note-bad { border-left-color: var(--bad); }
.note h3 { margin-bottom: 4px; }
.note p:last-child { margin-bottom: 0; }
.note p:first-of-type { margin-top: 0; }

/* ---- copy-to-clipboard field ---- */

.copyrow { display: flex; gap: 8px; align-items: stretch; }

.copyrow code {
    flex: 1;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    overflow-x: auto;
    white-space: nowrap;
    min-width: 0;
}

/* ---- prose (policy page) ---- */

.prose { max-width: 74ch; }
.prose p, .prose li { color: var(--ink-dim); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }

.prose table { border-collapse: collapse; width: 100%; margin: 14px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; font-size: 14px; }
.prose th { background: var(--panel-2); color: var(--ink); }

/* ---- footer ---- */

footer {
    border-top: 1px solid var(--line);
    padding: 22px 0 40px;
    color: var(--ink-faint);
    font-size: 13px;
}

footer a { color: var(--ink-dim); }

/* ---- narrow screens ----
 *
 * One breakpoint. The header is the only thing that genuinely needs to reflow; the grid is already
 * auto-fill and the panels are fluid. */

@media (max-width: 620px) {
    .top .wrap { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; gap: 10px; }
    .top nav { margin-left: 0; width: 100%; gap: 14px; }
    .rows { grid-template-columns: 1fr; gap: 2px 0; }
    .rows dd { margin-bottom: 10px; }
    main { padding-top: 24px; }
}

/* `hidden` is only a user-agent rule and loses to any author `display`, so anything given a display
 * value elsewhere in this file would still draw while hidden. Costs one line; the sibling site
 * shipped an empty stub pill on five pages without it, and a DOM test could not catch it because the
 * property was set perfectly correctly. */
[hidden] { display: none !important; }
