/* Waygard Design System */

:root {
  --color-primary: #1a73e8;
  --color-primary-dark: #1557b0;
  --color-accent: #34a853;
  --color-danger: #ea4335;
  --color-warning: #fbbc04;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-bg: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-card: #f7f8fa;
  --color-border: #e5e7eb;
  --color-border-subtle: rgba(0, 0, 0, 0.03);
  --color-border-light: #f3f4f6;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.18);
  --max-width: 1200px;
  --content-width: 800px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-width {
  max-width: var(--content-width);
}

/* Navigation */
.nav {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--color-text);
  text-decoration: none;
}

/* Nav dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0;
  padding-top: 0.75rem;
  list-style: none;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  margin-top: 0;
}

.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  white-space: nowrap;
}

.nav-dropdown-menu li a:hover {
  background: var(--color-bg-alt);
}

.nav-mobile-only {
  display: none;
}

@media (max-width: 768px) {
  main .app-store-btn {
    display: none;
  }
}

/* Hamburger menu for mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-desktop-only {
    display: none;
  }

  .nav-mobile-only {
    display: list-item;
  }
}

/* Hero */
.hero {
  padding: 4rem 0;
  text-align: center;
}

.hero-image {
  max-width: 500px;
  width: 100%;
  height: auto;
  margin: 0 auto 2rem;
  display: block;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.trust-signals {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.trust-signals span::before {
  content: "✓ ";
  color: var(--color-accent);
  font-weight: 700;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero .subtitle { font-size: 1.1rem; }
  .trust-signals { flex-direction: column; gap: 0.5rem; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-text);
  color: #fff;
}

.btn-primary:hover {
  background: #374151;
}

.btn-outline {
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 2px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
}

@media (hover: hover) {
  .btn-outline:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
  }
}

.btn-pill {
  border-radius: 100px;
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
}

/* App Store button */
.app-store-btn {
  display: inline-block;
  transition: opacity 0.2s;
}

.app-store-btn:hover {
  opacity: 0.8;
}

.app-store-btn img {
  height: 48px;
  width: auto;
  display: block;
}

/* Cards */
.card {
  background: var(--color-bg-card);
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .card:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
  }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Feature cards */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.feature-card {
  text-align: center;
  padding: 0;
  overflow: hidden;
}

.feature-card {
  display: flex;
  flex-direction: column;
}

.feature-card h3,
.feature-card p {
  padding: 0 1.5rem;
}

.feature-card h3 {
  padding-top: 1.5rem;
}

.feature-card-image {
  margin-top: auto;
}

.feature-card-image {
  width: 100%;
  display: block;
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.feature-card, .feature-card:hover {
  color: var(--color-text);
  text-decoration: none;
}

.country-card,
.country-tag,
.related-article,
.feature-card,
.blog-card {
  text-decoration: none !important;
}

/* Flag images — ensures rectangular flags clip to circle */
.flag {
  object-fit: cover;
}

/* Country search */
.country-search {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 1.5rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: var(--color-bg-card);
  color: var(--color-text);
  box-sizing: border-box;
}

.country-search:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .country-search-sticky {
    position: sticky;
    top: 60px;
    z-index: 50;
    margin: 0 -1.5rem 0;
    padding: 1.5rem 1.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .country-search {
    max-width: none;
    margin: 0;
  }
}

/* Country grid */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.country-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-bg-card);
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .country-card:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
    text-decoration: none;
  }
}

.country-card .flag {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.country-card .name {
  font-weight: 500;
  font-size: 0.9375rem;
}

/* Section styling */
.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--color-bg-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  margin-top: 0;
}

.section-header p {
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0.5rem auto 0;
}

/* Country page */
.country-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.country-header h1 {
  margin: 0;
}

.country-header .meta {
  margin: 0;
}

.country-header .flag {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.country-header .meta {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Widget showcase on country page */
.widget-showcase {
  text-align: center;
  margin: 1.5rem 0;
}

.widget-screenshot {
  max-width: 400px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 0 auto;
}

.widget-cta-text {
  margin: 1rem 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.feature-widget-showcase {
  margin: 3rem 0;
  padding: 2.5rem 1.5rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
}

.feature-widget-showcase h2 {
  margin-top: 0;
}

.feature-widget-showcase .widget-screenshot {
  margin-bottom: 1.5rem;
}

.widget-showcase-text {
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0.5rem auto 1.5rem;
}

/* Data sections on country page */
.country-section {
  margin: 1rem 0;
  padding-top: 0.5rem;
}

.country-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.severity-high {
  border-left: 4px solid var(--color-danger);
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.severity-medium {
  border-left: 4px solid var(--color-warning);
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.severity-low {
  border-left: 4px solid var(--color-accent);
  padding-left: 1rem;
  margin-bottom: 1rem;
}

/* City overrides */
.city-section {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.city-section h3 {
  margin-top: 0;
}

/* Nearby countries */
.country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.country-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg-card);
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: box-shadow 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .country-tag:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
    text-decoration: none;
  }
}

.country-tag .flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* Related articles on country pages */
.related-articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .related-articles {
    grid-template-columns: 1fr 1fr;
  }
}

.related-article {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--color-bg-card);
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .related-article:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
    text-decoration: none;
  }
}

.related-article-image {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.related-article-title {
  font-weight: 600;
  font-size: 0.9375rem;
  display: block;
  line-height: 1.3;
}

.related-article-date {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* FAQ */
.faq-section {
  margin: 2.5rem 0;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0;
}

.faq-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  color: var(--color-text);
}

.faq-item p {
  margin: 0;
  color: var(--color-text-secondary);
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  max-width: var(--max-width);
  margin: 0 auto;
}

.breadcrumbs a {
  color: var(--color-text-secondary);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs .separator {
  margin: 0 0.5rem;
}

/* CTA section */
.cta-section {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-xl);
  margin: 3rem 0;
}

.cta-section h2 {
  margin-top: 0;
}

.cta-section p {
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0.5rem auto 1.5rem;
}

/* Sticky mobile CTA */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.75rem 1.5rem;
  z-index: 99;
  text-align: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .sticky-cta {
    display: block;
  }

  body {
    padding-bottom: 80px;
  }
}

.sticky-cta .sticky-cta-btn {
  display: block;
  background: #000;
  border-radius: var(--radius-md) var(--radius-md) 100px 100px;
  padding: 0.625rem 1.75rem;
}

.sticky-cta .sticky-cta-btn img {
  height: 44px;
  margin: 0 auto;
  padding: 4px 0;
  display: block;
}

/* Footer */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 2rem;
  margin-top: 3rem;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--color-text-secondary);
}

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

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
}

/* Blog */
.blog-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .blog-list {
    grid-template-columns: 1fr;
  }
}

.blog-card {
  background: var(--color-bg-card);
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  align-items: stretch;
}

@media (hover: hover) {
  .blog-card:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
    text-decoration: none;
  }
}

.blog-card, .blog-card:hover {
  color: var(--color-text);
}

.blog-card-image {
  min-width: 140px;
  max-width: 140px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  flex-grow: 0;
}

.blog-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-card h3 {
  margin: 0.25rem 0 0.375rem;
  font-size: 1rem;
  line-height: 1.4;
}

.blog-card h3 a {
  color: var(--color-text);
}

.blog-card .date {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.blog-card .excerpt {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  margin-bottom: 0;
  line-height: 1.4;
}


/* Blog article */
.blog-article {
  max-width: var(--content-width);
}

.blog-article-header {
  margin-bottom: 2rem;
}

.blog-article-header .date {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
}

.blog-article-body h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.blog-article-body ul,
.blog-article-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.blog-article-body li {
  margin-bottom: 0.375rem;
}

/* Feature pages */
.feature-hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.feature-hero-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.feature-hero-image {
  max-width: 600px;
  width: 100%;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
}

.feature-intro {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 650px;
  margin: 0 auto 1.5rem;
}

.feature-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-highlight-card h3 {
  margin-top: 0;
  margin-bottom: 0.375rem;
  font-size: 1.0625rem;
}

.feature-highlight-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0;
}

.how-it-works {
  list-style: none;
  counter-reset: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.how-it-works li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-secondary { color: var(--color-text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* Focus indicators */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
