/* Prevent padding from causing overflow */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  min-height: 100svh;            /* modern viewport unit, safe on mobile */
  display: flex;
  flex-direction: column;
  color: #000;
  
}

/* Header & menu (desktop aligned left, mobile uses dropdown) */
header {
  display: flex;
  align-items: center;
  justify-content: flex-start;    /* aligned (not centered) */
  padding: 1rem;
  position: relative;
  background: transparent;
}

  header h1 {
      font-family: 'Poppins', sans-serif;
      font-size: 1.0rem; /* 40px/16=2.5em */
      font-weight: bold;
      letter-spacing: 8px;
  }

  header h2 {
        font-family: 'Poppins', sans-serif;
        font-size: 0.8rem; /* 40px/16=2.5em */
        font-weight: normal;
        letter-spacing: 2px;
  }

  header button {
      margin-top: 1rem;
      padding: 0.8rem 1rem;
      background: #0077cc;
      color: #fff;
      border: none;
      border-radius: 4px;
      cursor: pointer;
  }

  h1 {
    margin: 0 0 0.5rem 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem; /* 40px/16=2.5em */
    font-weight: normal;
    letter-spacing: 8px;
    text-align: center;
  }

    h2 {
        margin: 0 0 0.5rem 0;
        font-family: 'Poppins', sans-serif;
        font-size: 1.0rem; /* 40px/16=2.5em */
        font-weight: normal;
        letter-spacing: 2px;
        text-align: left;
    }
  
  .top-bar a:hover, .top-bar button:hover {
    background: #ccc;
  }

  section {
      
    padding: 1.0rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
  }

  section img {
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 1rem;
  }

.menu-toggle {
    display:none; /* hidden on desktop */
    background: none;
    border: none;
    font-size: 2rem;
    color:black;
    cursor: pointer;
    
    
    position: absolute;
    left: 2rem;
    top: 1rem;
}
  
  .menu-bar {
      display:block;
      justify-content:left; /* center on desktop */
      align-items:left;
      position:relative;
      margin-top:0.5rem;
      margin-bottom:0rem;
      z-index: 1000;
  }
  
  #navMenu ul {
    list-style: none;
    margin: 0;
    padding: 0rem;
    display: flex;                  /* desktop row */
  
  }

#navMenu a {
  padding: 0.5rem 2rem;
  color: black;
  text-decoration: none;
  font-weight: 500;
}

  #navMenu a:hover {
      background:#eee;
      border-radius:4px;
  }
  
/* Main area: vertically centered when there's extra height, but scrolls when taller */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  
}

/* This block is what gets centered vertically when there is extra space */
.center-when-room {
  margin-block: auto;             /* pushes block to vertical center if there's room */
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;            /* keep inner content centered horizontally wrapper-wise */
  gap: 1rem;
}


  
main {
  width: 100%;
  max-width: 800px;               /* desktop reading width */
  margin: 0 auto;                 /* horizontal centering */
  text-align: left;
}

main img {
  display: block;
  max-width: 100%;                /* never exceed container */
  height: auto;
  margin-bottom: 1rem;
  border-radius: 6px;
}

main p {
  font-size: 1.1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;        /* prevent long words/URLs from causing overflow */
  margin: 0;
}

main a {
  display: inline-block;
  margin-top: 1rem;
  color: blue;
  text-decoration: none;
}

#langBtn {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  align-self: center;             /* centered under content */
}

/* Mobile: hamburger + dropdown below, no overflow */
@media (max-width: 768px) {
    
    header {
        
        justify-content: flex-start;
    }
    
    .menu-toggle {
        display: block;
    }

    .menu-bar {
        justify-content:flex-start;
    }

    
  #navMenu ul {
    display: none;                       /* hidden until toggle */
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    background: #f9f9f9;
    width: 180px);             /* fit within viewport */
    border-radius: 4px;
    padding: 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);

  }

  #navMenu.active ul {
      
      display: flex;
  }

  #navMenu a {
    padding: 0.5rem 1rem;
    display: block;
    text-decoration:none;
    font-weight:500;
  }

}
  
  /* Grids */
/* Grid background with overlay */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px,1fr));
    gap: 1rem;
    padding: 0rem;
    position: relative; /* allow ::before overlay */
    /*background: url("img_3324.jpeg") center/cover no-repeat;*/
    border-radius: 12px;
    overflow: hidden;
    
}

/*
.grid::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.3)
    );
    backdrop-filter: blur(2px); optional, modern browsers only
    z-index: 0;
}
*/

.grid img {
    width: 100%;
    display: block;
}

/* Ensure thumbnails sit above overlay */
.caption_home_thumbnail {
  position: relative;
  z-index: 1;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.caption_home_thumbnail:hover {
  transform: translateY(-5px);
}

/* Thumbnails */
.caption_home_thumbnail img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: box-shadow 0.3s ease;
}

.caption_home_thumbnail:hover img {
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Captions */
.caption_home_thumbnail p {
  margin-top: 0.15rem;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: #222;
  background: rgba(255,255,255,0.8);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

/* ===== CONTAINER ===== */
.bounce-container {
  position: relative;
  width: 100%;
  height: 450px;
  overflow: hidden;
  background: transparent;
  z-index: 100; /* menu stays above this */
}

.static-img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.bounce-img {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  will-change: transform;
}

.bouncing .static-img { display: none; }
.bouncing .bounce-img { display: block; }

.magnify-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.8);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  z-index: 150;
}
