/**
 * Blog listing (/blog) — search bar on top, two-column card grid.
 *
 * Scope is the blog_view view only (.view-blog-view / .blog-listing), so no
 * other view, node display or sidebar widget is affected.
 */

/* ---------- Exposed search / filter bar ---------- */

/* The keyword and category filters stay on the view so the sidebar
   "Search Blog" box (?search=...) keeps working, but the form itself is
   not shown above the listing. */
.blog-listing .views-exposed-form {
  display: none;
}

/* ---------- Two-column card grid ---------- */

/* The .views-row cards are direct children of the view wrapper (no
   .view-content div in this theme), so the wrapper itself is the grid.
   Everything that is not a card spans both columns. */
.blog-listing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 30px;
}

.blog-listing > :not(.views-row) {
  grid-column: 1 / -1;
}

.blog-listing > .views-row {
  display: flex;
  min-width: 0;
  margin: 0;
}

.blog-listing__empty {
  padding: 30px;
  text-align: center;
  color: #666;
  background: #f9f9f9;
  border: 1px dashed #ccc;
  border-radius: 6px;
}

/* ---------- Card ---------- */

.blog-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-card:hover,
.blog-card:focus-within {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
}

/* Neutralise the legacy teaser rules (orange underline, bottom border). */
.node--type-blog.node--view-mode-teaser.blog-card {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 1px solid #e5e5e5;
}

.node--type-blog.node--view-mode-teaser.blog-card:after {
  content: none;
}

.blog-card__media {
  display: block;
  background: #eef0f6;
  line-height: 0;
}

.blog-card__media a {
  display: block;
}

.blog-card__media img,
.blog-card > div:not(.blog-card__body) img,
.blog-card__placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}

.blog-card__placeholder {
  aspect-ratio: 16 / 5;
  position: relative;
  background: linear-gradient(135deg, #253980 0%, #3d54b0 100%);
}

.blog-card__placeholder::after {
  content: "CAGP";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-family: ClearSans-Medium, Arial, sans-serif;
  font-size: 28px;
  letter-spacing: 0.3em;
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 18px 20px 20px;
}

.blog-card__category,
.blog-card__category a {
  font-family: ClearSans-Medium, Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fb6100;
  text-decoration: none;
}

.blog-card__category {
  margin-bottom: 8px;
}

.blog-card__category a:hover {
  text-decoration: underline;
}

.blog-card__title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.3;
}

.blog-card__title a {
  color: #263880;
  font-weight: bold;
  text-decoration: none;
}

.blog-card__title a:hover,
.blog-card__title a:focus {
  color: #17245a;
  text-decoration: underline;
}

.blog-card__date {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: #777;
}

.blog-card__summary {
  flex: 1 1 auto;
  font-size: 15px;
  line-height: 1.55;
  color: #444;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.blog-card__summary p {
  margin: 0 0 0.6em;
}

.blog-card__more {
  align-self: flex-start;
  margin-top: 14px;
  font-family: ClearSans-Medium, Arial, sans-serif;
  font-size: 14px;
  color: #253980;
  text-decoration: none;
}

.blog-card__more:hover,
.blog-card__more:focus {
  color: #fb6100;
  text-decoration: underline;
}

.blog-card--sticky .blog-card__media {
  box-shadow: inset 0 -4px 0 #fb6100;
}

/* Pager sits under the grid at full width. */
.blog-listing .pager,
.blog-listing nav.pager {
  clear: both;
}

/* ---------- Responsive ---------- */

@media (max-width: 767px) {
  .blog-listing {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
