/*
 * Blog Grid — styles for the [apac_blog_grid] shortcode + the blog index
 * banner rendered by home.php.
 *
 * Loaded on pages that contain the shortcode and on the blog index
 * (is_home()), see theme-settings.php.
 */

/* ---------- Blog index banner (home.php) ---------- */

/* GP gives <main id="main"> a default margin-top: 20px in separate-containers
   mode. On the blog index we want the banner to butt right up against the
   header (no white strip in between), so zero out main's vertical margins. */
body.blog #primary > #main {
  margin-top: 0;
  margin-bottom: 0;
}

.hs-blog-banner {
  /* Full-bleed breakout: extend banner to the viewport edges even when it sits
     inside a centered or constrained container (GP's #content, etc). */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: var(--hs-footer, #222334);
  color: var(--hs-footer-text, #E8E8EE);
  padding: 96px 20px;
  text-align: center;
  box-sizing: border-box;
}

.hs-blog-banner__inner {
  max-width: var(--hs-container, 1200px);
  margin: 0 auto;
}

.hs-blog-banner__title {
  margin: 0;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: -0.01em;
}

@media (max-width: 900px) {
  .hs-blog-banner { padding: 72px 20px; }
  .hs-blog-banner__title { font-size: 38px; }
}

@media (max-width: 600px) {
  .hs-blog-banner { padding: 56px 20px; }
  .hs-blog-banner__title { font-size: 30px; }
}

/* ---------- Blog grid ---------- */

.hs-blog-grid {
  display: grid;
  gap: 32px;
  margin: 40px auto;
  max-width: 1140px;
  padding: 0 20px;
  box-sizing: border-box;
}

.hs-blog-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hs-blog-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hs-blog-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.hs-blog-card {
  background: var(--hs-surface, #ffffff);
  border: 1px solid var(--hs-border, #DDDDE2);
  border-radius: var(--hs-radius-card, 10px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--hs-transition, 0.22s ease), box-shadow var(--hs-transition, 0.22s ease);
}

.hs-blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hs-shadow-card-hover, 0 16px 36px rgba(0, 0, 0, 0.1));
}

.hs-blog-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--hs-bg-alt, #F5F4F5);
  overflow: hidden;
}

.hs-blog-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--hs-transition, 0.22s ease);
}

.hs-blog-card:hover .hs-blog-card__image { transform: scale(1.04); }

.hs-blog-card__image--placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--hs-bg-alt, #F5F4F5) 0%, var(--hs-accent-soft, #F5F4F5) 100%);
}

.hs-blog-card__body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.hs-blog-card__meta {
  font-size: 13px;
  color: var(--hs-text, #4A4C57);
  opacity: 0.78;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hs-blog-card__sep { opacity: 0.6; }

.hs-blog-card__cat {
  color: var(--hs-accent, #B51717);
  font-weight: 600;
  text-decoration: none;
}

.hs-blog-card__cat:hover { text-decoration: underline; }

.hs-blog-card__title {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--hs-title, #1A1B25);
}

.hs-blog-card__title a {
  color: inherit;
  text-decoration: none;
}

.hs-blog-card__title a:hover { color: var(--hs-accent, #B51717); }

.hs-blog-card__excerpt {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--hs-text, #4A4C57);
  flex: 1;
}

.hs-blog-card__more {
  margin-top: auto;
  color: var(--hs-accent, #B51717);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  align-self: flex-start;
}

.hs-blog-card__more:hover { color: var(--hs-accent-dark, #760000); }

.hs-blog-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 48px auto 40px;
  flex-wrap: wrap;
  max-width: 1140px;
  padding: 0 20px;
  box-sizing: border-box;
}

.hs-blog-pagination a,
.hs-blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--hs-border, #DDDDE2);
  border-radius: 6px;
  color: var(--hs-title, #1A1B25);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: var(--hs-surface, #ffffff);
  transition: background-color var(--hs-transition, 0.22s ease), color var(--hs-transition, 0.22s ease), border-color var(--hs-transition, 0.22s ease);
}

.hs-blog-pagination a:hover {
  background: var(--hs-accent-soft, #F5F4F5);
  border-color: var(--hs-accent-border, #E8D4D4);
  color: var(--hs-accent, #B51717);
}

.hs-blog-pagination .current {
  background: var(--hs-accent, #B51717);
  border-color: var(--hs-accent, #B51717);
  color: #ffffff;
}

.hs-blog-empty {
  text-align: center;
  padding: 80px 0;
  color: var(--hs-text, #4A4C57);
  font-size: 17px;
}

@media (max-width: 900px) {
  .hs-blog-grid--3,
  .hs-blog-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

@media (max-width: 600px) {
  .hs-blog-grid--2,
  .hs-blog-grid--3,
  .hs-blog-grid--4 { grid-template-columns: 1fr; gap: 20px; }
  .hs-blog-card__body { padding: 18px 18px 22px; }
  .hs-blog-card__title { font-size: 18px; }
}
