/* ==========================================================================
   Mirana Labs — blog.css
   Loaded only on blog views (see inc/enqueue.php). Everything here is scoped
   to a blog class so it cannot reach the rest of the site.

   It reuses main.css tokens and components throughout: .container, .section,
   .section-rule, .label, .btn, .link-arrow, .page-hero, .breadcrumb, .tag-list,
   .brackets and .legal-prose. Only what is genuinely new is defined below.

   01 Hero and search      04 Article page
   02 Card and grid        05 Related and CTA
   03 Pagination           06 Reduced motion
   ========================================================================== */

/* 01. Hero and search ------------------------------------------------------ */
.blog-hero__kicker {
  margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
}
.blog-hero__kicker .label__index {
  text-transform: uppercase;
}
.blog-hero__note {
  max-width: 26rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--color-line-strong);
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--color-muted-light);
}
.blog-hero .page-hero__title {
  margin-top: clamp(1rem, .75rem + 1vw, 1.75rem);
}

.blog-search {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  max-width: 34rem;
}
.blog-search__input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: .6rem 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-body);
}
.blog-search__input::placeholder { color: var(--color-muted); }
.blog-search__input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* 02. Card and grid -------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 1.25rem + 2vw, 3rem) var(--col-gap);
}
@media (min-width: 600px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* The newest piece takes the full row on the index. */
  .post-grid > .post-card--featured { grid-column: 1 / -1; }
}

.post-card {
  position: relative;
  min-width: 0;
}
.post-card__link {
  display: grid;
  gap: 1.15rem;
  height: 100%;
  align-content: start;
  padding-top: 1.35rem;
  border-top: 1px solid var(--color-line-strong);
  color: inherit;
  transition: border-color var(--dur) ease;
}
.post-card__link:hover { border-top-color: var(--color-line-accent); }
.post-card__link:focus-visible { outline: none; }
.post-card__link:focus-visible .post-card__title {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.post-card__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  aspect-ratio: 16 / 11;
}
.post-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-out);
}

.post-card__body {
  display: grid;
  gap: .7rem;
  align-content: start;
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.post-card__meta .post-card__cat { color: var(--color-accent); }
.post-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h4);
  line-height: 1.22;
  letter-spacing: var(--tracking-heading);
  color: var(--color-text);
  text-wrap: balance;
}
.post-card__summary {
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--color-muted-light);
  text-wrap: pretty;
}
.post-card__arrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: .2rem;
  font-family: var(--font-display);
  font-weight: 680;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-muted-light);
  transition: color var(--dur-fast) ease;
}
.post-card__arrow .icon {
  width: .85rem;
  height: .85rem;
  transition: transform var(--dur) var(--ease-out);
}

@media (hover: hover) {
  .post-card__link:hover .post-card__media img { transform: scale(1.045); }
  .post-card__link:hover .post-card__title { color: var(--color-accent); }
  .post-card__link:hover .post-card__arrow { color: var(--color-accent); }
  .post-card__link:hover .post-card__arrow .icon { transform: translate(2px, -2px); }
  .post-card__link:hover .brackets::before,
  .post-card__link:hover .brackets::after,
  .post-card__link:hover .brackets > span::before,
  .post-card__link:hover .brackets > span::after { opacity: 1; transform: none; }
}

/* Featured card: image beside the text from 1024px, stacked below it. */
@media (min-width: 1024px) {
  .post-card--featured .post-card__link {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2rem, 1.5rem + 2vw, 3.5rem);
    align-items: center;
    padding-top: 1.75rem;
  }
  .post-card--featured .post-card__media { aspect-ratio: 16 / 9; }
  .post-card--featured .post-card__title { font-size: var(--fs-h3); }
  .post-card--featured .post-card__summary { font-size: var(--fs-body); max-width: 40rem; }
  /* With no image the text runs to a comfortable measure, not the full width. */
  .post-card--featured.post-card--textonly .post-card__link {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  }
  .post-card--featured.post-card--textonly .post-card__body { max-width: 52rem; }
}

.post-empty {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  border-top: 1px solid var(--color-line-strong);
}
.post-empty__links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.75rem;
}

/* 03. Pagination ----------------------------------------------------------- */
.post-pagination {
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-line-strong);
}
.post-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.post-pagination a,
.post-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding-inline: .85rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-muted-light);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.post-pagination a:hover {
  color: var(--color-accent);
  border-color: var(--color-line-accent);
}
.post-pagination .current {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.post-pagination .dots { border-color: transparent; }

/* 04. Article page --------------------------------------------------------- */
.article-hero__title { max-width: 20ch; }
.article-hero__lead { margin-top: clamp(1.25rem, 1rem + 1vw, 2rem); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  margin-top: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.article-meta a { color: var(--color-accent); }
.article-meta a:hover { color: var(--color-accent-bright); }

.article-figure {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.article-layout {
  display: grid;
  gap: clamp(2rem, 1.5rem + 2vw, 3rem);
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) var(--section-space);
}
@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
  }
  .article-toc--rail { grid-column: 1 / span 3; }
  .article-prose { grid-column: 5 / span 7; }
  .article-prose--wide { grid-column: 2 / span 9; }
}

/* The article body borrows .legal-prose wholesale, and adds only what long
   form editorial needs that a legal page never does. */
.article-prose > h2 {
  margin-top: clamp(2.5rem, 2rem + 1.5vw, 3.5rem);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.article-prose > h2:first-child { margin-top: 0; }
.article-prose > h3 { margin-top: 2.25rem; }
.article-prose ol:not(.legal-toc__list) {
  padding-left: 1.35rem;
  list-style: decimal;
}
.article-prose ol:not(.legal-toc__list) li::marker {
  font-family: var(--font-mono);
  font-size: .85em;
  color: var(--color-accent);
}
.article-prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--color-line-accent);
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--color-text);
}
.article-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.article-tags {
  margin-top: clamp(2rem, 1.5rem + 1.5vw, 3rem);
}
.article-tags li { padding: 0; border: 0; }
.article-tags a {
  display: inline-flex;
  align-items: center;
  padding: .32rem .6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--color-muted-light);
  border: 1px solid var(--color-line-strong);
  border-radius: 2px;
  white-space: nowrap;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.article-tags a:hover {
  color: var(--color-accent);
  border-color: var(--color-line-accent);
}

.article-author {
  margin-top: clamp(2rem, 1.5rem + 1.5vw, 3rem);
  padding-top: 1.35rem;
  border-top: 1px solid var(--color-line-strong);
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--color-muted);
}
.article-author strong { color: var(--color-text); font-weight: 600; }

/* The shared contents rail sits a little higher on an article, because the
   article has no numbered sections above it. */
.article-toc--rail { align-self: start; }
.article-toc--fold { margin-bottom: 0; }

/* 05. Related and CTA ------------------------------------------------------ */
.article-related .h3 {
  margin-bottom: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
}
.article-cta-section { padding-top: 0; }
@media (min-width: 1024px) {
  .post-grid--three > .post-card { grid-column: span 1; }
}

.blog-cta {
  position: relative;
  display: grid;
  gap: clamp(1.75rem, 1.25rem + 2vw, 3rem);
  padding: clamp(2rem, 1.5rem + 3vw, 4.5rem);
  overflow: hidden;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-soft);
}
.blog-cta > * { position: relative; }
.blog-cta > .bg-grid,
.blog-cta > .glow { position: absolute; }
.blog-cta__title { max-width: 16ch; }
.blog-cta__text p {
  margin-top: 1.25rem;
  max-width: 46ch;
  color: var(--color-muted-light);
  text-wrap: pretty;
}
.blog-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}
@media (min-width: 1024px) {
  .blog-cta {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    align-items: end;
    gap: clamp(2rem, 1.5rem + 2vw, 4rem);
  }
  .blog-cta__actions { justify-content: flex-end; }
}

/* 06. Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .post-card__media img,
  .post-card__arrow .icon,
  .post-card__link {
    transition: none;
  }
  .post-card__link:hover .post-card__media img { transform: none; }
}
