/* =========================================================
   BANGTAO STUDIO — Blog page styles
   blog.html + blog-article.html — not imported into main.css
   ========================================================= */

/* ─── Blog grid section ──────────────────────────────────── */

.blog-grid-section {
  padding-top: calc(var(--nav-h) + var(--nav-top) + 56px);
  padding-bottom: var(--section-y);
  background: var(--warm-2);
}

@media (max-width: 880px) {
  .blog-grid-section { padding-top: clamp(80px, 15vw, 108px); }
}

.blog-grid-section__header {
  text-align: center;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.blog-grid-section__title {
  font-family: var(--ff-display);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.06;
  color: var(--ink);
  margin: 0;
}

/* ─── Category filter ────────────────────────────────────── */

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.blog-filter__pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  border-radius: var(--r-pill);
  border: 1.5px solid rgba(15, 15, 15, 0.15);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  transition:
    background var(--dur-fast) var(--ease-out-soft),
    border-color var(--dur-fast) var(--ease-out-soft),
    color var(--dur-fast) var(--ease-out-soft);
}

.blog-filter__pill:hover:not(.is-active) {
  border-color: rgba(15, 15, 15, 0.38);
  color: var(--ink);
  background: rgba(15, 15, 15, 0.04);
}

.blog-filter__pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

/* ─── Blog grid ──────────────────────────────────────────── */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 28px);
  transition: opacity 160ms var(--ease-out-soft);
}

.blog-grid.is-filtering {
  opacity: 0;
  pointer-events: none;
}

.blog-card[hidden] { display: none !important; }

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

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

/* ─── Blog card — dark premium style ────────────────────── */

.blog-card {
  background: var(--ink);
  border-radius: 24px;
  overflow: hidden;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.32s var(--ease-out-soft),
              box-shadow 0.32s var(--ease-out-soft);
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
}

/* Image inset with inner rounded corners — matches reference */
.blog-card__img-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #1a1a1a;
  margin: 10px 10px 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.blog-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-out-soft);
}

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

.blog-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.blog-card__title {
  font-family: var(--ff-display);
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #FFFFFF;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__excerpt {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-card__date {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
}

.blog-card__arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out-soft);
}

.blog-card:hover .blog-card__arrow {
  background: var(--blob-hover-color);
  color: #FFFFFF;
}

/* Two-SVG fly: first exits top-right, second enters from bottom-left */
.blog-card__arrow svg {
  display: block;
  position: absolute;
  top: 50%; left: 50%;
  transition: transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 260ms ease;
}
.blog-card__arrow svg:first-child {
  transform: translate(-50%, -50%);
  opacity: 1;
}
.blog-card__arrow svg:last-child {
  transform: translate(calc(-50% - 12px), calc(-50% + 12px));
  opacity: 0;
}
.blog-card:hover .blog-card__arrow svg:first-child {
  transform: translate(calc(-50% + 12px), calc(-50% - 12px));
  opacity: 0;
}
.blog-card:hover .blog-card__arrow svg:last-child {
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* ─── Article hero ───────────────────────────────────────── */

.article-hero {
  background: var(--warm-1);
  padding-top: calc(var(--nav-h) + var(--nav-top) + 48px);
  padding-bottom: clamp(48px, 7vw, 80px);
}

.article-hero__inner {
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.article-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.article-hero__cat {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: var(--sun);
  color: var(--ink);
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-hero__date,
.article-hero__read-time {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}

.article-hero__date::after {
  content: "·";
  margin-left: var(--space-3);
}

.article-hero__title {
  font-family: var(--ff-display);
  font-size: clamp(28px, 4.5vw, 60px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0;
}

.article-hero__sub {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0;
  max-width: 640px;
}

.article-hero__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.article-hero__author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--warm-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.article-hero__author-name {
  font-size: var(--fs-small);
  font-weight: var(--fw-semi);
  color: var(--ink);
}

.article-hero__author-role {
  font-size: 12px;
  color: var(--ink-mute);
}

/* ─── Article cover image ────────────────────────────────── */

.article-cover {
  background: var(--warm-2);
}

.article-cover__img-wrap {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-radius: 0 0 var(--r-card-lg) var(--r-card-lg);
  background: var(--warm-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

.article-cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── Article body ───────────────────────────────────────── */

.article-body {
  padding-block: var(--section-y);
  background: var(--warm-1);
}

.article-body__layout {
  display: grid;
  grid-template-columns: 1fr minmax(0, 680px) 1fr;
  gap: clamp(24px, 4vw, 48px);
}

@media (max-width: 1100px) {
  .article-body__layout {
    grid-template-columns: 1fr;
  }
  .article-body__sidebar { display: none; }
}

.article-body__content {
  grid-column: 2;
  font-size: clamp(16px, 1.25vw, 18px);
  color: var(--ink-soft);
  line-height: 1.75;
}

.article-body__content h2 {
  font-family: var(--ff-display);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  line-height: 1.18;
  color: var(--ink);
  margin: 2em 0 0.6em;
}

.article-body__content h3 {
  font-family: var(--ff-display);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  color: var(--ink);
  margin: 1.8em 0 0.5em;
}

.article-body__content p { margin: 0 0 1.25em; }

.article-body__content ul,
.article-body__content ol {
  padding-left: 1.5em;
  margin: 0 0 1.25em;
}

.article-body__content li { margin-bottom: 0.4em; }

.article-body__content a {
  color: var(--ocean);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body__content strong { color: var(--ink); font-weight: var(--fw-semi); }

.article-body__content blockquote {
  border-left: 3px solid var(--sun);
  padding: var(--space-4) var(--space-5);
  margin: 2em 0;
  background: var(--warm-2);
  border-radius: 0 var(--r-sticker) var(--r-sticker) 0;
  font-style: italic;
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--ink);
}

.article-body__content code {
  background: var(--warm-2);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: var(--ff-mono);
  font-size: 0.87em;
  color: var(--ink);
}

.article-body__content pre {
  background: var(--ink);
  border-radius: var(--r-sticker);
  padding: var(--space-5);
  overflow-x: auto;
  margin: 1.5em 0;
}

.article-body__content pre code {
  background: none;
  padding: 0;
  color: var(--cream);
  font-size: 14px;
}

.article-body__sidebar {
  grid-column: 3;
  padding-top: 0.5em;
}

.article-toc {
  position: sticky;
  top: calc(var(--nav-h) + var(--nav-top) + 24px);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.article-toc__label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.article-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.article-toc__link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: var(--space-3);
  transition: color var(--dur-fast) var(--ease-out-soft),
              border-color var(--dur-fast) var(--ease-out-soft);
}

.article-toc__link:hover,
.article-toc__link.is-active {
  color: var(--ink);
  border-color: var(--ink);
}

/* ─── Related articles ───────────────────────────────────── */

.blog-related {
  padding-block: var(--section-y);
  background: var(--warm-2);
}

.blog-related__head {
  margin-bottom: clamp(32px, 5vw, 56px);
}

.blog-related__head h2 {
  font-size: clamp(24px, 3.2vw, 44px);
  letter-spacing: -0.022em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 var(--space-3);
}

.blog-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

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

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

/* ─── Article CTA ────────────────────────────────────────── */

.article-cta {
  padding-block: var(--section-y);
  background: var(--warm-1);
  text-align: center;
}

.article-cta__inner {
  max-width: 520px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.article-cta h2 {
  font-size: clamp(24px, 3.5vw, 44px);
  letter-spacing: -0.022em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
}

.article-cta p {
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0;
}

.article-cta__btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

/* ─── Reduce motion ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card__arrow,
  .blog-card__arrow svg,
  .blog-card__img,
  .blog-filter__pill,
  .blog-grid,
  .article-toc__link { transition: none !important; }
}
