/* ============================================================
   HOME BLOG SECTION — CSS Grid override + premium card styling
   Uses Grid (not Bootstrap flex) so it can't be overridden by
   any in-page <style> blocks.
   ============================================================ */

/* Show the section on tablet/mobile (was hidden at <=991.98px) */
@media (max-width: 991.98px) {
  section.home-blog-section { display: block !important; }
}

/* ============ GRID LAYOUT — minmax(0, 1fr) forces equal columns ============ */
html body section.home-blog-section > .container > .row:last-of-type {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  grid-auto-rows: auto !important;
  gap: 24px !important;
  margin: 0 !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}

/* Reset Bootstrap col-md-4 sizing AND force each card into one cell */
html body section.home-blog-section > .container > .row:last-of-type > [class*="col-"] {
  flex: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  grid-column: span 1 !important;
  grid-row: span 1 !important;
  align-self: stretch !important;
  justify-self: stretch !important;
}

/* Card itself must fill the grid cell */
html body section.home-blog-section > .container > .row:last-of-type .blog-style-01 {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
}

/* Image must respect the card's width, not its own natural size */
html body section.home-blog-section > .container > .row:last-of-type .blog-img {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

html body section.home-blog-section > .container > .row:last-of-type .blog-img img {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  display: block !important;
}

/* Tablet — 2 columns */
@media (max-width: 991.98px) {
  html body section.home-blog-section > .container > .row:last-of-type {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }
}

/* Mobile — 1 column */
@media (max-width: 575.98px) {
  html body section.home-blog-section > .container > .row:last-of-type {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ============ Premium card styling ============ */
.home-blog-section .blog-style-01 {
  display: block !important;
  height: 100% !important;
  background: #fff !important;
  border: 1px solid rgba(19, 19, 16, 0.08) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease !important;
  transform: none !important;
}

.home-blog-section .blog-style-01:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(190, 155, 82, 0.36) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
}

/* Image container — fixed 4:3 aspect ratio */
.home-blog-section .blog-img {
  position: relative !important;
  display: block !important;
  aspect-ratio: 4 / 3 !important;
  overflow: hidden !important;
  background: #f5f2ed !important;
  transform: none !important;
}

.home-blog-section .blog-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 0.32s ease !important;
}

.home-blog-section .blog-style-01:hover .blog-img img {
  transform: scale(1.04) !important;
}

/* Gradient overlay at bottom */
.home-blog-section .blog-img::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(180deg, rgba(15, 14, 12, 0) 45%, rgba(15, 14, 12, 0.72) 100%) !important;
  z-index: 1 !important;
  opacity: 1 !important;
  height: 100% !important;
  top: 0 !important;
}

.home-blog-section .blog-img::before {
  display: none !important;
}

/* Blog info positioned over image bottom */
.home-blog-section .blog-img .blog-info {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  padding: 18px 22px 20px !important;
  z-index: 2 !important;
  transition: none !important;
  transform: none !important;
}

.home-blog-section .blog-img .blog-info > p:first-child {
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 11px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  margin: 0 0 8px !important;
  opacity: 1 !important;
}

.home-blog-section .blog-img .blog-info h5 {
  margin: 0 !important;
}

.home-blog-section .blog-img .blog-info h5 a {
  color: #fff !important;
  font-size: 17px !important;
  line-height: 1.32 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.home-blog-section .blog-img .blog-info h5 a:hover {
  color: #fff !important;
  text-decoration: underline !important;
}

/* HIDE the duplicate uppercase content paragraph */
.home-blog-section .blog-img .blog-info p.blog-content,
.home-blog-section .blog-img .blog-info .blog-content {
  display: none !important;
}

.home-blog-section .blog-style-01:hover .blog-img .blog-info {
  bottom: 0 !important;
}

/* Mobile tweaks */
@media (max-width: 575.98px) {
  .home-blog-section .blog-img .blog-info h5 a { font-size: 15px !important; }
  .home-blog-section .blog-img .blog-info { padding: 14px 18px 16px !important; }
}
