/* ===================
   ===================
    Mobile (Default)
   =================== 
   =================== */
/* ===== Color Theme ===== */
:root {
/* Weird naming convention since primary is used the least, but the names fit for the rest */
    /* Dark */
    --primary-color: hsl(248, 39%, 29%);
    --secondary-color: hsl(34, 44%, 69%);
    --accent-color: hsl(195, 53%, 79%);
    --text-color: hsla(348 33 97 / 0.89);
    --background-color: hsl(210 50 13);
    .theme-icon {
        filter: invert(70%);
    }
}

/* Light */
body.light {
    --primary-color: hsl(296, 39%, 31%);
    --secondary-color: hsl(341, 66%, 67%);
    --accent-color: hsl(165, 70%, 46%);
    --text-color: hsl(0, 0%, 0%); 
    --background-color: hsl(15, 15%, 99%);
    .theme-icon {
        filter: invert(0);
    }
}

/* Loud */
body.neon {
    --primary-color: silver;
    --secondary-color: purple;
    --accent-color: lightgreen;
    --text-color: darkslateblue;
    --background-color: magenta;
    .theme-icon {
        filter: invert(0);
    }
}

body.milk {
    --primary-color: hsl(336, 17%, 19%);
    --secondary-color: hsl(98, 64%, 83%);
    --accent-color: hsl(244, 70%, 60%);
    --text-color: hsl(0, 17%, 98%);
    --background-color: hsl(231, 30%, 74%);
    .theme-icon {
        filter: invert(0);
    }
}

body.colorblind {
    --primary-color: hsl(327 45 44);
    --secondary-color: hsl(41 100 45);
    --accent-color: hsl(26 100 42);
    --text-color: white;
    --backgroundcolor: hsl(202 100 35);
    .theme-icon {
        filter: invert(90%);
    }
}

/* ===================
    Element Selectors
   =================== */
*:focus-visible {
    outline: 3px solid hotpink;
}

html {
    font-size: 16px;
}

body {
    font-family: monospace, Consolas, Monaco, 'Courier New', monospace;
    background-color: var(--background-color);
}

footer {
    position: sticky;
    background-color: var(--primary-color);
}

article {
    color: var(--text-color);
    & > div {
        padding-block-end: 1rem;
    }
}

a, a:visited {
    color: var(--accent-color);
}

a:hover {
    color: var(--secondary-color);
    filter: brightness(110%);
    transition: color 400ms ease;
}

abbr {
  font-style: italic;
  color: var(--secondary-color);
}


h1, h2, h3, h4, h5, h6  {
    color: var(--secondary-color);
}

p {
    color: var(--text-color);
}
/* ===================
        ID selectors
   =================== */
#posts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 2rem;
    > * {
        background: var(--primary-color);
        padding: 0.5em;
        outline: 1px solid var(--secondary-color);
        box-shadow: 0.6em 0.3em 1em 0.1em var(--primary-color);
        /* This will block the IMG popover with the below CSS */
        /* &:nth-child(odd) {
            filter: brightness(0.9);
            p {
                filter: brightness(1.1);
                filter: saturate(1.1);
            }
        } */
    }
}

#nav-menu {
    max-width: 90vw;
    padding: 2rem 1rem;

    .nav-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        list-style-type: none;
        justify-content: center;
        padding-inline-start: 0;
        padding-inline-end: 1rem;
        overflow: visible;
        li {
            min-width: 0;
            gap: 1rem;
        }
    }

    .theme-menu-toggle {
        position: absolute;
        top: 1rem;
        right: 1rem;
        aspect-ratio: 1;
    }

    .menu-bg-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
        background: rgb(0 0 0 / 0.3);
        backdrop-filter: blur(0.3rem);
    }
}
/* ===================
    Class Selectors
   =================== */
.theme-popup-menu {
    position: fixed;
    background-color: var(--accent-color);
    color: var(--primary-color);
    outline: 4px solid var(--primary-color);

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1rem 2rem 1rem;

    z-index: 100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 1000ms;

    li {
        list-style: none;
        width: 100%;
        color: var(--background-color);
        background-color: var(--accent-color);
        filter: brightness(110%);
        text-align: center;
        margin: 0.4rem 1rem;
        padding: 0.2rem;
        outline: 1px solid var(--primary-color);
        box-shadow: 2px 0px 8px 0px;        
    }

    .theme-popup-close {
        position: absolute;
        padding: 0.5rem 1rem 0.9rem 1rem;
        top: 1%;
        right: 2%;
    }
}

.home-header {
    margin-bottom: 2rem;
}

.home-intro > p {
    margin: 1.5rem 0rem;
}

.home-post {
    margin-top: 4rem;

    .home-latest-post-header {
        margin-bottom: 2.5rem;
    }
}

.post-show-back {
    margin-top: 4rem;
}

.post-img {
    margin-bottom: 1rem;
    outline: 2px solid var(--primary-color);
}

.post-popover {
    position: absolute;
    z-index: 200;
    width: 65vw;
}

.theme-icon:hover {
    filter: brightness(150%);
    border-block-start: 1px solid transparent;
    border-block-end: 1px solid transparent;
    background: radial-gradient(var(--secondary-color), transparent);
    border-radius: 70%;
    opacity: 80%;
}


.footer-container {
    display: flex;
    flex-direction: column;

    footer {
        min-height: 15vh;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        gap: 16px;

        .footer-links {
            display: flex;
            justify-content: space-between;

            .footer-link-item {
                margin-left: 0.5rem;
                margin-right: 0.5rem;
            }
        }

        .footer-image {
            margin-top: 1rem;
        }
    }
}

.yield-content {
    padding: 1rem;
    border-top: 2px solid var(--primary-color);
    &::after {
        content: "";
        display: block;
        padding-bottom: 70vh;
    }
}

.post-form {
    color: var(--text-color);
    & > div {
        margin: 1rem;
    }
}

/* ===================
   ===================
        Tablet
   =================== 
   =================== */
@media screen and (min-width: 768px) {
    body {
        font-size: 1.125rem /* 18px */;
    }

    #nav-menu {
        margin-inline: 0;
        justify-content: space-between;
    }

    .yield-content {
        padding-inline: 5rem;
    }

    .post-popover {
        width: 55vw;
    }
}

/* ===================
   ===================
        Desktop
   =================== 
   =================== */
@media screen and (min-width: 1024px) {  
    
    main::after {
        padding-bottom: 100vh;
    }

    body {
        /* padding-inline: 12rem; */
        font-size: 1.25rem /* 20px */;
    }

    footer {
        width: auto;
    }

    #nav-menu {
        .nav-list {
            gap: 3rem;
        }
    }

    .yield-content {
        padding-inline: 10rem;
    }

    .post-popover {
        width: 50vw;
    }
}

/* ===================
   ===================
    Custom Classes
   =================== 
   =================== */
.capitalize {
    text-transform: capitalize;
}

.lowercase {
    text-transform: lowercase;
}

.uppercase {
    text-transform: uppercase;
}

.underline {
    text-decoration: underline;
}

.italy {
    font-style: italic;
}

.bold {
    font-weight: 600;
}

.small-text {
    font-size: 0.82rem;
}

.hidden {
    display: none !important;
}

.text-color {
    color: var(--text-color);
}

.flex {
    display: flex;
    gap: var(--gap, 1rem);
}

.prose > * + * {
    margin-block-start: var(--prose-flow, 1.5em);
}

.debug {
    outline: 2px solid red;
}