/* Same look as yaakovfar.dev */
@font-face {
        font-family: EBGaramond;
        font-weight: 1 999;
        src: url(eb-garamond.woff2) format("woff2");
        font-display: swap;
}
@font-face {
        font-family: EBGaramond;
        font-style: italic;
        font-weight: 1 999;
        src: url(eb-garamond-italic.woff2) format("woff2");
        font-display: swap;
}

:root {
        color-scheme: light dark;
        --fg: light-dark(#141201, #fefdeb);
        --bg: light-dark(#fefdeb, #141201);
        --primary: light-dark(#0818f7, #f78308);
        --line: color-mix(in srgb, currentColor 25%, transparent);
        --shadow: 0 25px 50px -12px #0006;
}
* {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
}
body {
        max-width: 75ch;
        min-height: 100vh;
        margin: auto;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: 2rem;
        font:
                22px/33px EBGaramond,
                serif;
        color: var(--fg);
        background: var(--bg);
}
h1,
h2,
summary {
        font-size: 1.5rem;
        font-weight: bold;
}
summary {
        cursor: pointer;
}
button {
        font: inherit;
        color: var(--primary);
        text-decoration: underline;
        background: none;
        border: 0;
        cursor: pointer;
}
.login-link {
        float: right;
        font-size: 18px;
        font-weight: normal;
        color: var(--primary);
}
.login-link:hover,
button:hover {
        text-decoration: none;
}
input {
        font: inherit;
        color: inherit;
        width: 100%;
        padding: 0.25rem 0;
        background: none;
        border: 0;
        border-bottom: 1px solid var(--line);
        outline: none;
}
input:focus {
        border-color: var(--primary);
}

.login {
        margin: auto 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
}
.login button {
        align-self: flex-start;
}
.error {
        color: #dc2626;
        font-style: italic;
}

header {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding-top: 1rem;
}
#results:has(section) {
        position: absolute;
        inset: 100% 0 auto;
        z-index: 10;
        max-height: 70vh;
        margin-top: 0.5rem;
        padding: 1rem;
        overflow: auto;
        background: var(--bg);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
}
.close {
        float: right;
        font-size: 18px;
}

main,
#lists {
        display: flex;
        flex-direction: column;
        gap: 70px;
}
section {
        display: flex;
        flex-direction: column;
        gap: 1rem;
}
.count {
        font-weight: normal;
        opacity: 0.5;
}

.grid {
        list-style: none;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        margin-top: 1rem;
}
@media (min-width: 40rem) {
        .grid {
                grid-template-columns: repeat(4, 1fr);
        }
}
.grid li {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
}
.poster {
        width: 100%;
        aspect-ratio: 2/3;
        object-fit: cover;
        background: color-mix(in srgb, currentColor 10%, transparent);
}
.title {
        font-size: 18px;
        line-height: 1.25;
}
em {
        opacity: 0.6;
}
.grid form {
        margin-top: auto;
        display: flex;
        gap: 0.75rem;
        font-size: 16px;
}
.empty {
        grid-column: 1 / -1;
        font-style: italic;
        opacity: 0.6;
}

#toast:has(p) {
        position: fixed;
        inset: auto 1rem 1rem;
        z-index: 20;
        max-width: 28rem;
        margin: auto;
        padding: 1rem;
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        background: var(--bg);
        border: 1px solid #dc2626;
        box-shadow: var(--shadow);
}
#toast p {
        flex: 1;
        font-size: 18px;
        line-height: 1.4;
}
#toast strong {
        color: #dc2626;
}
#toast button {
        font-size: 18px;
}
