/* GKU Liederendatabank. Colours come from the GKU logo: purple, teal and gold. */

:root {
    --purple: #6a1b9a;
    --purple-dark: #4a1068;
    --purple-soft: #f3ecf8;
    --teal: #3a9a82;
    --gold: #e3b02c;

    --bg: #fbfafc;
    --surface: #ffffff;
    --text: #231a2b;
    --muted: #6b6275;
    --border: #ded6e6;
    --link: #5b1788;
    --mark: #fbe9a8;
    --error: #b3261e;
    --shadow: 0 1px 2px rgb(40 20 60 / 8%), 0 2px 8px rgb(40 20 60 / 6%);
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --purple-soft: #2a1738;
        --bg: #16111b;
        --surface: #201828;
        --text: #efe9f4;
        --muted: #a99db6;
        --border: #3a2d47;
        --link: #d2a8f0;
        --mark: #6b5a1a;
        --error: #ff8a80;
        --shadow: none;
    }
}

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

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 1.2rem 0 0.4rem; }
h2 { font-size: 1.25rem; margin: 1.6rem 0 0.4rem; }
h3 { font-size: 1.1rem; margin: 0; }
h4 { margin: 0; }

code {
    background: var(--purple-soft);
    padding: 0.05em 0.35em;
    border-radius: 4px;
    font-size: 0.92em;
}

.wrap { width: min(100% - 2rem, 62rem); margin-inline: auto; }

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

.skip-link {
    position: absolute; left: 0.5rem; top: -4rem; z-index: 10;
    background: var(--surface); padding: 0.5rem 0.8rem; border-radius: 6px;
}
.skip-link:focus { top: 0.5rem; }

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

.muted { color: var(--muted); }
.lead { color: var(--muted); margin: 0 0 1rem; }

/* Header */

.site-header {
    background: var(--purple);
    border-bottom: 4px solid var(--gold);
    color: #fff;
}

.header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-block: 0.6rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #fff;
    text-decoration: none;
}

.brand-logo {
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 4px 6px;
}
.brand-logo img { display: block; height: 42px; width: auto; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.3rem; font-weight: 600; }
.brand-text small { opacity: 0.8; font-size: 0.8rem; }

.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; }
.main-nav a, .link-button {
    color: #fff;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font: inherit;
}
.main-nav a:hover, .link-button:hover { background: rgb(255 255 255 / 16%); }
.main-nav a.active { background: rgb(255 255 255 / 22%); font-weight: 600; }
.main-nav form { margin: 0; }
.link-button { background: none; border: 0; cursor: pointer; }

main { flex: 1; padding-bottom: 2.5rem; }

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    padding-block: 1rem;
    text-align: center;
}
.site-footer .version { opacity: 0.8; }

/* Buttons and inputs */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font: inherit;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    min-height: 2.5rem;
}
.btn:hover { border-color: var(--purple); background: var(--purple-soft); }
.btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--purple-dark); }
.btn.small { min-height: 2rem; padding: 0.2rem 0.7rem; font-size: 0.85rem; }
.btn.done { background: var(--teal); border-color: var(--teal); color: #fff; }

input[type="search"], input[type="text"], input[type="password"] {
    font: inherit;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    min-width: 0;
}
input[type="search"]:focus, input[type="password"]:focus { border-color: var(--purple); }

input[type="checkbox"] { accent-color: var(--purple); width: 1.1rem; height: 1.1rem; }

/* Search */

.search-panel { margin-top: 1.4rem; }

.search-row { display: flex; gap: 0.5rem; }
.search-row input { flex: 1; font-size: 1.1rem; padding: 0.8rem 1rem; }
.search-row .btn { padding-inline: 1.5rem; }

.filters {
    margin-top: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filters summary { cursor: pointer; padding: 0.55rem 0.9rem; font-weight: 600; color: var(--link); }
.filter-body { padding: 0 0.9rem 0.9rem; display: grid; gap: 0.8rem; }
.filters fieldset { border: 0; margin: 0; padding: 0; }
.filters legend { color: var(--muted); font-size: 0.85rem; padding: 0; margin-bottom: 0.4rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    background: var(--bg);
}
.chip small { color: var(--muted); margin-left: 0.2rem; }
.chip input:checked + span { background: var(--purple); border-color: var(--purple); color: #fff; }
.chip input:checked + span small { color: rgb(255 255 255 / 75%); }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.check { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }

.intro { margin-top: 1.5rem; }
.tips { padding-left: 1.2rem; }
.tips li { margin-bottom: 0.4rem; }

.note {
    background: var(--purple-soft);
    border-left: 4px solid var(--purple);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    margin: 1.2rem 0 0;
}
.count { color: var(--muted); margin: 1rem 0 0.5rem; }
.empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.2rem 1.2rem 0.8rem; }

/* Results */

.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--purple);
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    box-shadow: var(--shadow);
}
.card-head h3 { font-size: 1.15rem; }
.card-head h3 a { text-decoration: none; }
.card-head h3 a:hover { text-decoration: underline; }
.ref { margin: 0; font-size: 0.85rem; color: var(--muted); }
.ref a { color: inherit; }
.alt { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.9rem; }
.snippet { margin: 0.4rem 0; color: var(--text); font-size: 0.95rem; }

mark { background: var(--mark); color: inherit; padding: 0 0.1em; border-radius: 3px; }

.card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.credits { margin: 0; font-size: 0.78rem; color: var(--muted); display: flex; flex-direction: column; }
.actions { display: flex; gap: 0.4rem; margin-left: auto; }

.more { text-align: center; margin-top: 1.2rem; }

/* Song page */

.crumbs { margin-top: 1rem; font-size: 0.9rem; color: var(--muted); }

.song-head h1 { margin-top: 0.2rem; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.2rem;
    margin: 1rem 0 0.3rem;
    padding: 0.7rem 0.9rem;
    background: var(--purple-soft);
    border-radius: var(--radius);
}
.hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 1rem; }

.lyrics { display: grid; gap: 1rem; }

.part {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem 1rem 0.9rem;
}
.part:has([data-part-toggle]:not(:checked)) { opacity: 0.45; }
.part-head { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.part-label { font-weight: 700; color: var(--purple); }
@media (prefers-color-scheme: dark) { .part-label { color: var(--link); } }
.part-text { margin: 0.3rem 0 0; white-space: pre-line; font-size: 1.1rem; line-height: 1.55; }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.pager a { max-width: 48%; }
.pager .next { margin-left: auto; text-align: right; }

/* Bundles */

.bundle-grid {
    list-style: none; margin: 1rem 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.7rem;
}
.bundle-card {
    display: flex; flex-direction: column; height: 100%;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--teal);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
}
.bundle-card:hover { border-top-color: var(--gold); }
.bundle-card span { color: var(--muted); font-size: 0.9rem; }

.table-filter { margin: 0.8rem 0; }
.table-filter input { width: min(100%, 24rem); }

.song-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.song-table th, .song-table td { text-align: left; padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--border); }
.song-table th { background: var(--purple-soft); font-size: 0.85rem; }
.song-table .num { width: 4.5rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.song-table .alt-col { color: var(--muted); }
.song-table tr[hidden] { display: none; }

/* Help */

.prose { max-width: 46rem; }
.help-table { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1rem; }
.help-table th, .help-table td { text-align: left; vertical-align: top; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); }
.help-table th { background: var(--purple-soft); font-size: 0.85rem; }
.plain-list { columns: 2 14rem; padding-left: 1.2rem; }

/* Login */

.login-card {
    max-width: 24rem;
    margin: 2.5rem auto;
    padding: 1.2rem 1.5rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--purple);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.login-card h1 { margin-top: 0; }
.login-card form { display: grid; gap: 0.6rem; }
.login-card label { font-weight: 600; }
.error { color: var(--error); margin: 0; font-weight: 600; }

@media (max-width: 36rem) {
    .search-row { flex-direction: column; }
    .brand-text small { display: none; }
    .card-foot { align-items: flex-start; }
    .actions { width: 100%; }
    .actions .btn { flex: 1; }
    .alt-col { display: none; }
}

@media print {
    .site-header, .site-footer, .toolbar, .hint, .pager, .crumbs { display: none; }
    .part { border: 0; opacity: 1 !important; }
    .part [data-part-toggle] { display: none; }
}
