body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  background: #f9f9f9;
}

header, footer {
  background: #31eb7b;
  color: white;
  padding: 1rem;
  text-align: center;
  position: relative;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
}

nav a:hover {
  background: #0055aa;
  border-radius: 4px;
}

section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
  background: white;
}

article {
  border: 1px solid #ddd;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fdfdfd;
}

img {
  border-radius: 8px;
}

/* MOBIILIVALIKKO */
.hamburger {
  display: none;
  flex-direction: column; 
  justify-content: space-around; 
  width: 2rem; 
  height: 2rem; 
  position: absolute; 
  top: 1.5rem; 
  right: 1rem; 
  cursor: pointer; 
}

.hamburger span {
  width: 100%; 
  height: 3px;
  background-color: white; 
  border-radius: 10px; 
  transition: all 0.3s linear;
}

.mobile-nav {
  display: none; 
  background-color: #003366; 
  padding: 1rem; 
  position: absolute; 
  top: 6rem; 
  left: 0; 
  width: 100%;
  z-index: 1000; 
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
}

.mobile-nav ul {
  list-style: none;
  padding: 0; 
  margin: 0;
}

.mobile-nav li {
  margin-bottom: 1rem; 
  text-align: center; 
}

.mobile-nav a {
  color: white; 
  text-decoration: none; 
  display: block; 
  padding: 0.5rem;
}

.mobile-nav a:hover {
  background-color: #0055aa; 
  border-radius: 4px;
}

/* -------------------- MEDIA QUERY -------------------- */
@media (max-width: 768px) {
  .hamburger {
    display: flex; 
    width: 30px;
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
  }
  
  nav ul {
    display: none;
  }
  
  .mobile-nav.active {
    display: flex; 
  }
  
  .hamburger span {
    display: block;
    height: 4px;
    width: 100%;
    background-color: #000;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* ANIMAATIO: hamburger → X */
  .hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

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

  .hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}

/* -------------------- LIGHTBOX (KAIKKI NÄYTÖT) -------------------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;                 /* top:0; left:0; right:0; bottom:0 */
  z-index: 99999;           /* varmasti kaiken päälle */
  background: rgba(0,0,0,0.95);
}

.lightbox-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  max-height: 80%;
}

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 100000;
}

/* -------------------- GALLERIA -------------------- */
.gallery-item {
  display: inline-block;
  margin: 10px;
  text-align: center;
  cursor: pointer;
}

.gallery-item img {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

.gallery-item .caption {
  margin-top: 5px;
  font-size: 0.9rem;
  color: #333;
}

/* -------------------- LIGHTBOX -------------------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.95);
}

.lightbox-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  max-height: 80%;
}

.lightbox-caption {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.2rem;
  text-align: center;
  max-width: 90%;
}

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 100000;
}
/* ---------- GALLERIA GRID ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  justify-items: center;
  margin-top: 20px;
}

.gallery-item {
  text-align: center;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

.gallery-item .caption {
  margin-top: 5px;
  font-size: 0.9rem;
  color: #333;
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.95);
}

.lightbox-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  max-height: 80%;
}

.lightbox-caption {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.2rem;
  text-align: center;
  max-width: 90%;
}

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 100000;
}

