/* ==========================================================================
   blog.css — blog index + article pages rendered by admin/includes/render.php
   Loaded only on /blog/ and generated content pages.
   ========================================================================== */

/* ------------------------------------------------------------ blog index */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 1.8vw, 1.6rem);
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #d7dfe7;
}

.blog-card__media {
  display: block;
  overflow: hidden;
  background: var(--paper);
}

.blog-card__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

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

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: clamp(1.1rem, 1.8vw, 1.5rem);
  flex: 1;
}

.blog-card__meta {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.blog-card__title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

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

.blog-card__excerpt {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--body);
}

.blog-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.7rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--red);
}

.blog-card__more svg {
  width: 15px;
  height: 15px;
  transition: transform 0.18s var(--ease);
}

.blog-card:hover .blog-card__more svg {
  transform: translateX(4px);
}

.blog-empty {
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  text-align: center;
  background: #fff;
}

.blog-pager {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
}

.blog-pager__item {
  min-width: 2.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  background: #fff;
}

.blog-pager__item:hover {
  border-color: var(--red);
  color: var(--red);
}

.blog-pager__item.is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------- article */
.post-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: rgb(255 255 255 / 60%);
}

.post-meta svg {
  width: 15px;
  height: 15px;
  color: var(--red);
}

.post-meta__dot {
  opacity: 0.5;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(1.6rem, 3.4vw, 3rem);
  align-items: start;
}

.post {
  min-width: 0;
}

.post-hero {
  margin: 0 0 clamp(1.4rem, 2.6vw, 2rem);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.post-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-body {
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--body);
}

.post-body > * + * {
  margin-top: 1rem;
}

.post-body h2 {
  font-size: clamp(1.35rem, 2.1vw, 1.7rem);
  margin-top: 2.2rem;
  margin-bottom: 0.6rem;
}

.post-body h3 {
  font-size: 1.1rem;
  margin-top: 1.6rem;
  margin-bottom: 0.4rem;
}

.post-body ul,
.post-body ol {
  display: grid;
  gap: 0.45rem;
  padding-left: 0;
  margin: 1rem 0;
}

.post-body ul li,
.post-body ol li {
  position: relative;
  padding-left: 1.6rem;
  list-style: none;
}

.post-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--red);
  transform: rotate(45deg);
}

.post-body ol {
  counter-reset: postlist;
}

.post-body ol li {
  counter-increment: postlist;
}

.post-body ol li::before {
  content: counter(postlist);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-050);
  color: var(--red-600);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
}

.post-body a {
  color: var(--red-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body a:hover {
  color: var(--red);
}

.post-body blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--red);
  background: var(--paper);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.98rem;
}

.post-body hr {
  margin: 2rem 0;
}

.post-body code {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--paper);
  font-size: 0.9em;
}

/* ------------------------------------------------------------------- CTA */
.post-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  margin-top: clamp(2rem, 3.4vw, 2.8rem);
  padding: clamp(1.4rem, 2.6vw, 2rem);
  background: var(--ink);
  border-radius: var(--r-lg);
  color: rgb(255 255 255 / 74%);
}

.post-cta__title {
  color: #fff;
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  margin-bottom: 0.4rem;
}

.post-cta__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.62;
  max-width: 34em;
}

.post-cta .eyebrow {
  margin-bottom: 0.6rem;
}

.post-cta__actions {
  display: grid;
  gap: 0.55rem;
  flex: none;
}

/* --------------------------------------------------------------- sidebar */
.post-side {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 100px;
}

.post-side__card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.2rem;
}

.post-side__card--ink {
  background: var(--ink);
  border-color: var(--ink);
}

.post-side__kicker {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.4rem;
}

.post-side__kicker--dark {
  color: var(--muted);
}

.post-side__lead {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 0.9rem;
  letter-spacing: -0.02em;
}

.post-side__link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: rgb(255 255 255 / 65%);
}

.post-side__link:hover {
  color: #fff;
}

.post-side__list {
  display: grid;
  gap: 0.1rem;
  margin: 0.2rem 0 0;
}

.post-side__list a {
  display: block;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-3);
}

.post-side__list li:last-child a {
  border-bottom: 0;
}

.post-side__list a:hover {
  color: var(--red);
}

.post-side__all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--red);
}

.post-side__all svg {
  width: 14px;
  height: 14px;
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .post-layout {
    grid-template-columns: 1fr;
  }

  .post-side {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-cta__actions {
    width: 100%;
    max-width: 24rem;
  }
}

@media (max-width: 720px) {
  .blog-grid,
  .post-side {
    grid-template-columns: 1fr;
  }

  .post-body {
    font-size: 0.98rem;
  }
}
