/*
 * Shared blog layout, loaded by every page in /blog/. It overrides the older
 * styles copied into each post, so all posts lay out the same way:
 *   desktop: article and comments on the left, About Me / Popular Post /
 *            Follow Me on the right
 *   narrow screens: one column, with the sidebar under the comments
 */

/* The logo box was fixed at 150px but the logo is taller, so it slid under
   the menu. Let the box fit the logo, like the rest of the site. */
#heading1 #rightHd,
#heading1 #logo { height: auto; }

.row.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  column-gap: 24px;
  align-items: start;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 20px;
}
.row.blog-layout::after { content: none; }

.blog-layout > .leftcolumn,
.blog-layout > .rightcolumn {
  float: none;
  width: auto;
  height: auto;
  margin: 20px 0 0;
  column-count: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* Article (or post list), sidebar, then comments */
.blog-layout > .leftcolumn:first-child { grid-column: 1; grid-row: 1; }
.blog-layout > .rightcolumn { grid-column: 2; grid-row: 1 / span 2; }
.blog-layout > .rightcolumn + .leftcolumn { grid-column: 1; grid-row: 2; }

.blog-layout > .leftcolumn > .card,
.blog-layout > .rightcolumn > .card {
  float: none;
  width: auto;
  margin: 0 0 20px;
  box-sizing: border-box;
}
.blog-layout .card img:not(.myimg) { max-width: 100%; height: auto; }

/* Articles, post list entries and comments: white rounded cards, matching
   the sidebar cards */
.blog-layout > .leftcolumn > .card {
  background: white;
  border: 1px solid black;
  border-radius: 25px;
  padding: 20px 24px;
}

@media screen and (max-width: 900px) {
  .row.blog-layout { grid-template-columns: minmax(0, 1fr); width: 95%; }
  .blog-layout > .rightcolumn { grid-column: 1; grid-row: 3; }
}

/* Sidebar ad (templates/ad-banner.php) */
.blog-layout .ad-card { min-height: 120px; overflow: hidden; }
.blog-layout .ad-label { margin: 0 0 6px; font-size: 11px; color: #777; text-transform: uppercase; letter-spacing: 0.05em; }

/*
 * Article body building blocks. Wrap a post's content in <div class="post">
 * to use them. Older posts don't use the wrapper, so they are unaffected.
 */
.aContent .post {
  --post-accent: #e8448f;
  --post-muted: #666;
  --post-soft: #f6f3f8;
  max-width: 780px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.7;
  text-align: left;
  color: #222;
}
.aContent .post p,
.aContent .post li { width: auto; line-height: 1.7; margin: 0 0 16px; }
/* The older page styles turn every <ul> into 4 centered columns. */
.aContent .post ul { columns: auto; column-count: auto; text-align: left; padding-left: 22px; margin: 0 0 16px; }
.aContent .post h2 {
  width: auto;
  font-size: 26px;
  line-height: 1.3;
  margin: 40px 0 14px;
  padding-left: 12px;
  border-left: 5px solid var(--post-accent);
}
.aContent .post a { color: #b51f66; }
.aContent .post .post-lede { font-size: 21px; line-height: 1.6; font-weight: 500; }

.aContent .post figure { margin: 24px 0; }
.aContent .post figure img { display: block; width: 100%; height: auto; border-radius: 12px; }
.aContent .post figcaption { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--post-muted); text-align: center; }

/* Quick facts: box art beside a list */
.aContent .post .post-facts {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin: 28px 0;
  padding: 20px;
  background: var(--post-soft);
  border-radius: 16px;
}
.aContent .post .post-facts figure { margin: 0; }
.aContent .post .post-facts h3 { width: auto; margin: 0 0 10px; font-size: 20px; line-height: 1.3; }
.aContent .post .post-facts ul { margin: 0; padding-left: 20px; }
.aContent .post .post-facts li { margin-bottom: 8px; }

.aContent .post blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--post-accent);
  font-size: 21px;
  font-style: italic;
}
.aContent .post blockquote p { margin: 0 0 6px; }
.aContent .post blockquote cite { font-size: 15px; font-style: normal; color: var(--post-muted); }

/* Responsive 16:9 video embeds */
.aContent .post .post-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.aContent .post .post-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Two-up grid for images or videos */
.aContent .post .post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.aContent .post .post-grid figure { margin: 0; }

.aContent .post .post-sources { margin-top: 40px; padding-top: 16px; border-top: 1px solid #ddd; font-size: 15px; }
.aContent .post .post-sources h2 { font-size: 20px; border: 0; padding: 0; margin: 0 0 8px; }
.aContent .post .post-sources li { margin-bottom: 6px; }

@media screen and (max-width: 600px) {
  .aContent .post { font-size: 17px; }
  .aContent .post .post-facts,
  .aContent .post .post-grid { grid-template-columns: minmax(0, 1fr); }
  .aContent .post .post-facts figure { max-width: 220px; margin: 0 auto; }
}
