/* Resetări generale */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f9f9f9;
  color: #333;
}

/* pentru layout pe toată înălțimea (ca footer-ul să stea jos natural) */
html, body {
  height: 100%;
}

/* wrapper-ul .main din lm.php */
.main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container principal */
#main_container {
  width: 100%;
  padding: 3%;
  background-color: #f9f9f9;
  flex: 1 0 auto;      /* ocupă tot spațiul între header și footer */
  min-height: 70vh;    /* ca să nu vezi „gaură” / schimbare de culoare înainte de JS */
}

/* Container pentru conținut */
.content-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

html {
  overflow-y: scroll; /* Forțează scrollbar-ul vertical */
}

.fade-in-text {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fade-in-text.visible {
  opacity: 1;
}

/* Stil pentru linii */
.line {
  margin-bottom: 3px;
  display: flex;
  gap: 10px;
}

.line.large {
  flex-direction: column;
  align-items: center;
}

.line.two {
  justify-content: space-between;
}

.line.largeText {
  justify-content: space-between;
}

/* Imagini mari – DESKTOP */
.large-image {
  position: relative;
  text-align: center;
  margin-bottom: 20px;
  width: 100%;
  max-width: 1400px;
  aspect-ratio: 16 / 6; /* Raport de aspect lat și îngust */
  background-color: #f8f8fc;
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.large-image img {
  height: 80vh; /* 80% din înălțimea ferestrei – rămâne așa pe desktop */
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  object-fit: cover;
  border-radius: 15px;
  transition: transform 0.4s ease;
}

.large-image img:hover {
  transform: scale(1.02);
}

/* Text peste imagini mari – desktop */
.text-overlay {
  position: absolute;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: white;
  font-size: 1.6em;
  font-weight: bold;
  text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  transform: translate(-50%, -70%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.text-overlay.scroll-active,
.text-overlay.fade-in-text.visible {
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* Poziționări pentru text */
.text-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.text-top-left {
  top: 15%;
  left: 20%;
}

.text-top-right {
  top: 15%;
  right: 20%;
}

.text-bottom-left {
  bottom: 10%;
  left: 10%;
}

.text-bottom-right {
  bottom: 10%;
  right: 10%;
}

/* Imagini mici – DESKTOP */
.small-image {
  flex: 1;
  text-align: center;
  position: relative;
  background-color: #fcfcfc;
  padding: 30px;
  border-radius: 15px;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  justify-content: space-between;
  margin: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.small-image img {
  width: 100%;
  aspect-ratio: 2 / 1.4;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

.small-image:hover {
  transform: scale(1.02);
  background-color: #eef3fa;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
}

/* Text sub imagini mici */
.small-image .text {
  margin-top: 15px;
  font-size: 1em;
  font-weight: 500;
  color: #333;
}

/* Text-container – simplu, alb, stil „card” */
.text-container {
  flex: 1;
  display: flex;
  justify-content: left;
  align-items: center;
  text-align: left;
  padding: 30px;
  font-size: 1.2em;
  font-weight: 300;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background-size: cover;
  background-position: center;
  background-color: #ffffff;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  line-height: 1.6;
  letter-spacing: 0.03em;
  margin: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.text-container p {
  margin: 0;
}

.text-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

/* Fade-in efect */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Două imagini cu text – DESKTOP */
.twoImagesWithText .image-container {
  position: relative;
  width: 70%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.twoImagesWithText .image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.twoImagesWithText .image-container img:hover {
  transform: scale(1.05);
}

.twoImagesWithText .text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2em;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding: 0.3em 0.7em;
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
}

.twoImagesWithText .image-container:hover .text-overlay {
  opacity: 1;
  transform: translate(-50%, -40%);
}

/* Fundaluri colorate */
.bg-gray {
  background-color: #f0f0f0;
  color: #333333;
}

.bg-white {
  background-color: #ffffff;
  color: #333333;
}

.bg-yellow {
  background-color: #fef8e0;
  color: #ffffff;
}

.bg-blue {
  background-color: #e0f7fa;
  color: #004d63;
}

.bg-green {
  background-color: #e0f8e0;
  color: #004d00;
}

/* Adaptări pentru mobil – toate imaginile VERTICALE, textul sub imagine
   + rotunjime mai fină, padding/margin reduse, stil mai aerisit/profi */
@media (max-width: 768px) {
  /* Container principal */
  #main_container {
    padding: 16px;
  }

  .content-container {
    gap: 18px;
  }

  /* Imagini mari – card vertical, text sub imagine */
  .large-image {
    max-width: 100%;
    padding: 0;
    aspect-ratio: auto;
    height: auto;
    display: block;
    background-color: transparent;
    box-shadow: none;
    margin-bottom: 18px;
    border-radius: 0;
  }

  .large-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;  /* FORMAT VERTICAL */
    object-fit: cover;    /* zoom / crop, fără întindere */
    border-radius: 10px;  /* rotunjime mai fină */
    display: block;
  }

  /* text-ul devine subtitlu sub imagine, nu overlay */
  .large-image .text-overlay {
    position: static;
    transform: none !important;
    opacity: 1 !important;
    margin-top: 6px;
    text-shadow: none;
    white-space: normal;
    font-size: 0.9rem;
    color: #111827;
    background: none;
    padding: 0;
    text-align: left;
  }

  /* Imagini mici – verticale, mai puțin padding/margine */
  .small-image {
    display: block;
    padding: 0;
    margin: 0 0 16px 0;
    background-color: transparent;
    box-shadow: none;
  }

  .small-image img {
    width: 100%;
    aspect-ratio: 3 / 4;  /* FORMAT VERTICAL */
    object-fit: cover;
    height: auto;
    border-radius: 10px;  /* rotunjime mai fină */
  }

  .small-image .text {
    font-size: 0.9em;
    background-color: transparent;
    border-radius: 0;
    text-align: left;
    margin-top: 6px;
  }

  /* Două imagini cu text – fiecare imagine verticală, mai aerisit */
  .twoImagesWithText {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .twoImagesWithText .image-container {
    width: 100%;
    aspect-ratio: auto;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
  }

  .twoImagesWithText .image-container img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;  /* FORMAT VERTICAL */
    object-fit: cover;
    border-radius: 10px;
  }

  .twoImagesWithText .text-overlay {
    font-size: 0.85em;
    padding: 5px 10px;
    background-color: #00000080;
    border-radius: 999px;
  }

  /* Text-container mai compact pe mobil, mai aerisit, rotunjime fină */
  .text-container {
    font-size: 1.1em;
    line-height: 1.4;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 10px;
    text-align: left;
    margin: 8px 0;
    box-shadow: none;
    box-sizing: border-box;
    display: block;
  }

  .text-container p {
    margin: 0;
  }

  /* DOAR text-container-ele cu background imagine – formă de poză, text jos */
  .text-container.has-bg-image {
    width: 100%;
    aspect-ratio: 3 / 4;       /* dreptunghi vertical, ca poza */
    display: flex;
    align-items: flex-end;     /* textul la baza cardului */
    justify-content: flex-start;
    padding: 16px;
  }
  .text-container:hover {
    transform: none;
    box-shadow: none;
  }

  /* Imagine verticală și în text-container-1 (ex: bg-yellow) */
  .text-container-1 img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    display: block;
  }

  /* Structuri pe linii */
  .line {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* mage-and-text-row-1 - elemente una sub alta */
  .mage-and-text-row-1 {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .mage-and-text-row-1 .image-container,
  .mage-and-text-row-1 .text-container {
    width: 100%;
  }

  .text-top-left {
    top: 15%;
    left: 30%;
  }

  .text-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
