/* Styles for the Blog section + blog article pages (hand-written, not from the Vite build). */

/* Home page: featured blog card (image left, text right on desktop) */
.itb-blog-card {
  display: grid;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}
.itb-blog-card__media {
  position: relative;
  height: 18rem;
  overflow: hidden;
  background: hsl(var(--muted));
}
.itb-blog-card__media img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform 500ms ease-out;
}
.itb-blog-card:hover .itb-blog-card__media img {
  transform: scale(1.05);
}
.itb-blog-card__footer {
  margin-top: auto;
  padding-top: 1.75rem;
}
.itb-chip {
  background-color: hsl(var(--primary) / 0.12);
}
.itb-blog-grid {
  /* flex (not grid) so a leftover card on the last row sits centered */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  max-width: 72rem;
  margin: 1.5rem auto 0;
}
.itb-blog-grid > * {
  width: 100%;
  height: auto; /* let cards in a row stretch to the tallest one */
  display: flex;
}
.itb-blog-grid > * > article {
  flex: 1;
}
@media (min-width: 768px) {
  .itb-blog-card {
    grid-template-columns: 1fr 1fr;
    min-height: 380px;
  }
  .itb-blog-card__media {
    height: auto;
  }
  /* image fills the column; the text side decides the card height */
  .itb-blog-card .itb-blog-card__media img {
    position: absolute;
    inset: 0;
  }
  .itb-blog-grid > * {
    width: calc((100% - 1.5rem) / 2);
  }
}
/* 3 cards per row on wide screens */
@media (min-width: 1024px) {
  .itb-blog-grid > * {
    width: calc((100% - 3rem) / 3);
  }
}

/* Article page */
.itb-article-figure {
  margin: 2.25rem 0 0;
}
.itb-article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border));
}
.itb-article-figure figcaption {
  margin-top: 0.625rem;
  text-align: center;
  font-size: 13px;
  font-style: italic;
  color: hsl(var(--muted-foreground));
}
.itb-article strong {
  font-weight: 700;
  color: hsl(var(--foreground));
}

/* Home card without image (text only) */
.itb-blog-card.itb-blog-card--text {
  grid-template-columns: 1fr;
  min-height: 0;
  max-width: 48rem;
}

/* Side-by-side photos inside an article section */
.itb-figure-row {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.itb-figure-row .itb-article-figure {
  margin: 0;
}
.itb-figure-row .itb-article-figure img {
  aspect-ratio: 3 / 4;
  height: auto;
  max-height: none;
  object-position: 50% 40%;
}
@media (min-width: 640px) {
  .itb-figure-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* A single (landscape) photo under a section: full width, no crop */
.itb-figure-row.itb-figure-row--single {
  grid-template-columns: 1fr;
}
.itb-figure-row--single .itb-article-figure img {
  aspect-ratio: auto;
}

/* Bulleted list inside an article section */
.itb-list {
  margin-top: 0.75rem;
  padding-left: 1.5rem;
  list-style: disc;
}
.itb-list li + li {
  margin-top: 0.375rem;
}
.itb-list li::marker {
  color: hsl(var(--primary));
}

/* Blogs section: auto-scrolling carousel (all screen sizes) */
.itb-carousel {
  margin: 0 -1.5rem;
  padding: 0.75rem 0 1.5rem; /* room for card hover shadow */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  /* soft fade on both edges */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}
.itb-carousel::-webkit-scrollbar {
  display: none;
}
.itb-carousel__item {
  width: 290px;
  margin: 0 0.625rem;
}
@media (min-width: 768px) {
  .itb-carousel__item {
    width: 360px;
    margin: 0 0.75rem;
  }
}
