/* ===========================
   Base styles
=========================== */
body, h1, h2, h3, p, ul {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Arial", sans-serif;
  line-height: 1.5;
  padding: 0.5rem;
  background: #f9f9f9;
  color: #333;
}

a {
  color: #0055aa;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


/* ===========================
   Header & Navigation
=========================== */
header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between; /* title stays right-aligned */
  align-items: center;
  background: #0055aa;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

header nav a {
  color: white;
  font-weight: bold;
  margin-right: 1rem;
  font-size: 1.5rem;    /* make text larger */
  padding: 0.4rem 0.8rem; /* add some button-like padding */
  border-radius: 4px;     /* optional, for nicer hover */
  transition: all 0.15s ease;
}

header nav a:hover {
  background: rgba(255,255,255,0.2); /* subtle hover highlight */
}


header h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

/* ===========================
   Sort controls
=========================== */
#sort-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

#sort-controls strong {
  flex-shrink: 0;
}

.sort-group {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

/* Buttons */
button.sort-btn {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

button.sort-btn:hover {
  background: #e0e0e0;
  border-color: #999;
}

/* ===========================
   Project Tiles
=========================== */
.project-tile {
  display: flex;
  align-items: flex-start;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  padding: 0.75rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
  text-decoration: none;  /* ensure link has no underline */
  color: inherit;         /* keep text color */
  cursor: pointer;
}

.project-tile:hover {
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
}

.project-tile img.project-thumb {
  flex-shrink: 0;
  max-width: 300px;
  max-height: 300px;
  width: auto;
  height: auto;
  margin-right: 1rem;
  border-radius: 4px;
  object-fit: cover;
}

/* Tile text */
.project-tile h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
}

.project-tile p {
  margin: 0.15rem 0;
  font-size: 0.95rem;
}


/* ===========================
   Project Pages
=========================== */
body.project-page h2 {
  margin-top: 1.5rem;
}


/* ===========================
   Gallery
=========================== */
#gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#gallery img {
  max-height: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  cursor: pointer;
}

#gallery img:hover {
  transform: scale(1.05);
}

.gallery-thumb {
  max-height: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
  cursor: pointer;
  border-radius: 4px;
}

#lightbox-overlay video {
  background: black;
}

/* Lightbox overlay */
#lightbox-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
}

#lightbox-overlay img {
  max-width: 90%;
  max-height: 80%;
  margin-bottom: 1rem;
  border-radius: 6px;
}

#lightbox-controls {
  display: flex;
  gap: 0.5rem;
}

#lightbox-controls button {
  background: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.15s ease;
}

#lightbox-controls button:hover {
  background: #e0e0e0;
}

/* ===========================
   Tables
=========================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

th, td {
  border: 1px solid #aaa;
  padding: 0.25rem 0.5rem;
  text-align: left;
}

th {
  background: #eee;
}

/* ===========================
   Banner Image
=========================== */
#banner img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* ===========================
   Responsive adjustments
=========================== */
@media (max-width: 600px) {
  header nav {
    flex-direction: column;
    align-items: flex-start;
  }

  header h1 {
    font-size: 1.25rem;
  }

  .project-tile {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-tile img.project-thumb {
    width: 100%;
    margin: 0 0 0.5rem 0;
  }

  #sort-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .sort-group {
    width: 100%;
    justify-content: flex-start;
  }

  table {
    display: block;
    overflow-x: auto;
    font-size: 0.8rem;
  }

  #gallery {
    justify-content: flex-start;
  }

  #gallery img {
    width: 100px;
  }
}
