/* Blog — index listing + article pages.
 *
 * Loaded on top of ../index.css and deliberately thin: layout, backgrounds and
 * spacing come from the site's own system, not from here.
 *
 *   .padding-global > .container-large        grey (#f8f8f8) rounded 3rem block
 *   .padding-global > .container-large.bglight  same, but white
 *   .container-large.hero                     transparent (used for page heroes)
 *   .section-padding-large                    6rem 2rem vertical rhythm
 *   .tagline-pill                             green kicker pill
 *   .heading-style-h2.weight-medium           section heading
 *   .text-size-medium                         1.25rem lead paragraph
 *
 * Rule of thumb followed here: grey cards live on white sections, never on grey.
 */

/* The navbar is fixed, so the site offsets whichever section comes first:
   .section-contact has margin-top 4rem, .section-hero-header padding-top 4rem.
   .section-projects has neither (on the homepage it never comes first), so a
   page that opens with it slides under the navbar — badly on mobile. */
.section-page-top {
  margin-top: 4rem;
}

/* ---------- index listing ---------- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-column-gap: 3rem;
  grid-row-gap: 3rem;
  align-items: stretch;
  /* matches the 3rem gap .project-section-header leaves above the project grid */
  margin-top: 4rem;
}

/* Mirrors .div-block-5 (the project cards) so the blog reads as the same site. */
.blog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--light-grey);
  border-radius: 1rem;
  padding: 2rem;
  text-decoration: none;
  color: var(--black);
  transition: transform .2s, box-shadow .2s;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(23, 23, 23, .09);
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: #6b6b6b;
}

.blog-card-tag {
  background-color: var(--green);
  border-radius: 100rem;
  padding: .2rem .7rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--black);
}

.blog-card h2 {
  margin-top: 1.5rem;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.3;
}

.blog-card p {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #4a4a4a;
}

.blog-card-more {
  margin-top: 2rem;
  font-weight: 600;
  font-size: .9375rem;
}

.blog-card-more::after {
  content: " →";
}

/* ---------- article ---------- */

/* Article pages narrow the whole section block to the reading column.
   Left full-width, a 44rem text column inside a 105rem block leaves ~500px of
   dead space to its right at 1440px (and ~750px at 1728px). Note .container-large
   ships with `margin-right: 2rem`, so both margins must be set to actually centre. */
.container-large.is-article {
  max-width: 58rem;
  margin-left: auto;
  margin-right: auto;
}

.article {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

/* .tagline-pill is authored as a div in index.css; as a link it needs these. */
a.tagline-pill {
  color: var(--black);
  text-decoration: none;
  transition: opacity .2s;
}

a.tagline-pill:hover {
  opacity: .75;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: #6b6b6b;
}

.article-body {
  margin-top: 3rem;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.article-body > *:first-child {
  margin-top: 0;
}

.article-body h2 {
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.25;
}

.article-body h3 {
  margin-top: 2.5rem;
  margin-bottom: .625rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.article-body p {
  margin-bottom: 1.25rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.5rem 1.25rem;
}

.article-body li {
  margin-bottom: .625rem;
  padding-left: .25rem;
}

.article-body a {
  color: var(--black);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

.article-body a:hover {
  background-color: var(--green);
  text-decoration: none;
}

.article-body strong {
  font-weight: 600;
}

/* Wide tables scroll inside their own box so the page never does. */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 2rem;
  border-radius: 1rem;
  background-color: var(--light-grey);
  padding: .5rem 1.5rem 1rem;
}

.article-body table {
  width: 100%;
  min-width: 26rem;
  border-collapse: collapse;
  font-size: .9375rem;
}

.article-body th,
.article-body td {
  text-align: left;
  padding: .75rem .75rem;
  border-bottom: 1px solid #e0e0e0;
}

.article-body tr:last-child td {
  border-bottom: 0;
}

.article-body th {
  font-weight: 600;
}

/* Only the last column (prices, durations) is kept on one line. A blanket
   nowrap on every column but the first blew the table far past the text
   column, because the wide "what it includes" column could never wrap. */
.article-body td:last-child,
.article-body th:last-child {
  white-space: nowrap;
}

.callout {
  background-color: var(--light-grey);
  border-left: 4px solid var(--green);
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
  margin: 2.5rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---------- calculator CTA ---------- */

/* Green block, same family as .contact-form-block on the contact page. */
.blog-cta {
  background-color: var(--green);
  color: var(--black);
  border-radius: 2rem;
  padding: 3rem;
}

.blog-cta h2 {
  margin: 0 0 .75rem;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.25;
}

.blog-cta p {
  max-width: 38rem;
  margin: 0 0 2rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.blog-cta-button {
  display: inline-block;
  background-color: var(--black);
  color: var(--white);
  border-radius: 100rem;
  padding: .8125rem 1.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity .2s;
}

.blog-cta-button:hover {
  opacity: .85;
}

/* ---------- related ---------- */

.related-heading {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.related-link {
  display: block;
  background-color: var(--light-grey);
  border-radius: 1rem;
  padding: 1.75rem;
  text-decoration: none;
  color: var(--black);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.4;
  transition: transform .2s, box-shadow .2s;
}

.related-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(23, 23, 23, .09);
}

/* ---------- responsive ---------- */

@media screen and (max-width: 991px) {
  .blog-grid {
    grid-template-columns: 1fr;
    grid-row-gap: 2rem;
  }
}

@media screen and (max-width: 767px) {
  .related-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .blog-cta {
    padding: 2rem;
    border-radius: 1.5rem;
  }

  .blog-card {
    padding: 1.5rem;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-body h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
  }

  .table-scroll {
    padding: .5rem 1rem 1rem;
  }
}
