/* Temporary diagnostic */
body {
  overflow-x: hidden !important;
}

* {
  box-sizing: border-box !important;
}

/* Prevent horizontal scrolling on all devices */
* {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
 margin: 0;
 background-color: #333;
 font-family:'Courier New', Courier, monospace;
 color: #f1f1f1;
}

.logo {
  float: none;
  width: 30%;
  max-width: 330px;
  min-width: 200px;
  height: auto;
  padding: 40px;
  margin-right: 20px; 
}

.header {
  position: relative;
  width: 100%;
  min-height: 80px;
  background-position: 50% 41%;
  background-repeat: no-repeat;
  background-size: cover;
  background-image: var(--header-bg, url("assets/default-header.webp"));
  display: flex;             /* Enable Flexbox */
  justify-content: space-between; /* Push logo left, menu right */
  align-items: center;       /* Vertically center them */
  box-sizing: border-box;
}

@media (max-width: 768px) {
  * {
    box-sizing: border-box;
  }

  .header, .gallery, .gallery-container, body, html {
    overflow-x: hidden;
    width: 100%;
  }

  .logo {
    max-width: 120px;
    padding: 10px;
  }

  .menu {
    font-size: 24px;
    padding: 10px;
  }
}

.overlay {
  height: 0%;
  width: 100%;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: rgb(0,0,0);
  background-color: rgba(0,0,0, 0.9);
  overflow-y: hidden;
  transition: 0.5s;
}

.overlay-content {
  position: relative;
  top: 25%;
  width: 100%;
  text-align: center;
  margin-top: 30px;
}

.overlay a {
  padding: 8px;
  text-decoration: none;
  font-size: 36px;
  color: #818181;
  display: block;
  transition: 0.3s;
}

.overlay a:hover, .overlay a:focus {
  color: #f1f1f1;
}

.overlay .closebtn {
  position: absolute;
  top: 20px;
  right: 45px;
  font-size: 60px;
}

@media screen and (max-height: 450px) {
  .overlay {overflow-y: auto;}
  .overlay a {font-size: 20px}
  .overlay .closebtn {
  font-size: 40px;
  top: 15px;
  right: 35px;
  }
}

.menu {
  float: none;
  font-size:30px;
  color: #f1f1f1;
  cursor:pointer;
  padding: 40px 40px;
  white-space: nowrap;
}

.container {
  position: relative;
  width: 100%;
  height: auto;
  padding-top: 10px;
  padding-bottom: 10px;
  border: #f1f1f1;
}

.container img {
  vertical-align: middle;
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: auto;
  max-height: 250px;
  object-fit: cover;
  overflow: hidden;
}

.container .content {
  position: absolute;
  bottom: 0;
  background: rgb(0, 0, 0); /* Fallback color */
  background: rgba(0, 0, 0, 0.5); /* Black background with 0.5 opacity */
  color: #f1f1f1;
  text-align: center;
  width: 100%;
  margin-bottom: 10px;
  overflow: hidden;
}

.gallery-container {
  width: 100%;
  max-width: 100vw;
  padding: 0px 10px; /* Your desired spacing around the gallery */
  box-sizing: border-box; /* Ensures padding doesn't affect total width */
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0px;
  list-style: none;
}

.gallery figure {
  margin: 0;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.gallery figcaption {
  bottom: 10px;
  left: 10px;
  right: 10px;
  color: white;
  padding: 8px 3px;
  font-size: 14px;
  margin-top: 4px;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
}

