/* =========================
   First v2 — Blog listing

   Mirrors thefirstokc.com/blog/: a three-up grid of bordered, rounded cards,
   each with a fixed-height cover image, a large serif title, a
   "date | category" meta row, an excerpt and a bold uppercase read-more.

   The reference markup differs from ours, so the mapping is:
     li.single-post            -> .blog-card
     .single-featured-image img-> .blog-thumb / .blog-img-block
     h4.single-post-title      -> .blog-title
     .post-date                -> .blog-date
     span.post-cat             -> .blog-category
     .single-post-excerpt      -> .blog-desc
     a.read-more-link          -> .blog-readmore

   component-common.css already forces the grid to 2 columns at 992 and 1 at
   767 with !important, so this file only sets the desktop count and tunes the
   gaps around those.
========================= */
.new-section.blog {
  padding: 40px 0 80px;
  background: var(--first-white);
  color: #000;
  font-family: var(--first-font-body);
}

.new-section.blog .container {
  max-width: 1560px;
  padding: 0 15px;
}

.new-section.blog .blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 50px;
  margin-top: 80px;
}

/* ===== Card ===== */
.new-section.blog .blog-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid #e3e3e3;
  border-radius: 15px;
  background: transparent;
  overflow: hidden;
}

.new-section.blog .blog-card-shadow {
  box-shadow: none;
}

/* ===== Image ===== */
.new-section.blog .blog-thumb,
.new-section.blog .blog-img-block {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center center;
}

.new-section.blog .blog-img-block {
  background-color: #d3d3d3;
}

.new-section.blog a.blog-thumb {
  height: auto;
}

/* ===== Copy ===== */
.new-section.blog .blog-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 0;
}

.new-section.blog .blog-title {
  width: 100%;
  margin: 25px 0;
  position: relative;
  font-family: var(--font-heading, "Playfair Display", Georgia, serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}

.new-section.blog .blog-title a {
  color: inherit;
  text-decoration: none;
}

.new-section.blog .blog-meta {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.new-section.blog .blog-date {
  flex: 0 0 auto;
  min-width: 120px;
  font-size: 15px;
  font-weight: 500;
}

/* Reference draws this as span.post-cat::after — a 2x20px rule 15px to the
   left of the category. Our markup already ships a .blog-divider span, so it
   plays that part instead of a pseudo-element. */
.new-section.blog .blog-divider {
  flex: 0 0 auto;
  width: 2px;
  height: 20px;
  margin: 0 15px 0 0;
  overflow: hidden;
  background: currentColor;
  opacity: 0.4;
  text-indent: -999px;
}

.new-section.blog .blog-category {
  flex: 1 1 auto;
  position: relative;
  font-size: 15px;
  font-weight: 500;
}

.new-section.blog .blog-desc {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
}

.new-section.blog .blog-readmore {
  display: block;
  margin: 15px 0 0;
  position: relative;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
}

.new-section.blog .blog-readmore:is(:hover, :focus-visible) {
  text-decoration: underline;
}

/* ===== Related posts (single post page) =====
   Posts with no featured image emit <div class="related-post-img-block"> in
   place of the <img>. With no height it collapses and the card shows an empty
   gap, so — as blog-7 does — give it a fixed-height grey placeholder exactly
   the size of a real thumbnail. */
.new-section.blog-post .related-card .blog-thumb img,
.new-section.blog-post .related-post-img-block {
  display: block;
  width: 100%;
  height: 262px;
  object-fit: cover;
  object-position: center center;
}

.new-section.blog-post .related-post-img-block {
  background-color: #d3d3d3;
}

/* =========================
   Single post — body, sidebar widgets and recent posts
   Mirrors the reference post page. Mapping from its markup to ours:
     .single-post-body        -> .d-flex
     .post-content            -> article.main-content
     .post-sidebar            -> aside.sidebar
     h2.widget-title          -> .blog-category > h4 / .featured > h4
     .category-widget li      -> p.blg-cat
     .single-related-posts    -> .related-card
     img.related-post-img     -> .related-card img
     .rp-group-wrapper        -> .related .related-posts
========================= */
.new-section.blog-post .container > .d-flex {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  /* component-common.css adds gap: 24px at 992; with 70% + 30% that overflows
     the row and wraps the sidebar underneath. The columns carry their own
     spacing via .main-content padding-right instead. */
  gap: 0;
}

.new-section.blog-post .main-content {
  width: 70%;
  padding-right: 70px;
}

.blog-post.new-section .sidebar {
  width: 30%;
}

/* ===== Post body ===== */
.new-section.blog-post .main-content p,
.new-section.blog-post .main-content ul li {
  color: #363636;
  font-size: 15px;
  font-weight: 500;
  line-height: 2.3;
}

.new-section.blog-post .main-content ul {
  padding-left: 25px;
  list-style-type: disc;
}

.new-section.blog-post .main-content h3 {
  margin-bottom: 20px;
  font-family: var(--font-heading, "Playfair Display", Georgia, serif);
  font-size: 30px;
}

/* ===== Sidebar widgets ===== */
.new-section.blog-post .sidebar .blog-category,
.new-section.blog-post .sidebar .featured {
  margin-bottom: 60px;
}

/* Widget headings only — .related-card titles also use h4.pt-0, so these are
   matched as direct children of the widget wrapper. */
.new-section.blog-post .sidebar .blog-category > h4,
.new-section.blog-post .sidebar .featured > h4 {
  margin: 0 0 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #dedede;
  font-family: var(--font-heading, "Playfair Display", Georgia, serif);
  font-size: 30px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.2;
}

.new-section.blog-post .blg-cat {
  margin: 0 0 0 15px;
  padding-left: 14px;
  position: relative;
  font-size: 15px;
  font-weight: 700;
  line-height: 2.5;
  text-transform: uppercase;
}

/* p elements take no list marker, so the disc is drawn in. */
.new-section.blog-post .blg-cat::before {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  top: 1.1em;
  left: 0;
  border-radius: 50%;
  background: currentColor;
}

/* ===== Sidebar post cards ===== */
.new-section.blog-post .featured .related-posts {
  gap: 0;
  margin-top: 0;
}

.new-section.blog-post .featured .related-card {
  height: auto;
  margin-bottom: 40px;
  padding: 20px;
  border: 1px solid #e3e3e3;
  border-radius: 15px;
}

.new-section.blog-post .featured .related-card img {
  width: 100%;
  height: auto;
}

.new-section.blog-post .featured .related-content {
  padding: 0;
}

.new-section.blog-post .featured .related-posts h4 {
  margin: 10px 0 15px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
}

/* ===== Recent posts row ("You May Be Interested") ===== */
.new-section.blog-post .related {
  width: 100%;
  margin-top: 40px;
}

.new-section.blog-post .related .related-posts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.new-section.blog-post .related .related-card {
  padding: 20px;
  border: 1px solid #e3e3e3;
  border-radius: 15px;
}

.new-section.blog-post .related .related-content {
  padding: 16px 0 0;
}

/* The card now has 20px of padding, so the badge moves in to sit on the image
   rather than over the card's border. */
.new-section.blog-post .related-badge {
  left: 32px;
  top: 32px;
}

/* ===== Responsive ===== */
@media screen and (max-width: 1440px) {
  .new-section.blog .blog-grid {
    gap: 36px;
    margin-top: 60px;
  }

  .new-section.blog .blog-thumb,
  .new-section.blog .blog-img-block {
    height: 240px;
  }

  .new-section.blog .blog-title {
    margin: 20px 0;
    font-size: 27px;
  }
}

@media screen and (max-width: 1200px) {
  .new-section.blog .blog-grid {
    gap: 28px;
  }

  .new-section.blog .blog-title {
    font-size: 24px;
  }
}

/* component-common.css drops the grid to 2 columns here (!important). */
@media screen and (max-width: 992px) {
  .new-section.blog {
    padding: 30px 0 60px;
  }

  /* Sidebar stays on the right here; just tighten the gutter. */
  .new-section.blog-post .main-content {
    padding-right: 30px;
  }

  .new-section.blog-post .sidebar .blog-category > h4,
  .new-section.blog-post .sidebar .featured > h4,
  .new-section.blog-post .main-content h3 {
    font-size: 26px;
  }

  .new-section.blog-post .related-card .blog-thumb img,
  .new-section.blog-post .related-post-img-block {
    height: 220px;
  }

  .new-section.blog .blog-grid {
    gap: 24px;
    margin-top: 45px;
  }

  .new-section.blog .blog-thumb,
  .new-section.blog .blog-img-block {
    height: 220px;
  }
}

/* ...and to a single column here, with gap: 12px !important. */
@media screen and (max-width: 767px) {
  .new-section.blog {
    padding: 20px 0 50px;
  }

  /* Only now does the sidebar drop below the post. */
  .new-section.blog-post .container > .d-flex {
    flex-wrap: wrap;
  }

  .new-section.blog-post .main-content,
  .blog-post.new-section .sidebar {
    width: 100%;
    padding-right: 0;
  }

  .new-section.blog-post .sidebar {
    margin-top: 45px;
  }

  .new-section.blog-post .related .related-posts {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .new-section.blog-post .related .related-card,
  .new-section.blog-post .featured .related-card {
    padding: 15px;
  }

  .new-section.blog-post .featured .related-posts h4 {
    font-size: 20px;
  }

  .new-section.blog-post .related-badge {
    left: 25px;
    top: 25px;
  }

  .new-section.blog-post .related-card .blog-thumb img,
  .new-section.blog-post .related-post-img-block {
    height: 200px;
  }

  .new-section.blog .blog-grid {
    margin-top: 35px;
  }

  .new-section.blog .blog-card {
    padding: 15px;
  }

  .new-section.blog .blog-thumb,
  .new-section.blog .blog-img-block {
    height: 200px;
  }

  .new-section.blog .blog-title {
    margin: 16px 0;
    font-size: 22px;
    line-height: 1.35;
  }

  .new-section.blog .blog-desc {
    font-size: 15px;
  }
}
