*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
    /* Neutrals*/
    --color-n-100: #e2d1de;
    --color-n-300: #c7b1c2;
    --color-n-500: #694460;
    --color-n-700: #421b38;
    --color-n-900: #2e0925;

    /* Accent*/
    --color-a-100: #eddee9;
    --color-a-500: #80005a;
    --color-a-900: #500138;
    
    /* States */
    --danger: #d41515;
    --success: #1a8000;


    /* =========== FONT ========== */
    font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* ==================== MAIN LAYOUT ==================== */

body{
    display: flex;
    flex-direction: column;
    min-height: 100vh;

    background-color: var(--color-n-300);
    color: var(--color-n-900);
}

header{
    display: flex;
    flex-flow: row wrap;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 2;

    background-color: var(--color-n-100);
    border-top: 1px solid var(--color-n-500);
}

header .logo{
    flex: 1;
    min-width: min(100%, 250px);
}

.tool-bar{
    min-width: 200px;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-end;
    align-items: stretch;
    flex: 2;
    gap: 16px;
}


/* Tool */

.tool{
    background-color: var(--color-a-500);
    color: var(--color-n-100);

    border: 0;
    border-radius: 8px;
    padding: 8px;

    vertical-align: center;

    transition: all 0.1s;
}

.tool:hover{
    outline: 2px solid var(--color-a-500);
    background-color: var(--color-n-100);
    color: var(--color-a-500);
}

.tool > svg{
    pointer-events: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}


main{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 32px;
}

footer{
    margin-top: auto;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;

    border-top: 1px solid var(--color-n-500);
}

header, main, footer{
    padding: 16px;
}

/* ==================== CONTENT ==================== */


/* Card */

.card{
    background-color: var(--color-n-100);

    display: flex;
    flex-direction: column;
    gap: 8px;

    border-radius: 16px;
    padding: 32px;

    box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.08);
}

.card:hover{
    outline: 2px solid var(--color-n-500);
}

.card > .thumbnail{
    align-self: center;
    height: 300px;
    padding-bottom: 16px;

    border-bottom: 1px solid var(--color-n-500);
}

.thumbnail img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card > .author{
    color: var(--color-n-700);
}

.tag-container{
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: baseline;
    gap: 8px;
}

.tag{
    font-size: 0.75rem;

    border: 1px solid var(--color-n-500);
    border-radius: 8px;
    padding: 8px;
    background-color: var(--color-a-100);
    color: var(--color-n-700);
    text-align: center;

    max-width: 15ch;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.card button:hover{
    box-shadow: 0 10px 10px 0 rgba(0, 0, 0, 0.25);
}

.card button, .card a{
    padding: 8px;
    border: 1px solid var(--color-n-500);
    border-radius: 8px;

    text-decoration: none;
    text-align: center;
}

.card .status{
    font-size: 1.1rem;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;
    flex: 4;

    color: inherit;
}

.card[data-have-read="true"] .status{
    background-color: var(--success);
}
.card[data-have-read="true"] .status::after{
    color: #faf5f9;
    content: "Read";
}

.card[data-have-read="false"] .status::after{
    content: "Unread";
}

.card .delete{
    color: grey;
}

.card .delete svg{
    width: 100%;
    height: 100%;

    pointer-events: none;
}

.card .delete:hover{
    color: var(--danger);
}

.card .tool-bar{
    margin-top: auto;
    min-height: 50px;
    max-height: 50px;
}

/* ===================== FORM MODAL ===================== */

#entry-modal{
    position: fixed;

    min-width: min(90%, 700px);
    min-height: min(90%, 500px);
    overflow-x: hidden;
    overflow-y: auto;

    margin: auto;

    padding: 32px;

    border: 2px solid var(--color-n-500);
    border-radius: 16px;

    background-color: var(--color-n-100);
    color: var(--color-n-900);
}

#entry-modal::backdrop{
    background: radial-gradient(ellipse,rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%);
}

#entry-modal form{
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 16px;

    place-content: center;
    align-items: baseline;
    
}
#entry-modal form > legend{
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    padding-bottom: 16px;

    border-bottom: var(--color-n-500);
}

#entry-modal form > button{
    padding: 16px;
    border-radius:8px;

    border: 1px solid var(--color-n-500);
    font-size: 1.1rem;
    font-weight: 700;
}

form button[type="submit"]{
    background-color: var(--color-a-500);
    color: var(--color-a-100);
}

form button:hover{
    box-shadow: 0 10px 10px 0 rgba(0, 0, 0, 0.25);
}

#close-entry{
    color: var(--color-n-900);
}

input[type="text"],
input[type="url"],
textarea{
    outline-color: var(--color-n-500);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--color-n-500);

    font-family: inherit;
}

input[type="text"]:invalid,
input[type="url"]:invalid{
    border: 2px solid var(--danger);
}


textarea{
    height: 400px;
    resize: none;
}

