/* =========================================================
   Nieuwste blogs — aoo-latest-posts
   assets/css/aoo/components/latest-posts.css
   ========================================================= */

/* =========================================================
   Sectie wrapper
   Gebruik !important om inline-gebundelde CSS te overwinnen
   ========================================================= */

.aoo-latest-posts {
  background: #f5f0eb !important;
  padding: clamp(10px, 1.5vw, 18px) 0;
  border-radius: 16px;
  margin-top: 15px;
  --aoo-accent: var(--brand, #b03a2e);
}

/* Forceer ook op mobiel — voorkomt overschrijving door andere regels */
@media (max-width: 640px) {
  .aoo-latest-posts {
    background: #f5f0eb !important;
    border-radius: 10px;
  }
}

.aoo-latest-posts,
.aoo-latest-posts * {
  box-sizing: border-box;
}

.aoo-latest-posts__inner {
  width: min(1200px, 92vw);
  margin: 0 auto;
}


/* =========================================================
   Header
   ========================================================= */

.aoo-latest-posts__header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 0 clamp(14px, 2vw, 28px);
}

.aoo-latest-posts__title {
  margin: 0;
  color: #1a1a1a;
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}


/* =========================================================
   Slider frame & viewport
   De viewport heeft overflow-x:auto — pijltjes staan
   BUITEN de viewport maar BINNEN het frame (overflow:visible)
   ========================================================= */

.aoo-latest-posts__frame {
  position: relative;
  /* overflow visible zodat pijltjes zichtbaar zijn buiten de scroll-baan */
  overflow: visible;
}

.aoo-latest-posts__viewport {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  /* Zijpadding zorgt dat kaarten niet achter de pijltjes vallen */
  padding: 8px clamp(52px, 5vw, 64px) 16px;
  scroll-padding-left: clamp(52px, 5vw, 64px);
  scroll-padding-right: clamp(52px, 5vw, 64px);
  scrollbar-width: none;
  /* Clip alleen verticaal, NIET horizontaal — anders verdwijnen de pijltjes */
  clip-path: none;
}

.aoo-latest-posts__viewport::-webkit-scrollbar {
  display: none;
}


/* =========================================================
   Post cards
   ========================================================= */

.aoo-latest-posts .aoo-post-card {
  flex: 0 0 calc((100% - 40px) / 3);
  min-width: 260px;
  background: #fff;
  border-radius: 10px;
  scroll-snap-align: start;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  max-width: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.aoo-latest-posts .aoo-post-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

@media (max-width: 980px) {
  .aoo-latest-posts .aoo-post-card {
    flex-basis: calc((100% - 20px) / 2);
  }
}

@media (max-width: 640px) {
  .aoo-latest-posts .aoo-post-card {
    flex-basis: 82%;
  }
}


/* =========================================================
   Thumbnail
   ========================================================= */

.aoo-latest-posts .aoo-post-card__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 0;
  flex-shrink: 0;
}

.aoo-latest-posts .aoo-post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin-bottom: 0 !important;
  transition: transform 0.35s ease;
}

.aoo-latest-posts .aoo-post-card:hover .aoo-post-card__thumb img {
  transform: scale(1.03);
}


/* =========================================================
   Card body
   ========================================================= */

.aoo-latest-posts .aoo-post-card__body {
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.aoo-latest-posts .aoo-post-card__title {
  margin: 0;
  line-height: 1.25;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 700;
  color: #1a1a1a;
}

.aoo-latest-posts .aoo-post-card__title a {
  text-decoration: none;
  color: inherit;
}

.aoo-latest-posts .aoo-post-card__title a:hover {
  color: #b03a2e;
}


/* =========================================================
   Meta: pills + datum
   ========================================================= */

.aoo-latest-posts .aoo-post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.aoo-latest-posts .aoo-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
}

.aoo-latest-posts .aoo-pill--cat {
  background: rgba(176, 58, 46, 0.1);
  color: #7a1f16;
  border: 1px solid rgba(176, 58, 46, 0.2);
}

.aoo-latest-posts .aoo-pill--author {
  background: #f0ede8;
  color: #4a4036;
}

.aoo-latest-posts .aoo-post-card__date {
  font-size: 12px;
  color: #888;
  margin-left: auto;
}


/* =========================================================
   Excerpt
   ========================================================= */

.aoo-latest-posts .aoo-post-card__excerpt {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #555;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* =========================================================
   Lees verder link
   ========================================================= */

.aoo-latest-posts .aoo-post-card__more {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: #b03a2e;
  margin-top: auto;
  transition: gap 0.15s ease;
}

.aoo-latest-posts .aoo-post-card__more:hover {
  gap: 7px;
}


/* =========================================================
   Navigatiepijlen
   Gepositioneerd t.o.v. __frame (overflow:visible)
   top: 50% van de thumbnail = 50% * (aspect 9/16) van kaartbreedte
   Benadering met vaste waarde die goed werkt op alle schermen
   ========================================================= */

.aoo-latest-posts__nav {
  position: absolute;
  /* Midden van de 16:9 thumbnail, niet midden van de hele kaart */
  top: 28%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 20px;
  /* Donker halfTransparant — goed zichtbaar op elke foto */
  background: rgba(20, 20, 20, 0.72);
  color: #fff;
  cursor: pointer;
  z-index: 30;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: background 0.15s ease;
}

.aoo-latest-posts__nav:hover {
  background: #b03a2e;
  box-shadow: 0 4px 14px rgba(176, 58, 46, 0.4);
}

.aoo-latest-posts__nav[disabled] {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.aoo-latest-posts__nav--prev {
  left: 10px;
}

.aoo-latest-posts__nav--next {
  right: 10px;
}

/* Op mobiel pijltjes verbergen — swipe is intuïtiever */
@media (max-width: 640px) {
  .aoo-latest-posts__nav {
    display: none;
  }
}


/* =========================================================
   Dot navigatie
   ========================================================= */

.aoo-latest-posts__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.aoo-latest-posts .aoo-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(26, 26, 26, 0.2);
  transition: background 0.2s, width 0.2s;
}

.aoo-latest-posts .aoo-dot.is-active {
  background: #b03a2e;
  width: 20px;
}


/* =========================================================
   WordPress / GeneratePress conflict reset
   ========================================================= */

.aoo .aoo-latest-posts article.aoo-post-card {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07) !important;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.aoo .aoo-latest-posts .aoo-post-card__thumb img {
  margin-bottom: 0 !important;
  display: block;
}