* {
  box-sizing: border-box;
}

/* lora-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  src: url('assets/fonts/Lora/lora-v36-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* roboto-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('assets/fonts/Roboto/roboto-v48-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

a:link {
  text-decoration: none;
}

a:visited {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

a:active {
  text-decoration: none;
}

body {
  background-color: #f5faff;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Lora', 'Roboto', Arial, serif;
}

#top-section {
  display: flex;
  justify-content: space-between;
  padding: 0px;
  flex-shrink: 0; /* don't grow or shrink */
}

#middle-section {
  display: flex;
  flex-direction: column; /* stack children vertically */
  align-items: center;    /* optional: center horizontally */
  gap: 10px;              /* spacing between the boxes */
}

#bottom-section {
  display: flex;
  justify-content: space-between;
  padding: 0px 20px 20px 20px;
  flex-shrink: 0; /* don't grow or shrink */
  flex-direction: row;
  align-items: center;
  margin-top: auto; /* pushes it to the bottom */
}

#top-section {
  /* font-family: 'Georgia', serif;*/
  font-size: 18px;
}

#middle-section {
  /*font-family: 'Verdana', sans-serif;*/
  font-size: 16px;
  justify-content: center;
}

#bottom-section {
  /* font-family: 'Courier New', monospace;*/
  font-size: 14px;
  justify-content: center;
}

.top-left, .top-center, .top-right {
  flex: 1;
  padding: 10px;
}

.top-right {
  display: flex;
  justify-content: flex-end;
  align-items: center; /* optional: centers vertically */
}

.middle-box {
  width: 80%;
  padding: 0vw 0.25vw 0.25vw 0.25vw;
  text-align: center;
}

#middle-box-1 {
  font-size: 2.5rem;
  font-weight: bold;
}

#middle-box-2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #34495e;
}

#middle-box-3 {
  font-size: 1.3rem;
  font-weight: normal;
  color: #555;
}

.middle-box-text-container {
  width: clamp(280px, 80%, 900px);
  text-align: start;
}

.middle-box-text-container-center {
  width: clamp(280px, 80%, 900px);
  margin: 0 auto;              /* centers the box */
  text-align: center;          /* centers the inner text */
  display: block;
  /*border: 1px solid red;
  background: #f5f5f5;*/
}

.middle-box-text-container-summary p {
  align-items: top;
  gap: 1rem;
  font-size: 1.3rem;
  font-style: italic;
  flex-direction: row;
  text-align: center;
}

.middle-box-text-container-summary p.note {
  font-size: 1rem;
}

.middle-box-text-container p {
  display: flex;
  align-items: top;
  gap: 1rem;
  margin: 2rem 0;
  font-size: 1.3rem;
}

.middle-box-text-container .row-left {
  flex-direction: row;
  text-align: justify;
}

.middle-box-text-container .row-right {
  flex-direction: row-reverse;
  text-align: justify;
}

.middle-box-text-container img {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.middle-box-text-container .text {
  flex: 1;
}

.bottom-left,
.bottom-right {
  flex: 0 1 auto;
  padding: 10px;
  white-space: nowrap;
}

.bottom-center {
  flex: 1 1 auto;
  padding: 10px;
  text-align: center;
  justify-content: center;
  font-size: 1.0rem;
}

#language-select {
  font-size: 16px;
  padding: 5px;
}

.custom-dropdown {
  position: relative;
  display: inline-block;
  width: 200px;
  cursor: pointer;
}

.selected {
  padding: 10px;
  border: 1px solid #ccc;
  background: white;
  position: relative;
}

.selected::after {
  content: '\25BC';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 12px;
  color: #333;
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  border: 1px solid #ccc;
  background: white;
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-options li {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-options li:hover {
  background-color: #f0f0f0;
}

.dropdown-options img {
  width: 20px;
  height: auto;
}

.big-blue-button {
  padding: 1.5vw 3vw;
  font-size: 1.0vw;
  display: inline-block;
  text-align: center;
  min-width: 200px;
  max-width: 400px;
  background-color: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.big-blue-button:hover {
  background-color: #28a745;
}

.big-blue-button:active {
  background-color: #218838;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .big-blue-button {
    font-size: 3.5vw;
    padding: 2.5vw 5vw;
  }
}

@media (max-width: 480px) {
  .big-blue-button {
    font-size: 5vw;
    padding: 4vw 8vw;
    display: block;
    margin: 15px auto;
    min-width: unset;
  }
}

@media (min-width: 1200px) {
  .big-blue-button {
    font-size: 20px;
    padding: 18px 30px;
  }
}

.flag-img {
  width: 25px;
  height: 25px;
  display: inline-block;
  vertical-align: middle;
}

.image-wrapper-viewport {
  width: 70vw;
  max-width: 400px;
  max-height: 518px;
  margin: 0 auto;
}

.image-wrapper-viewport img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Existing CSS */

/* --- NEW CAROUSEL STYLES --- */
.carousel-container {
    width: clamp(280px, 80%, 900px);
    margin: 20px auto;
    position: relative;
    overflow: hidden; /* Hide overflowing images */
    padding: 20px;
    background-color: #e0f2ff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.carousel-container h3 {
    text-align: center;
    margin-top: 0px;
    margin-bottom: 20px;
    color: #34495e;
    font-size: 1.8rem;
}

.carousel {
    display: flex;
    overflow-x: scroll; /* Allows horizontal scrolling */
    scroll-snap-type: x mandatory; /* Snaps to images */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
    gap: 15px; /* Space between images */
    padding-bottom: 10px; /* Space for potential scrollbar area */
}

.carousel::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari/Opera */
}

.carousel-inner {
    display: flex;
    gap: 15px; /* Space between images */
}

.carousel-item {
    flex-shrink: 0; /* Prevents images from shrinking */
    width: 200px; /* Fixed width for each carousel item */
    height: 150px; /* Fixed height for each carousel item */
    object-fit: cover; /* Crop images to fit, maintaining aspect ratio */
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    scroll-snap-align: start; /* Align items to the start of the scroll container */
    border: 3px solid transparent;
}

.carousel-item:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border-color: #007bff;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* --- POP-UP STYLES (Moved from script.js to style.css) --- */
#image-popup {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Optional: add a blur effect */
}

#image-popup.active {
    display: flex; /* Makes the popup visible */
}

.popup-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%; /* Occupy 90% of the screen width */
    max-height: 90vh; /* Occupy 90% of the viewport height */
    margin: auto;
    background-color: #fff; /* Background for the popup content */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: 20px; /* Padding inside the popup */
    box-sizing: border-box; /* Include padding in width/height */
}

.expanded-image {
    max-width: 80%;
    max-height: 100%;
    object-fit: contain; /* Ensures the image fits within the 90% view, maintaining aspect ratio */
    display: block; /* Remove extra space below image */
    border-radius: 5px;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #fff; /* Changed to white to be visible on dark overlay */
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001; /* Ensure it's above the image */
    /* background: red; */
    background-color: rgba(0, 0, 0, 0.6); /* dark background */
}

.close-popup:hover,
.close-popup:focus {
    color: #ccc;
    text-decoration: none;
}

.popup-prev-btn,
.popup-next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    z-index: 1001;
    transition: background-color 0.3s ease;
}

.popup-prev-btn:hover,
.popup-next-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.popup-prev-btn {
    left: 10px;
}

.popup-next-btn {
    right: 10px;
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    .carousel-item {
        width: 150px;
        height: 100px;
    }
    .carousel-btn {
        padding: 5px 10px;
        font-size: 20px;
    }
    .popup-content {
        padding: 10px;
    }
    .close-popup {
        font-size: 30px;
        top: 5px;
        right: 15px;
    }
}