@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* ============================================================
   PathtoAI Blogs — Shared Styles
   Editorial magazine system with atmospheric depth
   ============================================================ */
:root {
  --bg:     #f6f4ee;
  --bg-1:   #f3efe6;
  --card:   rgba(255, 252, 245, 0.92);
  --line:   #d8d1c5;
  --text:   #1d2a39;
  --text-2: #5d6e80;
  --a1:     #2f6f8f;
  --a2:     #d97706;
  --a3:     #4f8daa;
  --a4:     #ad6f3b;
  --display: "Fraunces", serif;
  --body:    "IBM Plex Sans", sans-serif;
  --mono:    "IBM Plex Mono", monospace;
  --ease:    cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(80rem 40rem at 7% -10%, rgba(47, 111, 143, 0.15) 0%, transparent 62%),
    radial-gradient(65rem 34rem at 93% 2%, rgba(217, 119, 6, 0.12) 0%, transparent 58%),
    linear-gradient(180deg, var(--bg-1), var(--bg));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(900px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ─── Topbar ─── */
.topbar {
  position: sticky;
  top: 0; z-index: 50;
  background: rgba(246, 244, 238, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--a1), var(--a3));
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}
.back-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.25s;
}
.back-link:hover { color: var(--text); }

/* ─── Hero (listing) ─── */
.hero {
  padding: 4rem 0 2rem;
}
.eyebrow {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--a2);
  margin-bottom: 0.7rem;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.hero__sub {
  color: var(--text-2);
  font-size: 1.05rem;
  margin-top: 0.8rem;
  max-width: 55ch;
  line-height: 1.65;
}

/* ─── Post Grid (listing page) ─── */
.posts { padding-bottom: 4rem; }
.post-grid {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  margin-top: 1rem;
}
.post-card {
  display: block;
  padding: 1.6rem 1.8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 18px 50px rgba(20, 24, 31, 0.12);
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.35s var(--ease);
}
.post-card:hover {
  border-color: var(--a1);
  transform: translateY(-5px);
  box-shadow: 0 26px 64px rgba(20, 24, 31, 0.2), 0 0 0 1px rgba(47, 111, 143, 0.18);
}
.post-card__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tag, var(--a1));
  margin-bottom: 0.6rem;
}
.post-card h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
.post-card p {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}
.post-card__meta {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: var(--text-2);
  opacity: 0.7;
}

/* ─── Article Page ─── */
.article-header {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.article-header .eyebrow { margin-bottom: 0.5rem; }
.article-header h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 0.8rem;
  background: linear-gradient(120deg, var(--text) 24%, var(--a1) 74%, var(--a2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.article-header .lead {
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 60ch;
}
.article-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-2);
}

/* ─── Article Body ─── */
.article-body {
  padding-bottom: 4rem;
  line-height: 1.8;
}
.article-body h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.5rem 0 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.article-body h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.8rem 0 0.6rem;
}
.article-body p {
  color: var(--text-2);
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
}
.article-body ul, .article-body ol {
  margin: 0.8rem 0 1.2rem 1.4rem;
  color: var(--text-2);
  font-size: 0.95rem;
}
.article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}
.article-body strong {
  color: var(--text);
}
.article-body code {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: rgba(47, 111, 143, 0.1);
  padding: 0.15em 0.45em;
  border-radius: 5px;
  color: var(--a1);
}
.article-body pre {
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 1.2rem 0;
  font-size: 0.85rem;
  line-height: 1.65;
  position: relative;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: #e5e7eb;
}
.article-body pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  font-family: var(--mono);
  color: #9ca3af;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.article-body blockquote {
  border-left: 3px solid var(--a1);
  padding: 0.8rem 1.2rem;
  margin: 1.2rem 0;
  background: rgba(47, 111, 143, 0.08);
  border-radius: 0 10px 10px 0;
}

.article-body figure {
  margin: 1.8rem 0;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.article-body figure img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

.article-body figcaption {
  margin-top: 0.75rem;
  color: var(--text-2);
  font-size: 0.82rem;
  font-style: italic;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.3rem 0;
  font-size: 0.9rem;
}

.article-body th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  background: rgba(47, 111, 143, 0.12);
  color: var(--a1);
  border-bottom: 1px solid var(--line);
  font-family: var(--body);
  font-weight: 600;
}

.article-body td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(93, 110, 128, 0.16);
  color: var(--text-2);
}

.article-body tr:nth-child(even) td {
  background: rgba(93, 110, 128, 0.05);
}
.article-body blockquote p {
  margin-bottom: 0;
  font-style: italic;
  color: var(--text);
}

.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
}
.callout strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--a2);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 252, 245, 0.82);
}
.footer__inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-2);
}
.footer a {
  color: var(--a1);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .post-card { padding: 1.2rem; }
  .article-header h1 { font-size: 1.4rem; }
  .footer__inner { flex-direction: column; gap: 0.5rem; padding: 1rem 0; }
}
