@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

* {
   font-family: "Nunito", sans-serif;
   box-sizing: border-box;
   padding: 0;
   margin: 0;
   outline: none;
   border: none;
   text-decoration: none;
}

:root {
   --main-color: #2563EB;
   --red: #DC2626;
   --orange: #F59E0B;
   --black: #1F2937;
   --white: #FFFFFF;
   --light-color: #6b7280;
   --light-bg: #E5E7EB;

   --border: .2rem solid var(--black);
   --border-light: .2rem solid var(--light-color);
   --box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.05);
}

*::selection {
   color: var(--white);
   background-color: var(--main-color);
}

::-webkit-scrollbar {
   height: .5rem;
   width: 1rem;
}

::-webkit-scrollbar-track {
   background-color: transparent;
}

::-webkit-scrollbar-thumb {
   background-color: var(--main-color);
}

html {
   font-size: 62.5%;
   overflow-x: hidden;
}

body {
   background-color: var(--light-bg);
   /* padding-bottom: 7rem; */
}

section {
   padding: 2rem;
   max-width: 1200px;
   margin: 0 auto;
}

.message {
   background-color: var(--white);
   border-bottom: var(--border);
   box-shadow: var(--box-shadow);
   padding: 2rem;
   display: flex;
   align-items: center;
   justify-content: space-between;
   position: sticky;
   top: 0;
   left: 0;
   z-index: 1000;
}

.message span {
   font-size: 2rem;
   color: var(--black);
}

.message i {
   color: var(--red);
   cursor: pointer;
   font-size: 2.5rem;
   transition: .2s linear;
}

.message i:hover {
   transform: rotate(90deg);
   color: var(--black);
}

.btn,
.option-btn,
.delete-btn,
.inline-btn,
.inline-option-btn,
.inline-delete-btn {
   display: inline-block;
   margin-top: 1rem;
   border-radius: .5rem;
   font-size: 1.8rem;
   color: var(--white);
   cursor: pointer;
   padding: 1rem 3rem;
   text-align: center;
}

.btn:hover,
.option-btn:hover,
.delete-btn:hover,
.inline-btn:hover,
.inline-option-btn:hover,
.inline-delete-btn:hover {
   background-color: var(--black);
}


.flex-btn {
   display: flex;
   gap: 1rem;
}

.empty {
   width: 100%;
   border: var(--border);
   background-color: var(--white);
   padding: 1.5rem;
   font-size: 2rem;
   color: var(--red);
   text-align: center;
   box-shadow: var(--box-shadow);
   margin: 0 auto;
   text-align: center;
   border-radius: .5rem;
}

.delete-btn,
.option-btn,
.btn {
   width: 100%;
}

.inline-btn,
.inline-delete-btn,
.inline-option-btn {
   margin-right: .5rem;
}

.inline-btn,
.btn {
   background-color: var(--main-color);
}

.inline-option-btn,
.option-btn {
   background-color: var(--orange);
}

.inline-delete-btn,
.delete-btn {
   background-color: var(--red);
}

.heading {
   margin-bottom: 2rem;
   text-align: center;
   font-size: 3.5rem;
   color: var(--black);
   text-transform: capitalize;
}

.header {
   position: sticky;
   top: 0;
   left: 0;
   right: 0;
   z-index: 1000;
   background-color: var(--white);
   box-shadow: var(--box-shadow);
   /* border-bottom: var(--border-light); */
}

.header .flex {
   display: flex;
   align-items: center;
   justify-content: space-between;
   position: relative;
   padding: 1.5rem 2rem;
}

.header .flex .logo {
   font-size: 2.5rem;
   color: var(--black);
}

.header .flex .nav-items {
   display: block;
}

.header .flex .nav-items a {
   color: var(--black);
   margin: 0 .5rem;
   font-size: 2rem;

}

.header .flex .search-form {
   display: flex;
   align-items: center;
   gap: 1.5rem;
   background-color: var(--light-bg);
   border-radius: .5rem;
   padding: 1rem;
   width: 45rem;
   border: var(--border-light);
}

.header .flex .search-form input {
   background: none;
   width: 100%;
   font-size: 2rem;
   color: var(--black);
}

.header .flex .search-form button {
   font-size: 2rem;
   color: var(--black);
   cursor: pointer;
   background: none;
}

.header .flex .search-form button:hover {
   color: var(--main-color);
}

.header .flex .icons div {
   cursor: pointer;
   height: 4.5rem;
   width: 5rem;
   line-height: 4.1rem;
   border: var(--border-light);
   background-color: var(--light-bg);
   color: var(--black);
   border-radius: .5rem;
   text-align: center;
   font-size: 2rem;
   margin-left: .7rem;
}

.header .flex .icons div:hover {
   background-color: var(--black);
   color: var(--white);
}

#menu-btn {
   display: none;
}

#search-btn {
   display: none;
}

.header .flex .navbar {
   position: absolute;
   top: 120%;
   right: 2rem;
   border-radius: .5rem;
   background-color: var(--white);
   padding: 1rem 2rem;
   box-shadow: var(--box-shadow);
   border: var(--border);
   width: 30rem;
   display: none;
   animation: fadeIn .2s linear;
}

@keyframes fadeIn {
   0% {
      transform: translateY(1rem);
   }
}

.header .flex .navbar.active {
   display: block;
}

.header .flex .navbar a {
   font-size: 2rem;
   display: block;
   padding: 1rem 0;

}

.header .flex .navbar a i {
   color: var(--main-color);
   margin-right: 1rem;
   transition: .2s linear;
}

.header .flex .navbar a:hover i {
   margin-right: 2rem;

}

.header .flex .navbar a span {
   color: var(--light-color);
}

.header .flex .profile {
   position: absolute;
   top: 120%;
   right: 2rem;
   border-radius: .5rem;
   background-color: var(--white);
   padding: 1.5rem;
   box-shadow: var(--box-shadow);
   border: var(--border);
   width: 30rem;
   text-align: center;
   display: none;
   animation: fadeIn .2s linear;
}


.header .flex .profile.active {
   display: block;
}

.header .flex .profile p {
   margin-bottom: .5rem;
   font-size: 1.8rem;
   text-overflow: ellipsis;
   white-space: nowrap;
   color: var(--light-color);
}

.home-grid .box-container {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(33rem, 1fr));
   gap: 1.5rem;
   align-items: flex-start;
}

.home-grid .box-container .box {
   border: var(--border);
   box-shadow: var(--box-shadow);
   border-radius: .5rem;
   background-color: var(--white);
   padding: 2rem;
   overflow: hidden;
}

.home-grid .box-container .box p {
   padding-bottom: 1rem;
   font-size: 2rem;
   color: var(--light-color);
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.home-grid .box-container .box p span {
   color: var(--main-color);
}

.home-grid .box-container .box .flex-box {
   display: flex;
   flex-wrap: wrap;
   gap: 1rem;
   padding-top: 1rem;
}

.home-grid .box-container .box .flex-box .links {
   padding: 1rem 3rem;
   border-radius: .5rem;
   background-color: var(--light-bg);
   font-size: 2rem;
   color: var(--black);
   /* border:var(--border); */
}

.home-grid .box-container .box .flex-box .links:hover {
   background-color: var(--black);
   color: var(--white);
}

.cat-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
   gap: 2rem;
   margin: 1rem 0;
}

.cat-card {
   position: relative;
   display: grid;
   place-items: center;
   height: 180px;
   border-radius: 1rem;
   overflow: hidden;
   color: var(--white);
   text-decoration: none;
   box-shadow: var(--box-shadow);
   background: #0f0f10;
   /* fallback color while image loads */
   isolation: isolate;
   transition: transform .18s ease, box-shadow .18s ease;
}

/* Background image element */
.cat-card .cat-bg {
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   object-fit: cover;
   filter: grayscale(25%) brightness(.78);
   z-index: 0;
}

/* Dark overlay */
.cat-card::after {
   content: "";
   position: absolute;
   inset: 0;
   background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .55));
   z-index: 1;
}

/* Label on top */
.cat-label {
   position: relative;
   z-index: 2;
   font-size: 1.5rem;
   font-weight: 600;
   text-align: center;
   padding: .2rem .6rem;
   text-transform: capitalize;
   letter-spacing: .2px;
}

/* Hover */
.cat-card:hover {
   transform: translateY(-2px);
   box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}


@media (max-width: 520px) {
   .cat-card {
      height: 96px;
   }
}


.cat-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
   gap: 2.5rem;
   margin: 1rem 0 0.5rem;
   /* bottom reduce so niche extra space na bane */
}

/* View-all tile styles (same as before) */
.cat-card--all {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: .6rem;
   height: 180px;
   border-radius: 1rem;
   background: #0f172a;
   position: relative;
}

.cat-card--all::before {
   content: "";
   position: absolute;
   inset: 0;
   background: radial-gradient(120% 120% at 20% 10%, rgba(46, 91, 255, .35), transparent 45%),
      radial-gradient(120% 120% at 80% 90%, rgba(231, 12, 21, .35), transparent 50%);
   opacity: .35;
   z-index: 0;
}

.cat-card--all::after {
   content: "";
   position: absolute;
   inset: 0;
   background: linear-gradient(180deg, rgba(0, 0, 0, .22), rgba(0, 0, 0, .45));
   z-index: 0;
}

.cat-card--all .cat-all-icon,
.cat-card--all .cat-all-text {
   position: relative;
   z-index: 1;
   color: #fff;
}

.cat-card--all .cat-all-icon {
   width: 42px;
   height: 42px;
   border-radius: 50%;
   display: grid;
   place-items: center;
   background: rgba(255, 255, 255, .1);
   font-size: 1.1rem;
   transition: transform .2s ease;
}

.cat-card--all:hover .cat-all-icon {
   transform: translateX(3px);
   /* background: rgba(255, 255, 255, .18); */
}

.cat-card--all .cat-all-text {
   font-weight: 600;
   letter-spacing: .2px;
   font-size: 1.5rem;
}

@media (max-width:520px) {
   .cat-card--all {
      height: 96px;
   }

   .cat-card--all .cat-all-icon {
      width: 36px;
      height: 36px;
   }

   .cat-card--all .cat-all-text {
      font-size: 1rem;
   }
}



.posts-container .box-container {
   columns: 3 30rem;
   gap: 2rem;
}

.posts-container .box-container .box {
   /* border:var(--border); */
   box-shadow: var(--box-shadow);
   border-radius: .5rem;
   background-color: var(--white);
   padding: 2rem;
   overflow: hidden;
   margin-bottom: 2rem;
   break-inside: avoid;
   overflow-x: hidden;
}


/* Same outer width for both sections */
.view-post .posts-container {
   max-width: 1200px;
   /* same cap */
   margin: 0 auto;
   /* center align */
   padding: 0 1rem;
   /* side padding like comments */
}

/* Disable multi-columns for single post list */
.view-post .posts-container .box-container {
   columns: auto;
   /* remove */
   column-count: 1;
   /* single column */
   column-gap: 0;
}

/* Make post card span full width like comments box */
.view-post .posts-container .box-container .box {
   width: 100%;
   max-width: none;
   margin: 2rem 0;
}

/* Optional: ensure image/content expand nicely */
.view-post .posts-container .post-image {
   width: 100%;
   height: auto;
   display: block;
}


.posts-container .box-container .box .post-admin {
   display: flex;
   align-items: center;
   gap: 1.5rem;
   margin-bottom: 2rem;
}

.posts-container .box-container .box .post-admin i {
   text-align: center;
   height: 4.5rem;
   width: 5rem;
   line-height: 4.2rem;
   font-size: 2rem;
   border: var(--border);
   border-radius: .5rem;
   background-color: var(--light-bg);
   color: var(--black);
}

.posts-container .box-container .box .post-admin a {
   font-size: 2rem;
   color: var(--main-color);
}

.posts-container .box-container .box .post-admin a:hover {
   color: var(--black);
}

.posts-container .box-container .box .post-admin div {
   font-size: 1.5rem;
   margin-top: .2rem;
   color: var(--light-color);
}

.posts-container .box-container .box .post-image {
   height: 60rem;
   object-fit: cover;
   width: 100%;
   border-radius: .5rem;
   margin-bottom: 2rem;
}

.posts-container .box-container .box .post-title {
   font-size: 2.5rem;
   color: var(--black);
   font-weight: 600;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
   margin-bottom: 1rem;
}

.posts-container .box-container .box .post-content {
   font-size: 1.8rem;
   line-height: 1.5;
   padding: .5rem 0;
   color: var(--black);
   white-space: normal;
}

.posts-container .box-container .box .post-content::after {
   content: '...';
}

.posts-container .box-container .box .post-cat {
   display: block;
   margin-top: 2rem;
   font-size: 1.7rem;
}

.posts-container .box-container .box .post-cat i {
   margin-right: .5rem;
   color: var(--light-color);
}

.posts-container .box-container .box .post-cat {
   color: var(--main-color);
   text-transform: capitalize;
}

.posts-container .box-container .box .post-cat:hover {
   color: var(--black);
}

.posts-container .box-container .box .icons {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 1rem;
   background-color: var(--light-bg);
   border-radius: .5rem;
   padding: 1rem 1.5rem;
   /* border:var(--border); */
   margin-top: 2rem;
}

.posts-container .box-container .box .icons button {
   cursor: pointer;
}

.posts-container .box-container .box .icons i {
   margin-right: .5rem;
   font-size: 1.5rem;
   color: var(--light-color);
}

.posts-container .box-container .box .icons span {
   font-size: 1.5rem;
   color: var(--black);
}

.posts-container .box-container .box .icons *:hover {
   color: var(--black);
}

.comments-container .comment-title {
   background-color: var(--black);
   color: var(--white);
   padding: 1.5rem;
   font-size: 2rem;
   border-radius: .5rem;
   border-bottom-left-radius: 0;
   border-bottom-right-radius: 0;
}

.comments-container .add-comment {
   /* border:var(--border); */
   margin-bottom: 2rem;
   box-shadow: var(--box-shadow);
   border-radius: .5rem;
   padding: 2rem;
   background-color: var(--white);
   border-top-left-radius: 0;
   border-top-right-radius: 0;
}

.comments-container .add-comment p {
   font-size: 1.5rem;
   color: var(--light-color);
   margin-bottom: 1rem;
}

.comments-container .add-comment p i {
   margin-right: 1rem;
}

.comments-container .add-comment p a {
   color: var(--main-color);
}

.comments-container .add-comment p a:hover {
   text-decoration: underline;
   color: var(--black);
}

.comments-container .add-comment textarea {
   width: 100%;
   border-radius: .5rem;
   background-color: var(--light-bg);
   padding: 1.5rem 2rem;
   margin: 1rem 0;
   font-size: 1.8rem;
   color: var(--black);
   height: 15rem;
   resize: none;
}

.comments-container .user-comments-container {
   display: grid;
   gap: 2.5rem;
   /* border:var(--border); */
   box-shadow: var(--box-shadow);
   border-radius: .5rem;
   padding: 2rem;
   background-color: var(--white);
   border-top-left-radius: 0;
   border-top-right-radius: 0;
}

.comments-container .user-comments-container .show-comments .post-title {
   margin-bottom: 1rem;
   font-size: 2rem;
   color: var(--light-color);
}

.comments-container .user-comments-container .show-comments .post-title span {
   color: var(--black);
   line-height: 1.5;
}

.comments-container .user-comments-container .show-comments .post-title a {
   color: var(--main-color);
}

.comments-container .user-comments-container .show-comments .post-title a:hover {
   text-decoration: underline;
}

.comments-container .user-comments-container .show-comments .comment-user {
   display: flex;
   align-items: center;
   gap: 1rem;
   margin-bottom: 1.5rem;
}

.comments-container .user-comments-container .show-comments .comment-user i {
   text-align: center;
   height: 5rem;
   width: 5rem;
   line-height: 4.7rem;
   font-size: 2rem;
   /* border:var(--border); */
   border-radius: .5rem;
   background-color: var(--light-bg);
   color: var(--black);
}

.comments-container .user-comments-container .show-comments .comment-user span {
   font-size: 2rem;
   color: var(--main-color);
}

.comments-container .user-comments-container .show-comments .comment-user div {
   font-size: 1.5rem;
   margin-top: .2rem;
   color: var(--light-color);
}

.comments-container .user-comments-container .show-comments .comment-text {
   line-height: 1.5;
   font-size: 1.7rem;
   color: var(--light-color);
}

.comments-container .user-comments-container .show-comments .comment-box {
   border-radius: .5rem;
   background-color: var(--light-bg);
   padding: 1.5rem 2rem;
   font-size: 2rem;
   color: var(--black);
   width: 100%;
   /* white-space: pre-line; */
   line-height: 1.5;
   /* border: var(--border); */
}

.comments-container .user-comments-container .show-comments textarea {
   resize: none;
   /* border:var(--border); */
}

.comment-edit-form {
   padding-bottom: 0;
}

.comment-edit-form p {
   background-color: var(--black);
   color: var(--white);
   padding: 1.5rem;
   font-size: 2rem;
   border-radius: .5rem;
   border-bottom-left-radius: 0;
   border-bottom-right-radius: 0;
}

.comment-edit-form form {
   border-bottom-left-radius: .5rem;
   border-bottom-right-radius: .5rem;
   border: var(--border);
   padding: 2rem;
   background-color: var(--white);
   box-shadow: var(--box-shadow);
}

.comment-edit-form form textarea {
   font-size: 2rem;
   color: var(--black);
   line-height: 1.5;
   height: 15rem;
   width: 100%;
   resize: none;
   background-color: var(--light-bg);
   border: var(--border);
   border-radius: .5rem;
   padding: 1.5rem;
   margin-bottom: .5rem;
}



/* featured posts */
/* Split featured layout */
.featured {
   max-width: 1200px;
   margin: 1.6rem auto 2.4rem;
   padding: 0 1.2rem;
}

.featured-split {
   display: grid;
   grid-template-columns: 1.3fr 1fr;
   gap: 1.6rem;
   align-items: center;
   background: var(--white);
   border-radius: .5rem;
   box-shadow: var(--box-shadow);
   padding: 2rem;
}

.feat-left {
   color: var(--black);
   display: flex;
   flex-direction: column;
   gap: .65rem;
}


.feat-cat {
   display: inline-block;
   width: max-content;
   font-size: 2rem;
   color: var(--main-color);
   font-weight: 600;
}

.feat-title {
   font-size: 2.5rem;
   line-height: 1.22;
   margin: 1rem 0;
   /* text-shadow: 0 2px 10px rgba(0, 0, 0, .25); */
}

.feat-excerpt {
   margin: 0;
   font-size: 1.8rem;
   max-width: 60ch;
}

.feat-actions {
   margin-top: .5rem;
}




/* Right: square image box */
.feat-right {
   display: flex;
   justify-content: flex-end;
}

.feat-img-wrap {
   width: 360px;
   aspect-ratio: 1 / 1;
   border-radius: .5rem;
   overflow: hidden;
   background: #111827;
   box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}

.feat-img-wrap img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   transform: scale(1.02);
   transition: transform .35s ease, filter .35s ease;
   filter: saturate(1.06) contrast(1.02);
}

.featured-split:hover .feat-img-wrap img {
   transform: scale(1.05);
}

/* Placeholder style (if image missing) */
.feat-img-placeholder {
   display: grid;
   place-items: center;
   color: #94a3b8;
   font-size: .95rem;
}

/* Responsive */
@media (max-width: 1020px) {
   .featured-split {
      grid-template-columns: 1fr 1fr;
   }

   .feat-img-wrap {
      width: 300px;
   }

   .feat-title {
      font-size: 1.6rem;
   }
}

@media (max-width: 760px) {
   .featured-split {
      grid-template-columns: 1fr;
      padding: 1.1rem;
   }

   .feat-right {
      justify-content: flex-start;
   }

   .feat-img-wrap {
      width: 100%;
      aspect-ratio: 16 / 9;
   }

   /* mobile: wide card */
   .feat-title {
      font-size: 2rem;
   }

   .feat-excerpt {
      font-size: 1.6rem;
   }
}



.categories .box-container {
   border: var(--border);
   border-radius: .5rem;
   background-color: var(--light-bg);
   padding: 1rem 2rem;
   background-color: var(--white);
   box-shadow: var(--box-shadow);
}

.categories .box-container .box {
   padding: 1rem 0;
   font-size: 2rem;
}

.categories .box-container .box span {
   color: var(--light-color);
   display: inline-block;
   padding: .7rem 1rem;
   border: var(--border);
   background-color: var(--light-bg);
   border-radius: .5rem;
   text-align: center;
}

.categories .box-container .box a {
   margin-left: 1.2rem;
   color: var(--black);
}

.categories .box-container .box a:hover {
   color: var(--main-color);
   text-decoration: underline;
}



.footer .contact-link {
   /* color: #e5e7eb; */
   text-decoration: none;
   border: 1px solid #4b5563;
   padding: .4rem .75rem;
   border-radius: .4rem;
}

.footer .contact-link:hover {
   background: #4b5563;
   color: #fff;
}


.footer {
   text-align: center;
   padding: 2rem;
   font-size: 1.6rem;
   color: var(--light-color);
   background-color: var(--white);
   /* border-top: var(--border); */
}

.footer a {
   color: var(--black);
   margin: 0 0.5rem;
   text-decoration: none;
}

.footer a:hover {
   text-decoration: underline;
}




@media (max-width:991px) {

   html {
      font-size: 55%;
   }

   .header .flex .nav-items {
      display: none;
   }

   #menu-btn {
      display: inline-block;
   }
}

@media (max-width:778px) {


   #search-btn {
      display: inline-block;
   }



   .header .flex .search-form {
      position: absolute;
      top: 99%;
      left: 0;
      right: 0;
      border-left: none;
      border-right: none;
      border-radius: 0;
      width: 100%;
      background-color: var(--white);
      box-shadow: var(--box-shadow);
      padding: 2rem;
      clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
      transition: .2s linear;
   }

   .header .flex .search-form.active {
      clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
   }

}

@media (max-width:450px) {

   html {
      font-size: 50%;
   }

   .heading {
      font-size: 3rem;
   }

}