/*
Theme Name: Scan to BIM Solutions Blog
Theme URI: https://scantobimsolutions.com/blog/
Author: MaRS BIM Solutions
Description: Custom WordPress blog theme using the Scan to BIM Solutions main website header, footer and design system.
Version: 1.5.2
License: GPL-2.0-or-later
Text Domain: scantobim-blog
*/

/* Load the original main-site design system from assets/css/style.css */
@import url('assets/css/style.css');

/* ==========================================================
   WORDPRESS BLOG LAYER
   ========================================================== */

body.blog-page,
body.single-post,
body.archive,
body.search,
body.error404 {
  background: var(--bg);
}

.blog-main { min-height: 60vh; }

.blog-hero {
  position: relative;
  padding: clamp(38px, 5vw, 58px) 0 18px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #FAF9FE 0%, #FFFFFF 82%);
}
.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(700px 400px at 85% 0%, rgba(124,95,218,.17), transparent 62%),
    radial-gradient(620px 380px at 5% 10%, rgba(90,79,214,.12), transparent 60%);
  pointer-events: none;
}

.blog-hero h1 { margin-bottom: 16px; }
.blog-hero .lead { max-width: 760px; }

/* Blog listing: remove the large default section padding under the hero. */
.blog-list-section {
  padding-top: 0;
  padding-bottom: clamp(56px, 6vw, 80px);
}


.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}
.blog-card-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--p-50);
}
.blog-card-placeholder {
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  background: var(--p-50);
  color: var(--p-700);
  font-family: var(--font-head);
  font-weight: 800;
}
.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.blog-card:hover .blog-card-placeholder {
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  background: var(--p-50);
  color: var(--p-700);
  font-family: var(--font-head);
  font-weight: 800;
}
.blog-card-image img { transform: scale(1.045); }
.blog-card-body { padding: 28px 30px 30px; display: flex; flex: 1; flex-direction: column; }
.blog-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 13px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  font-family: var(--font-head);
}
.blog-meta .sep { opacity: .4; }
.blog-card h2 { font-size: 1.28rem; margin-bottom: 12px; }
.blog-card h2 a { color: var(--ink); }
.blog-card h2 a:hover { color: var(--p-700); }

.blog-card .link-arrow { margin-top: auto; padding-top: 20px; }

.blog-pagination { margin-top: 46px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.blog-pagination .page-numbers {
  min-width: 42px; height: 42px; padding: 0 13px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: #fff; color: var(--ink-soft); font-family: var(--font-head); font-weight: 700;
}
.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current { background: var(--p-50); border-color: var(--p-200); color: var(--p-800); }

.single-blog-wrap { padding: clamp(34px, 4vw, 52px) 0 100px; }
.single-blog-layout { display: grid; grid-template-columns: minmax(0, 820px) 260px; gap: clamp(38px, 6vw, 76px); align-items: start; }
.single-blog-header { margin-bottom: 34px; }
.single-blog-header h1 { font-size: 48px; line-height: 1.12; margin-bottom: 18px; }
.single-blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-family: var(--font-head); font-size: .9rem; font-weight: 600; }
.single-blog-featured { margin: 0 0 40px; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--sh-md); }
.single-blog-featured img { width: 100%; height: auto; }

.blog-content { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.85; }
.blog-content > * { max-width: 100%; }
.blog-content h2 { margin-top: 46px; font-size: clamp(1.7rem, 3vw, 2.35rem); }
.blog-content h3 { margin-top: 34px; font-size: 1.4rem; }
.blog-content h4 { margin-top: 28px; font-size: 1.15rem; }
.blog-content p { margin-bottom: 1.25em; }
.blog-content ul, .blog-content ol { margin: 0 0 1.35em 1.35em; padding-left: 1rem; }
.blog-content li { list-style: disc; margin-bottom: .45em; }
.blog-content ol li { list-style: decimal; }
.blog-content img { max-width: 100%; height: auto; border-radius: 16px; margin: 28px auto; }
.blog-content blockquote { margin: 30px 0; padding: 22px 26px; border-left: 4px solid var(--p-500); background: var(--p-50); border-radius: 0 16px 16px 0; }
.blog-content table { width: 100%; border-collapse: collapse; margin: 28px 0; }
.blog-content th, .blog-content td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }
.blog-content th { background: var(--p-50); color: var(--ink); font-family: var(--font-head); }
.blog-content iframe { max-width: 100%; }

.blog-sidebar { position: sticky; top: calc(var(--nav-h) + 28px); }
.blog-sidebar-box { padding: 24px; margin-bottom: 18px; }
.blog-sidebar-box h3 { font-size: 1.05rem; margin-bottom: 15px; }
.blog-sidebar-box ul li { border-bottom: 1px solid var(--line-2); }
.blog-sidebar-box ul li:last-child { border-bottom: 0; }
.blog-sidebar-box ul a { display: block; padding: 10px 0; color: var(--ink-soft); font-size: .9rem; }
.blog-sidebar-box ul a:hover { color: var(--p-700); }

/* Recent Blogs sidebar widget */
.recent-blogs-box { padding: 22px 24px; }
.recent-blogs-list { display: flex; flex-direction: column; }
.recent-blog-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
  color: inherit;
}
.recent-blog-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.recent-blog-item:first-child { padding-top: 2px; }
.recent-blog-thumb {
  width: 68px;
  height: 52px;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--p-50);
  border: 1px solid var(--line);
}
.recent-blog-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-blog-thumb-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--p-700); font-family: var(--font-head); font-weight: 800; font-size: .72rem; }
.recent-blog-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.recent-blog-info strong {
  color: var(--ink);
  font-family: var(--font-head);
  font-size: .78rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-blog-info time { color: var(--muted); font-size: .7rem; font-weight: 600; font-family: var(--font-head); }
.recent-blog-item:hover .recent-blog-info strong { color: var(--p-700); }
.recent-blog-empty { margin: 0; color: var(--muted); font-size: .85rem; }

.blog-not-found { text-align: center; padding: 70px 20px; }
.blog-not-found h1 { margin-bottom: 12px; }

@media (max-width: 980px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .single-blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
}

@media (max-width: 720px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-card-body { padding: 24px; }
  .single-blog-wrap { padding-top: 34px; }
  .single-blog-header h1 { font-size: 48px; line-height: 1.12; }
  .blog-content { font-size: 1rem; }
}

/* WordPress admin bar: keep sticky header below it when logged in. */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .site-header { top: 46px; } }

/* Single post title: requested 48px on desktop/tablet. */
.single-blog-header h1 { font-size: 48px; }
@media (max-width: 520px) {
  .single-blog-header h1 { font-size: 40px; }
}

/* ==========================================================
   FINAL 1200PX BLOG CONTENT WIDTH
   Header/navigation intentionally excluded.
   ========================================================== */
body.scantobim-blog-site .blog-main .wrap,
body.scantobim-blog-site .single-blog-wrap > .wrap,
body.scantobim-blog-site .site-footer > .wrap {
  width: 1200px !important;
  max-width: 1200px !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

body.scantobim-blog-site .blog-main .blog-grid {
  width: 100% !important;
  max-width: 1200px !important;
}

body.scantobim-blog-site .site-footer .foot-grid,
body.scantobim-blog-site .site-footer .foot-bottom {
  width: 100% !important;
  max-width: 1200px !important;
}

@media (max-width: 1247px) {
  body.scantobim-blog-site .blog-main .wrap,
  body.scantobim-blog-site .single-blog-wrap > .wrap,
  body.scantobim-blog-site .site-footer > .wrap {
    width: calc(100% - 48px) !important;
    max-width: none !important;
  }
}

@media (max-width: 720px) {
  body.scantobim-blog-site .blog-main .wrap,
  body.scantobim-blog-site .single-blog-wrap > .wrap,
  body.scantobim-blog-site .site-footer > .wrap {
    width: calc(100% - 36px) !important;
  }
}

