/*
 * RF Custom Blog (2025)
 * Consolidated styles for blog templates + archives + single enhancements.
 */

:root{
  --blog-divider-color: rgba(0,0,0,0.25);
  --blog-radius: 3px;
  --container-lg-width: var(--container-lg-width, 1600px);
  --category-archive-top-offset: 120px;
  --category-archive-top-offset-mobile: 96px;
}

/* GLOBAL WRAPPERS */
#primaryWrapperHomepage{ padding-top: 7em; }

/* Image radius within blog experience */
#primaryHomepage img,
.cat-archive img,
article img,
.jbweb-post-cta img,
.jbweb-related-posts img{
  border-radius: var(--blog-radius);
}

/* Site-width inner container (used by some theme sections) */
.section-inner{
  max-width: var(--container-lg-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Ensure span + dark-section text matches blog template intent (scoped to primary content) */
#primaryHomepage .bg-medium-green span{ color:#fff !important; font-style: italic; }
#primaryHomepage :not(.bg-medium-green) span{ font-style: italic; }
#primaryHomepage .bg-medium-green h1,
#primaryHomepage .bg-medium-green h2,
#primaryHomepage .bg-medium-green h3,
#primaryHomepage .bg-medium-green h4,
#primaryHomepage .bg-medium-green h5,
#primaryHomepage .bg-medium-green h6,
#primaryHomepage .bg-medium-green p,
#primaryHomepage .bg-medium-green a{ color:#fff !important; }

/* DIVIDERS */
.blog-h1-divider{ margin: 12px 0 24px; }
.blog-section-divider,
.blog-section-divider-featured{
  border: 0;
  border-top: 1px solid var(--blog-divider-color);
  width: 100%;
  max-width: var(--container-lg-width);
  margin: 4rem auto;
}
.blog-section-divider-featured{ margin: 2rem auto; }
.blog-mini-divider{
  border: 0;
  border-top: 1px solid var(--blog-divider-color);
  width: 10%;
  max-width: 520px;
  margin: 10px 0;
}
.news-events-title-list li:last-child .blog-mini-divider,
.custom-category-post-list li:last-child .blog-mini-divider{ display:none; }

/* SUBTITLE + LINK */
.post-subtitle-link,
.post-subtitle-link:visited,
.post-subtitle-link:hover,
.post-subtitle-link:active,
.post-subtitle-link:focus{
  color: inherit !important;
  font: inherit !important;
  font-weight: inherit !important;
  text-decoration: none !important;
}
.post-subtitle{ margin:0; color:#000; font-size:1rem; line-height:1.5; }

/* META */
.postAuthor,
.postAuthor *,
.hero-post-author,
.hero-post-author *{ font-style: italic; }
.hero-post-author,
.postAuthor{ margin: 8px 0 0; font-size: 1.1em; font-weight: 300; color: inherit; }
.hero-post-author-link,
.hero-post-author-link:visited{ color: inherit; text-decoration:none; }
.hero-post-author-link:hover{ text-decoration: underline; }
.custom-category-post-meta.hero-post-author{ margin: 4px 0 0; font-size: 1.105em; }

/* BLOG PAGE UTIL */
.section-top-content{ margin-bottom: 24px; }
.blog-section-heading{ margin: 0 0 40px 0; }
.blog-hero-right.with-divider{ border-left: 1px solid rgba(0,0,0,0.1); padding-left: 2rem; }

/* FEATURED + HERO */
.custom-featured{ display:flex; flex-direction:column; gap:18px; flex:1; min-height:0; }
.custom-featured .image{ position:relative; width:100%; aspect-ratio:3/2; overflow:hidden; border-radius: var(--blog-radius); flex:0 0 auto; }
.custom-featured .image a{ position:absolute; inset:0; display:block; }
.custom-featured .image img{ position:absolute; inset:0; width:100% !important; height:100% !important; object-fit:cover !important; display:block; }

.custom-hero-grid{ display:grid; grid-template-columns: minmax(0,2.3fr) minmax(0,0.9fr); gap:30px; align-items:stretch; }
.custom-hero-left{ display:flex; flex-direction:column; height:100%; min-height:0; }
.custom-hero-right{ display:flex; flex-direction:column; gap:30px; height:100%; min-height:0; }
.custom-hero-row{ display:grid; grid-template-columns: repeat(3,1fr); gap:30px; }
.custom-hero-row-item{ display:flex; flex-direction:column; gap:12px; }
.custom-hero-row-item .thumb,
.custom-hero-side-item .thumb{ display:block; }
.custom-hero-row-item img,
.custom-hero-side-item img{ width:100%; aspect-ratio:3/2; object-fit:cover; display:block; }
.custom-hero-side-item{ display:flex; flex-direction:column; gap:12px; }

/* TAG PILLS */
.hero-post-tags{ margin:10px 0 0; padding:0; list-style:none; display:flex; flex-wrap:wrap; gap:10px; }
.hero-post-tags li{ margin:0; padding:0; }
.hero-post-tags .tag-pill,
.hero-post-tags .tag-pill:visited{ display:inline-block; padding:4px 12px; border-radius: var(--blog-radius); background: rgba(0,0,0,0.04); color:inherit; text-decoration:none; font-size:.85em; line-height:1.2; font-style:normal; font-weight:300; }
.hero-post-tags .tag-pill:hover{ background: rgba(0,0,0,0.08); }
.bg-medium-green .hero-post-tags .tag-pill,
.bg-medium-green .hero-post-tags .tag-pill:visited{ background: rgba(255,255,255,0.18); }
.bg-medium-green .hero-post-tags .tag-pill:hover{ background: rgba(255,255,255,0.26); }

/* CTA (BLOG PAGE + SINGLE) */
.custom-cta{ padding-top: 2rem; display:block; width:100%; background-color: transparent; }
.custom-cta-stack{ width:100%; }
.custom-cta-heading{ margin:0 0 1rem 0; }
.jbweb-post-cta .jbweb-stay-connected-title{ margin:0 0 1rem 0; }
.jbweb-post-cta .custom-cta{ padding-top:0; }

/* NEWS & EVENTS */
.news-events-split{ display:flex; gap:40px; align-items:flex-start; }
.news-events-featured{ flex:0 0 33.333%; max-width:33.333%; }
.news-events-featured-card .text{ margin-top:14px; }
.news-events-featured-thumb{ display:block; }
.news-events-featured-thumb img{ width:100%; height:auto; aspect-ratio:3/2; object-fit:cover; }
.news-events-list{ flex:1; }
.news-events-caption{ margin:0 0 10px 0; font-size:.85em; letter-spacing:.06em; text-transform:uppercase; opacity:.8; }
.news-events-title-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:0; }
.news-events-title{ margin:0; }
.news-events-date{ margin:4px 0 0; font-size:1.105em; opacity:.8; }
.news-events-view-all{ display:inline-block; margin-top:16px; text-decoration:none; font-size:.85em; letter-spacing:.06em; text-transform:uppercase; font-weight:600; }
.news-events-view-all:hover{ text-decoration:underline; }

/* ALL POSTS GRID */
.custom-all-posts-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:30px; }
.custom-category-card{ display:flex; flex-direction:column; gap:14px; }
.custom-category-card img{ width:100%; aspect-ratio:3/2; object-fit:cover; }
.custom-category-post-list{ list-style:none; padding:0; margin:0; }
.custom-category-post-title{ margin:0; font-size:1.5em; line-height:1.4; }
.custom-category-post-title a,
.custom-category-post-title a:visited{ color:inherit; text-decoration:none; }
.custom-category-post-title a:hover{ text-decoration:underline; }

/* CATEGORY + TAG ARCHIVES */
.cat-archive{ padding: var(--category-archive-top-offset) 0 70px; }
body.admin-bar .cat-archive{ padding-top: calc(var(--category-archive-top-offset) + 32px); }
@media (max-width: 980px){ .cat-archive{ padding-top: var(--category-archive-top-offset-mobile); } }

.cat-header{ margin-bottom: 24px; }
.cat-top-grid{ display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:26px; }
.cat-card a{ display:block; text-decoration:none; color:inherit; }
.cat-thumb{ position:relative; width:100%; aspect-ratio:3/2; overflow:hidden; border-radius: var(--blog-radius); background: rgba(0,0,0,0.04); }
.cat-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.cat-card-text{ margin-top:10px; }
.cat-card-title,
.cat-row-title{ margin:0 0 8px 0; }
.cat-card-title a,
.cat-row-title a{ text-decoration:none; color:inherit; }
.cat-card-title a:hover,
.cat-row-title a:hover{ text-decoration:underline; }
.cat-divider{ border:0; border-top:1px solid var(--blog-divider-color); margin:32px 0; }
.cat-all-head{ margin-bottom:14px; }
.cat-all-title{ margin:0; }
.cat-all-list{ display:grid; gap:18px; }
.cat-row{ display:grid; grid-template-columns:200px 1fr; gap:18px; align-items:start; padding-top:18px; border-top:1px solid var(--blog-divider-color); }
.cat-row:first-child{ border-top:0; padding-top:0; }
.see-more-wrap{ margin-top:20px; display:flex; }
.see-more-btn{ appearance:none; border:1px solid rgba(0,0,0,0.25); background:transparent; padding:10px 14px; border-radius:999px; cursor:pointer; font:inherit; }
.see-more-btn[disabled]{ opacity:.55; cursor:default; }
@media (max-width:980px){
  .cat-top-grid{ grid-template-columns:1fr; }
  .cat-row{ grid-template-columns:1fr; }
  .cat-row .cat-thumb{ max-width:520px; }
}

/* SINGLE RELATED POSTS SECTION */
.jbweb-related-posts{ padding:40px 0; }
.jbweb-related-posts .jbweb-related-heading{ margin:0 0 24px 0; }

/* RESPONSIVE (shared) */
@media(max-width:1062px){
  .custom-hero-grid{ grid-template-columns:1fr; width:100%; }
  .custom-hero-left,
  .custom-hero-right{ width:100%; max-width:100%; }
  .custom-hero-row{ grid-template-columns:1fr; }
  .custom-hero-row-item{ flex-direction:row; align-items:flex-start; gap:20px; }
  .custom-hero-row-item .thumb{ flex:0 0 45%; max-width:45%; }
  .custom-hero-row-item img{ width:100%; height:auto; }
  .custom-hero-row-item .text{ flex:1; }
  .blog-hero-right.with-divider{ border-left:none; padding-left:0; margin-top:2rem; }
  .custom-all-posts-grid{ grid-template-columns:1fr; }
  .news-events-split{ flex-direction:column; width:100%; gap:30px; }
  .news-events-featured{ width:100%; max-width:100%; }
}

/* =========================================================
   BLOG CTA FORM (moved from WP Additional CSS)
========================================================= */

/* Hide Ninja Forms required note */
.putney-newsletter-form .nf-form-fields-required{ display:none !important; }

/* Ensure submit aligns left */
.blog-form-sumbit{ text-align:left !important; }

/* Form Background Styling */
#nf-form-4-cont > div > div.nf-form-layout > form > div > div.nf-form-content.blog-form-wrap{
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  padding: 1.5rem;
}

/* Remove bottom padding on last form field only */
#nf-form-4-cont > div > div.nf-form-layout > form > div > div.nf-form-content.blog-form-wrap
nf-fields-wrap > nf-field:last-child .nf-field-container{
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

#nf-form-4-cont > div > div.nf-form-layout > form > div > div.nf-form-content.blog-form-wrap
nf-fields-wrap > nf-field:last-child{
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Desktop / default (two-column) */
.putney-newsletter-row{
  display:flex;
  width:100%;
  gap:24px;
  align-items:flex-start;
  justify-content:space-between;
}

.putney-newsletter-col--left{
  flex:0 0 calc(40% - 12px);
  max-width:calc(40% - 12px);
  box-sizing:border-box;
}

.putney-newsletter-col--right{
  flex:0 0 calc(50% - 12px);
  max-width:calc(50% - 12px);
  align-content:right;
  box-sizing:border-box;
}

.putney-newsletter-image{
  display:block;
  width:100%;
  aspect-ratio:4 / 3;
  object-fit:cover;
  height:auto;
  margin:0 0 16px 0;
  border-radius:8px;
}

.putney-newsletter-text{
  font-family:inherit;
  font-size:18px;
  line-height:1.5;
  margin:0;
}

@media (max-width: 767px){
  .putney-newsletter-row{
    flex-direction:column;
    gap:24px;
    align-items:stretch;
  }

  .putney-newsletter-col--left,
  .putney-newsletter-col--right{
    flex:0 0 auto;
    width:100%;
    max-width:100%;
  }
}
