/* --- Ultra-Minimalist Design System (Medium / Substack Style) --- */
:root {
  /* Colors */
  --bg-main: #ffffff;
  --bg-subtle: #fafafa;

  --text-primary: #191919;
  --text-secondary: #242424;
  --text-muted: #6b6b6b;
  --text-light: #757575;

  --border-subtle: #f2f2f2;
  --border-medium: #e6e6e6;

  --accent-black: #191919;
  --accent-green: #15803d;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Newsreader', 'Lora', Georgia, serif;
}

/* Yellow Text Highlight Utility */
.highlight-yellow,
mark.highlight-yellow {
  background-color: #fef08a;
  color: #191919;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  line-height: 1.15;
}

/* Reset & Box Sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.collage-item,
.logo a {
  text-decoration: none;
}

/* --- Layout Structure (Content Left, Wider Sidebar Right) --- */
.layout-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 56px;
}

/* Left Content Column */
.main-content {
  padding-top: 56px;
  padding-bottom: 96px;
}

/* Site / Blog Hero Title Banner (Static, not sticky) */
.blog-hero {
  margin-bottom: 32px;
}

.hero-top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
  text-decoration: none;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  color: var(--accent-black);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lang-divider {
  color: var(--border-medium);
  font-weight: 300;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.welcome-banner {
  margin-top: 24px;
  padding: 16px 24px;
  border-left: 3px solid #dc2626;
  background-color: var(--bg-subtle);
  border-radius: 0 6px 6px 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.welcome-banner strong {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.01em;
}

/* --- Featured Mestizaje Section --- */
.featured-mestizaje-section {
  margin-bottom: 48px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-subtle);
}

.featured-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.featured-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.28;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.featured-text {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.mestizaje-callout {
  border-left: 2px solid var(--text-muted);
  padding-left: 16px;
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.genetics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 12px;
}

.genetic-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Section Header Component --- */
.section-header {
  margin-top: 16px;
}

.section-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-green);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-subtitle {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* --- Question Stream --- */
.articles-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  padding: 40px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.post-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.post-excerpt {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* --- Ultra-Minimalist Comparison Table (UI) --- */
.comparison-matrix {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
}

.matrix-row {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.92rem;
  gap: 20px;
}

.matrix-row:last-child {
  border-bottom: none;
}

.matrix-row.highlight-row {
  font-weight: 600;
}

.country-badge {
  font-weight: 600;
  width: 140px;
  flex-shrink: 0;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.country-detail {
  color: var(--text-secondary);
  line-height: 1.45;
}

.country-detail strong {
  color: var(--text-primary);
}

/* --- Collapsible Sources Below Tables --- */
.sources-details {
  margin-top: 16px;
  padding-top: 10px;
}

.sources-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  font-weight: 500;
  list-style: none;
  transition: color 0.15s ease;
}

.sources-summary::-webkit-details-marker {
  display: none;
}

.sources-summary:hover {
  color: var(--text-primary);
}

.sources-content {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  background-color: var(--bg-subtle);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.sources-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sources-content li strong {
  color: var(--text-primary);
}

/* --- Right Column: Widened Sidebar --- */
.sidebar {
  border-left: 1px solid var(--border-subtle);
  padding-left: 40px;
  padding-top: 56px;
  padding-bottom: 96px;
}

.sidebar-sticky {
  position: sticky;
  top: 40px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-sticky::-webkit-scrollbar {
  width: 5px;
}

.sidebar-sticky::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-sticky::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 99px;
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

.sidebar-widget {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget-header {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Collapsible FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 6px 0;
  line-height: 1.35;
  transition: opacity 0.15s ease;
}

.faq-question:hover {
  opacity: 0.7;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 4px;
  flex-shrink: 0;
}

.faq-item[open] .faq-chevron {
  transform: rotate(-135deg);
}

.faq-answer {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.copyright {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* --- Picture Grid / Strip below Hero --- */
.faces-collage-grid,
.faces-collage-strip {
  margin-top: 20px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.collage-item {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background-color: #eee;
  cursor: pointer;
  position: relative;
}

.collage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.3s ease;
}

.collage-item:hover .collage-img {
  transform: scale(1.08);
}

.collage-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.collage-item:hover .collage-overlay {
  opacity: 1;
}

.collage-name {
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15;
}

.collage-tag {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.58rem;
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Responsive Layout --- */
@media (max-width: 1024px) {
  .layout-container {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sidebar {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border-subtle);
  }

  .sidebar-sticky {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

/* --- Floating Mobile Navigation Button --- */
.mobile-nav-btn {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 1000;
    background-color: var(--accent-black, #191919);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }

  .mobile-nav-btn:hover {
    background-color: #333333;
  }

  .mobile-nav-btn:active {
    transform: scale(0.95);
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .post-title,
  .featured-title {
    font-size: 1.35rem;
  }

  .genetics-grid {
    grid-template-columns: 1fr;
  }

  .faces-collage-grid,
  .faces-collage-strip {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .matrix-row {
    flex-direction: column;
    gap: 4px;
  }

  .country-badge {
    width: 100%;
  }
}

/* WVS Survey Blockquote below image grid */
blockquote.wvs-quote {
  margin: 24px 0 36px 0;
  padding: 16px 24px;
  border-left: 3px solid var(--accent-black);
  background-color: var(--bg-subtle);
  border-radius: 0 6px 6px 0;
}

blockquote.wvs-quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

blockquote.wvs-quote a {
  color: var(--text-primary);
  font-weight: 600;
  font-style: normal;
  text-decoration: underline;
  text-underline-offset: 3px;
}

blockquote.wvs-quote a:hover {
  color: var(--accent-green);
}

/* --- Banknote Banner Component (Minimalist Editorial Style) --- */
.banknote-section {
  margin-top: 56px;
  border-top: 1px solid var(--border-medium);
  padding-top: 36px;
  margin-bottom: 0;
}

.banknote-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.banknote-legend {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.banknote-legend strong {
  color: var(--text-primary);
  font-weight: 600;
}