/* blog.css — blog.html */

body.blog-page #main-content {
  overflow-x: clip;
}

body.blog-page main {
  overflow-x: clip;
}

/* ——— Hero ——— */
.blog-hero {
  position: relative;
  padding: calc(100px + env(safe-area-inset-top, 0px)) 0 var(--section-pad-y);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--primary) 6%, var(--bg)) 0%,
    var(--bg) 70%
  );
}

.blog-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.blog-hero__badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--secondary);
  border: 1px solid color-mix(in srgb, var(--secondary) 32%, var(--border));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--secondary) 8%, var(--surface));
}

.blog-hero__title {
  font-size: clamp(2rem, 4.8vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--text);
}

.blog-hero__subtitle {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 1.5rem;
}

.blog-hero__cta {
  gap: 0.45rem;
}

.blog-hero__media {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px color-mix(in srgb, var(--text) 8%, transparent);
}

.blog-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ——— Articles grid ——— */
.blog-articles {
  padding: var(--section-pad-y) 0;
}

.blog-articles__header {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.blog-articles__header h2 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.blog-articles__subtitle {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 36rem;
  margin-inline: auto;
  line-height: 1.65;
}

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.blog-filter__btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-filter__btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.blog-filter__btn.is-active,
.blog-filter__btn[aria-pressed="true"] {
  color: #fff;
  border-color: transparent;
  background: var(--gradient);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}

.blog-filter__status {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

.blog-card__topic {
  display: inline-block;
  width: fit-content;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--secondary);
  background: color-mix(in srgb, var(--secondary) 12%, transparent);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.55rem;
  margin-bottom: 0.4rem;
}

.blog-grid__empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 2rem 1rem 3rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--text) 5%, transparent);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.3s ease;
}

.blog-card__media {
  display: block;
  overflow: hidden;
}

.blog-card__media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease;
}

.blog-card__body {
  padding: 1.15rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.blog-card__title {
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.blog-card__title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card__title a:hover {
  color: var(--secondary);
}

.blog-card__excerpt {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.blog-card__link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
}

.blog-card__link:hover {
  text-decoration: underline;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) {
  .blog-card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--secondary) 35%, var(--border));
    box-shadow: 0 14px 32px color-mix(in srgb, var(--secondary) 12%, transparent);
  }

  .blog-card:hover .blog-card__media img {
    transform: scale(1.05);
  }
}

@media (max-width: 1024px) {
  .blog-hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .blog-hero__subtitle {
    margin-inline: auto;
  }

  .blog-hero__media {
    order: -1;
    max-width: 28rem;
    margin-inline: auto;
  }

  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .blog-hero {
    padding-top: calc(88px + env(safe-area-inset-top, 0px));
    padding-bottom: var(--section-pad-y-md);
  }

  .blog-articles {
    padding: var(--section-pad-y-md) 0;
  }

  .blog-hero__cta {
    width: 100%;
    max-width: 20rem;
  }
}

@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .blog-card,
  .blog-card__media img {
    transition: none;
  }
}
