/* Blog list and article pages, in the look of the rest of the site.
   The site sets 1rem = 10px and a global "img { width: 100% }", which the rules
   below account for. */

/* Banner under the fixed header, same as the other inner pages */
.kv-wrapper {
  position: relative;
  width: 100%;
  height: auto;
}

.kv-img {
  z-index: -1;
}

.kv-copy-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 20px 80px;
  max-width: 60%;
  margin: 0 auto;
}

.contact-title {
  text-align: center;
  color: #fff;
  font-size: 2rem;
  letter-spacing: 0.2em;
  font-weight: 100;
}

.blog-section {
  padding: 60px 0 80px;
}

.blog-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.blog-container-narrow {
  max-width: 760px;
}

.blog-intro-text {
  margin-bottom: 50px;
  text-align: center;
  font-size: 1.5rem;
  line-height: 2.2;
}

/* Card grid: one column on phones, two on tablets, three on desktop */
.blog-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  color: #333;
  text-decoration: none;
}

.blog-card-image {
  display: block;
  overflow: hidden;
  background: #eee;
  aspect-ratio: 8 / 5;
}

.blog-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-image img,
.blog-card:focus-visible .blog-card-image img {
  transform: scale(1.04);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.blog-card-category {
  display: inline-block;
  padding: 1px 12px;
  border: 1px solid #CD3E2B;
  color: #CD3E2B;
  font-size: 1.2rem;
  line-height: 1.8;
}

.blog-card-date {
  font-size: 1.2rem;
  color: #777;
}

.blog-card-title {
  font-size: 1.6rem;
  line-height: 1.8;
  color: #1f1f1f;
}

.blog-card-more {
  margin-top: auto;
  font-size: 1.3rem;
  color: #CD3E2B;
}

.blog-card-more::after {
  content: ' \2192';
}

.blog-empty {
  padding: 40px 0;
  text-align: center;
}

/* Pagination and buttons */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 60px;
}

.blog-pagination-status {
  font-size: 1.3rem;
  color: #777;
}

.blog-button {
  display: inline-block;
  min-width: 240px;
  padding: 10px 30px;
  box-sizing: border-box;
  border: 1px solid #222;
  border-radius: 10px;
  background: #222;
  color: #fff;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.blog-button:hover,
.blog-button:focus-visible {
  background: #fff;
  color: #222;
}

.blog-button-quiet {
  min-width: 0;
  background: transparent;
  color: #222;
}

.blog-button-quiet:hover,
.blog-button-quiet:focus-visible {
  background: #222;
  color: #fff;
}

/* Article */
.article-header {
  margin-bottom: 30px;
  text-align: center;
}

.article-category {
  display: inline-block;
  padding: 1px 14px;
  border: 1px solid #CD3E2B;
  color: #CD3E2B;
  font-size: 1.3rem;
}

.article-title {
  margin: 16px 0 10px;
  font-size: 2.4rem;
  line-height: 1.7;
  font-weight: 100;
  color: #1f1f1f;
}

.article-date {
  display: block;
  font-size: 1.3rem;
  color: #777;
}

.article-cover {
  margin: 0 0 40px;
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.article-body {
  font-size: 1.6rem;
  line-height: 2.1;
  overflow-wrap: anywhere;
}

.article-body > * + * {
  margin-top: 1.5em;
}

.article-body h2,
.article-body h3 {
  margin-top: 2.4em;
  line-height: 1.7;
  font-weight: 100;
  color: #1f1f1f;
}

.article-body h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid #ccc;
  font-size: 2.1rem;
}

.article-body h3 {
  font-size: 1.8rem;
}

.article-body a {
  color: #CD3E2B;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body blockquote {
  margin-left: 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid #CD3E2B;
  color: #555;
}

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

.article-body th,
.article-body td {
  padding: 10px 12px;
  border: 1px solid #ccc;
  text-align: left;
}

.article-back {
  margin-top: 60px;
  text-align: center;
}

@media screen and (min-width: 600px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 960px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 50px 34px;
  }
}

@media screen and (max-width: 767px) {
  .kv-copy-wrapper {
    padding: 10px 30px;
    width: 70%;
    max-width: none;
    box-sizing: border-box;
  }

  .contact-title {
    font-size: 1.6rem;
  }

  .blog-section {
    padding: 40px 0 60px;
  }

  .blog-intro-text {
    font-size: 1.3rem;
    margin-bottom: 40px;
  }

  .article-title {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card-image img {
    transition: none;
  }
}
