
:root {
  --bg: #faf9f7;
  --fg: #1a1a1a;
  --muted: #666;
  --border: #ddd;
  --accent: #2563eb;
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --level-a: #059669;
  --level-b: #2563eb;
  --level-c: #d97706;
  --level-d: #dc2626;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: white;
}

.site-header .logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.home-page h1 {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.home-page .tagline {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 3rem;
  max-width: 600px;
}

.home-page .what-we-are-not {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.home-page .what-we-are-not h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.home-page .what-we-are-not ul {
  list-style: none;
}

.home-page .what-we-are-not li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.home-page .what-we-are-not li:last-child {
  border-bottom: none;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.country-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.country-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.country-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.country-card .name-en {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.country-card .stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Country page */
.country-page .banner {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 3rem;
}

.country-page .banner h1 {
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.country-page .banner p {
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.country-page .banner .pin-count {
  font-size: 0.9rem;
  color: var(--accent);
}

.country-page .add-pin-btn {
  display: inline-block;
  background: var(--fg);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  margin-top: 1rem;
}

.country-page .add-pin-btn:hover {
  opacity: 0.9;
}

/* Stories */
.stories-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.story-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.story-card .level {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.story-card .level.level-a { background: #d1fae5; color: var(--level-a); }
.story-card .level.level-b { background: #dbeafe; color: var(--level-b); }
.story-card .level.level-c { background: #fef3c7; color: var(--level-c); }
.story-card .level.level-d { background: #fee2e2; color: var(--level-d); }

.story-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.story-card h3 a {
  color: inherit;
  text-decoration: none;
}

.story-card h3 a:hover {
  color: var(--accent);
}

.story-card .summary {
  color: var(--muted);
  margin-bottom: 1rem;
}

.story-card .sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.story-card .sources a {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.story-card .sources a:hover {
  text-decoration: underline;
}

/* Pin page */
.pin-page .instructions {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.pin-page .instructions h2 {
  margin-bottom: 1rem;
}

.pin-page .source-checklist {
  list-style: none;
  margin: 1.5rem 0;
}

.pin-page .source-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.pin-page .source-checklist input[type="checkbox"] {
  margin-top: 0.25rem;
}

.pin-page form {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
}

.pin-page .form-group {
  margin-bottom: 1.5rem;
}

.pin-page label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.pin-page input[type="text"],
.pin-page textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.pin-page textarea {
  resize: vertical;
  min-height: 100px;
}

.pin-page .char-count {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.25rem;
}

.pin-page .submit-btn {
  background: var(--fg);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.pin-page .submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pin-page .privacy-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* Verify page */
.verify-page h1 {
  margin-bottom: 1.5rem;
}

.verify-page .intro {
  color: var(--muted);
  margin-bottom: 2rem;
}

.verify-page .level-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.verify-page .level-card h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.verify-page .level-card .badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.verify-page .level-card .badge.level-a { background: #d1fae5; color: var(--level-a); }
.verify-page .level-card .badge.level-b { background: #dbeafe; color: var(--level-b); }
.verify-page .level-card .badge.level-c { background: #fef3c7; color: var(--level-c); }
.verify-page .level-card .badge.level-d { background: #fee2e2; color: var(--level-d); }

/* Translation tooltips */
.translate-trigger {
  position: relative;
  display: inline-block;
  font-size: 0.5em;
  color: #999;
  margin-left: 0.35rem;
  vertical-align: super;
  cursor: pointer;
  transition: color 0.2s;
}

.translate-trigger:hover {
  color: #666;
}

.translate-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: white;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  max-width: 420px;
  width: max-content;
  text-align: center;
  z-index: 100;
  margin-top: 0.75rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.translate-tooltip::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: #1a1a1a;
}

.translate-tooltip strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0;
}

.translate-trigger:hover .translate-tooltip,
.translate-trigger.show-tooltip .translate-tooltip {
  display: block;
}

/* Share quietly */
.share-quietly {
  position: relative;
  display: inline-block;
  margin: 1.5rem 0;
}

.share-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.share-trigger:hover {
  color: var(--fg);
}

.share-icon {
  font-size: 1.1rem;
}

.share-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}

.share-option {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 0.9rem;
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
}

.share-option:hover {
  background: #f5f5f5;
}

.share-option + .share-option {
  border-top: 1px solid #eee;
}

.share-confirmation {
  position: absolute;
  top: 100%;
  left: 0;
  font-size: 0.85rem;
  color: var(--success);
  padding: 0.5rem 0;
  white-space: nowrap;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--fg);
  transition: transform 0.2s, opacity 0.2s;
}

/* Main nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.main-nav a:hover {
  color: var(--fg);
}

.nav-search {
  display: flex;
}

.nav-search input {
  width: 140px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  transition: width 0.2s, border-color 0.2s;
}

.nav-search input:focus {
  outline: none;
  border-color: var(--accent);
  width: 200px;
}

/* Breadcrumbs */
.breadcrumbs {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--fg);
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 0.5rem;
  color: #ccc;
}

.breadcrumb-current {
  color: var(--fg);
}

/* Footer nav */
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-nav a:hover {
  color: var(--fg);
}

/* Countries page regions */
.countries-page .subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
}

.region-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.region-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 16px;
  transition: background 0.2s, color 0.2s;
}

.region-link:hover {
  background: var(--accent);
  color: white;
}

.region-section {
  margin-bottom: 3rem;
}

.region-title {
  font-size: 1.1rem;
  color: var(--fg);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.country-card.no-stories {
  opacity: 0.6;
}

.country-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

/* Stories page */
.stories-page .subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
}

.stories-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.country-tag {
  color: var(--accent);
  text-decoration: none;
  padding: 0.125rem 0.5rem;
  background: #dbeafe;
  border-radius: 4px;
}

.country-tag:hover {
  background: #bfdbfe;
}

.source-count {
  color: var(--muted);
}

/* Search page */
.search-page .search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.search-page .search-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.search-page .search-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-page .search-form button {
  padding: 0.75rem 1.5rem;
  background: var(--fg);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

.search-page .search-form button:hover {
  opacity: 0.9;
}

.results-count {
  color: var(--muted);
  margin-bottom: 2rem;
}

.search-section {
  margin-bottom: 2rem;
}

.search-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.no-results {
  text-align: center;
  padding: 3rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}

@media (max-width: 640px) {
  .site-header {
    position: relative;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    gap: 0;
  }

  .main-nav.mobile-open {
    display: flex;
  }

  .main-nav a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .main-nav a:last-of-type {
    border-bottom: none;
  }

  .nav-search {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
  }

  .nav-search input {
    width: 100%;
  }

  .home-page h1 {
    font-size: 1.75rem;
  }

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

  .share-dropdown {
    left: auto;
    right: 0;
  }

  .translate-tooltip {
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 2rem);
    width: max-content;
    font-size: 0.9rem;
  }

  /* On mobile, only show on tap (via .show-tooltip class) */
  .translate-trigger:hover .translate-tooltip {
    display: none;
  }

  .translate-trigger.show-tooltip .translate-tooltip {
    display: block;
  }

  .region-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  .footer-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .search-page .search-form {
    flex-direction: column;
  }

  .breadcrumbs {
    padding: 0.75rem 1rem 0;
    font-size: 0.8rem;
  }
}

/* =============================================================================
   Hero Stats Section
   ============================================================================= */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2.5rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 0.5rem;
  display: block;
}

/* =============================================================================
   Pull Quote Rotation
   ============================================================================= */
.pull-quote-container {
  margin: 3rem 0;
  text-align: center;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pull-quote {
  max-width: 600px;
  padding: 0 2rem;
  opacity: 0;
  animation: fadeQuote 12s infinite;
}

.pull-quote:nth-child(1) { animation-delay: 0s; }
.pull-quote:nth-child(2) { animation-delay: 4s; }
.pull-quote:nth-child(3) { animation-delay: 8s; }

@keyframes fadeQuote {
  0%, 25% { opacity: 1; }
  33%, 100% { opacity: 0; position: absolute; }
}

.pull-quote-text {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--foreground);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.pull-quote-text::before {
  content: '"';
  font-size: 2rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.pull-quote-text::after {
  content: '"';
  font-size: 2rem;
  color: var(--muted);
  margin-left: 0.25rem;
}

.pull-quote-attribution {
  font-size: 0.875rem;
  color: var(--muted);
}

/* =============================================================================
   Section Break
   ============================================================================= */
.section-break {
  text-align: center;
  padding: 3rem 1rem;
  margin: 3rem 0;
  background: var(--foreground);
  color: white;
}

.section-break p {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}

/* =============================================================================
   Submit Story CTA
   ============================================================================= */
.submit-story-cta {
  text-align: center;
  padding: 3rem 2rem;
  margin: 3rem 0;
  background: #f8f8f8;
  border: 2px dashed var(--border);
  border-radius: 8px;
}

.submit-story-cta h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.submit-story-cta p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: var(--foreground);
  color: white;
  text-decoration: none;
  font-weight: 500;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.cta-button:hover {
  background: #333;
  color: white;
}

/* =============================================================================
   Country Flags
   ============================================================================= */
.country-flag-large {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.country-flag {
  font-size: 1.25rem;
  margin-right: 0.5rem;
}

.story-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.story-card-header .country-flag {
  font-size: 1.5rem;
}

.level-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--foreground);
  color: white;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================================================
   Cross-Site Footer Banner
   ============================================================================= */
.salt-footer-banner {
  background: #1a1a1a;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

.salt-footer-banner p {
  margin: 0;
  font-size: 0.875rem;
}

.salt-footer-banner a {
  color: #ff6b6b;
  text-decoration: none;
  font-weight: 500;
}

.salt-footer-banner a:hover {
  text-decoration: underline;
}

.salt-footer-banner .separator {
  margin: 0 0.75rem;
  color: #666;
}

@media (max-width: 640px) {
  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .pull-quote-container {
    min-height: 150px;
  }

  .pull-quote-text {
    font-size: 1.1rem;
  }

  .section-break p {
    font-size: 1rem;
  }

  .submit-story-cta {
    padding: 2rem 1rem;
  }
}
