@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

:root {
    --primary: #006989;
    --secondary: #F5F5F5;
}

.bg-custom-primary {
    background-color: var(--primary);
}

.bg-custom-secondary {
    background-color: var(--secondary);
}

.bungee {
    font-family: 'Bungee', sans-serif;
}

.h1 {
    font-family: 'Bungee', sans-serif;
}

.separator {
    height: 1px;
    background-color: #000;
}

#icon-theme{
    color: #000;
    transition: 0.3s;
}

#icon-theme:hover {
    color: #FFF;
    transition: 0.3s;
}

.search-results {
    width: 100%;
    z-index: 1050;
    font-family: system-ui, sans-serif;
}

.search-thumbnail {
    width: 40px;
    height: 56px;
    object-fit: cover;
}

/* Webcomic list: filter sidebar */

.filter-sidebar {
    --filter-accent: #1A9BBF;
    --bs-offcanvas-bg: #D9D9D9;
}

/* Bootstrap makes .offcanvas-lg transparent on large screens */
@media (min-width: 992px) {
    .filter-aside {
        background-color: #D9D9D9;
    }

    .filter-sidebar {
        padding: 1.5rem 1rem;
    }
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group legend {
    color: #3A3A3A;
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* The list is centered as a block, options are left-aligned inside it */
.filter-options {
    width: fit-content;
    margin: 0 auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
    color: var(--filter-accent);
    cursor: pointer;
}

.filter-option input {
    appearance: none;
    flex-shrink: 0;
    width: 0.9rem;
    height: 0.9rem;
    margin: 0;
    background-color: var(--filter-accent);
    border: 2px solid var(--filter-accent);
    cursor: pointer;
}

.filter-option input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 2px #D9D9D9;
}

.filter-option input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.filter-option:has(input:checked) {
    color: var(--primary);
}

.filter-option:hover {
    color: var(--primary);
}

/* Two range inputs stacked on top of each other, only their thumbs are clickable */
.episode-range {
    position: relative;
    height: 1.5rem;
}

.episode-range::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    background-color: #EEE;
    border-radius: 3px;
}

.episode-range input {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    appearance: none;
    background: none;
    pointer-events: none;
}

.episode-range input::-webkit-slider-thumb {
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: none;
    border-radius: 50%;
    background-color: var(--filter-accent);
    pointer-events: auto;
    cursor: pointer;
}

.episode-range input::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    border: none;
    border-radius: 50%;
    background-color: var(--filter-accent);
    pointer-events: auto;
    cursor: pointer;
}

/* Webcomic list: grid */

.webcomic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 2rem 1.5rem;
}

@media (max-width: 575.98px) {
    .webcomic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem 1rem;
    }
}

.webcomic-card {
    overflow-wrap: anywhere;
}

.webcomic-row .webcomic-card {
    flex: 0 0 160px;
}

.webcomic-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.webcomic-add {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 2px solid #FFF;
    border-radius: 50%;
    color: #FFF;
    background-color: rgba(0, 0, 0, 0.15);
    text-decoration: none;
    transition: 0.3s;
}

.webcomic-add:hover {
    color: #FFF;
    background-color: var(--primary);
}

/*
 * Tables with many columns: on small screens, each row becomes a card
 * and each cell a "label: value" line (the label comes from the cell's data-label attribute).
 * With .table-stack-sort, the header stays visible as a bar of sort links.
 */
@media (max-width: 767.98px) {
    .table-stack thead {
        display: none;
    }

    .table-stack.table-stack-sort thead {
        display: block;
    }

    .table-stack.table-stack-sort thead tr {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .table-stack.table-stack-sort thead th {
        border: 1px solid var(--bs-border-color);
        border-radius: 999px;
        padding: 0.25rem 0.75rem;
        font-weight: normal;
    }

    /* only the sortable columns are useful in the sort bar */
    .table-stack.table-stack-sort thead th:not(:has(a)) {
        display: none;
    }

    .table-stack,
    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
        width: 100%;
    }

    .table-stack tbody tr {
        margin-bottom: 1rem;
        border: 1px solid var(--bs-border-color);
        border-radius: 0.5rem;
        overflow: hidden;
    }

    .table-stack td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .table-stack td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-weight: bold;
        text-align: left;
    }

    .table-stack td:last-child {
        border-bottom: 0;
    }

    /* groups of buttons go to the right, next to their label */
    .table-stack td > .d-flex {
        justify-content: flex-end;
    }

    /* message of an empty table */
    .table-stack td[colspan] {
        justify-content: center;
        text-align: center;
    }
}
