:root {
	--color-primary: #6f6af8;
	--color-primary-light: hsl(242, 91%, 69%, 18%);
	--color-primary-variant: #5854c7;
	--color-red: #da0f03;
	--color-red-light: hsl(346, 87%, 46%, 15%);
	--color-green: #00c476;
	--color-green-light: hsl(156, 100%, 38%, 15%);
	--color-gray-900: #1e1e66;
	--color-gray-700: #2d2b7c;
	--color-gray-300: rgba(242, 242, 254, 0.3);
	--color-gray-200: rgba(242, 242, 254, 0.7);
	--color-white: #f2f2fe;
	--color-bg: #0f0f3e;

	--transition:all 300ms ease;

	--container-width-lg: 74%;
	--container-width-md: 74%;
	--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: 0;
	list-style: none;
	text-decoration: none;
	box-sizing: border-box;
}

body {
	font-family: 'Montserrat', sans-serif;
	line-height: 1.6;
	color: var(--color-gray-200);
	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;
}

/* add to posts on index if there's no featured post. eg. search results page */
.section__extra-margin {
	margin-top: 7rem;
}

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;
	margin: 1rem 0;
}

a {
	color: var(--color-white);
	reansition: var(--transition);
}

img {
	display: block;
	width: 100%;
	object-fit: cover;
}

/* ===========================================================================
NAV
==============================================================================
*/

nav {
	background: var(--color-primary);
	width: 100vw;
	height: 4.5rem;
	position: fixed;
	top: 0;
	z-index: 999; /* higher than most content */
	box-shadow: 0 1rem 1rem rgba(0, 0, 0, 0.2);
}

nav button {
	display: none;
}

.nav__container {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.avatar {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	overflow: hidden;
	border: 0.3rem solid var(--color-bg);
}

.nav__logo {
	font-weight: 600;
	font-size: 1.2rem;
}

.nav__logo__small {
	padding: 0;
	margin: 0;
	font-size: 1.0rem;
	font-weight: 300;
	display: flex;
}

.nav__items {
	display: flex;
	align-items: center;
	gap: 4rem;
}

.nav__profile {
	position: relative;
	cursor: pointer;
}

.nav__profile ul {
	position: absolute;
	top: 140%;
	right: 0;
	display: flex;
	flex-direction: column;
	box-shadow: 0 3rem 3rem rgba(0, 0, 0, 0.4);
	visibility: hidden;
	opacity: 0;
	transition: var(--transition);
    z-index: 1000; /* higher than nav content but below nav overlay if needed */
}

/* show nav ul when profile is hovered */
.nav__profile:hover > ul {
	visibility: visible;
	opacity: 1;
}

.nav__profile ul li a{
	padding: 1rem;
	background: var(--color-gray-900);
	display: block;
	width: 100%;
}

.nav__profile ul li:last-child a {
	background: var(--color-red);
	color: var(--color-bg);
}

/* ===========================================================================
 Modern Nav Enhancements (Instagram-like vibe)
============================================================================*/

/* Nav container - slim, glassy effect */
nav {

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /*border-bottom: 1px solid rgba(255, 255, 255, 0.15);*/
  

  transition: background 0.3s ease, height 0.3s ease;
}

/* Logo - slightly bolder but sleek */
.nav__logo {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

/* Navigation items - closer spacing, cleaner look */
.nav__items {
  gap: 2.5rem;
}

.nav__items a {
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: color 0.2s ease;
}

/* Modern hover underline effect */
.nav__items a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0%;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.nav__items a:hover::after {
  width: 100%;
}

/* Avatar - subtle hover glow */
.avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0.4rem rgba(0,0,0,0.25);
}

/* Profile dropdown - modern card style */
.nav__profile ul {
  background: var(--color-gray-900);
  border-radius: 0.75rem;
  overflow: hidden;
  min-width: 10rem;
  box-shadow: 0 1rem 2rem rgba(0,0,0,0.35);
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

/*.nav__profile:hover ul {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}*/

/* Show dropdown when parent has .active */
.nav__profile.active ul {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav__profile ul li a {
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.nav__profile ul li a:hover {
  background: rgba(255,255,255,0.05);
}

/* Last item (logout) – more pill-like */
.nav__profile ul li:last-child a {
  background: var(--color-red);
  color: var(--color-bg);
  text-align: center;
  border-radius: 0 0 0.75rem 0.75rem;
}


/* ===========================================================================
CATEGORY BUTTON
==============================================================================
*/

.category__button {
	background: var(--color-primary-light);
	color: var(--color-primary);
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: var(--card_border-radius-2);
	font-weight: 600;
	font-size: 0.8rem;
	text-align: center;
	margin-top: 0.5rem;
}

.category__button:hover {
	color: var(--color-white);
}

/* ===========================================================================
GENERAL POST
==============================================================================
*/
.post__thumbnail {
	border-radius: var(--card_border-radius-5) 0;
	border: 1rem solid var(--color-gray-900);
	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: 1.2rem;
}

.post__author-avatar {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: var(--card_border-radius-3);
	overflow: hidden;
}

/* =========================================================================== 
POST CARD SWIPER & LIGHTBOX 
Adapted from featured style but fits post-card layout
============================================================================== */

/* ==========================
   Post Media Container
   ========================== */
.posts__container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5rem;
    margin-bottom: 5rem;
}

.post {
    width: 100%;
    box-sizing: border-box;
}

.post .post__media {
    position: relative;   /* This ensures absolutely positioned children anchor here */
    border-radius: var(--card_border-radius-5) 0; /* same as your thumbnail rounding */
    border: 0.8rem solid var(--color-gray-900);   /* thick border like thumbnail */
    overflow: hidden;                           /* clip content to rounded edges */
    margin-bottom: 1.6rem;                      /* space below swiper */
    height: auto;
    max-height: 280px;     /* container height */
    display: flex;         /* center contents */
    justify-content: center;
    align-items: center;
}

/* On smaller screens, allow a bit more height */
@media (max-width: 600px) {
  .post .post__media {
      max-height: ;
      justify-content: center;
      align-items: center;
      position: relative;
  }
}

/* On smaller screens, allow the post to take the full sreen width */
@media (max-width: 600px) {
    .post {
        width: calc(100vw - var(--fix, 0px));
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

.post .swiper {
    width: 100%;
    max-width: 100%;
    height: auto;
}

.post .swiper-slide {
    width: 100% !important;
    height: auto;
}


/* ==========================
   Images inside slides
   ========================== */
.post .swiper-slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Constrain Swiper containers */
.post__media .dynamic-post-swiper {
	width: 100%; /* Ensure Swiper takes the width of the post */
	max-width: 100%; /* Prevent overflow */
	height: auto; /* Adjust height as needed */
    position: relative;
}

/* ==========================
   Swiper Slides
   ========================== */
.post__media .swiper-slide {
    display: flex;                   /* center media */
    justify-content: center;
    align-items: center; 
    overflow: hidden;              /*  clip any overflow */ 
    position: relative; 
    /* display: block;   remove inline gap */
    width: 100% !important; /* Override Swiper's default slide width */
  	height: auto; /* Adjust height as needed */
}

/* ==========================
   Video wrapper
   ========================== */

.post__media .video-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.post__media .video-wrapper video {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: 0.5rem;
}


/* ==========================
   Thumbnail Swiper
   ========================== */
.post .thumbs-swiper {
    margin-top: 0.5rem;
    width: 100%;
    max-width: 800px;             /* match main Swiper width */
}

.post .thumbs-swiper .swiper-slide {
    width: auto; /* Constrain width to fit ~4 thumbnails (adjust as needed) */
    max-width: 20%; /* Prevent overly wide thumbnails */
    height: 50px;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.4; /* Dim inactive thumbnails */
    border-radius: 6px;
    position: relative;
    margin-right: 0.5 rem;
    transition: opacity 0.3s; /* smooth transition when active changes */
}

.post .thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1; /* Active thumbnail fully visible */
}

.post .thumbs-swiper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================
   Video thumbnail icon
   ========================== */
.thumb-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.thumb-video-wrapper .video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.5rem;
    pointer-events: none;
}

/* ==========================
   Responsive Adjustments
   ========================== */
@media (max-width: 768px) {
    .post__media {
        max-width: 100%;
        position: relative; /* make it the anchor */
    }

    .post__media .swiper-slide {
        max-height: 300px;
    }

    .thumbs-swiper .swiper-slide {
        height: 60px;
    }
}

/* ========================
   Post Info icons
   ======================== */

   .post__info .post__stats {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem; /* Reduced gap for smaller screens */
        font-size: 0.85rem; /* Smaller font size */
   }

    .post__stats .post__stat {
        padding: 0.3rem 0.5rem; /* Reduced padding */
        gap: 0.3rem; /* Reduced gap between icon and text */
    }

    .post__stats .post__stat i {
        font-size: 0.85rem; /* Smaller icon size */
    }

/* ========================
   Author Info
   ======================== */
.post__author {
    display: flex;
    gap: 1rem;
    margin-top: 1.2rem;
}

.post__author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--card_border-radius-3);
    overflow: hidden;
}

.post__author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Author Info -> Responsive for small screens */
@media (max-width: 600px) {
	.post__title {
        font-size: 1.2rem; /* Smaller title */
        margin: 0.3rem 0; /* Reduced margin */
    }

    .post__body {
        font-size: 0.85rem; /* Smaller body text */
        margin: 0.3rem 0; /* Reduced margin */
    }

    .post__author {
        gap: 0.6rem; /* Reduced gap for smaller screens */
        margin-top: 0.8rem; /* Reduced margin */
    }

    .post__author-avatar {
        width: 1.8rem; /* Smaller avatar size */
        height: 1.8rem;
    }

    .post__author-info h5 {
        font-size: 0.7rem; /* Smaller author name */
    }

    .post__author-info small {
        font-size: 0.7rem; /* Smaller date */
    }
}

/* Post Info Icons -> Responsive for small screens */
@media (max-width: 600px) {
    .post__stats {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem; /* Reduced gap for smaller screens */
        font-size: 0.65rem; /* Smaller font size */
    }

    .post__stats .post__stat {
        padding: 0.3rem 0.4rem; /* Reduced padding */
        gap: 0.3rem; /* Reduced gap between icon and text */
    }

    .post__stats .post__stat i {
        font-size: 0.75rem; /* Smaller icon size */
    }
}



/* ===========================================================================
FEATURED
==============================================================================
*/

.featured {
	margin-top: 8rem;
}

.featured__container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4rem;
}

.featured .post__thumbnail {
	height: fit-content;
}

/* ====== SWIPER IN FEATURED ====== */
/* ====== Thumbnail Swiper ====== */
/* Wrap main Swiper like a card */
.featured-media .main-swiper-0 {
    border-radius: var(--card_border-radius-5) 0; /* same as your thumbnail rounding */
    border: 0.8rem solid var(--color-gray-900);   /* thick border like thumbnail */
    overflow: hidden;                           /* clip content to rounded edges */
    margin-bottom: 1.6rem;                      /* space below swiper */
}

.main-swiper-0 .swiper-slide {
	width: 100%;
    height: auto;  /* maintain aspect ratio */
    display: block; /* remove inline gap */

    justify-content: center;
    align-items: center;
}

.main-swiper-0 .swiper-slide .video-wrapper video {
    width: 100%;
    height: auto;  /* maintain aspect ratio */
    display: block; /* remove inline gap */

    justify-content: center;
    align-items: center;
}

.main-swiper-0 .swiper-button-next,
.main-swiper-0 .swiper-button-prev {
    display: none;
}

/* Thumbnail Swiper */
.thumbs-swiper .swiper-slide {
    width: auto;
    height: 80px;
    cursor: pointer;
    opacity: 0.4; /* Dim inactive thumbnails */
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    transition: opacity 0.3s; /* smooth transition when active changes */
}

.thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1; /* Active thumbnail fully visible */
}

.thumbs-swiper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video thumbnail overlay */
.thumb-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.thumb-video-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-video-wrapper .video-icon {
    position: absolute;
    font-size: 20px;
    color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Force GLightbox close button to be visible */
.glightbox-container .gclose {
    display: flex !important;       /* ensure it's displayed */
    align-items: center;
    justify-content: center;
    position: fixed !important;     /* fixed position over screen */
    top: 20px !important;
    right: 20px !important;
    width: 40px;
    height: 40px;
    font-size: 24px;
    color: white !important;        /* visible on all backgrounds */
    background: rgba(0, 0, 0, 0.6); /* semi-transparent circle */
    border-radius: 50%;
    z-index: 9999 !important;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.3s, transform 0.2s;
}

/* Hover effect for close button */
.glightbox-container .gclose:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ================
	Post Info
 ================ */ 
/* Hide right column on mobile by default */
@media (max-width: 768px) {
  .featured-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
  }
  .featured-details.active {
    opacity: 1;
  }
}


/* Hide toggle button on larger screens */
@media (min-width: 769px) {
  .toggle-more {
    display: none;
  }
  .featured-details {
    max-height: none; /* always fully visible */
  }
}

#toggleBtn {
  background: var(--color-primary, #007bff);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin-top: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

#toggleBtn:hover {
  	background-color: var(--color-gray-900);
  	letter-spacing: 0.2rem;
	opacity: 1;
	transition: var(--transition);
}

/* ==========================
   Responsive Adjustments
   ========================== */
@media (max-width: 768px) {
    .featured .thumbs-swiper .swiper-slide {
        height: 60px;
    }
}

/* ===========================================================================
POSTS
==============================================================================
*/

.posts__container {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 5rem;
	margin-bottom: 5rem;
}

/* Post info and icons */
.post__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem; /* space between stats */
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #333;
}

.post__stat {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* space between icon and text */
    background-color: #f8f8f8;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: default;
}

.post__stat i {
    color: var(--color-bg); /* icon color */
    font-size: 1rem;
}

/* Hover effect */
.post__stat:hover {
    background-color: var(--color-gray-900);
    color: #fff;
	letter-spacing: 0.2rem;
	opacity: 1;post__info
	transition: var(--transition);    
}

.post__stat:hover i {
    color: #fff;
}

/* Responsive for small screens */
@media (max-width: 600px) {
    .post__stats {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem; /* Reduced gap for smaller screens */
        font-size: 0.8rem; /* Smaller font size */
    }

    .post__stat {
        padding: 0.3rem 0.5rem; /* Reduced padding */
        gap: 0.3rem; /* Reduced gap between icon and text */
    }

    .post__stat i {
        font-size: 0.85rem; /* Smaller icon size */
    }
}

/* ========================= 
	Posts' Maps 
========================= */
.post__map {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0; /* subtle border */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post__map iframe {
    width: 100%;
    height: 200px;
    border: 0;
    display: block;       /* remove inline gap */
}

/* Hover effect */
.post__map:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Responsive for smaller screens */
@media (max-width: 600px) {
    .post__map iframe {
        height: 180px;
    }
}

/* ========================= 
    Post Info Category & Rating 
========================= */
.post__category__rating {
    display: flex;
    justify-content: space-between; /* left = category, right = rating */
    align-items: center;            /* vertically center them */
    gap: 1rem;                      /* optional spacing */
}

.post__rating {
    display: flex;
    align-items: center;
    gap: 0.3rem; /* space between number and star */
    color: #FFD700; /* golden star color */
}

/* ========================= 
    Post Info "More..." button 
========================= */
.more-btn {
    /*color: #3897f0;  Instagram-like blue */
    color: gold;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    float: right;
}

.more-btn:hover {
    letter-spacing: 0.2rem;
    opacity: 1;
    transition: var(--transition);
}



/* ===========================================================================
CATEGORY BUTTONS
==============================================================================
*/

.category__buttons {
	padding: 4rem 0;
	border-top: 2px solid var(--color-gray-900);
	border-bottom: 2px solid var(--color-gray-900);
}

.category__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);
}

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.2rem;
	opacity: 1;
	transition: var(--transition);
}

.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; */
    margin-top: 0 !important; /* remove spacing if sticky */
    position: sticky; /* stick at top */
    top: 4.5rem; /* same as your nav height */
    z-index: 998; /* higher than most content but lower than navbar */
    background: var(--color-bg); /* same as your page background */
    padding: 1rem 0; /* some breathing room */
}

.search__bar-container {
	position: relative;
	width: 30rem;
	background: var(--color-gray-900);
	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: var(--color-gray-300);
}

/* ===========================================================================
FILTER
==============================================================================
/* Make search + filter line up horizontally */
/* Center search+filter horizontally */
.search__wrapper {
  display: flex;
  align-items: center;
  justify-content: center; /* center horizontally */
  gap: 1rem; /* space between search and filter */
}

/* Filter button adopts search bar styling */
.filter-btn {
  background: var(--color-gray-900);
  color: var(--color-gray-300);
  border-radius: var(--card_border-radius-2);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.filter-btn:hover {
  background: var(--color-gray-700);
}

/* ============================
   SEARCH & FILTER MOBILE RESPONSIVE STYLES
============================ */
/* ============================
   MOBILE RESPONSIVE STYLES
============================ */
@media (max-width: 768px) {
  .search__bar-container {
    width: 16rem; /* shrink search bar */
    padding: 0.4rem 0.6rem;
  }

  .search__bar input {
    font-size: 0.85rem; /* smaller input text */
  }

  .filter-btn {
    padding: 0.4rem 0.6rem; /* smaller button */
    font-size: 0.85rem;
    white-space: nowrap; /* keep "Filter" text on one line */
  }
}

@media (max-width: 480px) {
  .search__bar-container {
    width: 12rem; /* narrower search */
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem; /* even smaller padding */
  }
}



/* ===========================================================================
BUTTON
==============================================================================
*/
.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;
	transition: var(--transition);
	color: var(--color-white);
}

.btn.sm {
	padding: 0.3rem 0.7rem;
	font-size: 0.8rem;
}

.btn.danger {
	background: var(--color-red);
}

.btn:hover {
	background: var(--color-white);
	color: var(--color-bg);
}


/* ===========================================================================
SINGLE POST
==============================================================================
*/
.singlepost {
	margin: 6rem 0 2rem;
}

.singlepost__container {
	width: var(--form-width);
	background: var(--color-gray-900);
	padding: 1rem 2rem 3rem;
}

.singlepost__thumbnail {
	margin: 1.5rem 0 1rem;
}

.singlepost__container p {
	margin-top: 1rem;
	line-height: 1.7rem;
}


/* ===========================================================================
CATEGORY TITLE
==============================================================================
*/
.category__title {
	height: 15rem;
	margin-top: 4.5rem;
	background: var(--color-gray-900);
	display: grid;
	place-items: center;
}

/* ===========================================================================
EMPTY PAGES
==============================================================================
*/
.empty__page {
	height: 70vh;
	display: grid;
	place-content: center;
}

#posts-empty {
    margin: 4.5rem;
    place-items: center;
}

/* ===========================================================================
GENERAL FORM
==============================================================================
*/
/*
.form__section {
	display: grid;
	place-items: center;
	height: 100vh;
}
*/
.form__section {
	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 2rem 1rem;
	box-sizing: border-box;
	overflow-y: auto;
}

.form__section-container {
	width: var(--form-width);
}

.alert__message {
	padding: 0.8rem 1.4rem;
	margin-bottom: 1rem;
	border-radius: var(--card_border-radius-2);
}

.alert__message.error {
	background: var(--color-red-light);
	color: var(--color-red);
}

.alert__message.success {
	background: var(--color-green-light);
	color: var(--color-green);
}

/* centers text alert. eg. empty category-posts page */
.alert__message.lg {
	text-align: center;
}

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;
}

input, textarea, select {
	padding: 0.8rem 1.4rem;
	background-color: var(--color-gray-900);
	border-radius: var(--card_border-radius-2);
	resize: none;
	color: var(--color-white 
	);
}

.form__section small {
	margin-top: 1rem;
	display: block;
}

.form__section small a {
	color: var(--color-primary);
}

/* ===========================================================================
MAP
==============================================================================
*/
#map, #map > * {
	height: 400px;
    z-index: 1 !important; /* Override map library’s z-index */
    position: relative !important; /* Ensure map stays in document flow */
}


/* ===========================================================================
DASHBOARD
==============================================================================
*/
.dashboard {
	margin-top: 6rem;
}

.sidebar__toggle {
	display: none;
}

.dashboard__container {
	display: grid;
	grid-template-columns: 14rem auto;
	gap: 1rem;
	background: var(--color-gray-900);
	padding: 2rem;
	margin-bottom: 5rem;
}

.dashboard aside a {
	background-color: 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-color: var(--color-gray-900);
}

.dashboard main {
	margin-left: 1.5rem;
}

.dashboard main h2 {
	margin: 0 0 2rem 0;
	line-height: 1;
}

.dashboard main table {
	width: 100%;
	text-align: left;
}

.dashboard main table th {
	background: var(--color-gray-700);
	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-color: var(--color-bg);
	color: var(--color-white);
	cursor: default;
	transition: var(--transition);
}

/* ===========================================================================
MEDIA QUERIES (MEDIUM DEVICES)
==============================================================================
*/
@media screen and (max-width: 1024px) {
	/* ========================= GENERAL =======================*/
	.container {
		width: var(--container-width-md);
	}

	h2 {
		font-size: 1.6rem;
	}

	h3 {
		font-size: 1.2rem;
	}

	h5 {
		font-size: 0.8rem;
	}

	/* ========================= 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;
	}

	/* nav dropdown animation */
	@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 {
		background: var(--color-gray-900);
	}

	.nav__profile ul {
		top: 100%;
		width: 100%;
	}

	.nav__profile .avatar {
		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;
		gap: 3rem;
	}

	/* ========================= BLOG =======================*/
	.search__bar-container {
		width: 60%;
	}

	/* ========================= GENERAL FORM =======================*/
	.form__section-container {
		padding: 3rem;
	}

	/* =================== DASHBOARD ======================*/
	.dashboard__container {
		grid-template-columns: 4.3rem 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);
	}

	.dashboard main table tr:hover td {
		background: transparent;
	}

}

/* ===========================================================================
MEDIA QUERIES (SMALL DEVICES)
==============================================================================
*/

@media screen and (max-width: 600px) {
	/* ========================= GENERAL =======================*/
	section {
		margin-top: 2rem;
	}

	h1 {
		font-size: 2rem;
	}

	.featured {
		margin-top: 6rem;
	}

	.featured__container {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.posts__container {
		grid-template-columns: 1fr;
	}

	.category__buttons-container {
		grid-template-columns: 1fr 1fr;
	}

	.footer__container {
		grid-template-columns: 1fr;
		text-align: center;
		gap: 2rem;
	}

	/* ========================= BLOG =======================*/
	.search__bar-container {
		width: var(--container-width-md);
	}

	/* ========================= SINGLE POST =======================*/
	.singlepost__-container {
		background-color: transparent;
		padding: 0;
	}

	/* ========================= GENERAL 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 {
		margin-top: 1rem;
	}

	.dashboard aside {
		position: fixed;
		box-shadow: 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: var(--color-primary-variant);
		color: var(--color-white);
		position: fixed;
		right: 0;
		bottom: 4rem;
		z-index: 1;
		width: 2.5rem;
		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;
	}

	#hide__sidebar-btn {
		display: none;
	}

}

