/* ============================================================
   MEBL – About Us Styles
   ============================================================ */

.page-spacer {
  height: 110px;
  background: var(--primary-color);
}

/* -- Text+BG Section --------------------------------------- */
.text-bg-section {
  min-height: 60vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

.text-bg-section.bg-right {
  background-size: contain;
  background-position: right center;
  background-repeat: no-repeat;
}

.text-bg-section.bg-right::before {
  background: transparent;
}

.text-bg-section::before {
  content: '';
  position: absolute;
  inset: 0;
  /* background: rgba(16,65,97,0.6); */
}

.text-bg-section.light-overlay::before {
  background: rgba(255, 255, 255, 0.4);
}

.text-bg-content {
  position: relative;
  z-index: 1;
  color: var(--primary-color);
  padding: 8rem 4rem;
  max-width: var(--screen-width-limit);
  margin: 0 auto;
  width: 100%;
}

.text-bg-section.light-overlay .text-bg-content {
  color: var(--primary-color);
}

.text-bg-label {
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  /* opacity: 0.7; */
}

.text-bg-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.text-bg-desc {
  font-size: 1rem;
  line-height: 1.85;
  max-width: 560px;
}

/* -- Text + Image Side ------------------------------------ */
.text-image-section {
  padding: 10rem 4rem;
  max-width: var(--screen-width-limit);
  margin: 0 auto;
  display: flex;
  gap: 4rem;
  align-items: center;
  color: var(--primary-color);
}

.text-image-text {
  flex: 1;
}

.text-image-label {
  font-size: 1rem;
  /* font-weight: 700; */
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  /* opacity: 0.6; */
}

.text-image-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.text-image-desc {
  font-size: 1rem;
  line-height: 1.85;
}

.text-image-img {
  flex-basis: 40%;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  height: 250px;
  padding-left: 4rem;
  padding-right: 4rem;
  overflow: hidden;

}

.text-image-img img {
  width: 100%;
  height: 100%;
  object-fit: contain; 
  /* object-fit: fill */
}

/* -- Timeline -------------------------------------------- */
.timeline-section {
  background: var(--primary-color);
  padding: 5rem 2rem;
  color: white;
}

.timeline-header {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.timeline-header h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.timeline-header p {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.85;
  white-space: pre-line;
}

.timeline-list {
  max-width: var(--screen-width-limit);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  gap: 4rem;
  align-items: center;
  padding: 3rem 0;
  position: relative;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--secondary-color);
  z-index: 1;
}

.timeline-content {
  flex: 1;
  text-align: right;
  padding-right: 4rem;
}

.timeline-item:nth-child(even) .timeline-content {
  text-align: left;
  padding-right: 0;
  padding-left: 4rem;
}

.timeline-year {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.timeline-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.timeline-desc {
  font-size: 0.9rem;
  line-height: 1.8;
  opacity: 0.85;
}

.timeline-img {
  flex: 1;
  padding-left: 4rem;
}

.timeline-item:nth-child(even) .timeline-img {
  padding-left: 0;
  padding-right: 4rem;
}

.timeline-img img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 8px;
}

/* -- Horizontal Scroll Timeline -------------------------- */
.htl-container {
  background: var(--primary-color);
}

.htl-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

.htl-track {
  display: flex;
  width: 100%;
  transition: transform 0.25s ease-out;
  will-change: transform;
}

.htl-card {
  flex-shrink: 0;
  flex-basis: 500px;
  height: 100vh;
  /* display: flex; */
  flex-direction: column;
  gap: 6px;
  padding: 2rem;
  padding-top: 150px;
  position: relative;
  color: white;
  overflow: hidden;
}

.htl-heading {
  background-color: var(--primary-color);
  justify-content: center;
}

.htl-heading-bottom-img {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  object-fit: contain;
  object-position: bottom center;
}

.htl-heading-title {
  font-size: 2rem;
  font-weight: 900;
  width: 100%;
  margin-bottom: 8px;
}

.htl-heading-desc {
  font-size: 1rem;
  line-height: 1.85;
  width: 100%;
  white-space: pre-line;
  /* opacity: 0.85; */
}

.htl-primary {
  background-color: var(--primary-color);
}

.htl-secondary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.htl-first {
  background-size: cover;
  background-position: center;
}

.htl-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: rgba(255, 255, 255, 0.1);
}

.htl-first .htl-card-img {
  visibility: hidden;
}

.htl-year {
  padding-top: 1rem;
  padding-bottom: 1rem;
  /* padding-top: 1rem; */
  /* padding-bottom: 0.5rem; */
  width: 100%;
  font-size: 2rem;
  font-weight: 900;
}

.htl-primary .htl-year {
  color: var(--secondary-color);
}

.htl-secondary .htl-year {
  color: var(--primary-color);
}

.htl-line {
  border: none;
  border-top: 1px solid currentColor;
  width: 200%;
  margin: 0;
  opacity: 0.4;
}

.htl-mark {
  width: 3px;
  height: 20px;
  background: white;
  margin-right: auto;
  transform: translateY(-15px);
}

.htl-secondary .htl-mark {
  background: var(--primary-color);
}

.htl-card-title {
  /* padding-top: 1rem; */
  width: 100%;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 40px;
}

.htl-card-desc {
  font-size: 0.9rem;
  width: 100%;
  line-height: 1.7;
  opacity: 0.85;
  overflow-y: auto;
}

/* -- Markets Map ----------------------------------------- */
.markets-section {
  background-color: #efefef;
  position: relative;
  color: var(--primary-color);
}

.markets-wrapper {
  max-width: var(--screen-width-limit);
  margin: 0 auto;
  padding: 12rem 4rem 16rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.markets-text-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
}

.markets-text-section h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.markets-text-section p {
  font-size: 1rem;
  line-height: 1.8;
}

.markets-labels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.markets-btn-existing,
.markets-btn-new {
  display: block;
  padding: 0.5rem 1rem;
  width: 300px;
  color: white;
  font-family: var(--font-main);
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-align: left;
}

.markets-btn-existing {
  background-color: #156b5e;
}

.markets-btn-new {
  background-color: var(--primary-color);
}

.markets-img {
  position: absolute;
  height: 100%;
  right: max(2rem, 5vw);
  top: 0;
  transform: scale(1.1);
  transform-origin: center center;
  object-fit: contain;
  max-width: none;
  width: auto;
}

/* -- Responsive ------------------------------------------ */
@media screen and (max-width: 780px) {
  .text-bg-content {
    padding: 4rem 1.5rem;
  }

  .text-bg-title {
    font-size: 1.5rem;
  }

  .text-image-section {
    flex-direction: column;
    padding: 3rem 1.5rem;
    gap: 2rem;
  }

  /* Carousel: disable scroll-driven animation, use touch scroll-snap */
  .htl-container {
    height: auto !important;
    overflow: hidden;
  }

  .htl-sticky {
    position: relative;
    top: auto;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .htl-sticky::-webkit-scrollbar {
    display: none;
  }

  .htl-track {
    transform: none !important;
    transition: none;
    width: max-content;
  }

  .htl-card {
    width: 85vw !important;
    flex-basis: 85vw !important;
    height: 90vw;
    min-height: 480px;
    scroll-snap-align: start;
    padding-top: 2.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .htl-heading {
    min-height: 480px;
    height: 90vw;
  }

  .htl-heading-title {
    font-size: 1.5rem;
  }

  .htl-year {
    font-size: 1.5rem;
  }

  .htl-card-title {
    font-size: 1.1rem;
    min-height: 60px;
  }

  /* Markets: mobile stacked layout */
  .markets-wrapper {
    flex-direction: column-reverse;
    gap: 1.5rem;
    padding: 2.5rem;
  }

  .markets-text-section {
    max-width: none;
  }

  .markets-text-section h2 {
    font-size: 1.5rem;
  }

  .markets-labels {
    flex-direction: row;
    gap: 0.75rem;
  }

  .markets-btn-existing,
  .markets-btn-new {
    width: auto;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.5rem;
  }

  .markets-image-container {
    position: relative;
    height: 420px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .markets-img {
    position: relative;
    width: 100%;
    height: 100%;
    right: 30%;

    transform: scale(1.8);
    top: auto;
    /* transform: none;
    max-width: none; */
    object-fit: contain;
  }
}