/* 
? Headings font -  font-family: "Taviraj", serif; 
? body font - font-family: "Figtree", sans-serif; 
* Dark blue: #168EAB
* light blue: #118AB2
* light green: #2a9d8f
* yellow-ish: #FFD166
* orange-ish-header: #dda15e
* notWhite bg: #fefae0
* notBlack bgn and font: #181818
*/
/*! === Base Reset === */

* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

/*! --- Body --- */

body {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: space-between;
   font-family: "Figtree", sans-serif;
   font-size: 1rem;
   background-color: #fefae0; /*? #dfdfdf */
   color: #181818;
   line-height: 1;
   height: 100vh;
   width: 100%;
   transition: 0.3s ease-in-out;
}

/*! ----- body dark theme -----  */
body.dark {
   background-color: #181818;
   color: #fefae0;
}
/*! ------------------------------  */

/*! --- Header --- */
header {
   width: 100%;
   height: 3.25rem;
   background-color: #dda15e;
   padding: 0.5rem 1rem;
   box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
   position: sticky;
   top: 0;
   z-index: 100;
}

/*! ----- Header dark theme -----  */
body.dark header {
   background-color: #09131a; /* Dark mode header bg */
}
/*! ----------------------------  */
header,
#logo,
#nav-links,
#nav-links li a,
#navbarAndtheme-toggle {
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   align-items: center;
}
/*! --- left side of the header (logo + h1 + h2) ---  */
#logo {
   height: 100%;
   gap: 0.5rem;
}
#logo-img,
#logo a {
   height: 100%;
}

#logo-img {
   transition: transform 0.3s ease-in-out;
}

/* Hover animation */
#logo-img:hover {
   animation: flap 0.3s ease-in-out infinite alternate;
}

/* Flapping keyframes */
@keyframes flap {
   0% {
      transform: rotateY(0deg) scale(1);
   }
   100% {
      transform: rotateY(40deg) scale(1.1);
   }
}
#logo-text {
   height: 100%;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
}
h1,
h2,
h4,
h5,
h6 {
   font-family: "Taviraj", serif;
   color: #181818;
   font-weight: 300;
}
h3 {
   font-family: "Taviraj", serif;
   color: #168eab;
}

/*! ------ header dark theme colors ------  */
body.dark h1,
body.dark h4,
body.dark h5,
body.dark h6 {
   font-family: "Taviraj", serif;
   color: #fefae0; /* Dark mode header text color */
   font-weight: 300;
}
body.dark h3 {
   color: #168eab;
}
/*! ---------------------------------------------  */
#logo-text h1 {
   font-size: 1.125rem;
   font-weight: 500;
}
#logo-text p {
   font-size: 1rem;
   font-weight: 400;
}
/*! --- Right side of the header (nav + dark mode button) ---  */
nav ul {
   gap: 0.75rem;
}
nav ul li {
   list-style: none;
}
nav ul li a {
   display: flex;
   align-items: center;
   gap: 0.375rem;
   color: #181818;
   font-size: 0.8125rem;
   font-weight: 500;
   text-decoration: none;
   background-color: #ffffff;
   padding: 0.5rem 0.875rem;
   border-radius: 1.5rem;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
   transition: all 0.3s ease;
   border: 1px solid transparent;
}
nav ul li img {
   width: 0.875rem;
   height: 0.875rem;
}

nav ul li a:hover {
   transform: translateY(-2px);
   color: #ffffff;
   background-color: #2a9d8f;
   cursor: pointer;
   box-shadow: 0 6px 12px rgba(60, 225, 206, 0.376);
}
nav ul li a:active {
   transition: 0.3s ease;
   background-color: #2a9d8f;
   box-shadow: inset 0.25rem 0.25rem 0.25rem rgba(0, 0, 0, 0.25);
}
nav ul li.active a {
   background-color: #2a9d8f;
   color: #ffffff;
}
.separator {
   font-size: 1.125rem;
   color: #181818;
   padding: 0 0.5rem;
   opacity: 0.6;
}

/*! ----------- separator dark mode-----------  */
body.dark .separator {
   color: #ffffff;
   opacity: 1;
}
/*! --------------------------------  */
/*! Pill-shaped theme toggle button */
#theme-toggle {
   width: 2.9rem;
   height: 1.5rem;
   background-color: #4b515a;
   border: solid 0.0625rem rgba(122, 122, 122, 0.654);
   box-shadow: 0.25rem 0.25rem 0.25rem rgba(0, 0, 0, 0.25);
   border-radius: 62rem;
   cursor: pointer;
   padding: 0.125rem 0;
   display: flex;
   align-items: center;
   justify-content: space-between;
   transition: all 0.3s ease;
   overflow: hidden;
   position: relative;
}

body.dark #theme-toggle {
   background-color: #bbbbbb;
}

/*! Slider that moves left/right */
.slider {
   background-color: #000000;
   border-radius: 50%;
   width: 1.25rem;
   height: 1.25rem;
   display: flex;
   align-items: center;
   justify-content: center;
   transition: transform 0.4s ease, background-color 0.3s ease;
   position: relative;
   z-index: 1;
   transform: translateX(0);
}
#theme-toggle:hover {
   border: solid 0.0625rem rgba(244, 16, 46, 0.654);
   transform: translateY(-1px);
   color: #ffffff;
   cursor: pointer;
   box-shadow: 0.25rem 0.25rem 0.25rem rgba(0, 0, 0, 0.25);
}
#theme-toggle:active {
   border: solid 0.0625rem rgba(244, 16, 46, 0.654);
   box-shadow: inset 0.25rem 0.25rem 0.25rem rgba(0, 0, 0, 0.25);
}

body.dark .slider {
   transform: translateX(1.5rem);
   background-color: #ffffff;
}

/*! Both icons exist, but only one is shown at a time */
.sun-icon,
.moon-icon {
   padding: 0.0625rem;
   width: 1.25rem;
   height: 1.25rem;
   position: absolute;
   transition: opacity 0.3s ease;
   pointer-events: none;
}

.sun-icon {
   opacity: 0;
}

body.dark .sun-icon {
   opacity: 1;
}

body.dark .moon-icon {
   opacity: 0;
}

/*! --- main ---  */
main {
   flex: 1;
   width: 100%;
   padding: 2rem 1rem 3rem 1rem;
   display: flex;
   flex-direction: column;
   align-items: center;
}
/*! Gallery header and p */
.gallery-header {
   text-align: center;
   margin-bottom: 3rem;
   opacity: 0;
   animation: fadeInUp 0.8s ease forwards;
}

.gallery-header h3 {
   color: #2a9d8f;
   font-size: 2.5rem;
   font-weight: 400;
   margin-bottom: 1rem;
}
.gallery-header p {
   font-size: 1.1rem;
   color: #181818;
   max-width: 600px;
   margin: 0 auto;
   line-height: 1.6;
}

/*! ----- .gallery-header p dark theme -------  */
body.dark .gallery-header p {
   color: #fefae0;
}
/*! ------------------------------------------  */
.filter-nav {
   display: flex;
   justify-content: center;
   gap: 1rem;
   margin-bottom: 3rem;
   flex-wrap: wrap;
   opacity: 0;
   animation: fadeInUp 0.8s ease forwards;
   animation-delay: 0.3s;
}

.filter-input {
   display: none;
}

.filter-btn {
   padding: 0.75rem 1.5rem;
   border: 2px solid #2a9d8f;
   background: transparent;
   color: #2a9d8f;
   border-radius: 2rem;
   cursor: pointer;
   font-size: 1rem;
   font-weight: 500;
   transition: all 0.3s ease;
   position: relative;
   overflow: hidden;
   text-decoration: none;
   display: inline-block;
}

.filter-input:checked + .filter-btn,
.filter-btn:hover {
   background: linear-gradient(135deg, #2a9d8f, #118ab2);
   color: white;
   transform: translateY(-2px);
   box-shadow: 0 8px 16px rgba(42, 157, 143, 0.3);
}

.filter-btn::before {
   content: "";
   position: absolute;
   top: 0;
   left: -100%;
   width: 100%;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
   transition: left 0.5s ease;
}

.filter-btn:hover::before {
   left: 100%;
}
@keyframes fadeInUp {
   from {
      opacity: 0;
      transform: translateY(20px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}

/*! Gallery Articles Styling */

.gallery {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
   gap: 2rem;
   max-width: 1200px;
   width: 100%;
   margin: 0 auto;
   opacity: 0;
   animation: fadeInUp 0.8s ease forwards;
   animation-delay: 0.6s;
}

.gallery-item {
   background: #ffffff;
   border-radius: 1rem;
   overflow: hidden;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
   transition: all 0.4s ease;
   position: relative;
   cursor: pointer;
}

/*! ----- .gallery-item dark theme -------  */
body.dark .gallery-item {
   background: #2a2a2a;
   box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}
/*! ------------------------------------------  */

.gallery-item:hover {
   transform: translateY(-8px) scale(1.02);
   box-shadow: 0 12px 24px rgba(42, 157, 143, 0.3);
}

.gallery-item img {
   width: 100%;
   height: 250px;
   object-fit: cover;
   transition: transform 0.4s ease;
}

.gallery-item:hover img {
   transform: scale(1.1);
}

.gallery-item h4 {
   font-family: "Taviraj", serif;
   font-size: 1.375rem;
   font-weight: 500;
   color: #2a9d8f;
   margin: 1rem 1.25rem 0.5rem 1.25rem;
   transition: color 0.3s ease;
}

.gallery-item p {
   font-family: "Figtree", sans-serif;
   font-size: 0.95rem;
   color: #181818;
   margin: 0 1.25rem 1.5rem 1.25rem;
   line-height: 1.5;
   opacity: 0.8;
}

/*! ----- .gallery-item p dark theme -------  */
body.dark .gallery-item p {
   color: #fefae0;
}
/*! ------------------------------------------  */

.gallery-item:hover h4 {
   color: #118ab2;
}

/* Loading animation for articles */
.gallery-item {
   opacity: 0;
   animation: slideInScale 0.6s ease forwards;
}

.gallery-item:nth-child(1) {
   animation-delay: 0.8s;
}
.gallery-item:nth-child(2) {
   animation-delay: 0.9s;
}
.gallery-item:nth-child(3) {
   animation-delay: 1s;
}
.gallery-item:nth-child(4) {
   animation-delay: 1.1s;
}
.gallery-item:nth-child(5) {
   animation-delay: 1.2s;
}
.gallery-item:nth-child(6) {
   animation-delay: 1.3s;
}
.gallery-item:nth-child(7) {
   animation-delay: 1.4s;
}
.gallery-item:nth-child(8) {
   animation-delay: 1.5s;
}
.gallery-item:nth-child(9) {
   animation-delay: 1.6s;
}
.gallery-item:nth-child(10) {
   animation-delay: 1.7s;
}

@keyframes slideInScale {
   from {
      opacity: 0;
      transform: translateY(30px) scale(0.9);
   }
   to {
      opacity: 1;
      transform: translateY(0) scale(1);
   }
}

/* Optional: Add a subtle border accent */
.gallery-item::before {
   content: "";
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   height: 4px;
   background: linear-gradient(90deg, #2a9d8f, #118ab2, #168eab);
   opacity: 0;
   transition: opacity 0.3s ease;
}

.gallery-item:hover::before {
   opacity: 1;
}

footer {
   width: 100%;
   height: fit-content;
   background-color: #dda15e;
   padding: 0.5rem 1rem;
   box-shadow: 0 -0.25rem 0.25rem rgba(0, 0, 0, 0.25);
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   align-items: center;
}
#footer-links {
   font-size: large;
   display: flex;
   flex-direction: row;
   align-items: center;
   justify-content: center;
   gap: 1rem;
}
#footer-links img {
   height: 1.25rem;
}

/*! ---------- footer dark mode ------  */
body.dark footer {
   background-color: #09131a; /* Dark mode footer bg */
}
/*! --------------------------------  */

@media (max-width: 768px) {
   .gallery {
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 2rem;
      padding: 0 0.5rem;
   }

   .gallery-item img {
      height: 200px;
   }

   .gallery-item h4 {
      font-size: 1.25rem;
      margin: 0.75rem 1rem 0.5rem 1rem;
   }

   .gallery-item p {
      margin: 0 1rem 1.25rem 1rem;
      font-size: 0.9rem;
   }
}
@media screen and (max-width: 768px) {
   .desktop {
      display: none;
   }
   .mobile {
      display: block;
   }
   .mobile {
      width: 90%;
      margin: 1rem auto;
   }

   /*! ---- header for mobile ----  */
   header {
      height: auto;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
   }
   #logo-text {
      justify-content: space-around;
   }

   #logo img {
      height: 3rem;
   }
   nav ul {
      gap: 0.25rem;
   }
   nav ul li a {
      padding: 0.25rem 0.5rem;
      font-size: 0.75rem;
   }
   footer {
      flex-direction: column;
      align-items: space-between;
      gap: 1rem;
      padding: 1rem;
      text-align: center;
   }
   #footer-links {
      font-size: 1rem;
      align-items: center;
      justify-content: center;
   }
}
