/* ==========================================================================
   Ah Game Studio — Blog (index + article)
   Inherits tokens from style.css (--bg, --brand, --grad, --shell, etc.)
   ========================================================================== */

/* ─── Blog index hero (animated header) ──────────────────────────────────── */
.blog-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(130px, 22vh, 240px) 0 clamp(48px, 8vh, 96px);
  text-align: center;
}
/* animated particle canvas + glow sit behind the content */
.blog-hero .hero-particles { z-index: -2; }
.blog-hero .hero-glow { z-index: -2; }
.blog-hero::before {         /* soft aurora wash behind the title */
  content: ''; position: absolute; inset: 0; z-index: -3;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(139, 92, 246, .16), transparent 62%),
    radial-gradient(45% 40% at 82% 20%, rgba(76, 201, 240, .12), transparent 60%);
}
.blog-hero .hero-fade { z-index: -1; }
.blog-hero .eyebrow { justify-content: center; }
.blog-hero-inner { position: relative; z-index: 1; }
.blog-hero-title {
  font-family: var(--display); font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(2.8rem, 8vw, 5.2rem); line-height: 1.03; margin: .28em 0 .24em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.blog-hero-sub { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: clamp(1rem, 1.6vw, 1.15rem); }

/* ─── Controls ───────────────────────────────────────────────────────────── */
.blog-controls {
  display: flex; flex-direction: column; gap: 16px; align-items: center; margin-top: 32px;
}
.blog-search {
  position: relative; width: min(460px, 100%);
}
.blog-search .icon {
  position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--dim); pointer-events: none;
}
.blog-search input {
  width: 100%; padding: 14px 18px 14px 46px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font: inherit; font-size: .98rem; transition: border-color .25s, box-shadow .25s;
}
[dir="rtl"] .blog-search input { padding: 14px 46px 14px 18px; }
.blog-search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.blog-search input::placeholder { color: var(--dim); }

.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bfilter {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font: inherit; font-size: .9rem;
  font-weight: 500; cursor: pointer; transition: all .22s var(--ease);
}
.bfilter:hover { color: var(--text); border-color: var(--line-soft); transform: translateY(-1px); }
.bfilter.is-active {
  color: #14100A; background: var(--brand); border-color: transparent; font-weight: 600;
}

/* ─── Featured ───────────────────────────────────────────────────────────── */
.blog-featured {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; margin: 40px 0;
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; color: inherit;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.blog-featured:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.bf-art { position: relative; min-height: 320px; overflow: hidden; }
.bf-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.blog-featured:hover .bf-art img { transform: scale(1.05); }
.bf-body { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.bf-body h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; margin: 0; }
.bf-body p { color: var(--muted); margin: 0; }

/* ─── Grid + cards ───────────────────────────────────────────────────────── */
.blog-section-title {
  font-family: var(--display); font-weight: 700; font-size: 1.5rem;
  margin: 46px 0 22px; padding-inline-start: 14px; position: relative;
}
.blog-section-title::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 1.1em; border-radius: 4px; background: var(--grad);
}
.blog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px; margin-bottom: 60px;
}
.blog-card {
  display: flex; flex-direction: column; border-radius: var(--r);
  overflow: hidden; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: inherit;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.bc-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.bc-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.blog-card:hover .bc-art img { transform: scale(1.06); }
.bc-cat-badge {
  position: absolute; inset-block-start: 12px; inset-inline-start: 12px;
  padding: 5px 12px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: rgba(7, 11, 24, .78); color: var(--text); backdrop-filter: blur(6px);
  border: 1px solid var(--line);
}
.bc-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bc-body h3 { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.3; margin: 0; }
.bc-body p {
  color: var(--muted); font-size: .93rem; margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bc-cat { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent, var(--brand)); }
.bc-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--dim); font-size: .82rem; }
.bc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.bc-meta .icon { width: 15px; height: 15px; }
.bc-link { display: inline-flex; align-items: center; gap: 7px; color: var(--brand); font-weight: 600; font-size: .9rem; }
.bc-link .icon { width: 17px; height: 17px; transition: transform .25s; }
.blog-card:hover .bc-link .icon, .blog-featured:hover .bc-link .icon { transform: translateX(4px); }
[dir="rtl"] .blog-card:hover .bc-link .icon, [dir="rtl"] .blog-featured:hover .bc-link .icon { transform: translateX(-4px); }
[dir="rtl"] .bc-link .icon, [dir="rtl"] .crumb-sep, [dir="rtl"] .art-cta .icon { transform: scaleX(-1); }

.blog-empty { text-align: center; color: var(--muted); padding: 40px 0 80px; }

/* ─── Article ────────────────────────────────────────────────────────────── */
.art-hero { padding-top: clamp(90px, 12vh, 130px); }
.art-hero-inner { max-width: 860px; }
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--dim); margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumb-sep { width: 15px; height: 15px; opacity: .5; }
.art-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-weight: 600; font-size: .84rem;
}
.art-badge .icon { width: 17px; height: 17px; }
.art-title { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: 18px 0 14px; }
.art-sub { font-size: 1.15rem; color: var(--muted); max-width: 720px; }
.art-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; color: var(--dim); font-size: .9rem; align-items: center; }
.art-meta span { display: inline-flex; align-items: center; gap: 6px; }
.art-meta .icon { width: 16px; height: 16px; }
.art-meta .am-author strong { color: var(--text); }

.art-cover { margin: 34px 0 0; }
.art-cover img {
  width: 100%; aspect-ratio: 40 / 21; object-fit: cover; border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}

/* Body grid: content + sticky TOC */
.art-body { display: grid; grid-template-columns: 1fr; gap: 40px; padding-top: 44px; padding-bottom: 20px; }
@media (min-width: 1000px) { .art-body { grid-template-columns: 240px minmax(0, 1fr); } .art-toc { order: -1; } }

.art-toc { position: sticky; top: 100px; align-self: start; }
.toc-inner { border-inline-start: 2px solid var(--line); padding-inline-start: 18px; }
.toc-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 0 0 12px; }
.art-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; counter-reset: toc; }
.art-toc a { color: var(--muted); text-decoration: none; font-size: .9rem; line-height: 1.4; transition: color .2s; display: block; }
.art-toc a:hover, .art-toc a.is-active { color: var(--brand); }
.toc-progress { height: 3px; border-radius: 3px; background: var(--line); margin-top: 18px; overflow: hidden; }
.toc-progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .1s linear; }

/* Content typography */
.art-content { max-width: 760px; font-size: 1.06rem; line-height: 1.8; }
.art-content p { margin: 0 0 1.25em; color: #D8DFEE; }
.art-lead { font-size: 1.2rem; color: var(--text) !important; font-weight: 500; }
.art-section { margin: 2.4em 0; scroll-margin-top: 100px; }
.art-section h2 {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.8rem);
  line-height: 1.25; margin: 0 0 .7em; display: flex; align-items: center; gap: 12px;
}
.sec-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 11px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}
.sec-icon .icon { width: 22px; height: 22px; }
.art-section h3 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; margin: 1.4em 0 .6em; }

.art-figure { margin: 1.8em 0; }
.art-figure img { width: 100%; border-radius: var(--r); border: 1px solid var(--line); }
.art-figure figcaption { margin-top: 10px; font-size: .85rem; color: var(--dim); text-align: center; }

.art-highlights {
  margin: 1.6em 0; padding: 22px 26px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
}
.art-highlights h3 { margin: 0 0 .7em; }
.art-highlights ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.art-highlights li { display: flex; gap: 12px; align-items: flex-start; }
.art-highlights li .icon { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 3px; }

.art-quote {
  margin: 1.8em 0; padding: 4px 0 4px 26px; border-inline-start: 4px solid var(--brand);
  font-family: var(--display); font-size: 1.3rem; line-height: 1.5; font-weight: 500; color: var(--text);
}
[dir="rtl"] .art-quote { padding: 4px 26px 4px 0; }
.art-quote p { margin: 0 0 .3em; color: var(--text) !important; }
.art-quote cite { font-family: var(--font); font-size: .92rem; font-style: normal; color: var(--dim); }

/* FAQ */
.art-faq details { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.art-faq summary {
  cursor: pointer; padding: 16px 20px; font-family: var(--display); font-weight: 600; font-size: 1.02rem;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none;
}
.art-faq summary::-webkit-details-marker { display: none; }
.faq-chev { width: 18px; height: 18px; flex: none; transition: transform .25s; color: var(--brand); }
.art-faq details[open] .faq-chev { transform: rotate(90deg); }
.faq-a { padding: 0 20px 16px; color: var(--muted); }
.faq-a p { margin: 0; color: var(--muted) !important; }

/* Foot: tags + share */
.art-foot { margin-top: 2.6em; padding-top: 1.6em; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.art-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.art-tags li { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.art-tags .icon { width: 14px; height: 14px; color: var(--dim); }
.art-share { display: flex; align-items: center; gap: 10px; }
.art-share span { font-size: .85rem; color: var(--dim); }
.art-share a { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); transition: all .22s; }
.art-share a:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.art-share .icon { width: 18px; height: 18px; }

/* CTA */
.art-cta {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
  margin: 30px 0 20px; padding: clamp(26px, 4vw, 42px); border-radius: var(--r-lg);
  background: linear-gradient(120deg, rgba(245,168,70,.14), rgba(255,77,109,.12)); border: 1px solid var(--line);
}
.art-cta h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 .3em; }
.art-cta p { color: var(--muted); margin: 0; }

/* RTL article flips */
[dir="rtl"] .toc-inner { border-inline-start: none; border-inline-end: 2px solid var(--line); }

@media (max-width: 640px) {
  .blog-featured { grid-template-columns: 1fr; }
  .bf-art { min-height: 220px; }
  .art-share { width: 100%; }
}
