/* =====================================================================
   NE Clean — Blog, archive and single post
   Enqueued on /resources/, the posts page, category/archive pages and
   single posts (see neclean_page_stylesheets() in functions.php).

   Two jobs:
     1. Skin Divi's Blog module (et_pb_blog) to look like the source's
        static .blog-card grid.
     2. Style the single-article and archive Theme Builder templates.
   ===================================================================== */

/* =====================================================================
   1. BLOG MODULE -> source .blog-grid / .blog-card
   ===================================================================== */
.et-l .nec-blog-section .et_pb_ajax_pagination_container .et_pb_blog_posts  {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
	padding: 40px 16px 0;
	max-width: 1150px;
	margin-left: auto;
	margin-right: auto;
}
@media (min-width: 768px) {
    .et-l .nec-blog-section .et_pb_ajax_pagination_container .et_pb_blog_posts  {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .et-l .nec-blog-section .et_pb_ajax_pagination_container .et_pb_blog_posts  {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Related-posts variant is always 3 across from tablet up. */
.et-l .nec-blog-related article {
	margin-bottom:30px !important;
}
@media (min-width: 768px) {
    .et-l .nec-blog-related .et_pb_ajax_pagination_container .et_pb_blog_posts  {
        grid-template-columns: repeat(3, 1fr);
		display: grid;
		    gap: 30px;
    }
}

/* Divi's pagination row must span the whole grid, not sit in a cell. */
.et-l .nec-blog .pagination {
    grid-column: 1 / -1;
    margin-top: 10px;
}

/* --- Card ------------------------------------------------------- */
.et-l .nec-blog .et_pb_post {
    background: var(--nec-white);
    border-radius: var(--nec-radius-lg);
    box-shadow: var(--nec-shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    padding: 0;
}
.et-l .nec-blog .et_pb_post:hover {
    transform: translateY(-8px);
    box-shadow: var(--nec-shadow-md);
    border-color: rgba(134, 168, 115, 0.3);
}

/* Featured image — source .blog-card-img is 220px, cover. */
.et-l .nec-blog .et_pb_image_container,
.et-l .nec-blog .et_main_video_container {
    margin: 0;
    width: 100%;
}
.et-l .nec-blog .et_pb_image_container a,
.et-l .nec-blog .et_pb_image_container img {
    display: block;
    width: 100%;
}
.et-l .nec-blog .et_pb_image_container img {
    height: 220px;
    object-fit: cover;
    border-radius: 0;
}

/* Card body — source .blog-card-content padding: 30px */
.et-l .nec-blog .et_pb_post > :not(.et_pb_image_container) {
    padding-left: 30px;
    padding-right: 30px;
}
.et-l .nec-blog .et_pb_post .post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--nec-text-muted);
    margin-bottom: 15px;
}
.et-l .nec-blog .et_pb_post .post-meta a[rel~="category"],
.et-l .nec-blog .et_pb_post .post-meta a[rel~="tag"] {
    background: rgba(134, 168, 115, 0.1);
    color: var(--nec-primary) !important;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}
.et-l .nec-blog .et_pb_post .entry-title {
    font-family: var(--nec-font);
    color: var(--nec-dark-green);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    padding-top: 0;
}
.et-l .nec-blog .et_pb_post .entry-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}
.et-l .nec-blog .et_pb_post .entry-title a:hover {
    color: var(--nec-primary);
}
.et-l .nec-blog .et_pb_post .post-content {
    color: var(--nec-text-muted);
    line-height: 1.6;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.et-l .nec-blog .et_pb_post .post-content p {
    margin-bottom: 24px;
	font-size: 16px;
}

/* Read more link — source .blog-card-footer with a top border. */
.et-l .nec-blog .et_pb_post .more-link {
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    padding-top: 20px;
    margin-top: auto;
    margin-bottom: 30px;
    color: var(--nec-primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s;
	  text-transform: capitalize;
}
.et-l .nec-blog .et_pb_post .more-link:after {
    content: "\f061"; /* fa-arrow-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.85rem;
}
.et-l .nec-blog .et_pb_post .more-link:hover {
    gap: 12px;
}

#main-content article .wp-pagenavi {
	  margin-top: 40px;
	  text-align: center !important;
	  padding-top: 30px;
	  max-width: 1120px;
	margin-left: auto;
	margin-right: auto;
}

#main-content article .wp-pagenavi a,
#main-content article .wp-pagenavi span {
	border: 1px solid black;
}

#main-content article .wp-pagenavi span.current,
#main-content article .wp-pagenavi a,
#main-content article .wp-pagenavi span.pages {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 35px;
    text-align: center;
    margin: 0 4px;
    border-radius: 5px; /* Makes them square */
    box-sizing: border-box;
    text-decoration: none;
}

/* Inactive pages and next/previous arrows (White background with border) */
#main-content article .wp-pagenavi a,
#main-content article .wp-pagenavi span.pages {
    background-color: #ffffff;
    border: 1px solid #e0e0e0 !important;
    color: #0f172a !important;
}

/* Active page style (Background color added, no border or custom border) */
#main-content article .wp-pagenavi span.current {
    background-color: #16a34a; /* Change this to your preferred active color */
    color: #ffffff !important;
    border: 1px solid #4f46e5;
}

/* Hover effect for inactive buttons */
#main-content article .wp-pagenavi a:hover {
    background-color: #f5f5f5;
    border-color: #cccccc;
}

/* =====================================================================
   2. CATEGORY PILL NAV
   ===================================================================== */
.et-l .nec-pill-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
}
.et-l .nec-pill-nav a {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    background: var(--nec-white);
    color: var(--nec-text-muted);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.et-l .nec-pill-nav a:hover {
    background: rgba(134, 168, 115, 0.05);
    color: var(--nec-dark-green);
    border-color: rgba(134, 168, 115, 0.3);
}
.et-l .nec-pill-nav a.nec-active,
.et-l .nec-pill-nav a[aria-current="page"] {
    background: var(--nec-primary);
    color: var(--nec-white);
    border-color: var(--nec-primary);
    box-shadow: 0 4px 10px rgba(134, 168, 115, 0.3);
}

/* =====================================================================
   3. ARCHIVE HEADER
   ===================================================================== */
.et-l .nec-archive-title h1 {
    color: #fff;
}
.et-l .nec-archive-desc p:empty {
    display: none;
}

/* =====================================================================
   4. SINGLE ARTICLE
   ===================================================================== */
.et-l .nec-article-cats a {
    color: var(--nec-primary);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
}
.et-l .nec-article-title h1,
.et-l .nec-article-title .entry-title {
    color: #fff !important;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.2;
	  text-align: center;
}

.category-title p {
	display: inline-block;
  padding: 6px 16px !important;
  background: rgba(134,168,115,0.2);
  color: #16a34a;
  border-radius: 20px;
  font-weight: 700 !important;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px !important;
  font-size: 0.85rem;
}

.nec-article-cats p {
	display: inline-block;
  padding: 6px 16px !important;
  background: rgba(134,168,115,0.2);
  
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  font-size: 0.85rem;
  text-decoration: none;
}

.et-l .nec-article-byline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.et-l .nec-article-byline img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.et-l .nec-article-byline strong {
    color: #fff;
}

/* Featured image pulled up over the navy header */
.nec-article-body {
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}
.et-l .nec-article-hero-row {
    position: relative;
    z-index: 2;
	  max-width: 1008px !important;
	  top: -35px;
}
.et-l .nec-article-hero-img img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: var(--nec-radius-xl);
    box-shadow: var(--nec-shadow-lg);
}

/* Article prose — source .article-content */
.et-l .nec-article-content h2 {
    color: var(--nec-dark-green);
    font-size: 2rem;
    margin: 40px 0 20px;
}
.et-l .nec-article-content h3 {
    color: var(--nec-dark-green);
    font-size: 1.5rem;
    margin: 30px 0 16px;
}
.et-l .nec-article-content p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--nec-text-muted);
    margin-bottom: 24px;
}
.et-l .nec-article-content ul,
.et-l .nec-article-content ol {
    margin-bottom: 24px;
    padding-left: 20px;
    list-style: disc;
}
.et-l .nec-article-content ol {
    list-style: decimal;
}
.et-l .nec-article-content li {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--nec-text-muted);
    margin-bottom: 12px;
}
.et-l .nec-article-content img {
    border-radius: var(--nec-radius-lg);
    width: 100%;
    margin: 30px 0;
}
.et-l .nec-article-content blockquote {
    border-left: 4px solid var(--nec-primary);
    padding: 20px 30px;
    background: rgba(134, 168, 115, 0.05);
    border-radius: 0 var(--nec-radius-lg) var(--nec-radius-lg) 0;
    margin: 40px 0;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--nec-dark-green);
}

/* Inline CTA box embedded mid-article */
.et-l .nec-article-content .nec-inline-cta {
    background: var(--nec-dark-green);
    border-radius: var(--nec-radius-lg);
    padding: 40px;
    text-align: center;
    margin: 50px 0;
    box-shadow: var(--nec-shadow-md);
}
.et-l .nec-article-content .nec-inline-cta h3 {
    color: #fff;
    margin-top: 0;
}
.et-l .nec-article-content .nec-inline-cta p {
    color: rgba(255, 255, 255, 0.8);
}

/* Author box */
.et-l .nec-author-box {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--nec-radius-lg);
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}
.et-l .nec-author-box img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
    flex-shrink: 0;
}
.et-l .nec-author-box h4 {
    color: var(--nec-dark-green);
    font-size: 1.25rem;
    margin-bottom: 8px;
}
.et-l .nec-author-box p {
    font-size: 1rem;
    margin-bottom: 8px;
}
.et-l .nec-author-box p:last-child {
    margin-bottom: 0;
}

/* =====================================================================
   5. FEATURED POST BLOCK (resources page)
   ===================================================================== */
.nec-featured-post-section  {
	padding-left: 16px !important;
	padding-right: 16px !important;
}



#main-content article .et-l .nec-featured-post {
	border-radius: 24px;
	overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
	  max-width: 1150px !important;
	  align-items: stretch  !important;
}
#main-content article .et-l .nec-featured-post .et_pb_column_2 {
  padding-top: 50px;
  padding-bottom: 50px;
}

.et-l .nec-featured-post .nec-img-wide.et_pb_image_0, 
.et-l .nec-featured-post .nec-img-wide a,
.et-l .nec-featured-post .nec-img-wide .et_pb_image_wrap {
  min-height: 100%;
	height: 100%;
}

.et-l .nec-featured-post .nec-img-wide img {
	border-radius: 0;
	  min-height: 100%;
  height: 100%;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 768px) {
	.nec-featured-post-section .et_pb_column_2 {
		padding: 30px !important
	}
    .et-l .nec-article-hero-img img {
        height: 260px;
    }
    .et-l .nec-article-content p,
    .et-l .nec-article-content li {
        font-size: 1.05rem;
    }
    .et-l .nec-article-content h2 {
        font-size: 1.6rem;
    }
    .et-l .nec-blog .et_pb_post > :not(.et_pb_image_container) {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 600px) {
    .et-l .nec-author-box {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
    }
}

/* =====================================================================
   POST CARD THUMBNAILS — match the source's blog card image
   ---------------------------------------------------------------------
   The design's card image is edge-to-edge, a uniform 220px tall, and
   cropped with object-fit: cover:
       .blog-card img { width:100%; height:220px; object-fit:cover; }

   Divi's Blog module renders the thumbnail inside .et_pb_image_container
   with its own margins, and applies no object-fit — so the images came out
   329px wide inside a 391px card (inset instead of full-bleed), at
   inconsistent heights (205/205/183 against the design's uniform 220), and
   with object-fit:fill, which stretches each thumbnail out of proportion.
   ===================================================================== */
.et-l .nec-blog .et_pb_post .et_pb_image_container,
.et-l .nec-blog .et_pb_post a.entry-featured-image-url {
    display: block;
    margin: 0 0 20px !important;
    width: 100%;
    max-width: none;
    border-radius: 0;
    overflow: hidden;
}

.et-l .nec-blog .et_pb_post .et_pb_image_container img,
.et-l .nec-blog .et_pb_post a.entry-featured-image-url img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: 220px !important;
    object-fit: cover !important;   /* was `fill`, which distorted every thumb */
    object-position: center;
    border-radius: 0;
}

/* The rules above did not reach the thumbnail — Divi's blog markup nests it as
   .et_pb_blog > .et_pb_ajax_pagination_container > article.et_pb_post >
   a.entry-featured-image-url > img, and Divi's own sizing wins on specificity.
   Match its ID-level prefix, as with the button icons. */
body #page-container .nec-blog a.entry-featured-image-url {
    display: block !important;
    width: 100% !important;
    margin: 0 0 20px !important;
	padding: 0;
    overflow: hidden;
}
body #page-container .nec-blog a.entry-featured-image-url img {
    width: 100% !important;
    max-width: 100% !important;
    height: 220px !important;
    object-fit: cover !important;
    display: block !important;
}
