/* =========================
   Timeline News Slider - Layout Update
   ========================= */

.tns-wrap {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 0 0 rgba(0,0,0,0); /* flat card look */
  overflow: hidden;
  padding: 60px 60px;
}

/* --- Responsive padding --- */
@media (max-width: 1024px) {
  .tns-wrap { padding: 40px 50px; }
}
@media (max-width: 768px) {
  .tns-wrap { padding: 20px 20px; }
}

/* --- DATES ROW --- */
.tns-dates {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 0;
  margin-bottom: 40px;
}

.tns-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  height: 1px;
  background: var(--e-global-color-border, #e5e7eb);
  z-index: 1;
}

.tns-date {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 4px 40px;
  cursor: pointer;
  color: var(--e-global-color-c0b1ca3, #1e40af);
  font-weight: 500;
  font-family: inherit;
  font-size: inherit;
  position: relative;
  transition: color 0.25s;
}

.tns-date:hover {
  color: var(--e-global-color-accent, #0073e6);
}

.tns-date .tns-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--e-global-color-muted, #cbd5e1);
  left: 50%;
  top: 34px;
  transform: translateX(-50%);
  transition: background 0.25s, transform 0.25s;
  z-index: 2;
}

.tns-date.is-active .tns-dot {
  background: var(--e-global-color-accent, #0073e6);
  transform: translateX(-50%) scale(1.25);
}

/* --- BODY GRID --- */
.tns-body {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
}


.tns-texts {
  position: relative;
  min-height: 220px;
  overflow: hidden;
}

.tns-item {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.tns-item.is-active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

.tns-title {
  font-size: var(--e-global-typography-h3-font-size, 28px);
  line-height: 1.3;
  margin: 0 0 12px;
  color: var(--e-global-color-c0b1ca3, #1e40af);
  font-family: inherit;
  font-weight: 600;
}

.tns-title a {
  color: inherit;
  text-decoration: none;
}

.tns-title a:hover {
  text-decoration: underline;
}

.tns-excerpt {
  color: var(--e-global-color-text, #475569);
  font-size: var(--e-global-typography-text-font-size, 16px);
  line-height: 1.6;
  margin: 0 0 20px;
}

/* --- CONTROLS --- */
.tns-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tns-prev,
.tns-next {
  background: none;
  border: 1px solid var(--e-global-color-border, #d1d5db);
  color: #fff;
  font-size: 18px;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s ease;
}



.tns-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 0;
  background: var(--e-global-color-accent, #0073e6);
  color: #fff !important;
  font-weight: 600;
  padding: var(--e-global-control-padding, 12px 24px);
  transition: background 0.25s, color 0.25s;
}


.tns-all::after {
  content: "\f105";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
}

/* --- IMAGE --- */

.tns-image {
  max-width: 320px;
  margin-left: auto;
}

.tns-img {
  display: none;
  width: 100%;
  height: auto;
  border-radius: 0;
  object-fit: cover;
  transition: opacity 0.6s ease;
}

.tns-img.is-active {
  display: block;
  opacity: 1;
}

/* Remove padding from right edge on small screens */
@media (max-width: 1024px) {
  .tns-body { grid-template-columns: 1fr 280px; gap: 20px; }
  .tns-wrap { padding: 40px; }
  .tns-image { margin-right: -40px; }
  .tns-title { font-size: 24px; }
}
@media (max-width: 768px) {
  .tns-body {
    grid-template-columns: 1fr;
  }
  .tns-image {
    order: -1;
    margin-right: 0;
    margin-bottom: 20px;
  }
  .tns-wrap {
    padding: 24px;
  }
  .tns-title {
    font-size: 22px;
  }
  .tns-excerpt {
    font-size: 15px;
  }
}

/* --- Updated Grid Layout to move dates beside text --- */
.tns-body {
  display: grid;
  grid-template-columns: 1.2fr 320px;
  grid-template-areas:
    "dates image"
    "texts image";
  gap: 0px;
  align-items: start;
}

/* Move .tns-dates inside the grid flow */
.tns-dates {
  grid-area: dates;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 0;
  margin-bottom: 48px;
  padding-right: 40px;
}

/* Text section */
.tns-texts {
  grid-area: texts;
  position: relative;
  min-height: 220px;
  overflow: hidden;
  padding-right: 40px;
}

/* Image stays on the right */
.tns-image {
  grid-area: image;
  position: relative;
  margin-right: -60px;
  margin-top: -60px;
  margin-bottom: -60px;
  align-self: stretch;
}

@media (max-width: 1024px) {
  .tns-body {
    grid-template-columns: 1fr 280px;
    grid-template-areas:
      "dates image"
      "texts image";
    gap: 20px;
  }
  .tns-image { margin-right: -40px; }
}

@media (max-width: 768px) {
  .tns-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "dates"
      "texts";
  }
  .tns-image {
    margin: 0px 0px 0px 0px;
    max-width: none;
  }
  .tns-dates {
    padding-right: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
margin-bottom: 48px;
  }
  .tns-dates::-webkit-scrollbar {
    display: none;
  }
  .tns-texts {
    padding-right: 0;
  }
}

button.tns-date {
  padding: 0px;
}

/* Hide dates beyond mobile limit on mobile */
@media (max-width: 768px) {
  .tns-date.tns-mobile-hidden {
    display: none !important;
  }
}
