html,
body {
  height: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  /* header + nav + content */
}

/* Bootstrap container adaptiv + să umple spațiul rămas */
.container {
  flex: 1;
  width: 100%;
  max-width: 1140px;
  padding-left: 15px;
  padding-right: 15px;
  display: flex;
  flex-direction: column;
}

/* =========================
   1) Hero banner + title responsive
   ========================= */
.hero-banner {
  position: relative;
  background-image: url('../image/map_banner.jpg');
  background-size: cover;
  background-position: center;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
}

/* click pe banner (ai <a> pe el) */
.hero-banner a {
  text-decoration: none;
  color: inherit;
}

.hero-banner .title-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.86);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
}

.hero-banner h1 {
  font-family: 'Merriweather', serif;
  color: #0d3b66;
  margin: 0;
  /* responsive font */
  font-size: clamp(1.8rem, 4.5vw, 3.5rem);
  line-height: 1.1;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.25);
}

.hero-banner p {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  color: #0d3b66;
  margin: 10px 0 0 0;
  /* responsive font */
  font-size: clamp(0.95rem, 2.6vw, 1.6rem);
  line-height: 1.25;
  max-width: 1000px;
  padding: 0 6px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.18);
}

/* Steaguri */
.flag-container {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  display: flex;
  gap: 10px;
}

.flag {
  width: 24px;
  height: 18px;
  cursor: pointer;
  border-radius: 2px;
}

/* =========================
   2) Navbar + hamburger (tap-friendly)
   ========================= */
.navbar {
  background: linear-gradient(to bottom, #c5d5a5, #ddebcf);
  font-family: 'Merriweather', serif;
  padding: 6px 10px;
}

/* linkuri desktop */
.navbar-nav {
  margin-left: auto;
}

.nav-link {
  color: #2b2b2b;
  font-weight: 600;
  padding: 8px 14px;
  margin: 4px;
  border-radius: 8px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.nav-link:hover,
.nav-link:focus {
  background-color: #a5b592;
  color: #ffffff;
  outline: none;
}

/* Dropdown */
.nav-item.dropdown .dropdown-menu {
  background: linear-gradient(to bottom, #c5d5a5, #ddebcf);
  border: none;
  border-radius: 10px;
  padding: 6px 0;
}

.dropdown-item {
  font-family: 'Merriweather', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #2b2b2b;
  padding: 8px 14px;
  border-radius: 8px;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #a5b592;
  color: #ffffff;
  outline: none;
}

/* Hamburger (custom) - mai mare, usor de apasat */
.hamburger {
  display: none;
  /* apare doar pe mobil */
  cursor: pointer;
  margin-left: auto;
  user-select: none;

  /* Tap target mare (recomandat min 44px) */
  min-width: 48px;
  min-height: 48px;
  padding: 10px 14px;

  font-size: 34px;
  /* mai mare */
  line-height: 1;

  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(13, 59, 102, 0.18);
  align-items: center;
  justify-content: center;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.70);
}

.hamburger:active {
  transform: scale(0.98);
}

.hamburger:focus {
  outline: 2px solid rgba(13, 59, 102, 0.35);
  outline-offset: 2px;
}

/* =========================
   3) Content fieldset full-height (fara <br>)
   ========================= */
.content-fieldset {
  flex: 1;
  /* umple ce rămâne pe pagină */
  width: 100%;
  padding: 12px;
  background-color: #f8f9fa;
  border: 2px solid #a5b592;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* important pt flex */
}

.title_proj {
  font-family: 'Merriweather', serif;
  font-size: clamp(1.1rem, 3.2vw, 1.5rem);
  font-weight: normal;
  color: #2b2b2b;
  margin-bottom: 8px;
  text-align: left;
}

.content-section {
  padding: 10px;
}

.inner-fieldset {
  padding: 10px;
  border: 2px solid #c5d5a5;
  border-radius: 10px;
  background-color: #ffffff;
  flex: 1;
  margin-top: 12px;
  min-height: 0;
}

.inner-fieldset legend {
  font-family: 'Merriweather', serif;
  font-size: clamp(1.05rem, 2.8vw, 1.5rem);
  color: #2b2b2b;
  font-weight: bold;
}

.content-text {
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  color: #333333;
  line-height: 1.6;
  text-align: justify;
  overflow-wrap: anywhere;
}

.content-text p {
  margin-bottom: 10px;
}

/* =========================
   4) Map + Leaflet controls
   ========================= */
.map,
#map {
  width: 100%;
  height: clamp(320px, 60vh, 580px);
  margin-bottom: 20px;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
}

/* Control slider opacitate */
.leaflet-control-opacity {
  background: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.30);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.leaflet-control-opacity label {
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
}

.leaflet-control-opacity input[type="range"] {
  width: 120px;
  margin: 0;
  vertical-align: middle;
}

.leaflet-bar button {
  background: #fff;
  width: 38px;
  height: 38px;
  line-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
}

.leaflet-bar button:last-child {
  border-bottom: none;
}

.leaflet-bar button:hover {
  background: #f4f4f4;
}

/* =========================
   5) Dictionary slideshow responsive
   ========================= */
.image-container {
  position: relative;
  width: 100%;
  height: clamp(320px, 75vh, 750px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-container img {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.image-container img.active {
  opacity: 1;
}

/* =========================
   6) Mobile / Tablet rules
   ========================= */

/* TABLET */
@media (max-width: 991.98px) {

  /* hamburger apare */
  .hamburger {
    display: flex;
  }

  /* navbar devine "stacked" */
  .navbar {
    padding: 6px 10px;
  }

  /* ascundem meniul by default */
  #navbarNav {
    display: none;
    width: 100%;
  }

  /* cand e deschis */
  #navbarNav.is-open {
    display: block;
  }

  /* meniu vertical */
  .navbar-nav {
    margin-left: 0;
    padding: 10px 0;
  }

  .nav-link {
    display: block;
    margin: 6px 0;
    padding: 12px 14px;
    border-radius: 10px;
  }

  /* title-container mai compact pe tableta/mobil */
  .hero-banner .title-container {
    padding: 14px 12px;
    border-radius: 10px;
  }

  .flag-container {
    top: 10px;
    right: 10px;
  }

  .flag {
    width: 26px;
    height: 19px;
  }
}

/* MOBILE */
@media (max-width: 575.98px) {
  .hero-banner {
    min-height: 175px;
  }

  .hero-banner p {
    padding: 0 2px;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .content-fieldset {
    padding: 10px;
  }

  .inner-fieldset {
    padding: 10px;
  }
}

/* Pagini de start: antet și meniu compact. */
    /* Variantă de antet testată numai pe paginile de start. */
    .hero-banner.home-hero {
      min-height: 138px;
      padding: 0;
    }
    .home-hero > a {
      position: absolute;
      inset: 0;
      display: block;
    }
    .home-hero .title-container {
      background-color: rgba(255, 255, 255, 0.86);
      border-radius: 0;
      box-shadow: none;
      flex-direction: row;
      justify-content: center;
      gap: clamp(18px, 3vw, 42px);
      padding: 22px 72px;
    }
    .home-hero h1 {
      flex: 0 0 auto;
      font-size: clamp(2rem, 3.3vw, 2.8rem);
      position: relative;
      padding: 0 0 12px;
      letter-spacing: .085em;
      line-height: 1;
      color: #123e59;
      background: linear-gradient(110deg, #103b63 15%, #167a78 65%, #236c56);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      filter: drop-shadow(0 2px 2px rgba(13, 59, 102, .18));
    }
    .home-hero h1::after {
      content: "";
      position: absolute;
      left: 1px;
      bottom: 0;
      width: 78%;
      height: 3px;
      border-radius: 3px;
      background: linear-gradient(90deg, #103b63, #269d86 70%, transparent);
      -webkit-text-fill-color: initial;
    }
    .home-hero p {
      flex: 0 1 690px;
      max-width: 690px;
      margin: 0;
      padding: 0 0 0 clamp(16px, 2vw, 30px);
      border-left: 3px solid #4b938a;
      font-size: clamp(.94rem, 1.5vw, 1.17rem);
      font-weight: 700;
      line-height: 1.35;
      text-align: left;
      text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
    }
    /* Meniu mai suplu, fără a micșora zona de atingere pe mobil. */
    .home-page .navbar { padding: 2px 12px; }
    .home-page .navbar .nav-link { padding: 5px 12px; margin: 1px 3px; }
    @media (max-width: 991.98px) {
      .home-page .navbar { padding: 3px 10px; }
      .home-page .navbar .hamburger {
        min-height: 44px;
        min-width: 44px;
        padding: 6px 10px;
        font-size: 28px;
      }
      .home-page .navbar .nav-link { padding: 11px 14px; margin: 4px 0; }
    }
    /* Când apare hamburgerul, antetul crește după lungimea titlului. */
    @media (max-width: 991.98px) {
      .hero-banner.home-hero {
        min-height: 0;
        display: block;
      }
      .home-hero > a {
        position: relative;
        inset: auto;
        width: 100%;
      }
      .home-hero .title-container {
        position: relative;
        min-height: 150px;
        height: auto;
        flex-direction: column;
        gap: 8px;
        padding: 43px 20px 22px;
      }
      .home-hero p {
        flex: 0 1 auto;
        border-left: 0;
        padding: 0;
        text-align: center;
      }
      .home-page .navbar { position: relative; }
    }
    /* Tabletă: spațiu rezervat pentru acronim și titlul pe mai multe rânduri. */
    @media (min-width: 576px) and (max-width: 991.98px) {
      .hero-banner.home-hero {
        height: 220px;
        min-height: 220px;
      }
      .home-hero > a {
        position: absolute;
        inset: 0;
        width: 100%;
      }
      .home-hero .title-container {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 40px 26px 18px;
      }
      .home-page .navbar { margin-top: 0; }
    }
    @media (max-width: 575.98px) {
      /* Bannerul mobil are propria înălțime; meniul curge după el. */
      .hero-banner.home-hero {
        display: block;
        height: 118px;
        min-height: 118px;
      }
      .home-hero > a {
        position: absolute;
        inset: 0;
        width: 100%;
      }
      .home-hero .title-container {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 30px 16px 10px;
      }
      .home-hero h1 { font-size: clamp(1.9rem, 7vw, 2.5rem); }
      .home-hero p { display: none; }
      .home-page .navbar { margin-top: 0; }
    }
