/**
 * bw_blog front styles — shop-agnostic.
 *
 * Every colour comes from two custom properties, so any shop can rebrand the
 * blog WITHOUT editing this module. Override them in the child theme (e.g.
 * themes/<child>/assets/css/custom.css) and nothing in here changes:
 *
 *   :root {
 *     --bw-blog-accent: #c8102e;   // links, hover, buttons, active pagination
 *     --bw-blog-text:   #1a1a1a;   // headings and card titles
 *   }
 *
 * The defaults below are Bootstrap 5's own primary/body colours, so the module
 * renders sensibly on a bare Hummingbird before any theming is done.
 * @author Boks Webdesign
 */

:root {
  --bw-blog-accent: #0d6efd;
  --bw-blog-text: #212529;
}

.bw-blog { margin-bottom: 2rem; }

/* ---- archive grid ---- */
.bw-blog__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 3 across -> 3x3 with 9 posts/page */
  gap: 28px;
  margin-top: 1rem;
}
.bw-blog__cat-desc { margin-bottom: 1.5rem; }
.bw-blog__empty { padding: 2rem 0; color: #666; }

/* ---- home block (displayHome) ----
 * home.tpl emits bw-blog-home / __head / __title / __subtitle / __grid / __more,
 * and NONE of them had a rule here: the archive styled .bw-blog__grid but the home
 * block's grid class was never covered. Without a grid the cards fall to full
 * container width, and because .bw-blog-card__media has aspect-ratio 16/10 each
 * card then grew to ~961px tall - a 3-post block rendered 3376px high as an
 * unstyled stack. Uses auto-fit rather than a fixed 3 columns because the count is
 * configurable (BW_BLOG_HOME_COUNT), so 2 or 4 posts lay out correctly too. */
.bw-blog-home { margin: 3rem 0; }
.bw-blog-home__head { margin-bottom: 1rem; }
.bw-blog-home__title {
  color: var(--bw-blog-text);
  margin: 0;
}
.bw-blog-home__subtitle {
  margin: .35rem 0 0;
  color: #666;
}
.bw-blog-home__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 1rem;
}
.bw-blog-home__more { margin-top: 1.25rem; }
.bw-blog-home__more-link {
  color: var(--bw-blog-accent);
  font-weight: 600;
  text-decoration: none;
}
.bw-blog-home__more-link:hover,
.bw-blog-home__more-link:focus { text-decoration: underline; }

/* ---- post card ---- */
.bw-blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
}
.bw-blog-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
  transform: translateY(-3px);
}
.bw-blog-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: #f1f1f1;
  overflow: hidden;
}
.bw-blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bw-blog-card__media-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eef3f7, #dce6ee);
}
.bw-blog-card__body {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 16px 18px 18px;
}
.bw-blog-card__cat {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--bw-blog-accent, #0d6efd);
  text-decoration: none;
}
.bw-blog-card__title {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0;
  font-weight: 600;
}
.bw-blog-card__title a { color: var(--bw-blog-text, #212529); text-decoration: none; }
.bw-blog-card__title a:hover { color: var(--bw-blog-accent, #0d6efd); }
.bw-blog-card__date { font-size: 12px; color: #8a8a8a; }
.bw-blog-card__excerpt { font-size: .92rem; color: #555; margin: .25rem 0 .5rem; }
.bw-blog-card__more {
  align-self: flex-start;
  margin-top: auto;
  font-weight: 600;
  color: var(--bw-blog-accent, #0d6efd);
  text-decoration: none;
}
.bw-blog-card__more:hover { text-decoration: underline; }

/* ---- pagination ---- */
.bw-blog__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}
.bw-blog__page {
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--bw-blog-accent, #0d6efd);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.bw-blog__page:hover { filter: brightness(1.05); color: #fff; }
.bw-blog__page-info { color: #666; font-size: .9rem; }

/* ---- single post ---- */
/* live: content sits in a bordered card (1px #f0f0f0 / 5px radius / 30px padding),
   ~1150px wide, with the title INSIDE the card (no separate amber page-header). */
.bw-blog-single {
  max-width: 1150px;
  margin: 0 auto;
  border: 1px solid #f0f0f0;
  border-radius: 5px;
  padding: 30px;
  background: #fff;
}
.bw-blog-single__title {
  font-size: 22px;
  font-weight: 500;
  color: #000;
  text-transform: none;
  line-height: 1.2;
  margin: 0 0 20px;
}
.bw-blog-single__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.bw-blog-single__cat {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--bw-blog-accent, #0d6efd);
  text-decoration: none;
}
.bw-blog-single__date { font-size: 13px; color: #8a8a8a; }
.bw-blog-single__media {
  margin: 0 0 1.5rem;
  border-radius: 10px;
  overflow: hidden;
}
.bw-blog-single__media img { width: 100%; height: auto; display: block; }
.bw-blog-single__content { line-height: 1.7; }
.bw-blog-single__content img { max-width: 100%; height: auto; border-radius: 8px; }
/* gallery slider (horizontal scroll-snap carousel, no JS library) */
.bw-blog-gallery {
  position: relative;
  margin: 1.5rem 0;
}
.bw-blog-gallery__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.bw-blog-gallery__track::-webkit-scrollbar { height: 6px; }
.bw-blog-gallery__track::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 3px; }
.bw-blog-gallery__slide {
  flex: 0 0 auto;
  width: clamp(220px, 46%, 360px);
  scroll-snap-align: start;
}
.bw-blog-gallery__slide img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.bw-blog-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--bw-blog-text, #212529);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  font-size: 24px;
  line-height: 38px;
  cursor: pointer;
}
.bw-blog-gallery__nav:hover { background: var(--bw-blog-accent, #0d6efd); color: #fff; }
.bw-blog-gallery__nav--prev { left: -10px; }
.bw-blog-gallery__nav--next { right: -10px; }
@media (max-width: 575.98px) {
  .bw-blog-gallery__slide { width: 78%; }
  .bw-blog-gallery__nav { display: none; }
}
/* Vorig bericht | Terug | Volgend bericht — 3-column row like live's xipblog nav */
.bw-blog-single__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
.bw-blog-single__nav-prev { flex: 1; text-align: left; }
.bw-blog-single__nav-back { flex: 1; text-align: center; }
.bw-blog-single__nav-next { flex: 1; text-align: right; }
.bw-blog-single__nav a {
  font-weight: 600;
  color: var(--bw-blog-text, #212529);
  text-decoration: none;
}
.bw-blog-single__nav a:hover { color: var(--bw-blog-accent, #0d6efd); }

@media (max-width: 991.98px) {
  .bw-blog__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .bw-blog__grid { grid-template-columns: 1fr; gap: 20px; }
  .bw-blog-home__grid { grid-template-columns: 1fr; gap: 20px; }
}
