/*
 * WBPA single post/member template — shared by ALL single posts.
 * Two layout branches:
 *   .post-content--member  : 1/3 photo + 2/3 bio/contact grid
 *   .post-layout (.post-main / .post-sidebar) : 3/5 content + 2/5
 *      date/time sidebar, used for article/update/MotM posts
 */

.post-wide-container {
  max-width: 1200px;
  width: 80%;
  margin: 0 auto;
}

/* Neutralize Divi's wrapper divs — default is simple block stacking.
   .post-content--member re-enables flex for the real 1/3-2/3 split. */
.post-content [class*="et_pb_section"],
.post-content [class*="et_pb_row"],
.post-content [class*="et_pb_column"],
.post-content [class*="et_pb_module"],
.post-content [class*="et_pb_text"] {
  display: block;
  width: auto;
  max-width: 100%;
}

/* ---------- Member profile layout: 1/3 photo + 2/3 bio ---------- */

.post-content--member .et_pb_row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
}
.post-content--member .et_pb_column:first-child {
  flex: 0 0 33.333%;
  max-width: 33.333%;
  padding-right: 30px;
  box-sizing: border-box;
}
.post-content--member .et_pb_column:last-child {
  flex: 1 1 0;
  min-width: 0;
}
.post-content--member img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--accent);
  margin: 0 auto 1.25rem;
}

@media (max-width: 860px) {
  /* flex-direction: column is the robust fix here (rather than relying
     on the row to wrap once the first child hits 100% basis) — a few
     mobile browsers don't reliably grow a lone wrapped flex item to
     fill the line, which is what was leaving the bio/contact column
     squeezed into a narrow strip instead of taking the full width. */
  .post-content--member .et_pb_row {
    flex-direction: column;
  }
  .post-content--member .et_pb_column:first-child,
  .post-content--member .et_pb_column:last-child {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
    padding-right: 0;
  }
  .post-content--member .et_pb_text_inner,
  .post-content--member p,
  .post-content--member a {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

/* ---------- Article/update/MotM layout: 3/5 main + 2/5 sidebar ---------- */

.post-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  padding: 2rem 0;
}
.post-main {
  flex: 0 0 70%;
  max-width: 70%;
  min-width: 0;
}
.post-sidebar {
  flex: 0 0 30%;
  max-width: 30%;
  min-width: 0;
}

/* Images in the article body render at their natural size (capped to the
   column width) rather than being stretched full-width. */
.post-main img {
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  border: 1px solid var(--accent);
  margin: 1.5rem 0 1.75rem 0;
}
.post-main h1,
.post-main h2 {
  font-size: 1.8rem;
}

/* No CTA/date box for this post — let the main column use the full width
   instead of leaving the right-hand sidebar empty. */
.post-layout--no-sidebar .post-main {
  flex: 1 1 100%;
  max-width: 100%;
}

.post-meta-box {
  background: var(--accent);
  color: #fff;
  padding: 1.25rem 1.5rem;
  border-radius: 2px;
  margin-top: 44px;
}
.post-meta-box h1,
.post-meta-box h2,
.post-meta-box h3,
.post-meta-box h4,
.post-meta-box h5 {
  color: #fff;
  margin-top: 0;
}
/* h5 (date/time lines) otherwise falls back to the browser's smaller
   default size, visibly smaller than the address paragraph next to it.
   Match it to the box's body/paragraph text size. */
.post-meta-box h4,
.post-meta-box h5 {
  font-size: 1rem;
  font-weight: 400;
}
.post-meta-box p:last-child { margin-bottom: 0; }
.post-meta-box hr { border-top-color: rgba(255, 255, 255, 0.5); }
.post-meta-box a { color: #fff; text-decoration: underline; }

/* Sidebar "Recent Posts" mini-list — reuses the .news-card/.news-grid
   styling from the posts listing page, just stacked single-column to
   fit the narrower 30% sidebar instead of that page's 3-column grid. */
.post-sidebar-heading {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 1.05rem;
  margin: 2rem 0 0.9rem;
}
.post-sidebar .news-grid {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .post-layout { flex-direction: column; }
  .post-main,
  .post-sidebar { flex: 1 1 100%; max-width: 100%; }
}

@media (max-width: 760px) {
  .post-wide-container { width: 92%; }
}

/* ---------- Typography shared by both layouts ---------- */

.post-content h1,
.post-content h2 { color: var(--accent); font-size: 1.6rem; margin: 1.5rem 0 0.5rem; }
.post-content h1:first-child,
.post-content h2:first-child { margin-top: 0; }
.post-content h3 { color: var(--accent); font-size: 1.2rem; margin: 0 0 0.75rem; }
.post-content h4,
.post-content h5 { color: var(--accent); font-size: 1.05rem; margin: 1.25rem 0 0.4rem; }
.post-content p { margin: 0 0 1em; line-height: 1.65; }
.post-content hr { border: none; border-top: 2px dashed var(--accent); margin: 1.25rem 0; }
.post-content a { text-decoration: underline; }
.post-content strong { font-weight: 700; }
.post-content ul,
.post-content ol { margin: 0 0 1em; padding-left: 1.3rem; }

.post-content .et_pb_blog_grid,
.post-content .et-social-icons-container,
.post-content [id*="post-sidebar"] { display: none; }

.post-back-link { text-align: center; padding: 0.5rem 0 1rem; }
