/* Blog (blog.tpl, blog-post.tpl). Tokens from front.css. */

body.page-blog {
  background: var(--soft);
}

/* TOP */
.blog-top {
  padding: 34px 0 6px;
}
.blog-top .eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-ink);
}
.blog-top h1 {
  margin: 0;
  font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink);
}
.blog-top p {
  max-width: 640px;
  margin: 10px 0 0;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 16px; line-height: 1.5; color: var(--muted);
}
.blog-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 18px;
}
.blog-chips a, .blog-chips a:hover {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 14px; font-weight: 600; color: var(--ink);
  background: #FFF;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.blog-chips a:hover {
  border-color: var(--brand);
}
.blog-chips a span {
  font-size: 12px; color: var(--muted);
}
.blog-chips a.active {
  color: #FFF;
  background: var(--brand-ink);
  border-color: var(--brand-ink);
}
.blog-chips a.active span {
  color: rgba(255, 255, 255, 0.8);
}

/* CARDS */
.blog-list {
  padding: 22px 0 56px;
}
.blog-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px;
}
.blog-card {
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif;
  background: #FFF;
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-card:hover {
  border-color: #CFE3DD;
  box-shadow: 0 16px 36px -24px rgba(12, 30, 26, 0.45);
}
.blog-card-media, .blog-card-media:hover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--brand-soft);
  border: 0;
}
.blog-card-media img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-media img {
  transform: scale(1.04);
}
.blog-card-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 34px; color: var(--brand-ink);
}
.blog-card-body {
  display: flex; flex-direction: column; gap: 8px; flex: 1;
  padding: 18px;
}
.blog-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 13px; font-weight: 600; color: var(--muted);
}
.blog-cat, a.blog-cat:hover {
  padding: 3px 10px;
  font-size: 12px; font-weight: 700; color: var(--brand-deep);
  background: var(--brand-soft);
  border: 0;
  border-radius: 999px;
}
.blog-card h2, .blog-card h3 {
  margin: 0;
  font-family: Raleway, sans-serif; font-size: 19px; font-weight: 800; line-height: 1.25; color: var(--ink);
}
.blog-card h2 a, .blog-card h3 a, .blog-card h2 a:hover, .blog-card h3 a:hover {
  color: inherit;
  border: 0;
}
.blog-card h2 a:hover, .blog-card h3 a:hover {
  color: var(--brand-ink);
}
.blog-card p {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 15px; line-height: 1.55; color: #42504C;
}
.blog-more, .blog-more:hover {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: auto; padding-top: 6px;
  font-size: 14px; font-weight: 700; color: var(--brand-ink);
  border: 0;
}
.blog-empty {
  padding: 28px;
  font-family: Figtree, sans-serif; text-align: center; color: var(--muted);
  background: #FFF;
  border: 1px dashed var(--line);
  border-radius: 18px;
}

/* Pagination (Pagination::paginate() prints a table) */
.blog-pages {
  margin-top: 26px;
}
.blog-pages table {
  margin: 0 auto;
}
.blog-pages td {
  padding: 0 3px;
}
.blog-pages a, .blog-pages span, .blog-pages strong {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 12px;
  font-family: Figtree, sans-serif; font-size: 14px; font-weight: 700; color: var(--ink);
  background: #FFF;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.blog-pages a:hover {
  border-color: var(--brand-ink);
}

/* ARTICLE */
.blog-article-head {
  padding: 30px 0 10px;
}
.blog-article-head .site-width {
  max-width: 820px;
}
.blog-back, .blog-back:hover {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
  font-family: Figtree, sans-serif; font-size: 14px; font-weight: 700; color: var(--brand-ink);
  border: 0;
}
.blog-article-head h1 {
  margin: 12px 0 0;
  font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink);
  text-wrap: balance;
}
.blog-lede {
  margin: 14px 0 0;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 18px; line-height: 1.55; color: var(--muted);
}
.blog-article-wrap {
  display: flex; flex-direction: column; gap: 24px;
  padding: 12px 0 40px;
}
.blog-content {
  min-width: 0;
  padding: 24px;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif; font-size: 17px; line-height: 1.75; color: #26322E;
  background: #FFF;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow-wrap: anywhere;
}
.blog-content p {
  margin: 0 0 1em;
}
.blog-content h2, .blog-content h3, .blog-content h4 {
  margin: 1.4em 0 0.5em;
  font-family: Raleway, sans-serif; font-weight: 800; line-height: 1.25; color: var(--ink);
}
.blog-content h2 { font-size: 24px; }
.blog-content h3 { font-size: 20px; }
.blog-content a {
  color: var(--brand-ink);
  text-decoration: underline; text-underline-offset: 2px;
  border: 0;
}
.blog-content img {
  display: block;
  max-width: 100%; height: auto;
  margin: 1em auto;
  border-radius: 12px;
}
.blog-content ul, .blog-content ol {
  margin: 0 0 1em; padding-left: 1.3em;
}
.blog-content blockquote {
  margin: 1em 0; padding: 12px 18px;
  color: var(--muted);
  background: var(--soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
}
.blog-content table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
}
.blog-content td, .blog-content th {
  padding: 8px;
  border: 1px solid var(--line);
}
.blog-tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 24px; padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.blog-tags strong {
  margin-right: 6px;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
.blog-tags span {
  padding: 4px 10px;
  font-size: 13px; color: var(--ink);
  background: var(--soft);
  border-radius: 999px;
}

.blog-cta {
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px;
  font-family: Figtree, "Segoe UI", system-ui, sans-serif;
  color: #FFF;
  background: var(--brand-deep);
  border-radius: 18px;
}
.blog-cta-icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  font-size: 18px; color: var(--ink);
  background: var(--action);
  border-radius: 12px;
}
.blog-cta strong {
  margin-top: 4px;
  font-family: Raleway, sans-serif; font-size: 20px; font-weight: 800;
}
.blog-cta p {
  margin: 0;
  font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.85);
}
.blog-cta a, .blog-cta a:hover {
  display: flex; align-items: center; justify-content: center;
  height: 46px;
  margin-top: 8px;
  font-size: 15px; font-weight: 700; color: var(--ink);
  background: var(--action);
  border: 0;
  border-radius: 12px;
}
.blog-cta a:hover {
  background: var(--action-hover);
}

.blog-related {
  padding-top: 0;
}
.blog-related h2 {
  margin: 0 0 16px;
  font-size: 22px; font-weight: 800; color: var(--ink);
}

@media screen and (min-width: 640px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .blog-content {
    padding: 32px;
  }
}
@media screen and (min-width: 768px) {
  .blog-top {
    padding-top: 48px;
  }
  .blog-top h1, .blog-article-head h1 {
    font-size: 40px;
  }
}
@media screen and (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  /* the newest post leads, across two columns with its picture beside it */
  .blog-card-lead {
    grid-column: span 3;
    flex-direction: row;
  }
  .blog-card-lead .blog-card-media {
    flex: 0 0 58%;
    aspect-ratio: auto;
    min-height: 340px;
  }
  .blog-card-lead .blog-card-body {
    justify-content: center;
    padding: 32px;
  }
  .blog-card-lead h2 {
    font-size: 28px;
  }
  .blog-article-wrap {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 28px;
    max-width: 1140px;
  }
  .blog-article-head .site-width {
    max-width: 1140px;
  }
  .blog-article-head .site-width > * {
    max-width: 812px;
  }
  .blog-side {
    position: sticky; top: calc(var(--header-h) + 20px);
  }
}
