/* ============================================================
   atlvibe — blog
   Extends styles.css (same "Atlanta, after dark" system).
   Only the blog-specific pieces live here: the index grid,
   the article layout, and the long-form prose typography.
   ============================================================ */

/* ---------- shared layout width for blog sections ---------- */
.blog-head,
.blog-list,
.article,
.blog-cta {
  width: min(100% - 3rem, var(--maxw));
  margin-inline: auto;
}

/* A narrower measure for the reading column. */
.article { --measure: 44rem; }

/* ---------- blog header ---------- */
.blog-head {
  text-align: center;
  padding-top: clamp(2.5rem, 8vh, 5.5rem);
  padding-bottom: clamp(1.5rem, 4vh, 3rem);
  display: flex; flex-direction: column; align-items: center;
}
.blog-head__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-top: 1.2rem;
  font-optical-sizing: auto;
}
.blog-head__lead {
  max-width: 46ch;
  margin-top: 1.3rem;
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: var(--muted);
  text-wrap: balance;
}

/* ---------- back link ---------- */
.backlink {
  display: inline-flex; align-items: center; gap: 0.45rem;
  align-self: flex-start;
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
  padding: 0.4rem 0.85rem; border-radius: var(--pill);
  border: 1px solid var(--line); background: rgba(27,20,24,0.4);
  backdrop-filter: blur(8px);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
              transform 0.25s var(--ease);
}
.backlink:hover { color: var(--cream); border-color: rgba(255,138,91,0.45);
  transform: translateX(-2px); }

/* ============================================================
   Index — post grid
   ============================================================ */
.blog-list {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .blog-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .blog-list { grid-template-columns: 1fr; } }

.post-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(36,26,31,0.55), rgba(27,20,24,0.4));
  border: 1px solid var(--line);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
}
.post-card::before { /* corner sheen, echoing the feature cards */
  content: ""; position: absolute; top: -40%; right: -30%;
  width: 60%; height: 70%;
  background: radial-gradient(circle, rgba(255,138,91,0.16), transparent 70%);
  opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,138,91,0.35);
  box-shadow: 0 26px 50px -30px rgba(0,0,0,0.8);
}
.post-card:hover::before { opacity: 1; }

.post-card__cover {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(255,107,74,0.4), transparent 60%),
    radial-gradient(120% 120% at 85% 90%, rgba(255,92,134,0.34), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line);
}
.post-card__body {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1.4rem 1.4rem 1.5rem;
  flex: 1 1 auto;
}
.post-card__tag {
  align-self: flex-start;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold);
  padding: 0.28rem 0.7rem; border-radius: var(--pill);
  border: 1px solid rgba(244,197,107,0.28);
  background: linear-gradient(180deg, rgba(244,197,107,0.10), rgba(244,197,107,0.02));
}
.post-card__title {
  font-family: var(--display); font-weight: 600;
  font-size: 1.42rem; letter-spacing: -0.02em; line-height: 1.12;
  margin-top: 0.2rem;
}
.post-card__excerpt {
  color: var(--muted); font-size: 0.96rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__meta {
  margin-top: auto; padding-top: 0.9rem;
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.82rem; color: var(--faint);
}
.post-card__more {
  margin-left: auto; color: var(--peach); font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.3rem;
  transition: gap 0.25s var(--ease);
}
.post-card:hover .post-card__more { gap: 0.55rem; }

/* ============================================================
   States — loading / empty / error (shared by both pages)
   ============================================================ */
.state {
  grid-column: 1 / -1;
  text-align: center; color: var(--muted);
  padding: clamp(2.5rem, 8vh, 5rem) 1rem;
}
.state__title {
  font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  color: var(--cream); letter-spacing: -0.02em; margin-bottom: 0.4rem;
}
.state[hidden] { display: none; }

/* skeleton shimmer cards while posts load */
.skeleton {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(36,26,31,0.4), rgba(27,20,24,0.3));
  min-height: 320px; overflow: hidden; position: relative;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: sk 1.4s var(--ease-out) infinite;
}
@keyframes sk { to { transform: translateX(100%); } }

/* ============================================================
   Article — single post
   ============================================================ */
.article {
  padding-top: clamp(2rem, 6vh, 4rem);
  display: flex; flex-direction: column; align-items: center;
}
.article__inner { width: 100%; max-width: var(--measure); }

.article__tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold);
  padding: 0.4rem 0.9rem; border-radius: var(--pill);
  border: 1px solid rgba(244,197,107,0.28);
  background: linear-gradient(180deg, rgba(244,197,107,0.10), rgba(244,197,107,0.02));
}
.article__title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.02;
  letter-spacing: -0.035em; margin-top: 1.1rem;
  font-optical-sizing: auto; text-wrap: balance;
}
.article__meta {
  margin-top: 1.1rem;
  display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  font-size: 0.9rem; color: var(--faint);
}
.article__meta b { color: var(--muted); font-weight: 600; }
.article__cover {
  width: 100%; margin-top: 1.8rem;
  aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

/* ---------- long-form prose ---------- */
.prose {
  margin-top: clamp(1.8rem, 5vh, 3rem);
  font-size: 1.075rem; line-height: 1.75; color: var(--cream);
}
.prose > * + * { margin-top: 1.15em; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--display); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.15; color: var(--cream);
  margin-top: 2em; margin-bottom: -0.15em;
}
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.4rem; }
.prose h4 { font-size: 1.18rem; }
.prose p { color: #ece0d8; }
.prose a {
  color: var(--peach); text-decoration: underline;
  text-decoration-color: rgba(255,138,91,0.4); text-underline-offset: 3px;
  transition: text-decoration-color 0.2s var(--ease);
}
.prose a:hover { text-decoration-color: var(--peach); }
.prose strong { color: var(--cream); font-weight: 700; }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4em; color: #ece0d8; }
.prose li { margin-top: 0.4em; }
.prose li::marker { color: var(--peach); }
.prose blockquote {
  border-left: 3px solid var(--peach);
  padding: 0.2em 0 0.2em 1.2em; margin-left: 0;
  color: var(--muted); font-style: italic;
  font-family: var(--display); font-size: 1.2rem;
}
.prose img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line);
}
.prose hr {
  border: 0; height: 1px; margin: 2.4em 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em; color: var(--gold);
  background: rgba(244,197,107,0.10);
  border: 1px solid rgba(244,197,107,0.18);
  padding: 0.12em 0.4em; border-radius: 6px;
}
.prose pre {
  overflow-x: auto; padding: 1.1rem 1.25rem;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: rgba(16,11,13,0.7);
}
.prose pre code {
  color: var(--cream); background: none; border: 0; padding: 0; font-size: 0.92em;
}
/* tables — scroll horizontally on narrow screens */
.prose table {
  width: 100%; border-collapse: collapse;
  font-size: 0.96rem; display: block; overflow-x: auto;
}
.prose thead th {
  text-align: left; font-family: var(--display); font-weight: 600;
  color: var(--cream); letter-spacing: -0.01em;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid rgba(244,197,107,0.35);
  white-space: nowrap;
}
.prose tbody td {
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose h2:first-child, .prose h3:first-child, .prose p:first-child { margin-top: 0; }

/* article footer — back to all + share nudge */
.article__foot {
  width: 100%; max-width: var(--measure);
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding-top: 1.6rem; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}

/* ============================================================
   Closing CTA band (blog → app)
   ============================================================ */
.blog-cta {
  margin-top: clamp(4rem, 10vh, 6.5rem);
  text-align: center;
  padding: clamp(2.4rem, 6vw, 3.6rem);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(255,107,74,0.16), transparent 60%),
    linear-gradient(180deg, rgba(36,26,31,0.6), rgba(27,20,24,0.35));
  border: 1px solid var(--line);
}
.blog-cta__title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.7rem, 4.5vw, 2.6rem); letter-spacing: -0.03em;
}
.blog-cta__sub { color: var(--muted); margin-top: 0.55rem; }
.blog-cta .btn { margin-top: 1.5rem; }
