/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

/* Header */
header {
  background: #111;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: bold;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

nav ul li a:hover {
  color: #f00;
}

/* Hamburger menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.menu-toggle span {
  background: #fff;
  height: 3px;
  width: 25px;
  margin: 4px 0;
}

@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    background: #111;
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    padding: 1rem;
  }

  nav ul.show {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }
}

/* Sections */
section {
  padding: 100px 20px;
  min-height: 100vh;
}

#biography { background: #f4f4f4; }
#mission { background: #e9ecef; }
#gallery { background: #fdfdfd; }
#support { background: #f8f9fa; }
#contact { background: #f4f4f4; }
#memorian { background: #f4f4f4; }

h2 {
  margin-bottom: 1rem;
  color: #111;
}

.container {
  max-width: 1000px;
  margin: auto;
}

/* Biography Styles */
.bio-section {
  margin-bottom: 3rem;
}

.bio-section h3 {
  margin: 1rem 0;
  color: #c00;
}

.bio-section p {
  margin-bottom: 0.5rem;
}

.bio-img {
  width: 100%;
  max-width: 400px;
  margin: 1rem 0;
  border-radius: 8px;
  display: block;
}




.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Fixed 3 equal-width columns for desktop */
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start; /* Ensures items align to top; rows will have equal heights via grid stretching */
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 300px; /* Fixed total height for all items (adjust as needed for uniformity) */
    display: flex;
    flex-direction: column; /* Stacks media and description vertically within fixed height */
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gallery-item img, .gallery-item video {
    width: 100%;
    height: 200px; /* Fixed height for media to ensure same size across all */
    object-fit: cover;
    display: block;
    flex-shrink: 0; /* Prevents media from shrinking in the flex container */
}

.gallery-item a {
    text-decoration: none;
    color: inherit;
    flex: 1; /* Allows the link to fill the item height */
    display: flex;
    flex-direction: column;
}

.desc {
    padding: 10px;
    text-align: center;
    font-size: 14px;
    color: #666;
    flex: 1; /* Description takes remaining space after fixed media height */
    display: flex;
    align-items: center; /* Centers text vertically in remaining space */
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .gallery-item {
        height: 280px; /* Slightly smaller for medium screens */
    }
    
    .gallery-item img, .gallery-item video {
        height: 180px;
    }
}

/* Mobile: 1 column, full-width */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .gallery {
        grid-template-columns: 1fr; /* Single column stack */
        gap: 10px;
        max-width: 100%;
    }
    
    .gallery-item {
        height: 350px; /* Taller for better touch targets on mobile */
        border-radius: 12px; /* Rounded corners for mobile appeal */
    }
    
    .gallery-item img, .gallery-item video {
        height: 250px; /* Larger media area for visibility */
    }
    
    .desc {
        font-size: 16px; /* Bigger text for readability */
    }
    
    .gallery-item:hover {
        transform: none; /* Disable hover lift on touch devices */
    }
}