:root {
    --color-primary: #98A1BC;
    --color-primary-light: hsla(242, 91%, 69%, 0.18);
    --color-primary-variant: #5854C7;
    --color-bg: #555879;
    --color-white: #F4EBD3;
    --transition: all 300ms ease;
    --container-width-lg: 74%;
    --container-width-md: 88%;

    --transition: all 300ms ease;
    --container-width-lg: 74%;
    --container-width-md: 88%;
    --form-width: 40%;

    --card-border-radius-1: 0.3rem;
    --card-border-radius-2: 0.5rem;
    --card-border-radius-3: 0.8rem;
    --card-border-radius-4: 2rem;
    --card-border-radius-5: 5rem;
}

/* GENERAL */
* {
    margin: 0;
    padding: 0;
    outline: 0;
    border: 0;
    appearance: none;
    list-style: none;
    text-decoration: none;
}

body {
    font-family: "Signika", sans-serif;
    line-height: 1.6;
    color: var(--color-white);
    overflow-x: hidden;
    background: var(--color-bg);
    font-size: 0.9rem;
}

.container {
    width: var(--container-width-lg);
    max-width: 1800px;
    margin-inline: auto;
}

section {
    margin-top: 3rem;
    width: 100vw;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--color-white);
    line-height: 1.3;
}

h1 {
    font-size: 3rem;
    margin: 1rem 0;
}

h2 {
    font-size: 1.7rem;
    margin: 1rem 0;
}

h3 {
    font-size: 1.1rem;
    margin: 0.8rem 0 0.5rem;
}

h4 {
    font-size: 1rem;
}

a {
    color: var(--color-white);
    transition: var(--transition);
}

img {
    display: block;
    width: 100%;
    object-fit: cover;
}

/* PRELOADER */



/* NAVBAR */
nav {
    background: var(--color-primary);
    width: 100%;
    height: 4.5rem;
    position: fixed;
    top: 0;
    z-index: 10;
    box-shadow: 0 1rem 1rem rgba(0, 0, 0, 0.2);
}

.nav_container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: medium;
}

.nav_logo {
    width: 69px;
}

.nav_items {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.nav_items li a {
    color: #fff;
    transition: color 0.3s ease;
}

.nav_items li a:hover {
    color: #ddd;
}

nav button {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

/* === LANGUAGE DROPDOWN === */
.nav_language {
    position: relative;
}

.language_dropdown {
    display: none;
    position: absolute;
    background: var(--color-primary);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    list-style: none;
    padding: 0.5rem 0;
    z-index: 2;
    min-width: 8rem;
}

.language_dropdown li {
    text-align: left;
}

.language_dropdown li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s ease;
}

.language_dropdown li a:hover {
    background: rgba(255, 255, 255, 0.1);
}


.nav_language.active .language_dropdown {
    display: block;
}

/* CATEGORY BUTTON */
.category_button {
    background: #68a5df;
    color: var(--color-white);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--card-border-radius-2);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
}

.category_button:hover {
    transform: translateY(-2px);
    color: #000000;
}

/* GENERAL POST */
.post_thumbnail {
    border-radius: var(--card-border-radius-5);
    border: 0.8rem solid #DED3C4;
    overflow: hidden;
    margin-bottom: 1.6rem;
}

.post:hover .post_thumbnail img {
    filter: saturate(0);
    transition: filter 500ms ease;
}

.post_author {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.post_thumbnail img {
    width: 100%;
    aspect-ratio: 16/9;
    /* atau 4/3 tergantung bentuk gambar */
    object-fit: cover;
}


.post_author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--card-border-radius-3);
    margin-bottom: 1rem;
    overflow: hidden;
}

.post_author-info {
    color: black;
}

.post {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.post.show {
    opacity: 1;
    transform: translateY(0);
}

.post:nth-child(1) {
    transition-delay: 0s;
}

.post:nth-child(2) {
    transition-delay: 0.15s;
}

.post:nth-child(3) {
    transition-delay: 0.3s;
}

/* FEATURED */
.featured {
    margin-top: 8rem;
}

.featured_container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.featured .post_thumbnail {
    height: fit-content;
}

.read_more_btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    background-color: #007BFF;
    color: #fff;
    border-radius: var(--card-border-radius-3);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.read_more_btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.back_btn {
    display: inline-block;
    padding: 0.8rem 2.1rem;
    background-color: #13bfeb;
    color: #fff;
    border-radius: var(--card-border-radius-3);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.back_btn:hover {
    color: black;
    background-color: #4987ca;
    transform: translateY(-2px);
}

/* SEARCH  */
.search_bar {
    margin-top: 7rem;
}

.search_bar-container {
    position: relative;
    width: 30rem;
    background: #DED3C4;
    ;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    padding: 0.6rem 1rem;
    border-radius: var(--card-border-radius-2);
    color: rgba(242, 242, 254, 0.3);
}

.search_bar-container>div {
    width: 100%;
    display: flex;
    align-items: center;
}

.search_bar input {
    background: transparent;
    margin-left: 0.7rem;
    padding: 0.5rem 0;
    width: 100%;
}

.btn {
    display: inline-block;
    width: fit-content;
    padding: 0.6rem 1.2rem;
    background-color: var(--color-primary);
    border-radius: var(--card-border-radius-2);
    cursor: pointer;
    color: #000000;
    font-weight: bold;
}

.btn:hover {
    color: white;
}

/* POST */
.posts_container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5rem;
    margin-bottom: 5rem;
}

/* CATEGORY BUTTONS */
.category_buttons {
    padding: 4rem 0;
    border-top: 2px solid #DED3C4;
    border-bottom: 2px solid #DED3C4;
}

.category_buttons-container {
    width: fit-content;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* MORE LOAD BUTTON */
.load-more-container {
    text-align: center;
    margin: 30px 0;
}

/* FOOTER */
footer {
    background-color: #555879;
    box-shadow: inset 0 1.5rem 1.5rem rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 1.5rem 0;
    font-size: 300;
}

/* SINGE POST */
.singlepost {
    margin: 6rem 0 2rem;
}

.singlepost_container {
    width: var(--form-width);
    background: #DED3C4;
    padding: 1rem 2rem 3rem;
}

.singlepost_thumbnail {
    margin: 1.5rem 0 1rem;
}

.singlepost_container p {
    color: black;
    margin-top: 1rem;
    line-height: 1.7;
}

.singlepost_container h2 {
    color: black;
}

/* COMMENTS */
.comments {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: var(--card-border-radius-3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

#comment-heading {
    color: var(--color-white);
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 700;
}

.comment_form {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: 1fr;
    align-items: start;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.comment_form .field_group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.comment_form input,
.comment_form textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: var(--card-border-radius-2);
    border: 1px solid #ccc;
    background: #fff;
    color: #000;
    font-size: 0.95rem;
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.comment_form input:focus,
.comment_form textarea:focus {
    border-color: #68a5df;
    box-shadow: 0 0 5px rgba(104, 165, 223, 0.5);
    outline: none;
}

.comment_form textarea {
    min-height: 100px;
    max-height: 220px;
    resize: vertical;
}

.comment_form button {
    justify-self: start;
    padding: 0.7rem 1.2rem;
    border-radius: var(--card-border-radius-3);
    border: none;
    background: linear-gradient(135deg, #68a5df, #86b7ff);
    color: #000;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.3s ease;
}

.comment_form button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #7ab5f2, #9cc8ff);
}

.comment_list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 0.4rem;
    scrollbar-width: thin;
    scrollbar-color: #999 #222;
}

.comment_list::-webkit-scrollbar {
    width: 6px;
}

.comment_list::-webkit-scrollbar-thumb {
    background-color: #999;
    border-radius: 3px;
}

.comment_list::-webkit-scrollbar-track {
    background: #222;
}

.comment {
    background: #f6f2e9;
    padding: 0.9rem 1rem;
    border-radius: var(--card-border-radius-2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.comment_username {
    color: #333;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.comment_meta {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.4rem;
}

.comment_body {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    white-space: pre-wrap;
}

.load-more-comments {
    padding: 0.6rem 1.2rem;
    background: #68a5df;
    color: #fff;
    border: none;
    border-radius: var(--card-border-radius-2);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
}

.load-more-comments:hover {
    background: #7ab5f2;
    transform: translateY(-2px);
}

/* CATEGORY POST */
.category_title {
    height: 15rem;
    margin-top: 4/5rem;
    background: #DED3C4;
    display: grid;
    place-items: center;
    background: var(--color-bg);
}

/* FORM*/
.form_section {
    display: grid;
    place-items: center;
    height: 100vh;
}

.form_section-container {
    width: var(--form-width);
}

.alert_message_error {
    background: red;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form_control {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

input,
textarea,
select {
    padding: 0.rem 1.4rem;
}

/* RESPONSIVE TABLET */
@media (max-width: 1024px) {
    .container {
        width: var(--container-width-md);
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    h5 {
        font-size: 0.8rem;
    }
}

@media (max-width: 960px) {
    /* NAV */
    nav button {
        display: inline-block;
    }

    #close_nav-btn {
        display: none;
    }

    .nav_container {
        position: relative;
    }

    .nav_items {
        position: absolute;
        top: 100%;
        right: 0;
        width: 14rem;
        background: var(--color-primary);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        display: none;
        border-radius: 0 0 0.5rem 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    }

    .nav_items li {
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .nav_items li a {
        text-align: center;
        width: 100%;
        padding: 1rem 0;
        justify-items: center;
        display: block;
        color: #fff;
        background: transparent;
    }

    .nav_items li a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .language_dropdown {
        width: 100%;
    }
}

/* TABLET (max-width: 768px) */
@media (max-width: 768px) {

    /* NAVBAR */
    .nav_items {
        display: none;
        flex-direction: column;
        background: var(--color-primary);
        position: absolute;
        top: 4.5rem;
        left: 0;
        width: 100%;
        text-align: center;
        gap: 2rem;
        padding: 1.5rem 0;
    }

    .nav_items li a {
        text-align: center;
        padding: 1rem 0;
        justify-content: center;
    }

    #close_nav-btn {
        display: none;
    }

    .nav_items.active {
        display: flex;
    }

    nav button {
        display: block;
    }

    .nav_container {
        padding: 0 1.5rem;
    }

    /* FEATURED */
    .featured_container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* SEARCH */
    .search_bar-container {
        width: 80%;
    }

    /* POSTS */
    .posts_container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    /* CATEGORY BUTTONS */
    .category_buttons-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .singlepost_container {
        width: 90%;
        padding: 1rem 1rem 2rem;
        margin: 0 auto;
    }

    .comments {
        padding: 1rem;
    }

    .comment_form textarea {
        min-height: 80px;
    }
}


/* MOBILE (max-width: 425px) */
@media (max-width: 425px) {

    .nav_items {
        gap: 1.5rem;
        font-size: 0.9rem;
    }

    /* SEARCH */
    .search_bar-container {
        width: 90%;
        flex-direction: column;
        padding: 0.8rem;
        gap: 0.5rem;
    }

    .search_bar input {
        width: 100%;
        font-size: 0.9rem;
    }

    /* POSTS */
    .posts_container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* CATEGORY BUTTONS */
    .category_buttons-container {
        grid-template-columns: 1fr;
    }

    /* FEATURED */
    .featured_container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* BUTTONS */
    .category_button,
    .read_more_btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }

    /* SINGLE POST */
    .singlepost_container {
        width: 95%;
        padding: 0.8rem 0.8rem 1.5rem;
    }

    /* FORM */
    .form_section-container {
        width: 90%;
    }

    /* FOOTER */
    footer {
        font-size: 0.9rem;
        padding: 1rem 0;
    }
}