/* ----------------------------------------
   Coming Soon Component
---------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.project-card.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md) var(--space-xl);
  border: 2px dashed var(--color-grey);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  opacity: 0.8;
}

/* ----------------------------------------
   Project Card Component
---------------------------------------- */
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border: 1px solid var(--color-border);
  background-color: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(94, 92, 108, 0.08);
  align-items: flex-start;
  padding: var(--space-sm) var(--space-sm) var(--space-lg) var(--space-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none; /* Remove underline on hover */
  color: inherit; /* Inherit text color */
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(94, 92, 108, 0.16);
}

.project-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 0; /* No extra margin needed, gap handles it */
  flex-shrink: 0;
  object-fit: cover;
}

.project-card h3 {
  margin-bottom: var(--space-xxs);
}

.project-info {
  flex: 1;
  margin: 0 var(--space-sm);
}

.project-info p {
  color: var(--color-text);
}

/* ----------------------------------------
   Tags
---------------------------------------- */
.tag {
  display: inline-block;
  padding: var(--space-xxs) var(--space-xs);
  font-size: var(--fs-xs);
  background-color: var(--color-grey);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-light);
  text-transform: uppercase;
  line-height: normal;
}

.tags-btn-wrapper {
  /* Wrapper that holds tags and button */
  display: flex;
  flex-direction: column;
  margin-top: var(--space-lg);
  align-items: flex-start; /* Left aligned on mobile */
  gap: var(--space-md); /* Space between button and tags */
}

.project-tags {
  order: 2;
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ----------------------------------------
   Navigation Components
---------------------------------------- */
nav a {
  text-decoration: none;
  color: var(--color-primary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  display: block;
  width: 100%;
  padding: var(--space-xs) 0; /* Vertically aligns nav links with site title */
  transition: color 0.2s ease;
}

nav a:hover,
footer a:hover {
  color: var(--color-border);
}

.nav-links {
  /* Make nav-links a flex container with nav menu and dark mode toggle side by side */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-lg);
  padding: 0; /* Remove any default padding */
  text-transform: uppercase;
}

.nav-links li {
  width: 100%;
  text-align: center;
}

.nav-links li a {
  display: block; /* Ensures the full width applies */
}

#nav-toggle {
  /* Hamburger Button */
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 18px;
  position: relative;
  z-index: 9999;

  /* height: 100%;
    min-height: 2.5rem; */
}

.nav-links.active {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transform: translateX(0);
}

/* ----------------------------------------
   Hamburger Icon
---------------------------------------- */
.hamburger,
.hamburger::before,
.hamburger::after {
  /* Base bar */
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: var(--radius-xs);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger {
  /* Middle bar */
  top: 50%;
  transform: translateY(-50%);
}

.hamburger::before {
  /* Top bar */
  top: -8px;
}

.hamburger::after {
  /* Bottom bar */
  top: 8px;
}

.hamburger-active {
  /* Animate into X */
  background-color: transparent;
}

.hamburger-active::before {
  transform: rotate(45deg);
}

.hamburger-active::after {
  transform: rotate(-45deg);
}

.hamburger-active::before,
.hamburger-active::after {
  top: 0;
}

/* ----------------------------------------
   Dark Mode Toggle
---------------------------------------- */
.dark-mode-toggle {
  display: inline-block;
  position: relative;
  width: 48px;
  height: 24px;
  margin: var(--space-sm) 0 0 0;
  cursor: pointer;
}

.dark-mode-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  border-radius: 9999px;
  transition: background-color 0.3s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: var(--color-primary);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

/* Checked state */
.dark-mode-toggle input:checked + .toggle-slider {
  background-color: var(--color-primary);
}

.dark-mode-toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
  background-color: var(--color-bg); /* Light circle on dark background */
}

/* ----------------------------------------
   Dark Mode Overrides
---------------------------------------- */

.dark-mode .tag {
  background-color: var(--color-border);
}

.dark-mode .project-card {
  background-color: var(--color-grey);
  border-color: var(--color-border);
}

/* ----------------------------------------
   Mobile + Tablet (< 900px)
---------------------------------------- */
@media screen and (max-width: 899px) {
  /* Navigation Components */
  .nav-links {
    /* Hide nav-links by default on mobile/tablet */
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--color-bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    transform: translateX(100%);
    transition: transform 0.4s ease;
    z-index: 9998;
    display: none;
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
  }

  #nav-toggle {
    position: relative;
    z-index: 9999; /* Higher than .nav-links */
  }
}

/* ----------------------------------------
   Tablet Styles (min-width: 768px)
---------------------------------------- */
@media screen and (min-width: 768px) {
  /* Project Card Component */
  .project-card.placeholder {
    padding: var(--space-xl) var(--space-xl) var(--space-xl);
  }

  /* Tags */
  .tags-btn-wrapper {
    flex-direction: row; /* Side-by-side */
    align-items: center; /* Vertical center align */
  }
  .project-tags {
    order: 0; /* Show before button if needed, or keep order as is */
  }
}

/* ----------------------------------------
   Desktop Styles (min-width: 1024px)
---------------------------------------- */
@media screen and (min-width: 1024px) {
  /* Navigation Components */
  #nav-toggle {
    display: none;
  }

  /* Project Card Component */
  .project-card {
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: var(--space-sm);
  }

  .project-card img {
    width: 25rem;
    height: 18.75rem;
  }

  .project-info {
    margin: 0 var(--space-xl);
  }

  /* Dark Mode Toggle */
  .dark-mode-toggle {
    margin: 0 0 0 var(--space-sm);
  }
}
