/* ============================================================
   Altiora — Blog (index + article pages)
   Builds on the shared design system in ../styles.css.
   ============================================================ */

/* ---------- Page header ---------- */
.blog-head {
  position: relative;
  background: var(--hero-bg);
  padding-block: clamp(56px, 8vw, 104px) clamp(20px, 3vw, 32px);
  overflow: hidden;
}
.blog-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(80% 90% at 100% 0%, rgba(224, 174, 203, .34), transparent 60%),
    radial-gradient(70% 80% at 0% 100%, rgba(198, 170, 214, .3), transparent 62%);
}
.blog-head .container { position: relative; z-index: 1; }
.blog-head h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.3rem);
  color: var(--hero-plum);
  margin-bottom: 18px;
}
.blog-intro {
  max-width: 62ch;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--plum-muted);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { margin-bottom: 26px; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before {
  content: "/";
  color: var(--line);
}
.breadcrumbs a { color: var(--magenta); font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--muted); }

/* ---------- Post grid ---------- */
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(106, 13, 173, .28);
}
.post-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
}
.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.post-cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--magenta);
  background: rgba(154, 43, 132, .09);
  border: 1px solid rgba(154, 43, 132, .18);
}
.post-card h3 { font-size: 1.25rem; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--purple); }
.post-excerpt { color: var(--muted); font-size: 15.5px; }
.post-more {
  margin-top: 4px;
  font-weight: 600;
  font-size: 15px;
  color: var(--purple);
  display: inline-flex;
  gap: 6px;
}
.post-more:hover { text-decoration: underline; }

/* ---------- Empty state ---------- */
.posts-empty {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 40px);
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.posts-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 50%;
  font-size: 22px;
  color: #fff;
  background: var(--grad-brand);
}
.posts-empty h3 { font-size: 1.3rem; margin-bottom: 10px; }
.posts-empty p { color: var(--muted); margin-bottom: 22px; }
.posts-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---------- Blog CTA ---------- */
.blog-cta {
  text-align: center;
  max-width: 640px;
}
.blog-cta h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 12px; }
.blog-cta p { color: var(--muted); margin-bottom: 24px; }

/* ---------- Article page ---------- */
.article {
  max-width: 760px;
  margin-inline: auto;
}
.blog-head--article .post-meta { margin-bottom: 14px; }
.blog-head--article h1 { max-width: 24ch; }
.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.article-byline strong { color: var(--ink); }
.article-head { margin-bottom: 28px; }
.article-head h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  color: var(--hero-plum);
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
.article-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--plum-muted);
  margin-bottom: 8px;
}
.article-body { font-size: 17px; color: var(--ink-2); }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-top: 1.6em; color: var(--ink); }
.article-body h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); margin-top: 1.4em; color: var(--ink); }
.article-body ul, .article-body ol { list-style: revert; padding-left: 1.3em; }
.article-body li + li { margin-top: .4em; }
.article-body a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
.article-body img { border-radius: var(--radius-sm); margin-inline: auto; }
.article-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--magenta);
  color: var(--plum-muted);
  font-style: italic;
}
.article-figure figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.article-cta {
  margin-top: 48px;
  padding: clamp(24px, 4vw, 36px);
  background: var(--ink-solid);
  color: var(--on-dark);
  border-radius: var(--radius);
}
.article-cta h2 { color: #fff; font-size: 1.5rem; margin-bottom: 10px; }
.article-cta p { color: var(--muted-dark); margin-bottom: 20px; }
.article-back { margin-top: 28px; font-weight: 600; }

/* ---------- Article reading experience ---------- */
.article-hero { margin: 0; }
.article-hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.article-body {
  max-width: 70ch;
  margin: 34px auto 0;
}
.article-body h2,
.article-body h3 { scroll-margin-top: 96px; }

.article-body > .article-toc {
  margin-top: 1.8em;
  padding: 22px 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.article-body .article-toc-title {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-toc ol {
  margin: 0;
  padding-left: 1.25em;
}
.article-toc li + li { margin-top: .35em; }
.article-toc a {
  color: var(--purple);
  font-weight: 500;
  text-decoration: none;
}
.article-toc a:hover { text-decoration: underline; }

.article-body > .article-note {
  margin-top: 1.8em;
  padding: 18px 20px;
  background: linear-gradient(100deg, rgba(154, 43, 132, .07), rgba(106, 13, 173, .05));
  border-left: 3px solid var(--magenta);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-note p {
  margin: 0;
  font-size: 16px;
  color: var(--ink-2);
}

.article-body > .article-table-wrap {
  margin-top: 1.6em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
.article-body table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 15.5px;
}
.article-body th,
.article-body td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.article-body th {
  background: var(--bg-soft);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
}
.article-body tbody tr:last-child td { border-bottom: 0; }

.article-sources a { overflow-wrap: anywhere; }
.article-sources-note {
  margin-top: 1em;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .posts { grid-template-columns: 1fr; }
  .blog-head--article h1 { max-width: none; }
  .article-body > .article-toc { padding: 18px 20px; }
  .article-body { font-size: 16.5px; }
}
