@import './reset.css';
@import './vars.css';
@import './responsive.css';

/** Global */
body {
    background: var(--white);
    color: var(--black);
    min-height: 100vh;
    font-family: sans-serif;
    max-width: 100vw;
    overflow-x: hidden;
}
a {
    color: inherit;
    transition: .25s ease-in-out opacity;
}
a:hover {
    opacity: .75;
    text-decoration: underline;
}
.container {
    max-width: 80rem;
    width: calc(100% - 1rem);
    margin-left: auto;
    margin-right: auto;
}
.title,
.subtitle {
    display: inline-block;
    color: var(--primary);
}
.card {
    margin: .25rem;
    padding: .5rem;
    background-color: #fff;
    border-radius: 2px;
    width: calc(100% / 3 - .5rem);
    box-shadow:
            0 1px 3px rgba(0, 0, 0, .12),
            0 1px 2px rgba(0, 0, 0, .24);
}
.button {
    display: inline-flex;
    align-items: center;
    padding: .625rem .5rem .5rem;
    background-color: var(--white);
    color: var(--primary);
    border-radius: 2px;
    font-weight: 600;
    cursor: pointer;
    transition:
            .25s ease-in-out background-color,
            .25s ease-in-out box-shadow,
            .25s ease-in-out color;
}
.button svg {
    font-size: 1.25rem;
    margin-right: .25rem;
    margin-top: -.25rem;
}
.button:hover {
    background-color: var(--secondary);
    color: var(--white);
    box-shadow:
            0 3px 6px rgba(0, 0, 0, .16),
            0 3px 6px rgba(0, 0, 0, .23);
}
.button_warning:hover {
    background-color: var(--warning);
}

/** Header */
header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 0;
    margin-bottom: 1rem;
    z-index: 5;
}
header br {
    display: none;
}
header::before {
    content: '';
    position: absolute;
    z-index: -1;
    width: 100vw;
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
}
header .title {
    color: var(--white);
}

/** Toggle checked */
.toggleChecked {
    margin-bottom: .5rem;
}
.toggleChecked.button > svg {
    margin-top: 0;
}
.toggleChecked.button {
    padding-top: .5rem;
}
.toggleChecked.button > .hidden {
    display: none;
}
.toggleChecked.button:not(:hover) {
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
}
.toggleChecked.toggleChecked--visible > .visible {
    display: none;
}
.toggleChecked.toggleChecked--visible > .hidden {
    display: initial;
}

/** Checklists */
main {
    margin: -.25rem -.25rem .75rem;
}
.checklist {
    max-height: 40rem;
    overflow-x: hidden;
    overflow-y: auto;
}
.checklist-category,
.checklist-subcategory {
    position: relative;
    margin-top: .5rem;
    margin-left: .75rem;
}
.checklist-subcategory .subtitle {
    margin-bottom: .25rem;
}
.checklist-subcategory label {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    justify-content: space-between;
    margin-left: .25rem;
    transition: .25s ease-in-out background-color;
    padding: .125rem .25rem;
    border-radius: 2px;
    cursor: pointer;
}
.checklist-subcategory input[type=checkbox] {
    margin-left: 1rem;
}
.checklist-subcategory input[type="checkbox"]:checked + span {
    font-style: italic;
    text-decoration: line-through;
    opacity: .75;
}
.checklist-subcategory label:hover {
    background-color: var(--white);
}
.checklist-subcategory li:not(:last-child) {
    margin-bottom: .25rem;
}
.checklist-category + .checklist-category {
    margin-top: 1rem;
}
.checklist-category:not(:last-child) {
    margin-bottom: .5rem;
}
.checklist-category::before,
.checklist-subcategory::before {
    content: '';
    position: absolute;
    top: 0;
    left: -.5rem;
    height: 100%;
    border-left: 2px solid var(--primary);
}

/** Alert */
.alert {
    position: fixed;
    bottom: .5rem;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem;
    border-radius: 2px;
    box-shadow:
            0 1px 3px rgba(0, 0, 0, .12),
            0 1px 2px rgba(0, 0, 0, .24);
    width: max-content;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + .5rem)) scale(.5);
    cursor: pointer;
    transition:
            .25s ease-in-out transform,
            .25s ease-in-out opacity;
}
.alert_warning {
    background-color: var(--warning);
    color: #fff;
}
.alert_secondary {
    background-color: var(--secondary);
    color: #fff;
}
.alert--visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/** Footer */
footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    color: var(--white);
    padding: .5rem 0;
}
footer p {
    display: flex;
    align-items: center;
}
footer svg {
    color: var(--warning);
}
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 100vw;
    transform: translateX(-50%);
    background-color: var(--primary);
    z-index: -1;
}