:root {
    --color-primary:#d6e3ff;
    --color-primary-light: hsla(242, 94%, 68%, 0.18);
    --color-primary-variant: #edebff;
    --color-red: #da0f3f;
    --color-red-light: hsl(346, 87%, 46%, 15%);
    --color-green: #008628;
    --color-green-light: hsla(157, 100%, 67%, 0.15);
    --color-gray-900: hsl(216, 100%, 97%);
    --color-gray-100: #4f7dfd;
    --color-gray-00: #e0e9ff;
    --color-gray-700: #e5e4ff;
    --color-gray-300: rgba(73, 73, 73, 0.3);
    --color-gray-200: rgb(44, 44, 44);
    --color-white: #222222;
    --color-bg: #f3f3ff;

    --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;
}

/* ========================================================== */

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
    outline: 0;
    border: 0;
    appearance: 0;
}

body{
    font-family: "Montserrat", sans-serif;
    line-height: 1.3;
    color: var(--color-gray-200);
    overflow-x: hidden;
    background: var(--color-bg);
}
.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);
}

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;
}

.small {
    color: var(--color-gray-100);
}

.admin_alert_messege{
     
    text-align: center;
    display: flex;
    justify-content: center;
    
    place-items: center;

}
.logo_div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ======================================================= */

nav {
    background: var(--color-bg);
    width: 100vw;
    height: 4.5rem;
    position: fixed;
    top: 0;
    z-index: 10;
    box-shadow: 0 1rem 1rem rgba(0, 0, 0, 0.2);
    margin-bottom: 4rem;
}
nav button {
    display: none;
}

.nav_container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10rem;
}

.avater {
    width: 3.5rem;
    aspect-ratio: 1/1;
    height: 3.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 0.3rem solid var(--color-gray-100);

}

.logo {
    font-weight: 600;
    font-size: 1.2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.logo img {
    width: 60px;
    aspect-ratio: 1/1;
    
}
.nav_items {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    font-size: 15px;
    color: #000;
    /* font-weight: bold; */
}

 

.nav_profile {
    position: relative;
    cursor: pointer;
    
}

.nav_profile ul {
    position: absolute;
    top: 110%;
    right: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 3rem 3rem rgba(0, 0, 0, 0.4);
    /* background: var(--color-gray-900); */
    opacity: 0;
    transition: var(--transition);

}

.nav_profile:hover > ul {
    visibility: visible;
    opacity: 1;
}

.nav_profile ul li a {
    padding: 15px 30px;
    background: var(--color-gray-900);
    display: block;
    width: 100%;
    font-size: 14px;
    /* font-weight: bold; */
}

.nav_profile ul li:last-child a {
    background: var(--color-red);
    color: var(--color-bg);
}

/* ========================================================================= */

.catagory_button{
    background: var(--color-primary-light);
    color: var(--color-white);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--card-border-radius-2);
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
}
.catagory_button:hover {
    color: var(--color-white);
}

/* ================================================================================= */

.post_thumbail {
    border-radius: 30px;
    border: 2px solid var(--color-gray-900);
    overflow: hidden;
    margin-bottom: 1.6rem;
}

.post:hover .post_thumbail img {
    filter: saturate(0);
    transition: filter 500ms ease;
}

.post_author {
    display: flex;
    gap: 1rem;
    margin-top: 1.2rem;
}

.post_author_avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: hidden;
}

.posts h4 {
    text-align: center;
}

/* =============================================================================== */

.featured {
    margin-top: 8rem;

}

.featured_container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    font-size: 16px;
}

.featured .post_thumbail {
    height: fit-content;
}

/* =================================POST CONTAINER====================================================== */

.posts_container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5rem;
    /* margin-bottom: 5rem; */
    font-size: 15px;
}

/* ===================================CATAGORY BUTTONS====================================== */

.catagory_buttons {
    padding: 4rem 0;
    border-top: 2px solid var(--color-gray-900);
    border-bottom: 2px solid var(--color-gray-900);
    
}

.catagory_buttons_container {
    width: fit-content;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* =====================================FOOTER==================================== */

footer {
    background: var(--color-gray-900);
    padding: 5rem 0 0;
    box-shadow: inset 0 1.5rem 1.5rem rgba(0, 0, 0, 0.2);
}

.footer_socials {
    margin-inline: auto;
    width: fit-content;
    margin-bottom: 5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;

}

.footer_socials a {
    background: var(--color-bg);
    border-radius: 50%;
    width: 2.3rem;
    height: 2.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer_socials a:hover {
    background: var(--color-white);
    color: var(--color-bg)
}
.footer_container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}

footer h4 {
    color: var(--color-white);
    margin-bottom: 0.6rem;
}

footer ul li {
    padding: 0.4rem 0;
}

footer ul a {
    opacity: 0.75;
}

footer ul a:hover {
    letter-spacing: 0.1rem;
    opacity: 1;
}

.footer_copyright {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 2px solid var(--color-bg);
    margin-top: 4rem;
}

/* ============================================Search============================ */

.search_bar {
    margin-top: 7rem;
}

.search_bar_container {
    position: relative;
    width: 30rem;
    background: var(--color-gray-00);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    padding: 0.6rem 1rem;
    border-radius: var(--card-border-radius-2);
    color: var(--color-gray-300);
}

.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%;
}
.search_bar input::placeholder {
    color:  #5c5c5c;
}


/* ==========================================button style============================ */
.btn {
    display: inline-block;
    width: fit-content;
    padding: 0.6rem 1.2rem;
    background-color: var(--color-gray-100);
    border-radius: var(--card-border-radius-2);
    cursor: pointer;
    transition: var(--transition);
    color: var(--color-primary);
}

.btn.sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

.btn:hover {
    background: var(--color-white);
    color: var(--color-bg);
}

.btn.danger {
    background: var(--color-red);
}

/* ==============================================SINGLPOST================================ */

.singlpost {
    margin: 6rem 0 2rem;
}

.singlpost_container {
    /* width: var(--form-width); */
    width: 50%;
    background: var(--color-gray-900);
    padding: 1rem 2rem 3rem;
}

.singlpost .singlpost_thumbnail {
    margin: 1.5rem 0 1rem;
}

.singlpost_container p {
    margin-top: 1rem;
    line-height: 1.5;
}

/* ==================================================CATAGORYPOST======================= */

.catagory_title {
    height: 15rem;
    margin-top: 4.5rem;
    background: var(--color-gray-900);
    display: grid;
    place-items: center;

}

/* =================================emptypage============================== */

.empty_page {
    height: 70vh;
    text-align: center;
    display: grid;
    place-items: center;
}
/* ========================================FORM=============================== */

.form_section {
    display: grid;
    place-items: center;
    height: 100vh;

}

.form_section_container {
    /* width: var(--form-width); */
    width: 30%;
}

.alert_message {
    /* background-color: red; */
    padding: 0.8rem 1.4rem;
    margin-bottom: 1rem;
    border-radius: var(--card-border-radius-2);
}

.alert_message.error{
    /* font-size: 14px; */
    background-color: var(--color-red-light);
    counter-reset: var(--color-red);
}

.alert_message.success {
    /* font-size: 14px; */
    background-color: var(--color-green-light);
    color: var(--color-green);
}

.alert_message p {
    font-size: 14px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form_control {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.form_control.inline {
    flex-direction: row;
    align-items: center;
}

.form_control.inline input {
    width: 17px;
    height: 17px;
    
}

input, textarea, select {
    padding: 0.8rem 1.4rem;
    background: var(--color-gray-00);
    border-radius: var(--card-border-radius-2);
    resize: none;
    color: var(--color-white);
    font-size: 14px;
     
}

.form_section small {
    margin-top: 1rem;
    display: block;
}

.form_section small a{
    color: var(--color-gray-100);
}

textarea::placeholder {
    color: var(--color-gray-200);
}

/* ==========================================DASHBOARD=============================== */

.dashboard {
    margin-top: 9rem;
}
.dashboard_container {
    display: grid;
    grid-template-columns: 14rem auto;
    gap: 1rem  ;
    background: var(--color-gray-900);
    margin-bottom: 5rem;
    /* border-radius: 20px; */
    /* border: 1px solid var(--color-gray-700); */
    
}

.dashboard aside a {
    background: var(--color-primary);
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.6rem;
}

.dashboard aside ul li:not(:last-child) a {
    border-bottom: 1px solid var(--color-gray-900);
}

.dashboard aside a:hover{
    background: var(--color-gray-700);
}

.dashboard aside a.active {
    background: var(--color-gray-900);
}


.dashboard main {
    margin-left: 1.5rem;

    
}

.dashboard main h2 {
    margin: 1rem 0 2rem 0;
    line-height: 1;
}

.dashboard main table {
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.dashboard main table th {
    background: var(--color-gray-00);
    padding: 0.8rem;
    color: var(--color-white);
}

.dashboard main table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--color-gray-200);
    
}

.dashboard main table tr:hover td {
    background: var(--color-bg);
    color: var(--color-white);
    cursor: default;
    transition: var(--transition);
}

.sidebar_toggle {
    display: none;
}

/* ===========================================Media Tab=============================== */

@media screen and (max-width: 1024px) {
    body{
        /* font-size: 14px; */
    }

    /* =============================GENERAL====================== */
    .container {
        width: var(--container-width-md);
    }

   h2 {
    font-size: 2rem;
   }
    
   h3 {
    font-size: 1.5rem;
   }

   h5 {
    font-size: 1rem;
   }

   /* ===============================NAV========================== */

   nav button {
    display: inline-block;
    font-size: 1.5rem;
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
   }

   nav button#close_nav_btn {
    display: none;
   }

   .nav_container {
    position: relative;
   }

   .nav_items {
    position: absolute;
    flex-direction: column;
    top: 100%;
    right: 0;
    width: 12rem;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    display: none;
   }


   


   .nav_items li {
    width: 100%;
    height: 4.5rem;
    display: flex;
    align-items: center;
    box-shadow: -2rem 3rem 7rem rgba(0, 0, 0, 0.7);
    background: var(--color-gray-900);
    border-top: 1px solid var(--color-bg);
    animation: animateDropdown 1s 0s ease forwards;
    opacity: 0;
    transform-origin: top;
   }

   .nav_items li:nth-child(2){
    animation-delay: 200ms;
   }

   .nav_items li:nth-child(3){
    animation-delay: 400ms;
   }

   .nav_items li:nth-child(4){
    animation-delay: 600ms;
   }

   .nav_items li:nth-child(5){
    animation-delay: 800ms;
   }


   @keyframes animateDropdown {
        0% {
            transform: rotateX(90deg);
        }
        100% {
            transform: rotateX(0deg);
            opacity: 1;
        }
   }



   .nav_items li a {
    border-radius: 0;
    width: 100%;
    height: 100%;
    background: var(--color-gray-900);
    padding: 0 2rem;
    display: flex;
    align-items: center;
   }

   .nav_profile ul {
    top: 100%;
    width: 100%;
   }

   .nav_profile .avater {
    margin-left: 2rem;
    border: 0;
   }

   .featured_container {
    gap: 3rem;
   }

   .posts_container {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
   }

   .footer_container {
    grid-template-columns: 1fr 1fr;
    text-align: center;
   }

  .search_bar_container {
     width: 60%;
   }

   /* =================FORM================= */
   .form_section_container {
    padding: 3rem;
   }

   /* ==================dashboard================ */

   .dashboard_container {
    grid-template-columns: 4.5rem auto;
    padding: 0;
    background: transparent;
   }

   

   .dashboard aside h5 {
    display: none;
   }

   .dashboard main table thead {
    display: none;
   }

   .dashboard main table tr {
    display: flex;
    flex-direction: column;
   }

   .dashboard main table tr:nth-child(even){
    background: var(--color-gray-900);
    /* border-bottom: 1px solid var(--color-gray-200);
    border-top: 1px solid var(--color-gray-200); */
   }

   


   .dashboard main table tr:hover td {
    background: transparent;
   }
   
   .dashboard main table td {
    
    /* border: none; */
    
}
}

/* ======================================PHONE=============================== */

@media screen and (max-width: 720px) {
    section {
        margin-top: 2rem;
    }
    .logo h3{
        font-size: 20px;
    }
    h1 {
        font-size: 2rem;
    }

    .featured{
        margin-top: 6rem;
    }
    .featured_container {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .posts_container {
        grid-template-columns: 1fr;
        
    }

    .catagory_buttons_container {
        grid-template-columns: 1fr 1fr;
    }

    .footer_container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;

       }

     .search_bar_container {
        width: 80%;
      }

      .singlpost_container {
        background: transparent;
        padding: 0;
      }

      .catagory_title {
        height: 10rem;
        
        
    }

    /* ===========FORM================== */
    .form_section_container {
        padding: 0;
       }

       /* ===========dashboard============== */

       .dashboard {
        margin-top: 5rem;
       } 

       .dashboard_container {
        grid-template-columns: 1fr;
        gap: 0;
       }

       .dashboard main {
        margin: 0;
       }
       .dashboard main h2 {
        -webkit-margin-bottom-collapse: 1rem;
       }

       .dashboard aside {
        position: fixed;
        box-sizing: 2rem 0 4rem rgba(0, 0, 0, 0.4);
        left: -100%;
        height: 100vh;
        transition: var(--transition);
        background: var(--color-primary);
       }

       .dashboard .sidebar_toggle {
        display: inline-block;
        background-color: var(--color-primary-variant);
        color: var(--color-white);
        position: fixed;
        right: 0;
        bottom: 4rem;
        z-index: 1;
        width: 3rem;
        height: 2.5rem;
        border-radius: 50% 0 0 50%;
        font-size: 1.3rem;
        cursor: pointer;
        box-shadow: -1rem 0 2rem rgba(0, 0, 0, 0.4);
       }

       .dashboard aside a h5 {
        display: inline-block;
        font-size: 14px;
       }

       #hide_sidebar_btn {
        display: none;
       }
}