/* Make the page take full height */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Full page background and layout */
body {
  background-color: #e4c594;
  font-family: 'Times New Roman', Times, serif;
  display: flex;
  flex-direction: column;
}

/* Ensure main grows to fill available space */
main {
  flex: 1;
  padding: 20px;
}

/* Top bar layout */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 10px 20px;
  background-color: #ac792a;
  gap: 10px;
  border-bottom: 2px solid #5e4434;
}

/* Logo, title, and nav container */
.logo-title-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
}

/* Logo and site title */
.logo-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Navigation container */
.nav-container {
  position: relative;
}

/* Nav styles */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 1rem;
}

.main-nav a {
  color: #5e4434;
  font-weight: bold;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.3s, color 0.3s;
  position: relative;
  z-index: 0;
}

.main-nav a:hover {
  border-color: #fff;
  color: #fff;
}

/* Hamburger menu button (hidden by default) */
.nav-container .hamburger {
  display: none !important;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 36px;
  height: 36px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: #5e4434;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Logo styling */
.logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

/* Site title styling */
.site-name {
  font-size: 1.6rem; /* Adjusted to match logo height visually */
  line-height: 40px; /* Matches logo height */
  font-weight: bold;
  color: #5e4434;
  white-space: nowrap;
}

/* Search container */
.searchbar-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
  min-width: 120px;
  max-width: 300px;
  margin-left: auto;
}

/* Full search form (shown on large screens only) */
.searchbar-full {
  display: flex;
  background-color: #e4c594;
  height: 44px;
  border-radius: 5px;
  align-items: center;
  flex: 1;
  min-width: 100px;
}

.searchbar-full input[type="search"] {
  all: unset;
  flex: 1;
  font-size: 1rem;
  padding: 6px 10px;
  background-color: #e4c594;
  color: #5e4434;
  font-family: inherit;
  border-radius: 4px 0 0 4px;
}

.searchbar-full input::placeholder {
  color: #ac792a;
  opacity: 0.7;
}

.searchbar-full button {
  all: unset;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 4px 4px 0;
}

.searchbar-full svg {
  color: #ac792a;
  fill: currentColor;
  width: 24px;
  height: 24px;
}

/* Icon-only fallback (hidden on large screens) */
.searchbar-container .searchbar-icon {
  display: none !important;
  all: unset;
  cursor: pointer;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background-color: #e4c594;
  transition: background-color 0.3s;
}

.searchbar-container .searchbar-icon svg {
  width: 24px;
  height: 24px;
  color: #ac792a;
  fill: currentColor;
}

.searchbar-container .searchbar-icon:hover {
  background-color: #d4b07c;
}

/* Project grid styling */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.project-card {
  background-color: #f5e6c8;
  border: 2px solid #ac792a;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.project-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
}

.project-card h2 {
  font-size: 1.4rem;
  margin: 0;
  color: #5e4434;
}

.project-card p {
  font-size: 1rem;
  margin: 5px 0;
  color: #5e4434;
}

.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
}

.status-badge.in-progress {
  background-color: #d4b07c;
  color: #5e4434;
}

.status-badge.completed {
  background-color: #4CAF50;
  color: #fff;
}

.status-badge.paused {
  background-color: #888;
  color: #fff;
}

.update-log {
  font-size: 0.9rem;
  color: #5e4434;
  margin: 10px 0;
}

.read-more {
  background-color: #ac792a;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background-color 0.3s;
}

.read-more:hover {
  background-color: #d4b07c;
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #f5e6c8;
  border: 2px solid #ac792a;
  border-radius: 8px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #5e4434;
}

.modal-close:hover {
  color: #d4b07c;
}

.modal-content h2 {
  font-size: 1.6rem;
  color: #5e4434;
  margin-top: 0;
}

.modal-content p {
  font-size: 1rem;
  color: #5e4434;
}

.modal-content ul {
  list-style-type: disc;
  padding-left: 20px;
  color: #5e4434;
}

.modal-content li {
  margin-bottom: 5px;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .site-name {
    font-size: 1.4rem;
    line-height: 40px; /* Maintain consistent height with logo */
  }

  /* Reorder topbar for hamburger to be leftmost */
  .topbar {
    flex-direction: row;
    gap: 5px;
    padding: 8px 10px;
  }

  .logo-title-nav {
    flex-direction: row;
    align-items: center;
  }

  .nav-container {
    order: -1; /* Move hamburger to the left */
  }

  /* Hide navigation links and show hamburger */
  .nav-container .main-nav {
    display: none !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ac792a;
    width: 100%;
    padding: 10px;
    border-bottom: 2px solid #5e4434;
    z-index: 10;
  }

  .nav-container .main-nav.active {
    display: flex !important;
  }

  .main-nav a {
    padding: 8px 0;
  }

  .nav-container .hamburger {
    display: flex !important;
  }

  .searchbar-container {
    max-width: 100%;
    margin-left: 0;
  }

  /* Hide full form on small screens */
  .searchbar-full {
    display: none !important;
  }

  /* Show icon only on small screens */
  .searchbar-container .searchbar-icon {
    display: flex !important;
    width: 36px;
    height: 36px;
    margin-left: 4px;
  }

  .searchbar-container .searchbar-icon svg {
    width: 20px;
    height: 20px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card img {
    height: 120px;
  }
}

/* Footer styling */
footer {
  padding: 20px;
  color: #5e4434;
  font-size: 0.9rem;
  text-align: left;
}