/* site-css/blog.css
   Blog index, Mailchimp embed, subscribe band, and you-might-also-like intro.
   Load after templatemo-personal-style.css (uses :root design tokens). */

/* --- Blog index: magazine lead + grid --- */
main.blog-main.container {
  max-width: min(62rem, 100% - 2.25rem);
  margin-inline: auto;
  padding: 0 0 1.5rem;
}

.blog-hero {
  text-align: left;
  padding: calc(var(--nav-height) + 1.1rem) 0 0.9rem;
  border-bottom: 1px solid var(--line-white-12);
  margin-bottom: 0.35rem;
}

@media (min-width: 600px) {
  .blog-hero {
    text-align: center;
  }
}

.blog-hero h1 {
  font-size: clamp(1.9rem, 1.1rem + 2.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 0.45rem;
  color: var(--text-primary);
}

.blog-hero .lead {
  color: var(--text-secondary);
  max-width: 40rem;
  margin: 0 0 0.35rem;
  line-height: 1.6;
  font-size: 1.02rem;
}

@media (min-width: 600px) {
  .blog-hero .lead {
    margin-inline: auto;
  }
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  padding: 0.55rem 0 1.5rem;
  align-content: start;
}

@media (min-width: 640px) and (max-width: 999px) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .post-card--lead {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1000px) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    padding: 0.4rem 0 1.5rem;
  }
  .post-card--lead {
    grid-column: 1 / -1;
  }
}

.post-card {
  background: var(--surface-raised);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(15, 23, 42, 0.06);
  transition:
    box-shadow 0.22s ease,
    transform 0.22s ease,
    border-color 0.22s ease;
}

.post-card:hover {
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.1);
  transform: translateY(-2px);
  border-color: rgba(15, 23, 42, 0.09);
}

.post-card > a {
  display: block;
  position: relative;
  overflow: hidden;
}

.post-card > a > img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-card:hover > a > img {
  transform: scale(1.03);
}

@media (min-width: 700px) {
  .post-card--lead {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: 0;
  }

  .post-card--lead > a {
    display: block;
    align-self: stretch;
  }

  .post-card--lead > a img {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 19rem;
    object-fit: cover;
  }
}

@media (max-width: 699px) {
  .post-card--lead > a > img {
    height: 11rem;
  }
}

.post-body {
  padding: 0.8rem 0.9rem 1rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.post-card--lead .post-body {
  padding: 0.95rem 1.05rem 1.05rem;
  justify-content: center;
}

.post-card--lead .excerpt {
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

@supports not (-webkit-line-clamp: 4) {
  .post-card--lead .excerpt {
    display: block;
  }
}

.post-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-on-light-muted);
  margin-bottom: 0.32rem;
  display: flex;
  gap: 0.4rem 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-meta time {
  white-space: nowrap;
}

.post-meta .post-category {
  background: var(--category-pill-bg);
  color: var(--category-pill-fg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
  line-height: 1.28;
  font-weight: 600;
  font-family: var(--font-display, inherit);
}

.post-card--lead h2 {
  font-size: clamp(1.08rem, 0.25vw + 0.95rem, 1.3rem);
}

.post-card h2 a {
  color: var(--text-on-light);
  text-decoration: none;
  border-radius: 2px;
  transition: color 0.18s ease;
}

.post-card h2 a:hover,
.post-card h2 a:focus-visible {
  color: var(--color-link-accent);
}

.post-card h2 a:focus-visible {
  outline: 2px solid var(--color-link-accent);
  outline-offset: 2px;
}

.post-card .excerpt {
  color: var(--text-on-light-soft);
  margin-bottom: 0.45rem;
  flex: 1 1 auto;
  font-size: 0.92rem;
  line-height: 1.52;
}

.read-more {
  color: var(--color-link-accent);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.1rem;
  align-self: flex-start;
  display: inline-block;
  transition: color 0.18s ease, transform 0.2s ease;
}

.read-more:hover,
.read-more:focus-visible {
  text-decoration: underline;
  transform: translateX(2px);
}

.read-more:focus-visible {
  outline: 2px solid var(--color-link-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Optional blue subscribe band (blog posts) --- */
.subscribe-section.blue {
  background: var(--gradient-primary);
  color: var(--text-light);
  border-radius: 8px;
  padding: 1.35rem 1.25rem;
  margin: 1.1rem auto 1.4rem;
  max-width: var(--content-width-article);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  box-shadow: var(--shadow-subscribe-band);
  border: 1px solid var(--line-white-12);
}

.subscribe-section.blue .subscribe-copy {
  max-width: 72%;
  text-align: center;
}

.subscribe-section.blue h3 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.2rem, 0.2vw + 1.1rem, 1.45rem);
  color: var(--text-light);
}

.subscribe-section.blue p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  font-size: 0.95rem;
}

.subscribe-form.blue {
  display: flex;
  gap: 0.5rem 0.65rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.subscribe-form.blue input[type="email"] {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line-white-12);
  min-width: 200px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  font-size: 0.9rem;
}

.subscribe-form.blue input::placeholder {
  color: var(--line-white-75);
}

.subscribe-form.blue button {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line-white-20);
  background: var(--accent-color);
  color: var(--text-light);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: var(--shadow-button-ambient);
}

.subscribe-form.blue button:focus {
  outline: 2px solid var(--line-white-20);
  outline-offset: 2px;
}

@media (max-width: 780px) {
  .subscribe-section.blue {
    flex-direction: column;
    text-align: center;
  }

  .subscribe-section.blue .subscribe-copy {
    max-width: 100%;
  }

  .subscribe-form.blue {
    width: 100%;
  }
}

/* --- Mailchimp (blog.html + blog posts) --- */
.mailchimp-container {
  margin: 0.6rem 0 1.35rem;
}

#mc_embed_shell {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0.25rem 0;
}

#mc_embed_signup {
  background: var(--surface-raised-subtle);
  clear: left;
  font:
    14px Helvetica,
    Arial,
    sans-serif;
  width: 100%;
  max-width: 32rem;
  border-radius: 8px;
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(15, 23, 42, 0.04);
}

#mc_embed_signup h2 {
  color: var(--text-on-light);
  font-size: 1.12rem;
  margin: 0 0 0.45rem;
}

#mc_embed_signup p {
  color: var(--text-on-light-dim);
  margin: 0 0 0.9rem;
  line-height: 1.5;
  font-size: 0.92rem;
}

#mc_embed_signup label {
  color: var(--text-on-light);
  font-weight: 500;
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

#mc_embed_signup .indicates-required {
  color: var(--text-on-light);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

#mc_embed_signup .asterisk {
  color: var(--color-danger);
}

#mc_embed_signup .mc-field-group {
  margin-bottom: 0.55rem;
}

#mc_embed_signup .mc-field-group input[type="email"] {
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle-muted);
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#mc_embed_signup .mc-field-group input[type="email"]:hover {
  border-color: var(--color-link-accent);
}

#mc_embed_signup .mc-field-group input[type="email"]:focus-visible {
  outline: none;
  border-color: var(--color-link-accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.25);
}

#mc_embed_signup .button {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 0;
  background: var(--color-link-accent);
  color: var(--text-light);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  height: auto;
  line-height: 1.2;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

#mc_embed_signup .button:hover {
  background: var(--color-link-accent-hover);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

#mc_embed_signup .button:focus-visible {
  outline: 2px solid var(--color-link-accent);
  outline-offset: 2px;
}

#mc_embed_signup .button:active {
  transform: translateY(0);
}

/* --- You might also like intro (blog posts) --- */
.you-might-like-intro {
  text-align: center;
  margin: 0.4rem 0 0.65rem;
}

.you-might-like-intro h2 {
  margin: 0 0 0.2rem;
  color: var(--text-light);
  font-size: clamp(1.05rem, 0.3vw + 0.9rem, 1.2rem);
  font-weight: 600;
  font-family: var(--font-display, inherit);
}

.you-might-like-intro p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

/* Restrained micro-interaction: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .post-card,
  .post-card:hover,
  .post-card > a > img,
  .post-card:hover > a > img,
  .read-more,
  .read-more:hover,
  .read-more:focus-visible,
  #mc_embed_signup .button,
  #mc_embed_signup .button:hover,
  #mc_embed_signup .button:active {
    transition-duration: 0.01ms !important;
    transform: none !important;
  }
}
