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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* Account for sticky header */
  overflow-y: scroll; /* Always show vertical scrollbar to prevent layout shift */
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header and Navigation */
header {
  background-color: #2c3e50;
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background-color: #34495e;
}

/* Submenu styles */
.nav-item-with-submenu {
  position: relative;
}

.nav-item-with-submenu > .nav-link::after {
  content: ' ▼';
  font-size: 0.8em;
  margin-left: 0.5rem;
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #34495e;
  min-width: 200px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  list-style: none;
  padding: 0.5rem 0;
  z-index: 1001;
}

.nav-item-with-submenu:hover .submenu,
.submenu.show {
  display: block;
}

.submenu-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: block;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.submenu-link:hover {
  background-color: #2c3e50;
}

/* Mobile responsive styles for submenu */
@media (max-width: 768px) {
  .nav-item-with-submenu:hover .submenu {
    display: none; /* Disable hover on mobile */
  }
  
  .submenu.show {
    display: block !important; /* Only show when .show class is added via JavaScript */
  }
  
  .submenu {
    position: static;
    box-shadow: none;
    background-color: #34495e;
    border-radius: 0;
    margin-top: 0;
    padding: 0;
    display: none;
  }
  
  .submenu-link {
    padding: 1rem 3rem;
    border-bottom: 1px solid #2c3e50;
    background-color: #34495e;
  }
  
  .submenu-link:hover {
    background-color: #2c3e50;
  }
  
  .submenu-link:last-child {
    border-bottom: none;
  }
}

/* Hide hamburger menu elements on desktop */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  flex-direction: column;
  cursor: pointer;
  width: 35px;
  height: 30px;
  justify-content: space-around;
  padding: 3px;
}

.nav-toggle-label span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Main content */
.main-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background-color: white;
  flex: 1;
}

.info-box {
  background-color: lightblue;
  padding: 1rem 1rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.info-box p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
}

.content {
  padding: 2rem 0;
  text-align: justify;
}

.content h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.8;
}

.content ul {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.long-link {
  word-break: break-all;
  color: inherit;
}

.center-vertical {
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-container {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: 100%;
}

.intro-card {
  text-align: center;
  background-color: #2c3e50;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  font-size: 1.75rem;
  flex: 1;
}

.intro-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-image img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

svg {
  vertical-align: middle;
  margin-top: -3px;
}

.block-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.block {
  width: calc(50% - 8px);
}

.block img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

.square {
  aspect-ratio: 1;
}

.landscape {
  aspect-ratio: 513 / 342;
}

/* Desktop flex order for blocks */
@media screen and (min-width: 769px) {
  .block:nth-child(1) { order: 1; }
  .block:nth-child(2) { order: 3; }
  .block:nth-child(3) { order: 2; }
  .block:nth-child(4) { order: 4; }
  .block:nth-child(5) { order: 5; }
  .block:nth-child(6) { order: 7; }
  .block:nth-child(7) { order: 6; }
  .block:nth-child(8) { order: 8; }
  .block:nth-child(9) { order: 9; }
  .block:nth-child(10) { order: 10; }

  .block.middle {
    margin-left: calc(25% + 4px);
  }
}

/* Image loading animation */
img {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

img.loaded {
  opacity: 1;
  transform: scale(1);
}

/* Hide alt text while loading */
img:not(.loaded) {
  color: transparent;
  text-indent: -9999px;
}

/* Footer */
footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

/* Mobile responsive design */
@media screen and (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }

  .nav-toggle-label {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #2c3e50;
    flex-direction: column;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .nav-menu li {
    border-bottom: 1px solid #34495e;
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    padding: 1rem 2rem;
    border-radius: 0;
  }

  /* Show menu when checkbox is checked */
  .nav-toggle:checked~.nav-menu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  /* Animate hamburger menu */
  .nav-toggle:checked~.nav-toggle-label span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle:checked~.nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked~.nav-toggle-label span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .main-content {
    padding: 1rem;
  }

  .info-box {
    padding: 1rem;
  }

  .info-box p {
    font-size: 1rem;
  }

  .intro-container {
    flex-direction: column;
    gap: 1rem;
  }

  .intro-card {
    font-size: 1rem;
  }

  .block {
    flex: 1 1 100%;
  }
}

@media screen and (max-width: 480px) {
  .nav-brand h1 {
    font-size: 1.2rem;
  }

  .content h3 {
    font-size: 1.3rem;
  }

  .content {
    text-align: initial;
  }
}