/* ==========================================================
   PUBLISH DIGITAL - Site CSS
   ========================================================== */

:root {
  --blue: #1A8CFF;
  --blue-dark: #0066CC;
  --blue-light: #4DA8FF;
  --blue-glow: rgba(26, 140, 255, 0.4);
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-soft: #475569;
  --text-mute: #94a3b8;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --font-body: 'Manrope', 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-soft: #12121a;
  --bg-card: #15151f;
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-mute: #64748b;
  --border: #1e293b;
  --border-soft: #1a1a25;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.6);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.8);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ============= NAV ============= */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255,255,255,0.85);
  transition: background 0.3s ease;
}
[data-theme="dark"] nav { background: rgba(10,10,15,0.85); }

.nav-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo-full { display: flex; align-items: center; }
.logo-full img { height: 52px; width: auto; object-fit: contain; display: block; }
@media (max-width: 768px) { .logo-full img { height: 42px; } }
@media (max-width: 480px) { .logo-full img { height: 36px; } }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a {
  color: var(--text-soft);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--blue); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-soft);
  transition: all 0.2s ease;
}
.toggle:hover { border-color: var(--blue); color: var(--blue); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 4px 12px rgba(26,140,255,0.3);
}
.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26,140,255,0.4);
}
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--text-mute);
}
.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: 12px;
}

@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* ============= BLOG LIST ============= */
.blog-hero { padding: 80px 24px 64px; text-align: center; position: relative; overflow: hidden; }
.blog-hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 600px 300px at 50% 0%, rgba(26,140,255,0.08), transparent 70%);
}
.blog-hero-inner { max-width: 800px; margin: 0 auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(26,140,255,0.1);
  color: var(--blue);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 64px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-weight: 700;
  margin: 16px 0;
}
.blog-hero p {
  font-size: 17px;
  color: var(--text-soft);
  margin-bottom: 32px;
}

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

.filter-btn {
  padding: 8px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.2s ease;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.blog-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}
.post-card:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-cover {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  position: relative;
  overflow: hidden;
}
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  color: white;
}

.post-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-cat {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 12px;
}
.post-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--text);
}
.post-excerpt {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-mute);
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-soft);
  grid-column: 1 / -1;
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

/* ============= POST PAGE ============= */
.post-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.post-page-head {
  margin-bottom: 32px;
}
.back-to-blog {
  display: inline-block;
  font-size: 14px;
  color: var(--text-mute);
  margin-bottom: 16px;
  font-weight: 500;
}
.back-to-blog:hover { color: var(--blue); }

.post-cat-tag {
  display: inline-block;
  background: rgba(26,140,255,0.1);
  color: var(--blue);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.post-page h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}
.post-page-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-mute);
  flex-wrap: wrap;
}
.post-page-cover {
  margin: 32px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.post-page-cover img {
  width: 100%;
  height: auto;
}

.post-page-content {
  font-size: 18px;
  line-height: 1.75;
  color: var(--text);
}
.post-page-content p { margin-bottom: 18px; }
.post-page-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 40px 0 16px;
  font-weight: 700;
}
.post-page-content h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 32px 0 12px;
  font-weight: 700;
}
.post-page-content blockquote {
  border-left: 4px solid var(--blue);
  padding: 12px 24px;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-soft);
  background: var(--bg-soft);
}
.post-page-content ul, .post-page-content ol {
  margin: 16px 0 16px 32px;
}
.post-page-content li { margin-bottom: 8px; }
.post-page-content a {
  color: var(--blue);
  text-decoration: underline;
}
.post-page-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 20px 0;
}
.post-page-content strong { font-weight: 700; }

.post-page-footer {
  margin-top: 64px;
}
.cta-box {
  background: linear-gradient(135deg, #0a0a0f, #15151f);
  color: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
}
.cta-box h3 {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: 8px;
}
.cta-box p {
  color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
}

/* ============= RELATED ============= */
.related-posts {
  background: var(--bg-soft);
  padding: 64px 24px;
  border-top: 1px solid var(--border);
}
.related-wrap { max-width: 1200px; margin: 0 auto; }
.related-wrap h2 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  text-align: center;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}
.related-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}
.related-cover {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
}
.related-cover img { width: 100%; height: 100%; object-fit: cover; }
.related-info { padding: 16px; }
.related-info h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--text);
}

/* ============= FOOTER ============= */
footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 64px 24px 32px;
  margin-top: 0;
}
.footer-wrap { max-width: 1200px; margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
.footer-brand .logo-full img { height: 56px; margin-bottom: 12px; }
.footer-brand p {
  color: var(--text-soft);
  font-size: 14px;
  max-width: 320px;
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 14px;
  color: var(--text-soft);
}
.footer-col a:hover { color: var(--blue); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-mute);
  flex-wrap: wrap;
  gap: 12px;
}
