@font-face {
    font-family: "Visby";
    src: url("/webfonts/VisbyCF-Light.woff2");

    font-weight: 200;
    font-style: normal;
}

@font-face {
    font-family: "Visby";
    src: url("/webfonts/VisbyCF-Medium.woff2");

    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: "Visby";
    src: url("/webfonts/VisbyCF-Regular.woff2");

    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Visby";
    src: url("/webfonts/VisbyCF-DemiBold.woff2");

    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "Visby";
    src: url("/webfonts/VisbyCF-Bold.woff2");

    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "Visby";
    src: url("/webfonts/VisbyCF-ExtraBold.woff2");

    font-weight: 700;
    font-style: normal;
}

*{
    box-sizing: border-box;
}

html{
    interpolate-size: allow-keywords;
}

body {
    font-family: "Visby", sans-serif;
    line-height: 1.2;
    font-weight: 500;
    margin: 0;
}

h1,
h2,
h3 {
    margin: 0;
}

header{
    background-color: hotpink;
    color: midnightblue;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.75rem 0.6rem;
}

header h1{
    line-height: 1;
}

@media screen and (max-width: 400px){
    header h1{
        font-size: 1.4rem;
    }
}


@media screen and (max-width: 360px){
    header h1{
        font-size: 1.3rem;
    }
}

a{ color: inherit; }
a.no-underline{ text-decoration: none; }

nav ul{
    list-style: none;
    padding: 0;
    margin: 0;

    display: flex;
    flex-wrap: wrap;
    gap: .1rem 0.7rem;
    justify-content: end;
}

main{
    padding: 1rem;
}

.entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 10px;
    margin: 3rem 0;

}

article {
    border: 1px solid black;
    border-radius: 5px;
    padding: 10px;

    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;

    position: relative;

    &.to-do::before{
        content: " ";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 6px;
        background-color: green;
    }

    a{
        word-wrap: anywhere;
    }

    .content{
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .title{
        line-height: 1;
    }

    .date{
        margin-bottom: 5px;
    }

    .tag-list {
        font-size: 0.8em;
        margin-top: 1em;
    }

    .text-content{
        flex: 1;
    }

    .body{
        word-break: break-word;

        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    .media{
        margin-top: 1rem;
    }

    .media:not([data-mediacount="1"]){
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .media[data-mediacount="1"] img.portrait{
        width: 70%;
    }

    .categories ul{
        margin-bottom: 0;
    }


    .categories .single-cat{
        text-transform: uppercase;
        font-size: 0.7em;
        letter-spacing: 0.03em;
        border: 1px solid black;
        border-radius: 1em;
        padding: 4px 8px 2px;

        color: #444;
        background-color: transparent;
        transition: 0.2s ease-out;
    }

    figure{
        margin: 1em 0 0;
    }

    iframe{
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}



.categories button:hover, .categories .single-cat.active{
    background-color: #444;
    color: white;
}

.to-do-container{
    margin-top: 1rem;
}

input:not([type="checkbox"]),
textarea {
    display: block;
    width: 100%;
    border: 1px solid currentColor;
}

textarea {
    resize: vertical;
    min-height: 5em;
}

.password-wrapper{
    position: relative;
}

#togglePw{
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0 8px;
    display: grid;
    place-items: center;
}

#togglePw svg{
    display: block;
}

#togglePw .eye{ display: none; }
.show-pw #togglePw .eye{ display: block; }
.show-pw #togglePw .eye-slash{ display: none; }

details {
    transition: height 0.5s ease;

    summary{
        background: lightgray;
        text-align: center;
        padding: 0.5em;
        height: 1cap;
        box-sizing: content-box;
        text-box: trim-both cap alphabetic;
        border-radius: 5px;
        cursor: pointer;
    }

    ::marker {
        content: '';
    }

    &::details-content {
        transition: height 0.3s ease-out,
            margin 0.3s ease-out,
            content-visibility 0.3s ease-out allow-discrete;
        min-height: 0;
        height: 0;
        overflow: clip;
    }

    &[open]::details-content {
        margin-top: 1rem;
        height: auto;
    }
}

.filter{
    .tag-list{
        font-size: 0.8em;
    }
}

.count{
    margin-block-start: 0.5rem;
}

.tag-list,
.checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 0.6em;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tag-list a {
    line-height: 1.8ex;
    display: block;
    border: 1px solid black;
    border-radius: 1em;
    padding: 0.5em 0.8em 0.4em;
    text-decoration: none;
    transition: 0.1s ease-out;
}

.tag-list a:hover{
    background-color: hotpink;
    color: white;
}

.checkboxes label {
    position: relative;
}

.checkboxes label input {
    position: absolute;
    display: none;
}


.checkboxes input + span {
    display: block;
    padding: 0.4em 0.6em;
    border: 1px solid black;
    border-radius: 1em;
    transition: background-color 0.1s ease-out, color 0.1s ease-out;
}

.checkboxes input:checked + span,
.filter a.active {
    background-color: black;
    color: white;
}

.actions {
    display: flex;
    justify-content: end;
    gap: 10px;
}

button, .btn{
    font: inherit;
    cursor: pointer;

    background-color: lightgray;
    padding: 0.4em 0.8em;
    text-decoration: none;
    border-radius: 0.2em;
    line-height: 1;
    border: none;
    transition: 0.2s ease-out;

    &.active{
        background-color: black;
        color: white;
    }

    &:hover{
        background-color: black;
        color: white;
    }
}


.categories ul{ list-style: none; padding: 0; display: flex; gap: 0.5em; flex-wrap: wrap; }
.categories li{ display: flex; flex-wrap: wrap; gap: 0.5em; }
.categories ul ul{ display: none; }
.categories ul .active + ul{ display: flex; }

img, video{
    display: block;
    max-width: 100%;
}

img{ height: auto; }
video{ width: 100%; }

.url{
    display: block;
    margin-top: 1em;
    word-break: break-all;
}


#search-form{
    max-width: 30rem;
    border: 2px solid midnightblue;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#login-form{
    max-width: 100%;
    width: 25rem;
    margin-inline: auto;
    font-size: 1.1em;

    fieldset{
        margin-bottom: 1rem;
        border: none;
        padding: 0;
    }

    label:has(input[type="checkbox"]){
        display: flex;
        gap: 5px;
        align-content: baseline;
    }
}


fieldset label{
    margin-bottom: 0.25em;
    display: block;
}

fieldset input, fieldset textarea{
    padding: 0.5em;
    padding-bottom: 0.4em;
    font: inherit;
}

#login-button{
    display: block;
    margin-top: 1em;

    background-color: hotpink;
    color: midnightblue;
    border: none;
    padding: 0.5em 1em 0.4em;
    line-height: 1;

    transition: 0.2s ease-out;

    &:hover{
        background-color: midnightblue;
        color: hotpink;
    }
}


#create-form fieldset{
    margin-bottom: 1em;
}

#create-form .checkboxes{
    padding: 0.35em 0.75em 0.625em;
}

.ingredients, .steps{
    margin-top: 2rem;
    line-height: 1.3;
    padding-left: 1.5em;
}

.steps{
    max-width: 50ch;
}

.steps li:not(:last-child){
    margin-bottom: 1em;
}


.subtopics{
    display: none;

    label span{
        background-color: lightgray;
    }
}

label:has(input:checked){
    display: inline-flex;

    & + .subtopics{
        display: inline-flex;
        gap: 0.3em 0.6em;

        span{
            background-color: lightgrey;
        }
    }
}


.index article .media:not([data-mediacount="1"]){
    img{
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
}

.index article .media .plus{
    grid-column: 1 / -1;
    background-color: black;
    color: white;
    text-align: center;
    padding: 0.025em;
    font-size: 1.2em;
}

.single-entry article .media{
    grid-template-columns: repeat( auto-fit, minmax(350px, 1fr) );
}
