/* ==========================================================================
   Clean Blog Component Styles - Only what we need
   ========================================================================== */

/* Blog Section */
.blogs {
  background: transparent;
  padding: 3rem 1rem;
  margin: 0 auto;
  max-width: 1200px;
}

.blogs__text {
  text-align: center;
  margin-bottom: 2.5rem;
}

.blogs__text h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark-black);
  margin-bottom: 0.5rem;
}

.blogs__text p {
  font-size: 1.125rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Blog Grid – will be overridden by final strategy below */

/* Blog Card - remove max-width since final strategy handles it */
.blog {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--light-gray);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  width: 100%;
  transition: box-shadow 0.2s, transform 0.2s;
}

.blog:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 204, 188, 0.1);
}

.blog .blog-link {
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* Blog Image */
.blog__img {
  height: 220px;
  width: 100%;
  background: #e6f8f7;
  display: contents !important;
}

.blog__img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  transition: transform 0.3s ease;
  max-width: none !important;
  min-width: 100% !important;
  min-height: 100% !important;
}

.blog__img .field--name-field-image,
.blog__img .field--name-field-featured-image {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.blog__img .field__item {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
}

/* Force all nested elements to take full size */
.blog__img * {
  box-sizing: border-box !important;
}

.blog:hover .blog__img img {
  transform: scale(1.04);
}

/* Blog Text Content */
.blog__text {
  padding: 1.25rem 1.25rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  order: 2;
}

.blog__date {
  color: var(--gray);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.blog__title {
  color: var(--dark-black);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.blog__excerpt {
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog__excerpt p {
  margin: 0;
}

/* Blog Footer */
.blog__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
}

.blog__read-more {
  background: var(--cta);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 24px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0, 204, 188, 0.08);
}

.blog__read-more i {
  font-size: 0.85rem;
}

.blog__read-more:hover {
  background: #008a7e;
}

/* Responsive tweaks for very small phones */
@media (max-width: 480px) {
  .blogs {
    padding: 2rem 1rem;
  }

  .blogs__text h2 {
    font-size: 1.75rem;
  }

  .blog {
    max-width: 100%;
    width: 100%;
  }
}

/* ==========================================================================
   FINAL BLOG GRID STRATEGY
   Keep .blogs__grid as the grid container and flatten Drupal wrappers.
   ========================================================================= */
.blogs__grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 2rem !important;
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
  justify-items: stretch;
}
/* Flatten wrapper layers so .blog cards are grid items */
.blogs__grid .views-element-container,
.blogs__grid .view,
.blogs__grid .view-content,
.blogs__grid .views-row {
  display: contents !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* Ensure cards fill the cell */
.blogs__grid .blog {
  max-width: none !important;
  width: 100% !important;
}
@media (max-width: 1024px) {
  .blogs__grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }
}
@media (max-width: 768px) {
  .blogs__grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}
@media (max-width: 480px) {
  .blogs__grid {
    gap: 1rem !important;
  }
}
