/* ============================================================
   Astrosaras Journal — blog listing, article, home-page section.
   Builds on tokens from /styles.css (--gold, --text, --font-* …).
   ============================================================ */

/* ============== CARDS (shared: home + listing + related) ============== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.blog-grid--center {
  grid-template-columns: repeat(auto-fit, minmax(290px, 380px));
  justify-content: center;
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(42, 21, 71, 0.55) 0%, rgba(15, 6, 32, 0.78) 100%);
  border: 1px solid var(--line);
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.blog-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 175, 55, 0.1);
}

.blog-card:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.blog-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(75, 29, 138, 0.7), transparent 65%),
    radial-gradient(ellipse at 80% 90%, rgba(155, 122, 31, 0.35), transparent 60%),
    #140828;
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

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

.blog-card__media::after {
  content: "";
  position: absolute;
  inset: 55% 0 0 0;
  background: linear-gradient(180deg, transparent, rgba(15, 6, 32, 0.55));
  pointer-events: none;
}

.blog-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(212, 175, 55, 0.55);
}

.blog-card__cat {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  max-width: calc(100% - 28px);
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a0b2e;
  background: var(--gold-grad);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 22px 22px 24px;
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.blog-card__title {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text);
  transition: color 0.3s var(--ease);
}

.blog-card:hover .blog-card__title { color: var(--gold-soft); }

/* Whole card is clickable through the title link. */
.blog-card__title a::after,
.blog-lead__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

.blog-card__title a:focus-visible,
.blog-lead__title a:focus-visible { outline: none; }

.blog-card__excerpt {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--text-mute);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.blog-card__more svg { transition: transform 0.35s var(--ease); }
.blog-card:hover .blog-card__more svg,
.blog-lead:hover .blog-card__more svg { transform: translateX(4px); }

/* ============== HOME-PAGE SECTION ============== */
.blog-home[hidden] { display: none !important; }

.blog-home {
  position: relative;
  padding: 100px 24px 110px;
  overflow: hidden;
  isolation: isolate;
}

.blog-home::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 50%;
  width: min(900px, 90vw);
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(75, 29, 138, 0.35), transparent 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

.blog-home .section-head { margin-bottom: 56px; }
.blog-home .section-cta { margin-top: 56px; }

/* ============== LISTING PAGE ============== */
.blog-hero { min-height: 42vh; padding-bottom: 70px; }

.blog-list { padding: 20px 24px 110px; }

.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 40px;
}

.blog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.blog-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  background: rgba(42, 21, 71, 0.45);
  border: 1px solid var(--line);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.blog-chip span {
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-soft);
}

.blog-chip:hover { color: var(--text); border-color: rgba(212, 175, 55, 0.45); }

.blog-chip.is-active {
  color: #1a0b2e;
  background: var(--gold-grad);
  border-color: transparent;
}

.blog-chip.is-active span { background: rgba(26, 11, 46, 0.18); color: #1a0b2e; }

.blog-search {
  position: relative;
  flex: 0 1 300px;
  min-width: 220px;
}

.blog-search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  pointer-events: none;
}

.blog-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 16px 0 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 6, 32, 0.6);
  color: var(--text);
  font: 500 0.9rem var(--font-sans);
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.blog-search input::placeholder { color: var(--text-mute); opacity: 0.8; }

.blog-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
}

.blog-results {
  margin: -16px 0 28px;
  font-size: 0.9rem;
  color: var(--text-mute);
}

.blog-results a { margin-left: 10px; color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }

/* Lead (newest) post */
.blog-lead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  margin-bottom: 36px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(42, 21, 71, 0.65), rgba(15, 6, 32, 0.85));
  transition: border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.blog-lead:hover {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

.blog-lead:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }

.blog-lead__media {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(75, 29, 138, 0.7), transparent 65%),
    #140828;
}

.blog-lead__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

.blog-lead:hover .blog-lead__media img { transform: scale(1.04); }

.blog-lead__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 44px 42px;
}

.blog-lead__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

.blog-lead__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.blog-lead:hover .blog-lead__title { color: var(--gold-soft); }

.blog-lead__excerpt {
  font-family: var(--font-serif);
  font-size: 1.16rem;
  line-height: 1.65;
  color: var(--text-mute);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 56px;
}

.blog-pager a {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mute);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.blog-pager a:hover { color: var(--text); border-color: var(--gold); }
.blog-pager a.is-current { color: #1a0b2e; background: var(--gold-grad); border-color: transparent; }

.blog-empty {
  max-width: 560px;
  margin: 20px auto;
  padding: 56px 32px;
  text-align: center;
  border-radius: 24px;
  border: 1px dashed rgba(212, 175, 55, 0.3);
  background: rgba(42, 21, 71, 0.3);
}

.blog-empty__icon { display: inline-block; color: var(--gold); margin-bottom: 18px; }
.blog-empty h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin-bottom: 10px; }
.blog-empty p { color: var(--text-mute); margin-bottom: 26px; }

.blog-cta-band {
  padding: 90px 24px 110px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, rgba(75, 29, 138, 0.35), transparent 65%);
}

.blog-cta-band h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 12px;
}

.blog-cta-band h2 em,
.post-cta h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-cta-band p { color: var(--text-mute); margin-bottom: 30px; }

.blog-cta-band__actions,
.post-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* ============== ARTICLE PAGE ============== */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  height: 3px;
  pointer-events: none;
}

.read-progress span {
  display: block;
  height: 100%;
  background: var(--gold-grad);
  transform: scaleX(0);
  transform-origin: 0 50%;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
}

.blog-preview-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 1002;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 0.86rem;
  color: #1a0b2e;
  background: #facc15;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.blog-preview-bar a { margin-left: 10px; font-weight: 700; text-decoration: underline; }

.post-head {
  position: relative;
  padding: 170px 24px 48px;
  overflow: hidden;
  isolation: isolate;
}

.post-head__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(75, 29, 138, 0.5), transparent 65%),
    radial-gradient(ellipse at 100% 100%, rgba(155, 122, 31, 0.14), transparent 55%);
}

.post-head__inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.post-crumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.post-crumbs a { color: var(--gold); transition: color 0.3s var(--ease); }
.post-crumbs a:hover { color: var(--gold-soft); }

.post-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  font-weight: 600;
  line-height: 1.16;
  color: var(--text);
  margin-bottom: 20px;
  text-wrap: balance;
}

.post-dek {
  max-width: 680px;
  margin: 0 auto 28px;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  font-style: italic;
  line-height: 1.6;
  color: var(--text-mute);
}

.post-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-mute);
}

.post-meta__avatar,
.post-author__avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  color: #1a0b2e;
  background: var(--gold-grad);
}

.post-meta__author { font-weight: 600; color: var(--text); }

.post-cover {
  max-width: 1120px;
  margin: 0 auto 56px;
  padding: 0 24px;
}

.post-cover img {
  width: 100%;
  height: auto;
  max-height: 640px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-deep);
}

.post-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 90px;
}

/* ---- Article typography ---- */
.prose {
  font-family: var(--font-serif);
  font-size: clamp(1.16rem, 1.3vw, 1.28rem);
  font-weight: 500;
  line-height: 1.85;
  color: #eadfca;
  overflow-wrap: break-word;
}

.prose > * + * { margin-top: 1.15em; }

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  color: var(--gold-soft);
  scroll-margin-top: 110px;
}

.prose h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); margin-top: 2em; }
.prose h3 { font-size: clamp(1.2rem, 1.8vw, 1.42rem); margin-top: 1.7em; }

.prose h4 {
  margin-top: 1.6em;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }

.prose a {
  color: var(--gold-soft);
  text-decoration: underline;
  text-decoration-color: rgba(212, 175, 55, 0.45);
  text-underline-offset: 3px;
  transition: color 0.3s var(--ease), text-decoration-color 0.3s var(--ease);
}

.prose a:hover { color: var(--gold); text-decoration-color: var(--gold); }

.prose strong { font-weight: 700; color: var(--text); }

.prose ul { list-style: disc; padding-left: 1.4em; }
.prose ol { list-style: decimal; padding-left: 1.5em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--gold); }

.prose li.ql-indent-1 { margin-left: 1.5em; }
.prose li.ql-indent-2 { margin-left: 3em; }
.prose li.ql-indent-3 { margin-left: 4.5em; }
.prose li.ql-indent-4 { margin-left: 6em; }
.prose p.ql-indent-1 { padding-left: 1.5em; }
.prose p.ql-indent-2 { padding-left: 3em; }
.prose p.ql-indent-3 { padding-left: 4.5em; }

.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose .ql-align-justify { text-align: justify; }

.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 10px 0 10px 24px;
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  font-size: 1.12em;
  font-style: italic;
  color: var(--text);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.08), transparent 70%);
}

.prose img {
  display: block;
  height: auto;
  margin: 1.8em auto;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.prose iframe.ql-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 1.8em 0;
  border: 0;
  border-radius: 16px;
  background: #0f0620;
}

.prose hr {
  height: 1px;
  margin: 2.6em 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.prose code {
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: rgba(212, 175, 55, 0.1);
}

.prose pre {
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}

.prose pre code { padding: 0; background: none; }

/* ---- After the article ---- */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 48px;
}

.post-tags a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--gold-soft);
  border: 1px solid var(--line);
  background: rgba(212, 175, 55, 0.05);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.post-tags a:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.12); }

.post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.post-share__label {
  margin-right: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.post-share a,
.post-share__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(42, 21, 71, 0.45);
  color: var(--gold-soft);
  font: 600 0.78rem var(--font-sans);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

.post-share a:hover,
.post-share__copy:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

.post-author {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 40px;
  padding: 26px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(42, 21, 71, 0.35);
}

.post-author__avatar { width: 54px; height: 54px; font-size: 1.3rem; }
.post-author__label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.post-author__name { margin: 2px 0 6px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.post-author__bio { font-size: 0.9rem; line-height: 1.6; color: var(--text-mute); }

.post-cta {
  position: relative;
  margin-top: 40px;
  padding: 44px 32px;
  text-align: center;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.16), transparent 65%),
    linear-gradient(180deg, rgba(42, 21, 71, 0.75), rgba(15, 6, 32, 0.9));
}

.post-cta__eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

.post-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 600;
  margin-bottom: 10px;
}

.post-cta p { max-width: 520px; margin: 0 auto 26px; color: var(--text-mute); }

.post-related { padding: 90px 24px 110px; border-top: 1px solid var(--line); }
.post-related .section-head { margin-bottom: 48px; }

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
  .blog-lead { grid-template-columns: 1fr; }
  .blog-lead__media { min-height: 0; aspect-ratio: 16 / 9; }
  .blog-lead__body { padding: 28px 24px 30px; }
}

@media (max-width: 640px) {
  .blog-home { padding: 80px 16px 90px; }
  .blog-list { padding: 10px 16px 90px; }
  .blog-toolbar { flex-direction: column; align-items: stretch; }
  .blog-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .blog-chips::-webkit-scrollbar { display: none; }
  .blog-chip { flex-shrink: 0; }
  .blog-search { flex-basis: auto; min-width: 0; }
  .blog-grid { grid-template-columns: 1fr; gap: 22px; }
  .blog-grid--center { grid-template-columns: minmax(0, 1fr); }
  .post-head { padding: 130px 16px 36px; }
  .post-cover { padding: 0; margin-bottom: 36px; }
  .post-cover img { border-radius: 0; border-left: 0; border-right: 0; }
  .post-body { padding: 0 16px 70px; }
  .post-author { flex-direction: column; }
  .post-cta { padding: 36px 20px; }
  .post-share__copy span { display: none; }
  .blog-cta-band { padding: 70px 16px 90px; }
  .post-related { padding: 70px 16px 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card:hover,
  .blog-card__media img,
  .blog-card:hover .blog-card__media img,
  .blog-lead__media img,
  .blog-lead:hover .blog-lead__media img,
  .post-share a:hover,
  .post-share__copy:hover { transition: none !important; transform: none !important; }
}
