/* ==========================================================================
   GloryVolt — Blog (blog.html, blog-*.html) + article cards (.a-card),
   which the home page also uses. Loads after base.css.
   ========================================================================== */

/* ---------- Article cards ---------- */
.a-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.a-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.a-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s;
}
.a-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--gold-light); }
.a-card:focus-within { border-color: var(--gold); }
.a-media { display: block; aspect-ratio: 16 / 9; background: var(--ink); overflow: hidden; }
.a-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.a-card:hover .a-media img { transform: scale(1.045); }
.a-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }
.a-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.8rem; color: var(--muted); }
.a-meta > * + *:not(.a-tag)::before { content: "·"; margin-right: 12px; color: var(--line-2); }
.a-meta > .a-tag + *::before { content: none; }
.a-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--tint);
  border: 1px solid var(--gold-light);
  color: var(--gold-ink);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.a-title { margin: 0; font-size: 1.18rem; line-height: 1.3; }
.a-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.a-title a:hover { color: var(--gold-ink); }
.a-title a:focus-visible { outline: none; }
.a-title a:focus-visible::after { outline: 2px solid var(--gold); outline-offset: -2px; }
.a-excerpt { margin: 0; color: var(--muted); font-size: 0.93rem; }
.a-more { margin-top: auto; padding-top: 4px; font-size: 0.92rem; }
.a-card:hover .a-more svg { transform: translateX(3px); }

/* featured (first) article on the blog index */
.a-card.a-feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin-bottom: 24px; }
.a-feature .a-media { aspect-ratio: auto; min-height: 280px; }
.a-feature .a-body { justify-content: center; gap: 14px; padding: clamp(24px, 3.4vw, 48px); }
.a-feature .a-title { font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.15; }
.a-feature .a-excerpt { font-size: 1rem; }
.a-feature .a-more { margin-top: 8px; }

/* ---------- Blog index ---------- */
.page-hero h1 em { font-style: normal; color: var(--gold-on-dark); }
.blog-topics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px 48px; align-items: center; }
.blog-topics h2 { margin: 0 0 8px; }
.blog-topics p { margin: 0; color: var(--muted); }
.blog-topic-links { display: flex; flex-wrap: wrap; gap: 10px; }
.blog-ask {
  margin-top: clamp(32px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  flex-wrap: wrap;
  padding: clamp(22px, 3vw, 36px);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(255, 204, 26, 0.24), transparent 65%),
    var(--ink);
  color: var(--on-dark);
}
.blog-ask h2 { color: #fff; font-size: clamp(1.3rem, 2.2vw, 1.7rem); margin: 0 0 6px; }
.blog-ask p { margin: 0; max-width: 56ch; }
.blog-ask-btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Article page ---------- */
.post-hero h1 { max-width: 24ch; }
.post-hero .post-lede { font-size: 1.08rem; max-width: 60ch; }
.post-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  margin-bottom: 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 216, 77, 0.35);
  background: rgba(255, 204, 26, 0.12);
  color: var(--gold-on-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post-tag:hover { background: rgba(255, 204, 26, 0.22); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 22px; font-size: 0.88rem; color: var(--on-dark-muted); }
.post-meta strong { color: #fff; }
.post-author { display: inline-flex; align-items: center; gap: 10px; }
.post-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--on-gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.post-meta > span + span::before { content: "·"; margin-right: 18px; color: rgba(255, 255, 255, 0.25); }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.post-cover { margin: 0 0 clamp(28px, 4vw, 44px); border-radius: calc(var(--radius) + 6px); overflow: hidden; background: var(--ink); aspect-ratio: 16 / 9; box-shadow: var(--shadow-md); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.prose { max-width: 72ch; font-size: 1.05rem; line-height: 1.75; color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.35rem, 2vw, 1.7rem); margin: 2em 0 0.6em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { font-size: 1.15rem; margin: 1.6em 0 0.5em; }
.prose p { margin: 0 0 1.1em; }
.prose strong { color: var(--ink); }
.prose a { color: var(--gold-ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--gold-light); }
.prose a:hover { text-decoration-color: var(--gold-ink); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--gold-ink); font-weight: 800; }
.post-intro { font-size: 1.18rem; line-height: 1.65; color: var(--ink-3); }
.post-tip {
  margin: 1.6em 0;
  padding: 18px 22px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--tint);
  color: var(--ink-3);
  font-size: 0.98rem;
}
.post-tip strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.post-tip p:last-child { margin-bottom: 0; }
.post-table-wrap { margin: 1.4em 0 1.6em; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.post-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; }
.post-table th, .post-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.post-table thead th { background: var(--ink); color: #fff; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
.post-table tbody tr:last-child td { border-bottom: 0; }
.post-table td:first-child { font-weight: 700; color: var(--ink); }
.prose .post-check { list-style: none; padding-left: 0; }
.prose .post-check li { position: relative; padding-left: 32px; }
.prose .post-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dcc28f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.post-foot { max-width: 72ch; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.post-foot h2 { font-size: 1.1rem; margin: 0; }
.post-foot-links { display: flex; flex-wrap: wrap; gap: 10px; }
.post-foot-note { margin: 0; font-size: 0.88rem; color: var(--muted); }

/* sidebar */
.post-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 18px; }
.post-toc { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.post-toc h2, .post-shopcard h2 { margin: 0 0 12px; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.post-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; display: grid; gap: 2px; }
.post-toc li { counter-increment: toc; }
.post-toc a { display: flex; gap: 10px; padding: 7px 8px; border-radius: var(--radius-xs); font-size: 0.9rem; font-weight: 600; line-height: 1.35; color: var(--ink-3); }
.post-toc a::before { content: counter(toc, decimal-leading-zero); flex: none; font-size: 0.74rem; font-weight: 800; color: var(--gold-ink); padding-top: 0.15em; }
.post-toc a:hover { background: var(--tint); color: var(--gold-ink); }
.post-shopcard {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 22px;
  border-radius: var(--radius);
  background:
    radial-gradient(260px 200px at 100% 0%, rgba(255, 204, 26, 0.26), transparent 65%),
    var(--ink);
  color: var(--on-dark);
}
.post-shopcard h2 { color: var(--gold-on-dark); }
.post-shopcard p { margin: 0 0 14px; font-size: 0.9rem; }
.post-shopcard ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.post-shopcard li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}
.post-shopcard li a:hover { border-color: rgba(255, 216, 77, 0.5); background: rgba(255, 255, 255, 0.06); }
.post-shopcard li svg { width: 16px; height: 16px; flex: none; color: var(--gold-on-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-aside { position: static; }
  .post-toc { display: none; }
  .prose, .post-foot { max-width: none; }
  .prose h2 { scroll-margin-top: 110px; }
  .blog-topics { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .a-card.a-feature { grid-template-columns: minmax(0, 1fr); }
  .a-feature .a-media { aspect-ratio: 16 / 9; min-height: 0; }
  .a-feature .a-body { padding: 22px; }
}

@media (max-width: 760px) {
  .a-grid, .a-grid.cols-2 { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .a-body { padding: 18px; }
  .prose { font-size: 1rem; }
  .post-intro { font-size: 1.08rem; }
  .post-table th, .post-table td { padding: 10px 12px; }
  .post-meta > span + span::before { margin-right: 10px; }
  .post-meta { gap: 8px 10px; }
  .blog-ask-btns, .blog-ask-btns .btn { width: 100%; }
}
