/* ============================================================
   EMRC — v3
   Clean institutional design, inline newsletter, look-ahead search
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800;900&family=Libre+Franklin:wght@300;400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&display=swap');

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

:root {
  --dark: #0f1118;
  --ink: #1a1a2e;
  --text: #374151;
  --text-light: #6b7280;
  --text-faint: #9ca3af;
  --accent: #4a6cf7;
  --accent-hover: #3b5de7;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --bg: #ffffff;
  --bg-warm: #fafaf9;
  --bg-card: #ffffff;
  --tag-bg: #f0f1f3;
  --tag-opinion: #fef3c7;
  --tag-opinion-text: #92400e;
  --tag-research: #dbeafe;
  --tag-research-text: #1e40af;
  --tag-featured: #d1fae5;
  --tag-featured-text: #065f46;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Libre Franklin', system-ui, sans-serif;
  --font-editorial: 'Newsreader', Georgia, serif;
  --max-w: 1140px;
  --radius: 12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }
img { max-width: 100%; height: auto; display: block; }

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

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.site-logo-icon { width: 28px; height: 28px; }

.site-logo-text {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.04em;
  line-height: 1;
}

.site-logo:hover { opacity: 0.85; }

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

.header-nav a {
  font-family: var(--font-editorial);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-light);
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.header-nav a:hover { color: var(--ink); }

/* Search button */
.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-light);
  flex-shrink: 0;
}

.search-btn:hover {
  border-color: var(--text-light);
  color: var(--ink);
  background: var(--border-light);
}

.search-btn svg { width: 16px; height: 16px; }

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.search-overlay.open { display: flex; }

.search-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.search-box input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6875rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--accent); }

.search-box input::placeholder { color: var(--text-faint); }

.search-results {
  margin-top: 0.75rem;
  max-height: 50vh;
  overflow-y: auto;
}

.search-results a {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.search-results a:hover { background: var(--border-light); }

.search-results .sr-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.35;
}

.search-results .sr-meta {
  font-size: 0.6875rem;
  color: var(--text-faint);
  margin-top: 0.1875rem;
}

.search-results .sr-type {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-results .no-results {
  padding: 1rem 0.75rem;
  color: var(--text-faint);
  font-size: 0.875rem;
}

.header-cta {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  padding: 0.4375rem 1.125rem;
  border-radius: 100px;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.header-cta:hover {
  background: #2d3561;
  color: #fff;
  transform: translateY(-1px);
}

/* Mobile */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.mobile-toggle svg { width: 22px; height: 22px; }

.mobile-menu {
  display: none;
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.mobile-menu.open { display: block; }

.mobile-menu a {
  display: block;
  padding: 0.625rem 0;
  font-family: var(--font-editorial);
  font-size: 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}

.mobile-menu a:last-child { border-bottom: none; }

@media (max-width: 768px) {
  .header-nav, .header-cta { display: none; }
  .mobile-toggle { display: block; }
  .header-inner { padding: 0 1.25rem; }
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .page-wrap { padding: 0 1.25rem; }
}

/* ============================================================
   PINNED POST
   ============================================================ */
.pinned-post {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.pinned-image {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.pinned-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.pinned-post:hover .pinned-image img { transform: scale(1.03); }

.pinned-label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.pinned-title {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  transition: color 0.2s;
}

.pinned-post:hover .pinned-title { color: var(--accent); }

.pinned-excerpt {
  font-family: var(--font-editorial);
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.pinned-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

@media (max-width: 768px) {
  .pinned-post {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .pinned-title { font-size: 1.5rem; }
}

/* ============================================================
   ARTICLE GRID
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 3rem;
}

@media (max-width: 900px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 550px) {
  .article-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ARTICLE CARD
   ============================================================ */
.card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  border-color: #d1d5db;
  transform: translateY(-2px);
}

.card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--border-light);
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img img { transform: scale(1.04); }

.card-body { padding: 1.25rem 1.25rem 1.5rem; }

.card-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1875rem 0.625rem;
  border-radius: 100px;
  margin-bottom: 0.625rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card-tag.opinion { background: var(--tag-opinion); color: var(--tag-opinion-text); }
.card-tag.research { background: var(--tag-research); color: var(--tag-research-text); }
.card-tag.featured { background: var(--tag-featured); color: var(--tag-featured-text); }

.card-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  transition: color 0.2s;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card:hover .card-title { color: var(--accent); }

.card-date {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.75rem;
}

/* ============================================================
   NEWSLETTER CARD (inline with grid)
   ============================================================ */
.newsletter-card {
  border: 2px solid var(--accent) !important;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%) !important;
}

.newsletter-card:hover {
  transform: none !important;
  box-shadow: none !important;
}

.newsletter-card-inner {
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.newsletter-card-inner .nl-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.newsletter-card-inner h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.375rem;
}

.newsletter-card-inner p {
  font-size: 0.8125rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.feedblitz-slot {
  width: 100%;
}

/* Override Feedblitz form styling to fit card */
.feedblitz-slot form input[type="email"],
.feedblitz-slot form input[type="text"] {
  width: 100% !important;
  font-family: var(--font-body) !important;
  font-size: 0.8125rem !important;
  padding: 0.5rem 0.75rem !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  outline: none !important;
  margin-bottom: 0.375rem !important;
}

.feedblitz-slot form input[type="submit"],
.feedblitz-slot form button {
  width: 100% !important;
  font-family: var(--font-body) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  padding: 0.5rem 1rem !important;
  background: var(--ink) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
}

/* ============================================================
   SINGLE ARTICLE
   ============================================================ */
.article-single {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.article-single .cover-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.article-single .cover-wrap img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-single .article-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.article-single h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.article-single .article-meta-line {
  font-size: 0.875rem;
  color: var(--text-faint);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* Prose */
.prose {
  font-family: var(--font-editorial);
  font-size: 1.0625rem;
  color: var(--text);
  line-height: 1.8;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
}

.prose p { margin-bottom: 1.25rem; }
.prose ul, .prose ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.5rem; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.125rem 0 0.125rem 1.5rem;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--text-light);
}

.prose strong { font-weight: 600; color: var(--ink); }
.prose hr { margin: 2.5rem 0; border: none; border-top: 1px solid var(--border); }
.prose img { border-radius: var(--radius-sm); margin: 1.5rem 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-hover); }

/* Author box */
.author-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-light);
  flex-shrink: 0;
  font-family: var(--font-display);
}

.author-name { font-weight: 600; color: var(--ink); font-size: 0.9375rem; }
.author-bio { font-size: 0.8125rem; color: var(--text-light); }

/* Related */
.related-section {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.related-section .section-label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .related-grid { grid-template-columns: 1fr; }
  .article-single h1 { font-size: 1.75rem; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: var(--bg-warm);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-faint);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--ink); }

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ============================================================
   CATEGORY PAGE
   ============================================================ */
.category-page { padding-bottom: 3rem; }

.page-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-hero .subtitle {
  font-family: var(--font-editorial);
  font-size: 1.0625rem;
  color: var(--text-light);
  margin-top: 0.625rem;
  font-style: italic;
  max-width: 480px;
}

@media (max-width: 768px) {
  .page-hero h1 { font-size: 1.75rem; }
  .page-hero { padding: 2rem 0 1.5rem; }
}
/* --- LOGO PATCH: Add this at the end of main.css --- */

.site-logo-full {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.02em;
  margin-left: 0.125rem;
}

@media (max-width: 900px) {
  .site-logo-full { display: none; }
}
/* --- LOGO PATCH: Add this at the end of main.css --- */

.site-logo-full {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.02em;
  margin-left: 0.125rem;
}

@media (max-width: 900px) {
  .site-logo-full { display: none; }
}
