/* ================================
   KMI Blog Landing – Sanitised CSS
   ================================ */

:root{
  --kmi-blue:#143951;
  --kmi-gold:#ad9030;
  --kmi-cream:#f8f0d9;
  --kmi-gun:#112423;
  --kmi-gap: 28px;
}

/* Page base + spacing */
.kmi-blog-landing {
  padding: 0 20 40px 0; /* top | right | bottom | left */
  /* top gap handled by .kmi-page-hero */
}


/* Title + safe gap under fixed/overlay header */
.kmi-page-hero{
  padding-bottom: 24px;
  text-align: center;
  align-items: center;
  background:#fff;
}
.kmi-page-hero h2{
	margin: 0;
  font-family: "Marcellus", serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.2;
  color: var(--kmi-blue);
}
body[class*="page-kmi-blog-landing"] hr.kmi-bloghero-separator {
  height: 3px !important;
  background-color: #ad9030 !important;
  margin: 16px auto 24px !important;
  border: none !important;
}

/* Fix title hover turning white */
body[class*="page-kmi-blog-landing"] .kmi-card-title a,
body[class*="page-kmi-blog-landing"] .kmi-card-title a:visited {
  color: var(--kmi-blue);
}

body[class*="page-kmi-blog-landing"] .kmi-card-title a:hover,
body[class*="page-kmi-blog-landing"] .kmi-card-title a:focus,
body[class*="page-kmi-blog-landing"] .kmi-card-title a:active {
  color: var(--kmi-blue) !important;
  text-decoration: underline;
}


/* Grid – default (large screens) */
.kmi-blog-grid {
  display:grid;
  grid-template-columns: 25% 50% 25%;
  gap:var(--kmi-gap);
  align-items:start;

  margin:0 auto;
  padding-left:24px;
  padding-right:72px;   /* more breathing room on right */
  box-sizing:border-box;
}

/* Tablet + mobile (≤1024px) */
@media (max-width:1024px){
  .kmi-blog-grid {
    grid-template-columns:1fr;
    padding-left:24px;
    padding-right:24px; /* even gutter both sides */
  }
}

.kmi-col-wide{}

/* Cards */
.kmi-card{
  background: #fff;
  border: 1px solid rgba(20,57,81,.12);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: var(--kmi-gap);
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
}
.kmi-card-media{ display:block; }
.kmi-card-img{ width:100%; height:auto; display:block; }

.kmi-card-title{
  font-family: "Marcellus", serif;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--kmi-blue);
  margin: 16px 16px 8px;
}
.kmi-card-title a{ color: inherit; text-decoration: none; }
.kmi-card-title a:hover{ text-decoration: underline; }

.kmi-card-excerpt{
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--kmi-gun);
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0 16px 16px;
}

/* Make sure cards/media can’t overflow their columns */
.kmi-card, .kmi-card-media, .kmi-card-img{ max-width:100%; overflow: hidden; }

/* Last resort to hide a stray 1px overflow from other wrappers */
html, body{ overflow-x:hidden; }

/* Buttons (spec per brief) */
.kmi-card-btn{
  display:inline-block;
  margin:0 16px 20px;
  padding:10px 16px;
  border-radius:5px;
  background:#143951;          /* Kumar Blue */
  color:#fff;
  text-decoration:none;
  font-family:"Marcellus", serif; /* Heading font */
  font-weight:400;
  letter-spacing:0;
}
.kmi-card-btn:hover,
.kmi-card-btn:focus,
.kmi-card-btn:active{
  background:#143951;          /* no hover effect */
  color:#fff;
  filter:none;
}

/* Loader */
.kmi-loader{
  text-align: center;
  padding: 24px;
  color: var(--kmi-blue);
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Load More — tablet/mobile */
.kmi-load-more{
  display:block;
  margin: 12px auto 40px;
  padding: 12px 20px;
  background:#143951;              /* Kumar Blue */
  color:#fff;
  border:0;
  border-radius:5px;               /* match card buttons */
  font-family:"Marcellus", serif;  /* heading font, white */
  font-size:1rem;
  line-height:1;
  cursor:pointer;
}
.kmi-load-more[disabled]{ opacity:0.6; cursor:default; }

/* Hide button on large screens (defensive) */
@media (min-width:1025px){
  .kmi-load-more{ display:none; }
}

/* Placeholder image (for posts without thumbnails) */
.kmi-card-img--placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--kmi-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kmi-blue);
  font-family: "Marcellus", serif;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(20,57,81,0.15);
}
.kmi-card-img--placeholder::after {
  content: "KMI";
  opacity: 0.25;
  font-size: 2rem;
  letter-spacing: 2px;
}

/* Responsive collapse */
@media (max-width: 1024px){
  .kmi-blog-grid{ grid-template-columns: 1fr; }
}

/* ================================
   Full-Width Fix (Astra containers)
   Scope using a contains selector to match WP body class variations
   e.g. page-template-page-kmi-blog-landing-php
   ================================ */
body[class*="page-kmi-blog-landing"] { background:#fff; }
body[class*="page-kmi-blog-landing"] .kmi-blog-landing { background:#fff; }

/* Remove width caps + side paddings */
body[class*="page-kmi-blog-landing"] .site-content,
body[class*="page-kmi-blog-landing"] .site-content .ast-container,
body[class*="page-kmi-blog-landing"] .content-area,
body[class*="page-kmi-blog-landing"] .entry-content{
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Astra often nests containers; neutralise them too */
body[class*="page-kmi-blog-landing"] .ast-container,
body[class*="page-kmi-blog-landing"] .ast-plain-container,
body[class*="page-kmi-blog-landing"] .site-content > .ast-container{
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* Ensure extra clearance under fixed header on small screens */
/* @media (max-width: 1024px){
  .kmi-page-hero{
    padding-top: 200px !important; /* tweak to match your header height; try 120–140px */
/*   }
}

/* Ensure extra clearance under fixed header on small screens */
@media (max-width: 1024px){
  .kmi-page-hero h2{font-size: 2em;
    
  }
}
/* Ensure page content starts below the fixed header */
body[class*="page-kmi-blog-landing"] .kmi-blog-landing{
  position: relative;
  z-index: 1;           /* below the header (which is z-index 10010) */
  padding-top: 200px;   /* adjust to your actual header height */
}

/* Tweak on smaller screens if needed */
@media (max-width:1024px){
  body[class*="page-kmi-blog-landing"] .kmi-blog-landing{ padding-top: 200px; }
}
@media (max-width:768px){
  body[class*="page-kmi-blog-landing"] .kmi-blog-landing{ padding-top: 200px; }
}
/* Force blog-card title to stay Kumar Blue on hover (beats theme rules) */
#kmi-blog-landing .kmi-card-title,
#kmi-blog-landing .kmi-card-title a,
#kmi-blog-landing .kmi-card-title a:visited,
#kmi-blog-landing .kmi-card:hover .kmi-card-title a,
#kmi-blog-landing .kmi-card-title a:hover,
#kmi-blog-landing .kmi-card-title a:focus,
#kmi-blog-landing .kmi-card-title a:active {
  color: var(--kmi-blue) !important;
  text-decoration: underline;
}
