body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; /* ✅ Top -> Middle -> Bottom */
    min-height: 100vh;
    scroll-padding-top: 3rem; /* Adjust based on nav height */
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-image: url("../images/IMG_0712.jpg");
    background-size: cover;           /* Cover entire header area */
    background-position: center top 65%;      /* Keep image centered */
    background-repeat: no-repeat;     /* No tiling */
    background-color: rgb(41, 41, 41); /* Or whatever your site uses */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    text-align: center;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.0);  /* transparent white */
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 0px solid rgba(0, 0, 0, 0.1);
    padding: 0rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

nav a {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.35); /* translucent white */
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

nav a:hover {
    background-color: rgba(102, 102, 102, 0.6); /* translucent white */
    transform: translateY(-2px);
}

#archive {
    background: #f4f4f4;
    padding: 1rem;
    width: 220px;
    flex-shrink: 0;
}

main {
    flex-grow: 1;
    padding: 1rem;
}

#categories button {
    margin: 0.5rem;
    padding: 0.3rem 0.6rem;
    border: none;
    background: #555;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

#categories button:hover {
    background: #777;
}

.project-card {
    border: 1px solid #ccc;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: white;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}

.project-card:hover {
    box-shadow: 4px 4px 12px rgba(0,0,0,0.2);
}

.project-content {
    display: flex;
    align-items: center; /* Vertically center */
    justify-content: space-between;
    flex-wrap: nowrap; /* IMPORTANT: no wrapping! */
}

.project-text {
    flex: 1;
    min-width: 0; /* ALLOW shrinking if needed */
    margin-right: 1rem; /* Space between text and image */
}

.project-thumb {
    width: 100px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0; /* Thumbnail stays small */
}

footer {
    background-color: #f4f4f4;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    margin-top: 2rem;
}

.search-wrapper {
    position: relative;
    width: 250px;
}

#search {
    padding: 0.5rem 0.5rem 0.5rem 2rem; /* extra left padding for icon */
    font-size: 1rem;
    width: 20%;
}

.search-wrapper::before {
    content: '\\1F50D'; /* Unicode magnifying glass */
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #666;
}

.sidebar-controls {
    margin-bottom: 1.5rem;
}

.sidebar-controls #categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.sidebar-controls .search-wrapper {
    position: relative;
    width: 100%;
    max-width: 220px; /* Match sidebar width */
    margin-top: 1rem;
    box-sizing: border-box;
}

.sidebar-controls #search {
    padding: 0.5rem 0.5rem 0.5rem 2rem; /* 2rem left padding for icon */
    font-size: 1rem;
    width: 100%;
    max-width: 220px;
    box-sizing: border-box;
}

.sidebar-controls .search-wrapper::before {
    content: '🔍'; /* Direct emoji */
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #666;
}

.content {
    display: flex;
    flex-direction: row;
    min-height: 80vh;
}

.project-detail {
    max-width: 700px;
    margin: 2rem auto;
    padding: 1rem;
    line-height: 1.6;
    font-size: 1.1rem;
}

.project-detail h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.project-detail img.project-image {
    display: block;
    width: 80%; /* Try 60% or 70% for smaller look */
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quote-list {
    list-style-type: disc; /* Normal bullet points */
    padding-left: 2rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

.quote-list li {
    margin-bottom: 1rem;
}

.project-text h2 a {
    text-decoration: none;
    color: inherit;
}

.project-text h2 a:hover {
    text-decoration: underline;
}

.project-tags {
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    background-color: #e0e0e0;
    color: #333;
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    margin-right: 0.5rem;
    margin-bottom: 0.3rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

a.button {
    display: inline-block;
    background-color: #0077cc;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
}

a.button:hover {
    background-color: #005fa3;
}

.timeline {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    border-left: 3px solid #ccc;
    position: relative;
}

.timeline h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 2rem;
}

.timeline-date {
    position: absolute;
    left: -90px;
    top: 0;
    font-weight: bold;
    font-size: 1.1rem;
    color: #555;
    width: 70px;
    text-align: right;
}

.timeline-content {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-4px);
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    background-color: #3498db;
    border-radius: 50%;
}

.timeline-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.timeline-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
  }
  
  .timeline-entry {
    background: white;
    border-radius: 8px;
    margin: 2rem 0;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0.6;
    transform: scale(0.95);
  }
  
  .timeline-entry.active {
    transform: scale(1.05);
    opacity: 1;
    z-index: 10;
  }

  .quote-card cite {
    display: block;
    text-align: right;
    font-style: italic;
    margin-top: -0.5rem;
    color: #000000;
  }

  .quote-card {
    background: #fff;
    margin: 1rem 0rem;
    padding: 1rem;
    border-left: 4px solid #888;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    font-style: italic;
  }

  .timeline-card {
    border: 1px solid #ccc;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: white;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.timeline-card:hover {
    box-shadow: 4px 4px 12px rgba(0,0,0,0.2);
}

.timeline-card .card-content {
    display: flex;
    justify-content: space-between;
    align-items: center; /* This ensures vertical centering */
    gap: 1rem;
  }
  
  .timeline-card .card-text {
    flex: 1;
  }
  
  .timeline-card .card-image img {
    max-width: 120px;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
  }

  #lightbox-overlay {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
}

#lightbox-overlay img {
  max-width: 90%;
  max-height: 90%;
  /* box-shadow: 0 0 15px #fff; */
  box-shadow: 0 0 25px rgb(0, 0, 0);
  border-radius: 4px;
  transition: transform 0.3s ease;
}

#lightbox-overlay img:hover {
  transform: scale(1.0);
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

.autoscaled-img {
  width: 100%;
  max-width: 800px;
  height: auto;
  display: block;
  margin: 1rem auto;
  cursor: zoom-in;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode header,
body.dark-mode footer,
body.dark-mode #archive,
body.dark-mode .project-card,
body.dark-mode .timeline-card,
body.dark-mode .timeline-content,
body.dark-mode .quote-card {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border-color: #444;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-mode nav a {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

body.dark-mode nav a:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

body.dark-mode .tag {
  background-color: #333;
  color: #eee;
}

body.dark-mode #categories button {
  background: #333;
  color: #eee;
}

body.dark-mode #categories button:hover {
  background: #555;
}

body.dark-mode .timeline-date {
  color: #aaa;
}

body.dark-mode .project-detail img,
body.dark-mode .autoscaled-img {
  box-shadow: 0 0 12px rgba(255,255,255,0.05);
}

body.dark-mode .search-wrapper::before,
body.dark-mode .sidebar-controls .search-wrapper::before {
  color: #aaa;
}

body.dark-mode input[type="text"],
body.dark-mode textarea {
  background: #2b2b2b;
  color: #fff;
  border: 1px solid #555;
}

body.dark-mode cite {
  color: #aaa;
  font-style: italic;
}