:root {
  --bg: #fbf7ef; /* very light cream */
  --text: #1a1a1a;
  --content-w: 760px; /* readable width */
  --max: 860px;
  --gutter: 24px;
}

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--gutter);
}

main.container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 28px var(--gutter) 60px;
}

.site-header {
  border-bottom: 1px solid #ddd;
}

.site-header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.nav a {
  margin-left: 12px;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid #ddd;
  margin-top: 48px;
}
.site-footer p {
  font-size: 14px;
}

.hero {
  /* Constrain hero to the same content column as title/body/CTA. */
  width: 100%;
  margin: 18px 0 14px;
}

.hero img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
}

.pager a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.45);
  color: inherit;
}

.pager__next {
  margin-left: auto;
}

.pager--top {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  align-items: center;
  margin: 0 0 14px;
  gap: 12px;
}

.article-title {
  margin: 0;
  text-align: center;
  font-size: 1.8rem;
  line-height: 1.2;
}

.article--center {
  text-align: center;
}

.article-date {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* Keep title visually centered even if the prev/next labels have different widths. */
.pager--top .pager__prev,
.pager--top .pager__next {
  text-align: center;
  display: inline-flex;
  justify-content: center;
}

.pager--top .pager__prev {
  justify-self: start;
}

.pager--top .pager__next {
  justify-self: end;
  margin-left: 0;
}

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

  .pager--top .pager__prev,
  .pager--top .pager__next {
    padding: 8px 10px;
  }
  .article-title {
    font-size: 1.4rem;
  }
}

.cta-row {
  margin: 10px 0 18px;
  text-align: center;
}

.cta {
  display: block;
  width: min(50%, 520px);
  margin: 0 auto;
  padding: 12px 24px; /* ~50% wider than before */
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #ffffff;
  font-weight: 600;
  color: inherit;
  text-align: center;
}

.post-carousel {
  margin: 30px 0;
}

.post-carousel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.post-carousel__title {
  margin: 0;
}

.post-carousel__controls {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.post-carousel__viewport {
  margin-top: 12px;
  overflow: hidden; /* no scrollbar; buttons control movement */
}

.post-carousel__track {
  display: flex;
  gap: 14px;
  transform: translateX(0);
  transition: transform 260ms ease;
  will-change: transform;
}

.post-card {
  /* 3 visible cards (avoid calc multiplication for Firefox compatibility) */
  flex: 0 0 calc((100% - 28px) / 3);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.post-card a {
  color: inherit;
  text-decoration: none;
  display: flex; /* make the whole card a link */
  flex-direction: column;
  height: 100%;
}

.post-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.post-card__meta {
  padding: 10px 12px;
}
.post-card__title {
  font-weight: 700;
  line-height: 1.2;
}
.post-card__date {
  opacity: 0.75;
  font-size: 0.95rem;
  margin-top: 6px;
}

.carousel-btn {
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* Mobile: 2 visible cards (do NOT collapse to 1) */
@media (max-width: 700px) {
  .post-card {
    flex-basis: calc((100% - 14px) / 2); /* 2 visible cards */
  }
}
