html,
body {
  height: 100%;
}

.atlas-resolution-2 .atlas-list {
  flex-basis: 34%;
}

.atlas-resolution-2 .atlas-page .content-fieldset {
  width: 92%;
  max-width: 92%;
}

.atlas-resolution-2 .atlas-map #map {
  min-height: 360px;
}

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

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 1140px;
  padding-left: 15px;
  padding-right: 15px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.container.atlas-page {
  max-width: 100%;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
  min-height: 0;
  overflow: hidden;
}

.atlas-page .content-fieldset {
  width: 90%;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.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;
}

.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;
  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;
  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);
}

.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;
}

.navbar {
  background: linear-gradient(
    to bottom,
    #c5d5a5,
    #ddebcf
  );
  font-family: 'Merriweather', serif;
  padding: 6px 10px;
}

.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;
}

.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 {
  display: none;
  cursor: pointer;
  margin-left: auto;
  user-select: none;
  min-width: 48px;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 34px;
  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;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(10, 61, 98, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  width: 100%;
  margin-bottom: 10px;
}

.search-bar:hover,
.search-bar:focus-within {
  border-color: rgba(10, 61, 98, 0.5);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.search-field {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-color);
  font-size: 0.95rem;
  flex: 1;
  font-family: 'Crimson Text', serif;
  letter-spacing: 0.02em;
}

.search-field::placeholder {
  color: rgba(10, 61, 98, 0.5);
}

.search-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  margin-left: 8px;
  flex-shrink: 0;
  outline: none;
}

.search-icon:focus {
  outline: none;
  background-color: rgba(10, 61, 98, 0.05);
  border-radius: 4px;
}

.search-icon svg {
  stroke: rgba(10, 61, 98, 0.3);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.search-icon:hover svg {
  opacity: 0.9;
  transform: scale(1.1);
}

.content-fieldset {
  flex: 1;
  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;
  overflow: hidden;
}

.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;
}

.map,
#map {
  width: 100%;
  height: clamp(320px, 60vh, 600px);
  margin-bottom: 20px;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
}

.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;
}

.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;
}

@media (max-width: 991.98px) {
  .hamburger {
    display: flex;
  }

  .navbar {
    padding: 6px 10px;
  }

  #navbarNav {
    display: none;
    width: 100%;
  }

  #navbarNav.is-open {
    display: block;
  }

  .navbar-nav {
    margin-left: 0;
    padding: 10px 0;
  }

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

  .hero-banner .title-container {
    padding: 14px 12px;
    border-radius: 10px;
  }

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

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

@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;
  }
}

.atlas-layout {
  display: flex;
  gap: 12px;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.atlas-panel {
  border: 2px solid #c5d5a5;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  min-height: 0;
}

.atlas-list {
  flex: 0 0 22%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.atlas-map {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #ffffff;
}

.atlas-search {
  position: relative;
  margin-bottom: 10px;
}

.atlas-search input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  outline: none;
}

.atlas-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
}

.atlas-list-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 8px;
  padding-right: 4px;
}

.atlas-list-scroll::-webkit-scrollbar {
  width: 5px;
}

.atlas-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.atlas-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}

.atlas-list-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
}

.atlas-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: #f8f9fa;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.atlas-item:hover {
  background: #eef3ea;
}

.atlas-item-active {
  border-color: rgba(13, 59, 102, 0.35);
  box-shadow: 0 0 0 2px rgba(13, 59, 102, 0.12);
  background: #ffffff;
}

.atlas-item-found {
  border-color: #2e7d32 !important;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.25) !important;
  background: #f0faf0 !important;
  animation: highlightPulse 0.7s ease;
}

@keyframes highlightPulse {
  0% {
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.55);
  }

  50% {
    box-shadow: 0 0 0 9px rgba(46, 125, 50, 0.12);
  }

  100% {
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.25);
  }
}

.atlas-item-nr {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.60;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.atlas-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 2px;
  line-height: 1.3;
}

.atlas-item-q {
  font-size: 0.80rem;
  margin-top: 3px;
  opacity: 0.80;
  line-height: 1.35;
}

.atlas-map #map {
  flex: 1;
  height: auto;
  min-height: 320px;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

@media (max-width: 991.98px) {
  .atlas-layout {
    flex-direction: column;
  }

  .atlas-list {
    flex: 0 0 auto;
  }

  .atlas-list-scroll {
    max-height: 260px;
  }

  .atlas-map #map {
    min-height: 360px;
  }
}

.search-results-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  margin-top: -3px;
  margin-bottom: 8px;
  padding: 4px 6px 4px 8px;
  border: 1px solid rgba(171, 132, 20, 0.22);
  border-radius: 7px;
  background: #fff4c7;
  font-size: 0.78rem;
  color: #725c22;
}

.search-results-nav.is-visible {
  display: flex;
}

.search-results-count {
  white-space: nowrap;
  font-size: 0.77rem;
  color: #725c22;
}

.search-results-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-results-position {
  min-width: 42px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #725c22;
}

.search-nav-button {
  width: 28px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(171, 132, 20, 0.30);
  border-radius: 5px;
  background: #ffffff;
  color: #725c22;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.search-nav-button:hover {
  background: #ffedaa;
  border-color: rgba(171, 132, 20, 0.55);
}

.search-nav-button:disabled {
  opacity: 0.35;
  cursor: default;
  background: #ffffff;
}

.search-clear-button {
  font-size: 20px;
  font-weight: 700;
}

.atlas-item.atlas-item-search-match {
  background: #fff4c7 !important;
  border-color: rgba(210, 164, 33, 0.42) !important;
}

.atlas-item.atlas-item-search-match:hover {
  background: #ffedaa !important;
}

.atlas-item.atlas-item-search-current {
  background: #ffe89a !important;
  border-color: #d5a72d !important;
  box-shadow:
    0 0 0 2px rgba(213, 167, 45, 0.22) !important;
}

.map-tools-control {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
  background: #f1f1f1;
  border: 1px solid rgba(90, 90, 90, 0.35);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.map-tools-control button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(171, 132, 20, 0.30);
  border-radius: 5px;
  background: #ffffff;
  color: #333333;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.map-tools-control button:hover {
  background: #ffedaa;
}

.map-tools-control button:disabled {
  opacity: 0.4;
  cursor: default;
}

.map-tools-control svg {
  display: block;
  width: 19px;
  height: 19px;
}

/* Atlas pe tabletă și telefon: două panouri suprapuse, pagină derulabilă. */
@media (max-width: 991.98px) {
  html {
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.atlas-view {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .atlas-view .container.atlas-page {
    flex: 0 0 auto;
    overflow: visible;
    padding: 12px 16px 28px;
  }

  .atlas-view .atlas-page .content-fieldset {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow: visible;
  }

  .atlas-view .atlas-layout {
    flex: 0 0 auto;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .atlas-view .atlas-list {
    flex: 0 0 auto;
    overflow: hidden;
  }

  .atlas-view .atlas-list-scroll {
    flex: 0 1 auto;
    height: clamp(125px, 20vh, 190px);
    max-height: 190px;
    overflow-y: auto;
  }

  .atlas-view .atlas-map {
    flex: 0 0 auto;
    overflow: visible;
  }

  .atlas-view .atlas-map #map {
    flex: none;
    height: max(600px, calc((100vw - 70px) * var(--atlas-image-ratio, 1.193)));
    min-height: 600px;
    touch-action: pan-y;
    margin-bottom: 0;
  }
}

@media (max-width: 575.98px) {
  .atlas-view .container.atlas-page {
    padding: 12px 8px 24px;
  }

  .atlas-view .atlas-page .content-fieldset {
    padding: 8px;
  }

  .atlas-view .atlas-map #map {
    height: max(560px, calc((100vw - 46px) * var(--atlas-image-ratio, 1.193)));
    min-height: 560px;
  }
}

/* În listă, fiecare hartă este un buton interactiv, inclusiv pe ecrane mici. */
.atlas-view .atlas-list .atlas-item {
  color: #253745;
  cursor: pointer;
}

.atlas-view .atlas-list .atlas-item:hover,
.atlas-view .atlas-list .atlas-item:focus-visible {
  color: #0d3b66;
  background-color: #e7f0e8;
  border-color: #6d9c88;
  box-shadow: 0 2px 8px rgba(13, 59, 102, .15);
  outline: none;
}

.atlas-view .atlas-list .atlas-item.atlas-item-active {
  color: #0d3b66;
  border-color: #427c7c;
  background-color: #f0f7f4;
}

.atlas-view .atlas-list .atlas-item.atlas-item-active:hover,
.atlas-view .atlas-list .atlas-item.atlas-item-active:focus-visible {
  background-color: #dcece6;
  border-color: #2f7775;
}
