/* ___________________ FONTS ____________________________ */

@font-face {
    font-family: sarabun-bold;
    src: url("../fonts/Sarabun/Sarabun-Bold.ttf");
}

@font-face {
    font-family: sarabun-regular;
    src: url("../fonts/Sarabun/Sarabun-Regular.ttf");
}

@font-face {
    font-family: sarabun-light;
    src: url("../fonts/Sarabun/Sarabun-Light.ttf");
}

@font-face {
    font-family: sarabun-italic;
    src: url("../fonts/Sarabun/Sarabun-Italic.ttf");
}

/* ------------------- VARIABLES ------------------- */

:root {
    --primary-color: #0e1128;
    --secondary-color: #00abf5;
    --tertiary-color: #dbdee3;
    --quaternary-color: #ff5f68;
    --quinary-color: #141418;

    --primary-border: solid rgba(219, 222, 227, 0.071) 1px;

    --primary-shadow: rgba(0, 0, 0, 0.1) 0px 3px 5px,
        rgba(0, 0, 0, 0.1) 0px 3px 5px;

    --secondary-background-color: #18181c45;

    --radial-gradient: radial-gradient(
        circle farthest-corner at top,
        #00acf51f -606%,
        #000001 70%
    );

    --content-width: clamp(200px, 90%, 3200px);
}

/* ------------------- GLOBAL ------------------- */

html {
    position: relative;
    min-height: 100vh;
    width: 100%;
    font-family: sarabun-regular;
    font-size: 16px;
    background: var(--quinary-color);
    /* background: radial-gradient(circle farthest-corner at top left,rgb(255, 95, 104) -606%,#000001 70%); */
    overflow-x: hidden;
}

.bg-image {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--radial-gradient);
    background-size: cover;
    background-position: center;
    filter: blur(4px);
    opacity: 0.35;
}

body {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
}

body::-webkit-scrollbar,
ul::-webkit-scrollbar {
    width: 6px;
}

body::-webkit-scrollbar-track,
ul::-webkit-scrollbar-track {
    background: #222229; /* color of the tracking area */
}

body::-webkit-scrollbar-thumb,
ul::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: #c4c8ce; /* color of the scroll thumb */
}

/* ------------------- NAVIGATION ------------------- */

#app-navigation {
    z-index: 2;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: var(--content-width);
    height: 2.8rem;
    box-sizing: border-box;
    padding: 0 20px;
    margin: 20px 0 0 0;
    background-color: var(--secondary-background-color);
    border-radius: 4px;
    border: var(--primary-border);
    color: var(--tertiary-color);
    box-shadow: var(--primary-shadow);
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

@media screen and (min-width: 360px) {
    #app-navigation {
        justify-content: space-between;
        gap: initial;
    }
}

#app-navigation.opaque {
    background-color: var(--quinary-color);
}

.app-title {
    font-family: sarabun-bold;
    font-size: 1.3rem;
    letter-spacing: 2px;
    text-decoration: none;
    color: var(--tertiary-color);
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

.app-title.desktop {
    display: none;
}

#app-navigation ul {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 3px;
    width: 85%;
    color: var(--tertiary-color);
    list-style: none;
}

@media screen and (min-width: 440px) {
    #app-navigation ul {
        justify-content: space-around;
        gap: initial;
        width: 100%;
    }
}

@media screen and (min-width: 720px) {
    .app-title.mobile {
        display: none;
    }

    .app-title.desktop {
        display: inline-flex;
        font-size: 1.5rem;
    }

    #app-navigation ul {
        justify-content: space-between;
        gap: 30px;
        width: auto;
    }
}

#app-navigation .link-item {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 7px;
    text-decoration: none;
    letter-spacing: 1px;
    color: var(--tertiary-color);
    cursor: pointer;
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

#app-navigation .link-item:hover,
#app-navigation .link-item:active,
#app-navigation .link-item.selected {
    color: var(--quinary-color);
    background-color: var(--secondary-color);
}

#app-navigation .link-item:hover svg,
#app-navigation .link-item:active svg,
#app-navigation .link-item.selected svg {
    fill: #18181c;
}

#app-navigation svg {
    fill: var(--tertiary-color);
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

#app-navigation span {
    display: none;
}

@media screen and (min-width: 1200px) {
    #app-navigation span {
        display: inline-flex;
    }
}

#app-navigation a {
    text-decoration: none;
    color: inherit;
}

/* ------------------- CONTENT ------------------- */

.content {
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    flex-grow: 1;
    box-sizing: border-box;
    margin: 0;
    padding: 5px 0;
    width: var(--content-width);
    min-height: 80vh;
    color: var(--quinary-color);
}

.header {
    letter-spacing: 1px;
}

.content button {
    color: var(--quinary-color);
    padding: 7px 12px;
    border-radius: 4px;
    background-color: var(--secondary-color);
    border: none;
    cursor: pointer;
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

.content button.delete {
    background-color: transparent;
    border: var(--quaternary-color) 1px solid;
    border-radius: 0;
    color: var(--tertiary-color);
}

.content button.delete:hover {
    background-color: var(--quaternary-color);
    color: var(--quinary-color);
}

.content button:active {
    filter: brightness(0.9);
}

.content button:hover {
    filter: contrast(1.5);
}

.content a {
    text-decoration: none;
    color: var(--secondary-color);
}

.content a:hover {
    filter: contrast(1.5);
}

.content hr {
    width: 100%;
    border: none;
    border-top: solid var(--tertiary-color) 2px;
}

.flashed-messages {
    padding: 0;
    margin: 16px 0;
    color: var(--quaternary-color);
    list-style: none;
}

.pagination-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    flex-grow: 1;
    color: var(--tertiary-color);
    padding: 15px 20px;
    margin: 0;

    ol {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 10px;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    a {
        cursor: pointer;
    }

    .page-number {
        padding: 0.35rem;
        border-radius: 4px;
        color: var(--secondary-color);
        background-color: var(--secondary-background-color);
        border: var(--primary-border);
        box-shadow: var(--primary-shadow);
        transition: all 200ms linear;
    }

    .page-number:hover {
        color: var(--quinary-color);
        background-color: var(--secondary-color);
    }

    .page-number.selected {
        font-family: sarabun-bold;
        color: var(--quinary-color);
        background-color: var(--secondary-color);
    }
}

/* ------------------- LOG IN PAGE ------------------- */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    box-sizing: border-box;
    margin: 0;
    padding: 25px;
    height: auto;
    width: clamp(200px, 100%, 50ch);
    text-align: left;
    color: var(--tertiary-color);
    background-color: var(--secondary-background-color);
    border: var(--primary-border);
    border-radius: 4px;
    box-shadow: var(--primary-shadow);
}

.page .header {
    font-family: sarabun-bold;
    font-size: 2rem;
    letter-spacing: 2px;
    margin: 0;
    width: 100%;
    text-align: left;
}

.page .sub-header {
    margin: 0;
    text-align: left;
    width: 100%;
}

.page form {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    gap: 15px;
    margin: 0;
    padding: 0;
    text-align: left;
}

.page form .button-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.page form .row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 5px;
    width: 100%;
}

@media screen and (min-width: 720px) {
    .page form .row {
        flex-direction: row;
        align-items: center;
        gap: initial;
    }
}

.page input,
.page textarea {
    background-color: var(--tertiary-color);
    border: transparent 1px solid;
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

.page input:focus,
.page textarea:focus {
    outline: transparent;
    border: var(--secondary-color) 1px solid;
}

.page input {
    width: 25ch;
}

.page textarea {
    height: 20ch;
    width: 100%;
}

/* ------------------- CREATE AND EDIT BLOG POST ------------------- */
#create-blog-post-page,
#update-blog-post-page {
    width: clamp(200px, 100%, 800px);
}

#create-blog-post-page input,
#create-blog-post-page textarea,
#update-blog-post-page input,
#update-blog-post-page textarea {
    width: 100%;
}

#create-blog-post-page textarea,
#update-blog-post-page textarea {
    height: 40ch;
    width: 100%;
}

/* ------------------- BLOGGERS ------------------- */

a.featured-container {
    width: 100%;

    &:hover {
        filter: none !important;
    }
}

.featured {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    height: clamp(475px, 25vh, 700px);
    color: var(--tertiary-color);
    font-size: larger;
    box-sizing: border-box;
    padding: 15px 20px;
    margin-bottom: 14px;
    border-radius: 4px;
    background: var(--secondary-background-color);
    background: linear-gradient(
        110deg,
        rgb(4, 16, 32) 0%,
        rgb(0, 45, 94) 28%,
        rgb(0, 10, 15) 85%
    );
    box-shadow: var(--primary-shadow);
    transition: all 200ms linear;

    & * {
        padding: 0;
        margin: 0;
    }

    & > label {
        font-family: sarabun-bold;
        mix-blend-mode: color-dodge;
    }

    & > div {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-start;
        gap: 14px;
        width: 100%;
    }

    & p {
        max-width: 150ch;
    }

    svg {
        height: 1.5em;
        fill: var(--tertiary-color);
        margin-bottom: -7px;
    }

    .prompt-area {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .prompt {
        display: none;
        transition: all 200ms linear;
    }

    &:hover {
        -webkit-box-shadow: 0px 0px 12px 2px rgba(0, 172, 245, 1);
        -moz-box-shadow: 0px 0px 12px 2px rgba(0, 172, 245, 1);
        box-shadow: 0px 0px 12px 2px rgba(0, 172, 245, 1);

        .prompt {
            display: unset;
        }
    }
}

@media screen and (min-width: 720px) {
    .featured {
        height: clamp(300px, 25vh, 700px);
    }
}

.featured.blog {
    .author {
        font-size: initial;

        i {
            font-family: sarabun-italic;
        }
    }
}

.users {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    height: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

@media screen and (min-width: 444px) {
    .users {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

@media screen and (min-width: 1348px) {
    .users {
        grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    }
}

.no-users {
    color: var(--tertiary-color);
    font-family: sarabun-light;
    font-size: 1.2rem;
    letter-spacing: 1.5px;
}

.users > li {
    position: relative;
    color: var(--tertiary-color);
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
    padding: 15px 20px;
    border: var(--primary-border);
    border-radius: 4px;
    width: 100%;
    background-color: var(--secondary-background-color);
    box-shadow: var(--primary-shadow);
}

.users > li .bg-image {
    opacity: 0.65;
}

.users .about {
    max-width: 75ch;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.users .header {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.avatar {
    height: 3.3rem;
    width: 3.3rem;
    border-radius: 150px;
}

.avatar.lg {
    height: 4.25rem;
    width: 4.25rem;
}

.metadata {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media screen and (min-width: 1200px) {
    .metadata {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.post-count,
.since {
    font-family: sarabun-light;
    font-size: 0.7rem;
    letter-spacing: 1px;
}

/* ------------------- BLOGS ------------------- */

.blog-previews {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media screen and (min-width: 540px) {
    .blog-previews {
        grid-template-columns: 1fr 1fr;
    }
}

@media screen and (min-width: 720px) {
    .blog-previews {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media screen and (min-width: 1200px) {
    .blog-previews {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

.blog-preview {
    position: relative;
    color: var(--tertiary-color);
    padding: 15px;
    border: var(--primary-border);
    border-radius: 4px;
    background-color: var(--secondary-background-color);
    box-shadow: var(--primary-shadow);
}

.blog-preview .bg-image,
.blog-user .bg-image {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: blur(5px);
    opacity: 0.1;
}

.blog-preview .bg-image {
    background: var(--radial-gradient);
    opacity: 0.65;
}

.blog-preview .title {
    margin: 0;
    font-family: sarabun-bold;
    letter-spacing: 1.5px;
    word-break: break-all;
}

.blog-preview .date {
    font-family: sarabun-light;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.blog-user {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    margin: 0 0 20px 0;
    border: var(--primary-border);
    border-radius: 4px;
    color: var(--tertiary-color);
    box-shadow: var(--primary-shadow);
}

.blog-user .header {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.blog-user .user {
    margin: 0;
    word-break: break-all;
}

.blog-user svg {
    fill: var(--tertiary-color);
}

.blog-user .bg-image {
    background-image: url("../images/background/abstract.jpg");
    filter: hue-rotate(-44deg) blur(4px) contrast(2);
    opacity: 0.45;
}

.blog-post {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    padding: 0 9px;
    margin-bottom: 50px;
    color: var(--tertiary-color);
}

.blog-post .title {
    width: 100%;
    text-align: left;
}

.blog-post p {
    word-wrap: break-word;
    font-size: 1.2rem;
    max-width: 75ch;
    line-height: 2rem;
    text-align: left;
}

.no-blog-posts {
    color: var(--tertiary-color);
    font-family: sarabun-light;
    font-size: 1.2rem;
    letter-spacing: 1.5px;
}

#comment-section {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    color: var(--tertiary-color);
}

#comment-section .sub-header {
    font-size: 1.2rem;
    letter-spacing: 1.5px;
    margin: 10px 0;
    width: 100%;
    text-align: left;
}

#comment-section form {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    gap: 5px;
    margin: 0;
    padding: 0;
    text-align: left;
}

#comment-section form textarea {
    width: 100%;
    height: 10ch;
    background-color: var(--tertiary-color);
    border: var(--primary-color) 1px solid;
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

#comment-section form textarea:focus {
    outline: transparent;
    border: var(--secondary-color) 1px solid;
}

.comments {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    margin: 15px 0 0 0;
    border: var(--primary-border);
    list-style: none;
}

.comment {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    margin: 0;
    text-align: left;
}

.comment-author {
    font-family: sarabun-light;
    font-size: 0.7rem;
}

.comment p {
    width: 100%;
    margin: 0;
    text-align: left;
}

.comment svg {
    fill: var(--tertiary-color);
    padding-right: 5px;
}

/* ------------------- FOOTER ------------------- */
.app-footer {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: var(--content-width);
    height: 2.8rem;
    box-sizing: border-box;
    padding: 0 20px;
    margin: 20px 0;
    background-color: var(--secondary-background-color);
    border-radius: 4px;
    border: var(--primary-border);
    color: var(--tertiary-color);
    box-shadow: var(--primary-shadow);
}

#copyright {
    font-family: sarabun-light;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

#socials {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    list-style: none;
}

#socials a {
    text-decoration: none;
    color: var(--tertiary-color);
}

#socials a:hover {
    filter: brightness(1.1);
}

#socials img {
    height: 1.8rem;
}

#socials img:hover,
#socials img:active {
    scale: 1.1;
}

.you {
    color: var(--quaternary-color) !important;
}

.error {
    color: red;
}
