/* QuitLock's look for the book, on top of mdBook's own themes. Colours
   follow the app (android/app/src/main/res/values/colors.xml). */

:root {
    --ql-green: #1a8754;
    --ql-mint: #3dd68c;
    --ql-ink: #14171c;
    --ql-radius: 10px;
    --content-max-width: 820px;
}

.light, .rust, html:not(.js) {
    --links: #2f5bea;
    --ql-accent: #2f5bea;
    --ql-card-bg: #f6f7fa;
    --ql-card-border: #e2e5eb;
    --ql-muted: #5a6170;
}

.coal, .navy, .ayu {
    --links: #8aa4ff;
    --ql-accent: #8aa4ff;
    --ql-card-bg: rgba(255, 255, 255, 0.04);
    --ql-card-border: rgba(255, 255, 255, 0.1);
    --ql-muted: #a3aab8;
}

/* Text */

.content main {
    line-height: 1.65;
}

.content h1 {
    font-size: 2.1em;
    letter-spacing: -0.01em;
    margin-block-end: 0.6em;
}

.content h2 {
    margin-block-start: 1.8em;
    padding-block-end: 0.25em;
    border-bottom: 1px solid var(--ql-card-border);
}

.content a {
    text-underline-offset: 0.18em;
}

/* Tables: a framed box with a tinted header. */

.content table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--ql-card-border);
    border-radius: var(--ql-radius);
    overflow: hidden;
    margin: 1.2em 0;
}

.content table td,
.content table th {
    border: none;
    border-bottom: 1px solid var(--ql-card-border);
    padding: 0.55em 0.9em;
}

.content table tr:last-child td {
    border-bottom: none;
}

.content table thead th {
    font-weight: 600;
}

/* Callouts (> [!NOTE] and friends), and plain quotes. */

.content blockquote {
    border-radius: var(--ql-radius);
}

.content .blockquote-tag {
    padding: 0.7em 1.1em;
}

/* Code */

.content pre {
    border-radius: var(--ql-radius);
}

/* Task lists, as in Manual checks. */

.content li:has(> input[type="checkbox"]) {
    list-style: none;
    margin-inline-start: -1.4em;
}

.content input[type="checkbox"] {
    margin-inline-end: 0.5em;
    accent-color: var(--ql-green);
}

/* The introduction's header. */

.ql-hero {
    display: flex;
    align-items: center;
    gap: 1.4em;
    margin: 1.5em 0 1em;
}

.ql-hero img {
    width: 88px;
    height: 88px;
    flex: none;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(20, 23, 28, 0.25);
}

.coal .ql-hero img, .navy .ql-hero img, .ayu .ql-hero img {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ql-hero h1 {
    margin: 0;
    font-size: 2.6em;
}

.ql-hero p {
    margin: 0.2em 0 0;
    font-size: 1.15em;
    color: var(--ql-muted);
}

.ql-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 1.5em;
}

.ql-badges img {
    display: block;
    height: 20px;
}

/* Cards: the introduction's map of the book. */

.ql-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 1.2em 0 1.6em;
}

.content a.ql-card {
    display: block;
    padding: 1em 1.1em;
    border: 1px solid var(--ql-card-border);
    border-radius: var(--ql-radius);
    background: var(--ql-card-bg);
    color: var(--fg);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}

.content a.ql-card:hover {
    border-color: var(--ql-accent);
    transform: translateY(-1px);
}

.ql-card strong {
    display: block;
    margin-bottom: 0.3em;
    color: var(--ql-accent);
}

.ql-card span {
    display: block;
    font-size: 0.92em;
    line-height: 1.5;
    color: var(--ql-muted);
}

/* Small labels, as in Tested devices. */

.ql-tag {
    display: inline-block;
    padding: 0.05em 0.55em;
    border-radius: 999px;
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
}

.ql-tag.ok {
    background: rgba(26, 135, 84, 0.15);
    color: var(--ql-green);
}

.ql-tag.todo {
    background: rgba(168, 98, 0, 0.15);
    color: #a86200;
}

.coal .ql-tag.ok, .navy .ql-tag.ok, .ayu .ql-tag.ok {
    color: var(--ql-mint);
}

.coal .ql-tag.todo, .navy .ql-tag.todo, .ayu .ql-tag.todo {
    color: #f0b45a;
}

@media (max-width: 620px) {
    .ql-cards {
        grid-template-columns: 1fr;
    }
    .ql-hero img {
        width: 64px;
        height: 64px;
    }
    .ql-hero h1 {
        font-size: 2em;
    }
}

@media print {
    .ql-cards, .ql-badges {
        display: none;
    }
}
