/* ==========================
   INDEX PAGE
   ========================== */

.index-intro {
  margin-bottom: 2em;
  text-align: center;
  font-size: 1.2em;
}

.scroll-wrapper {
  position: relative;
  margin: 2em auto;
  width: 800px;
  /* or max-width: 800px; if you want it to shrink on smaller viewports */
  overflow: hidden;
}

.scroll-container {
  display: flex;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.scroll-card {
  flex: 0 0 100%;
  width: 100%;
  max-width: 800px;
  background: #1f1d2e;
  border: 1px solid #45a29e;
  border-radius: 12px;
  padding: 1em; /* reduce padding if you want less interior space */
  scroll-snap-align: center;

  display: flex;
  align-items: center;
  gap: 1em;
  box-sizing: border-box;
  
  /* Optional: set a max-height if you want a fixed height */
  max-height: 400px; /* adjust as needed */
  overflow: hidden; /* hide any overflow inside card */
}

.scroll-card img {
  width: 50%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0; /* don’t let it shrink smaller */
}

.scroll-card .card-text {
  width: 50%;
  /* if needed, constrain height or scroll inside text */
  overflow: auto;
}
/* Hide scrollbar inside container if necessary */
.scroll-container::-webkit-scrollbar {
  display: none;
}
.scroll-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Scroll Buttons */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #45a29e;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.5em;
  z-index: 10;
}

.left-btn {
  left: -60px; /* adjust as needed */
}

.right-btn {
  right: -60px;
}

/* Optional: Hide scrollbar for all browsers */
.scroll-container::-webkit-scrollbar {
  display: none;
}
.scroll-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}


/* Dots */
.dots-container {
  text-align: center;
  margin-top: 1em;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: grey;
  border-radius: 50%;
  margin: 0 4px;
}
.dot.active {
  background: #45a29e;
}

/* --- ARTICLE GRID --- */
.grid-container {
  margin: 1em auto;
  max-width: 1200px;
  padding: 0 1em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- ARTICLE CARD --- */
.article {
  flex: 0 0 100%;
  width: 100%;
  max-width: 800px;
  background: #1f1d2e;
  border: 1px solid #45a29e;
  border-radius: 12px;
  padding: 1em; /* reduce padding if you want less interior space */
  scroll-snap-align: center;

  display: flex;
  align-items: center;
  gap: 1em;
  box-sizing: border-box;
  
  /* Optional: set a max-height if you want a fixed height */
  max-height: 400px; /* adjust as needed */
  overflow: hidden; /* hide any overflow inside card */

  position: relative; /* Needed for absolutely positioning the tag */
}

.article:hover {
  transform: translateY(-5px);
}

.article a {
  display: flex;
  align-items: stretch;   /* Make image + text fill same vertical height */
  width: 100%;
  height: 100%;
  gap: 1em;
  color: inherit;
  text-decoration: none;
  padding: 0.75em;
}

/* --- IMAGE --- */
.article img {
  width: 40%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
  position: relative;
  border-radius: 8px;
  overflow: hidden ;
}

/* --- TEXT --- */

.article .card-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  object-fit: cover;
  flex: 1;                 /* fills the rest of the row */
  padding-right: 0.5em;  /* space between text and right edge */
  min-width: 0;            /* allows text wrapping inside flexbox */
}

.article h2 {
  font-size: 1rem;
  margin-bottom: 0.4em;
  color: #fff;

}

.article h2,
.article p {
  overflow-wrap: break-word; /* ensures long words wrap */
  word-break: break-word;    /* additional safeguard */
}

.article p {
  font-size: 0.85rem;
  color: #ccc;
  margin: 0;
}

/* --- TAGS --- */
.article .tags {
 position: absolute;
 bottom: 0.75em;
 left: 0.75em;
 margin: 0;
 z-index: 2;
}

.article .tag {
  display: inline-block;
  background: #45a29e;
  color: #1f1d2e;
  border-radius: 8px;
  padding: 0.25em 0.6em;
  margin-right: 6px;
  font-size: 0.8em;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.9;
}

.tag:hover {
  background: #66fcf1;
  color: #0b0c10;
  opacity: 1;
}




/* --- RESPONSIVE BEHAVIOR --- */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .article a {
    flex-direction: column;
  }

  .article img {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

