/* =========================================================
   Al Khair Blog SEO & Design Pack – blog.css  v1.0.6
   Clean, consolidated, fully responsive stylesheet
   Brand: green #033711 · gold #E7A40F · cream #F8F6EF
   Headings: Times New Roman · Body: Poppins
   Breakpoints: 1024 / 768 / 600 / 400
   ========================================================= */

:root{
  --ak-green:#033711;
  --ak-green-2:#0b4a1b;
  --ak-gold:#E7A40F;
  --ak-gold-dark:#9b720d;
  --ak-cream:#F8F6EF;
  --ak-text:#4a5147;
  --ak-muted:#7a8177;
  --ak-line:rgba(3,55,17,.12);
  --ak-radius:14px;
  --ak-shadow:0 8px 30px rgba(3,55,17,.07);
  --ak-pad-x:clamp(18px,5vw,56px);
  --ak-head:'Times New Roman',Times,serif;
  --ak-body:'Poppins',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;
}

/* ---------- Base ---------- */
body.blog,body.archive,body.search,body.single-post{
  font-family:var(--ak-body);
  color:var(--ak-text);
  overflow-x:clip;
}
body.single-post{background:#f6f7f3}
body.single-post *,
body.blog article.post *,
body.archive article.post *,
body.search article.post *{box-sizing:border-box}

/* =========================================================
   1) BLOG / ARCHIVE / SEARCH – NO SIDEBAR, 3 COMPACT CARDS PER ROW
   The plugin wraps the main posts loop in .ak-blog-grid.
   ========================================================= */

/* Sidebar hidden on listing pages (fallback if the theme still prints it) */
body.ak-listing #secondary,
body.ak-listing .widget-area,
body.ak-listing aside.sidebar,
body.ak-listing .sidebar-area,
body.ak-listing .blog-sidebar{display:none!important}
/* …and the content column takes the full width */
body.ak-listing #primary,
body.ak-listing .content-area,
body.ak-listing :is(.col-lg-8,.col-md-8,.col-lg-9,.col-md-9,.col-sm-8){
  float:none!important;
  width:100%!important;max-width:100%!important;flex:0 0 100%!important;
}

/* Grid */
.ak-blog-grid{
  box-sizing:border-box;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(16px,2vw,24px);
  align-items:stretch;
  width:100%;max-width:100%;flex:0 0 100%;
  margin:0 0 30px;padding:0;
}
.ak-blog-grid *{box-sizing:border-box}

/* Card = direct child of the grid (works for <article> or a theme wrapper) */
.ak-blog-grid>*{
  display:flex!important;flex-direction:column;
  width:auto!important;max-width:none!important;min-width:0;flex:none!important;
  margin:0!important;
  padding:0 18px 18px!important;
  background:#fff!important;
  border:1px solid var(--ak-line)!important;
  border-radius:12px!important;
  box-shadow:0 5px 20px rgba(3,55,17,.06)!important;
  overflow:hidden;
  transition:transform .25s ease,box-shadow .25s ease;
}
.ak-blog-grid>*:hover{transform:translateY(-4px);box-shadow:0 12px 28px rgba(3,55,17,.12)!important}
/* if the theme wraps the article inside a column div, flatten the inner article */
.ak-blog-grid>* article{margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important;border-radius:0!important;width:100%!important;max-width:100%!important;display:flex;flex-direction:column;flex:1 1 auto}

/* Image – compact, full-bleed at the top of the card */
.ak-blog-grid :has(>img){display:block!important;margin:0!important;padding:0!important;line-height:0;width:auto}
.ak-blog-grid img{
  display:block;
  width:calc(100% + 36px)!important;max-width:none!important;
  margin:0 0 0 -18px!important;
  height:170px!important;object-fit:cover;border-radius:0!important;
}

/* Meta row (By · date · comments) – small and tidy */
.ak-blog-grid ul{
  display:flex;flex-wrap:wrap;gap:4px 14px;
  list-style:none!important;margin:14px 0 8px!important;padding:0!important;
  font-size:11.5px;line-height:1.5;color:var(--ak-muted);
}
.ak-blog-grid li{margin:0!important;padding:0!important;list-style:none!important;display:inline-flex;align-items:center;gap:5px}
.ak-blog-grid li a,.ak-blog-grid ul a{color:var(--ak-muted);text-decoration:none}
.ak-blog-grid li svg{width:12px;height:12px;flex:none}

/* Title */
.ak-blog-grid h2,.ak-blog-grid h3{
  font-family:var(--ak-head)!important;font-weight:700!important;
  font-size:clamp(18px,1.55vw,20px)!important;line-height:1.28!important;
  color:var(--ak-green)!important;
  margin:0 0 8px!important;padding:0!important;
  overflow-wrap:anywhere;
}
.ak-blog-grid h2 a,.ak-blog-grid h3 a{color:inherit!important;text-decoration:none}
.ak-blog-grid h2 a:hover,.ak-blog-grid h3 a:hover{color:var(--ak-gold-dark)!important}

/* Excerpt */
.ak-blog-grid p{
  font-family:var(--ak-body);font-size:13.5px!important;line-height:1.7!important;
  margin:0 0 12px!important;color:var(--ak-text);
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}

/* Read More button – pushed to the bottom of every card */
.ak-blog-grid a.more-link,
.ak-blog-grid a.read-more,
.ak-blog-grid a.readmore,
.ak-blog-grid a.button,
.ak-blog-grid a.btn,
.ak-blog-grid p>a:only-child{
  display:inline-flex;align-items:center;align-self:flex-start;
  margin-top:auto;padding:9px 16px;
  background:var(--ak-green);color:#fff!important;border-radius:6px;
  font-size:12px;font-weight:600;text-decoration:none!important;line-height:1.2;
  transition:background .2s,color .2s;
}
.ak-blog-grid a.more-link:hover,
.ak-blog-grid a.read-more:hover,
.ak-blog-grid a.readmore:hover,
.ak-blog-grid a.button:hover,
.ak-blog-grid a.btn:hover{background:var(--ak-gold);color:var(--ak-green)!important}

/* Archive heading + pagination */
.archive .page-header .page-title,
.search .page-header .page-title{
  font-family:var(--ak-head);color:var(--ak-green);
  font-size:clamp(28px,4vw,42px);line-height:1.15;
}
.navigation.pagination .nav-links{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.navigation.pagination .page-numbers{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:40px;height:40px;padding:0 14px;border-radius:6px;
  border:1px solid var(--ak-line);background:#fff;color:var(--ak-green);
  text-decoration:none;font-size:14px;font-weight:600;
}
.navigation.pagination .page-numbers.current,
.navigation.pagination .page-numbers:hover{background:var(--ak-green);color:#fff;border-color:var(--ak-green)}

/* =========================================================
   2) SINGLE POST
   Theme-independent: the plugin wraps the post content in
   .ak-post-body, so these rules work with any theme markup.
   ========================================================= */

/* --- Article box: inner spacing so nothing touches the edges --- */
body.single-post article{
  box-sizing:border-box;
  padding-left:var(--ak-pad-x)!important;
  padding-right:var(--ak-pad-x)!important;
  padding-bottom:clamp(24px,4vw,48px)!important;
  background:#fff;
  border-radius:var(--ak-radius);
  overflow:hidden;
  max-width:100%;
}
/* Featured image stays full-width (edge to edge) inside the padded box */
body.single-post article img.wp-post-image,
body.single-post article .post-thumbnail img,
body.single-post article .featured-image img,
body.single-post article .post-image img{
  display:block;
  width:calc(100% + (var(--ak-pad-x) * 2))!important;
  max-width:none!important;
  margin-left:calc(var(--ak-pad-x) * -1)!important;
  margin-right:0!important;
  height:auto!important;
  max-height:480px;
  aspect-ratio:16/8;
  object-fit:cover;
}
body.single-post article .post-thumbnail,
body.single-post article .featured-image,
body.single-post article .post-image{margin:0!important;padding:0!important;line-height:0}

/* Title (when the theme prints it inside the article) */
body.single-post article h1,
body.single-post article .entry-title{
  font-family:var(--ak-head)!important;font-weight:700!important;
  font-size:clamp(26px,4.2vw,42px)!important;line-height:1.16!important;
  color:var(--ak-green)!important;
  overflow-wrap:anywhere;
}
/* Meta row (author · date · comments) */
body.single-post article .entry-meta,
body.single-post article .post-meta,
body.single-post article .meta-info{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px;
  padding:clamp(14px,2vw,20px) 0 14px!important;
  margin:0 0 6px!important;
  font-family:var(--ak-body);font-size:13px;line-height:1.5;color:var(--ak-muted);
  border-bottom:1px solid var(--ak-line);
}
body.single-post article .entry-meta a,
body.single-post article .post-meta a{color:var(--ak-green);text-decoration:none}
body.single-post article .entry-meta a:hover,
body.single-post article .post-meta a:hover{color:var(--ak-gold-dark)}

/* Theme's own content wrappers should not add a 2nd layer of spacing */
body.single-post article .entry-content,
body.single-post article .post-content,
body.single-post article .entry{padding-left:0!important;padding-right:0!important;margin-left:0!important;margin-right:0!important;max-width:100%!important}

/* --- Content body --- */
.ak-post-body{
  box-sizing:border-box;max-width:100%;
  padding:clamp(18px,3vw,30px) 0 0;
  font-family:var(--ak-body);
  font-size:clamp(15px,1.5vw,16.5px);
  line-height:1.9;
  color:var(--ak-text);
  overflow-wrap:break-word;word-wrap:break-word;
}
.ak-post-body *{box-sizing:border-box}
.ak-post-body>*:first-child{margin-top:0!important}
.ak-post-body p{margin:0 0 20px!important;font-family:var(--ak-body)}
.ak-post-body strong{color:var(--ak-green);font-weight:600}

.ak-post-body h2{
  font-family:var(--ak-head)!important;font-weight:700!important;
  font-size:clamp(23px,3vw,30px)!important;line-height:1.25!important;
  color:var(--ak-green)!important;
  margin:clamp(28px,4vw,40px) 0 14px!important;
  padding:0 0 10px 14px!important;
  border-left:4px solid var(--ak-gold)!important;
  border-bottom:1px solid rgba(231,160,15,.35)!important;
  scroll-margin-top:90px;
}
.ak-post-body h3{
  font-family:var(--ak-head)!important;font-weight:700!important;
  font-size:clamp(19px,2.4vw,23px)!important;line-height:1.3!important;
  color:var(--ak-green-2)!important;
  margin:26px 0 10px!important;padding:0!important;border:0!important;
  scroll-margin-top:90px;
}
.ak-post-body h4{font-family:var(--ak-head)!important;color:var(--ak-green);font-size:18px;margin:22px 0 8px}
.ak-post-body a:not(.alkhair-cta-button){
  color:#176b35;font-weight:600;
  text-decoration:underline;text-decoration-color:var(--ak-gold);text-underline-offset:3px;
  overflow-wrap:anywhere;
}
.ak-post-body a:not(.alkhair-cta-button):hover{color:var(--ak-gold-dark)}

/* Lists */
.ak-post-body ul,.ak-post-body ol{
  margin:0 0 24px!important;
  padding:18px 20px 16px clamp(34px,5vw,44px)!important;
  background:#fbfaf6;
  border:1px solid #edf0e8;border-left:4px solid var(--ak-gold);
  border-radius:9px;
}
.ak-post-body li{margin:0 0 8px!important;padding:0}
.ak-post-body li:last-child{margin-bottom:0!important}
.ak-post-body li::marker{color:var(--ak-gold-dark)}

/* Media, tables, quotes, code */
.ak-post-body img,.ak-post-body video,.ak-post-body iframe,.ak-post-body embed{max-width:100%!important;height:auto}
.ak-post-body iframe{aspect-ratio:16/9;width:100%}
.ak-post-body figure{margin:0 0 24px;max-width:100%}
.ak-post-body figcaption{font-size:13px;color:var(--ak-muted);text-align:center;margin-top:8px}
.ak-post-body .alignleft{float:left;margin:4px 22px 14px 0}
.ak-post-body .alignright{float:right;margin:4px 0 14px 22px}
.ak-post-body .aligncenter{display:block;margin:0 auto 20px}
.ak-post-body table{display:block;width:100%;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:0 0 24px;font-size:14px}
.ak-post-body th,.ak-post-body td{padding:10px 14px;border:1px solid var(--ak-line);text-align:left}
.ak-post-body th{background:var(--ak-cream);color:var(--ak-green)}
.ak-post-body blockquote{margin:0 0 24px;padding:16px 22px;background:var(--ak-cream);border-left:4px solid var(--ak-gold);border-radius:0 9px 9px 0;font-style:italic}
.ak-post-body blockquote p:last-child{margin-bottom:0!important}
.ak-post-body pre{max-width:100%;overflow-x:auto;padding:16px;background:#f3f4ef;border-radius:9px;font-size:13px}

/* --- CTA box at the end of each article --- */
.ak-post-body .alkhair-article-cta{
  margin:clamp(32px,5vw,48px) 0 0;
  padding:clamp(24px,4vw,36px) clamp(16px,3vw,32px);
  text-align:center;
  background:var(--ak-cream);
  border:1px solid rgba(231,160,15,.55);
  border-radius:12px;
}
.ak-post-body .alkhair-cta-kicker{display:block;font-size:11px;letter-spacing:2px;font-weight:700;color:var(--ak-gold-dark)}
.ak-post-body .alkhair-article-cta h2{
  font-size:clamp(22px,3.2vw,29px)!important;
  margin:10px 0!important;padding:0!important;border:0!important;
}
.ak-post-body .alkhair-article-cta p{margin:8px 0 20px!important}
.ak-post-body a.alkhair-cta-button{
  display:inline-block;padding:13px 26px;border-radius:6px;
  background:var(--ak-green);color:#fff!important;
  font-size:13px;font-weight:600;text-decoration:none!important;
  transition:background .2s,color .2s;
}
.ak-post-body a.alkhair-cta-button:hover{background:var(--ak-gold);color:var(--ak-green)!important}

/* --- Post navigation, comments --- */
body.single-post .post-navigation .nav-links{display:grid;grid-template-columns:1fr 1fr;gap:16px}
body.single-post .post-navigation .nav-previous a,
body.single-post .post-navigation .nav-next a{
  display:block;height:100%;padding:16px 18px;background:#fff;
  border:1px solid var(--ak-line);border-radius:12px;
  color:var(--ak-green);text-decoration:none;font-family:var(--ak-head);font-weight:700;line-height:1.35;overflow-wrap:anywhere;
}
body.single-post .post-navigation .nav-next{text-align:right}
body.single-post .comments-area input[type=text],
body.single-post .comments-area input[type=email],
body.single-post .comments-area input[type=url],
body.single-post .comments-area textarea{width:100%;max-width:100%}

/* =========================================================
   3) RESPONSIVE
   ========================================================= */
@media (max-width:1024px){
  .ak-blog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:768px){
  .ak-post-body .alignleft,.ak-post-body .alignright{float:none;display:block;margin:0 auto 18px}
  body.single-post article img.wp-post-image,
  body.single-post article .post-thumbnail img{aspect-ratio:16/9;max-height:360px}
  .ak-post-body ul,.ak-post-body ol{padding:16px 16px 14px 32px!important}
}
@media (max-width:600px){
  .ak-blog-grid{grid-template-columns:1fr;gap:18px}
  .ak-blog-grid img{height:190px!important}
  .ak-post-body{line-height:1.8}
  .ak-post-body h2{padding-left:11px!important;border-left-width:3px!important}
  .ak-post-body .alkhair-article-cta{padding:24px 16px}
  .ak-post-body a.alkhair-cta-button{display:block;width:100%;padding:14px 18px}
  body.single-post .post-navigation .nav-links{grid-template-columns:1fr}
  body.single-post .post-navigation .nav-next{text-align:left}
}
@media (max-width:400px){
  :root{--ak-pad-x:16px}
  body.single-post article .entry-meta,body.single-post article .post-meta{font-size:12px;gap:4px 12px}
  .ak-post-body{font-size:15px}
}
@media (prefers-reduced-motion:reduce){
  .ak-blog-grid>*{transition:none}
  .ak-blog-grid>*:hover{transform:none}
}
