html, body {
  margin: 0;
  padding: 0;
}


* {
  box-sizing: border-box;
  margin: 0;
  font-family: system-ui, sans-serif;
}

body {
  background: #555;
  padding-top: 200px;   /* EXACT header height */
}

/* Sticky Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 200px;

  display: flex;
  justify-content: center;
  align-items: flex-start;   /* 👈 move content to top */

  padding-top: 20px;         /* 👈 spacing from top edge */

  background-image: url('../images/Andromeda.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: white;
  z-index: 1000;
  overflow: hidden;
  border-bottom: 12px solid #555;
}

/* Overlay (optional for readability) */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  z-index: 1;
}


:root {
  --header-height: 200px;
}





.filters {
  margin-top: 0.5rem;
}

.header h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 2.5rem;   /* adjust as needed */
  letter-spacing: 1px;
  margin: 0;
  top: 0;          /* 👈 critical */
  left: 0;
}

.button-container {
  position: absolute;
  bottom: 10px;
  z-index: 2;
  padding: 12px 20px;
}

.filters button {
  margin: 0 0.5rem 0.5rem 0;
  background-color: #555;  /* mid grey default */
  color: #fff;                /* text white */
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filters button.active {
  background-color: #bbb;     /* inverted */
  color: #111;
  border: 1px solid #b5b5b5; /* optional outline for contrast */
}

/* Gallery Grid */
.gallery {
  /* margin-top: 200px;   /* EXACTLY header height */
  padding: 1rem;
  /* padding-top: 16px */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 1;
  background: #555;
  margin-top: 20px;
  
}


.card {
  /* border-radius: 8px;            /* rounded corners */
  /* overflow: hidden;              /* clips image and caption */
  /* border: 2px solid #e0e0e0;    /* thin pale outline */
  background-color: #555;        /* optional, ensures border shows cleanly */
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 200px;           /* fixed height for uniform grid */
  object-fit: cover;
  border-radius: 8px;      /* rounded corners on image */
  border: 1px solid #e0e0e0; /* thin pale outline */
  display: block;
  box-sizing: border-box;  /* include border in width */
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border-color: #ffffff; 
}

.card figcaption {
  text-align: center;
  background-color: #555; /* mid-grey */
  color: #fff;
  padding: 0.5rem;
  font-size: 0.9rem;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  z-index: 2000; /* higher than header (1000) */
}

.lightbox figure {
  max-width: 90%;
  text-align: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 6px;
}

.lightbox img {
  touch-action: pan-y;
  user-select: none;
}

.lightbox figcaption {
  margin-top: 0.6rem;
  color: #ddd;
}

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

/* Lightbox navigation */
.lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 2.5rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  user-select: none;
}

.lightbox .prev {
  left: 20px;
}

.lightbox .next {
  right: 20px;
}

.lightbox .nav:hover {
  background: rgba(0,0,0,0.8);
}
