/* ─────────────────────────────────────────────
   Sherpa Blog — Stylesheet
   Brand: #e6005c (pink), #9b4dff (purple)
   Fonts: Inter (body), League Spartan (headings)
───────────────────────────────────────────── */

:root {
  --pink: #e6005c;
  --purple: #9b4dff;
  --pink-light: rgba(230, 0, 92, 0.08);
  --purple-light: rgba(155, 77, 255, 0.08);
  --gradient: linear-gradient(135deg, var(--pink), var(--purple));

  --dark: #0f0f14;
  --dark-2: #1a1a24;
  --text: #1c1c2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --surface: #f9fafb;
  --white: #ffffff;

  --radius: 1rem;
  --radius-sm: 0.5rem;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);

  --font-body: "Inter", system-ui, sans-serif;
  --font-heading: "League Spartan", system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--pink); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* ── Layout ────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1.5rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

nav { display: flex; align-items: center; gap: 1.5rem; }

nav a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
nav a:hover { color: var(--white); opacity: 1; }

.btn-nav {
  background: var(--gradient);
  color: var(--white) !important;
  padding: 0.45rem 1.1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.85rem;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-nav:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Blog Hero ─────────────────────────────── */
.blog-hero {
  background: var(--dark);
  color: var(--white);
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(230, 0, 92, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(155, 77, 255, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.blog-hero .container { position: relative; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
}

.blog-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 1.25rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.blog-hero h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-hero p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 580px;
  margin: 0 auto;
}

/* ── Posts Grid ────────────────────────────── */
.posts-section {
  padding: 4rem 0 5rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* ── Post Card ─────────────────────────────── */
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image-link { display: block; overflow: hidden; }

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.35s;
}
.post-card:hover .card-image { transform: scale(1.04); }

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }

.tag-badge {
  display: inline-block;
  background: var(--pink-light);
  color: var(--pink);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 2rem;
}

.tag-badge--sm { font-size: 0.68rem; padding: 0.2rem 0.55rem; }

.card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.6rem;
  letter-spacing: -0.3px;
}

.card-title a { color: var(--text); }
.card-title a:hover { color: var(--pink); opacity: 1; }

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pink);
  white-space: nowrap;
}

/* ── Empty state ───────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Post Page ─────────────────────────────── */
.post-hero {
  background: var(--dark);
  color: var(--white);
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.post-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% 40%, rgba(230, 0, 92, 0.15) 0%, transparent 65%),
    radial-gradient(ellipse 60% 60% at 70% 60%, rgba(155, 77, 255, 0.15) 0%, transparent 65%);
  pointer-events: none;
}

.post-hero .container { position: relative; }

.post-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }

.post-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.8px;
  margin-bottom: 1rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.post-excerpt {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}
.separator { opacity: 0.4; }

.post-cover {
  margin-top: 2.5rem;
}
.post-cover img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ── Post Body (typography) ────────────────── */
.post-body {
  max-width: 720px;
  padding-top: 3rem;
  padding-bottom: 3rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.post-body h2 { font-size: 1.6rem; }
.post-body h3 { font-size: 1.25rem; }
.post-body h4 { font-size: 1.05rem; }

.post-body p { margin-bottom: 1.4rem; }

.post-body a {
  color: var(--pink);
  text-decoration: underline;
  text-decoration-color: rgba(230, 0, 92, 0.35);
  text-underline-offset: 3px;
}
.post-body a:hover { text-decoration-color: var(--pink); opacity: 1; }

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.post-body li { margin-bottom: 0.4rem; }

.post-body blockquote {
  border-left: 4px solid var(--pink);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--pink-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}

.post-body code {
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
}

.post-body pre {
  background: var(--dark);
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.4rem;
}
.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  color: inherit;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-body img {
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}

/* ── Post Footer ───────────────────────────── */
.post-footer {
  max-width: 720px;
  padding-bottom: 4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.55rem 1.1rem;
  border-radius: 2rem;
  transition: border-color 0.2s, color 0.2s;
}
.back-link:hover {
  border-color: var(--pink);
  color: var(--pink);
  opacity: 1;
}

/* ── Footer ────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 3rem 0 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand .logo { font-size: 1.25rem; display: block; margin-bottom: 0.4rem; }
.footer-brand p { font-size: 0.85rem; max-width: 360px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); opacity: 1; }

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── 404 ────────────────────────────────────── */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  text-align: center;
}
.error-page .container { max-width: 520px; padding: 4rem 1rem; }
.error-page .error-code {
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}
.error-page h1 { font-size: 1.75rem; margin-bottom: 0.75rem; }
.error-page p { color: var(--text-muted); margin-bottom: 2rem; }
.btn-primary {
  display: inline-block;
  background: var(--gradient);
  color: var(--white);
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .header-inner { height: 56px; }
  nav a:not(.btn-nav) { display: none; }
  .post-body { font-size: 1rem; }
  .blog-hero, .post-hero { padding: 3.5rem 0 2.5rem; }
}
