:root {
  --primary-color: var(--color-accent);
  --border-color: var(--color-border);
  --surface-color: var(--color-surface);
  --text-color: var(--color-text);
  --muted-text: var(--color-text-muted);
}

html {
  font-size: 17px;
}

body {
  font-size: 1rem;
  line-height: 1.6;
}

.hero {
  padding: 1.25rem;
}

.hero h1 {
  margin: 0 0 0.6rem;
}

.hero p {
  margin: 0;
}

.home-page main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.home-page header,
.home-page footer {
  position: relative;
  z-index: 2;
}

.home-globe {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 24rem;
}

.home-globe .globe-map {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.globe-overlay {
  position: relative;
  display: grid;
  place-items: center;
  gap: 1rem;
  padding: 1rem;
  width: 100%;
}

.hero-globe__panel {
  width: min(640px, 94%);
  background: color-mix(in srgb, var(--surface-color) 74%, transparent);
  border: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
  border-radius: 0.85rem;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  backdrop-filter: blur(4px);
}

.map-status {
  text-align: center;
  color: var(--muted-text);
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-weight: 600;
  background: transparent !important;
  color: var(--primary-color, #c084fc) !important;
  border: 1px solid color-mix(in srgb, var(--primary-color, #c084fc) 70%, transparent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-color, #c084fc) 20%, transparent);
}

.button:hover {
  background: color-mix(in srgb, var(--primary-color, #c084fc) 14%, transparent) !important;
  text-decoration: none;
}

.hero-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.search-input {
  width: 100%;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--surface-color) 80%, transparent);
  color: var(--text-color);
  border-radius: 0.6rem;
  padding: 0.65rem 0.75rem;
  min-height: 2.5rem;
}

.hero-search .button {
  background: transparent;
  color: var(--primary-color, #c084fc) !important;
  border: 1px solid color-mix(in srgb, var(--primary-color, #c084fc) 70%, transparent) !important;
  padding-inline: 1.05rem;
  min-height: 2.5rem;
}

.stats-grid {
  margin: 0.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid div {
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  padding: 0.5rem 0.65rem;
}

.stats-grid dt {
  color: var(--muted-text);
  font-size: 0.8rem;
}

.stats-grid dd {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .stats-grid div {
    padding: 0.4rem 0.5rem;
  }
  
  .stats-grid dt {
    font-size: 0.7rem;
  }
  
  .stats-grid dd {
    font-size: 0.95rem;
  }
}

.content {
  border: 1px solid var(--border-color);
  border-radius: 0.8rem;
  background: var(--surface-color);
  padding: 1rem;
  overflow: hidden;
}

.content .markdown-body {
  font-size: 1rem;
}

.airport-detail-title,
.country-page h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}

.country-page section > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.country-flag {
  display: inline-block;
  font-size: 0.95em;
  line-height: 1.2;
  vertical-align: middle;
}

.city-country {
  margin-bottom: 1rem;
  color: var(--muted-text);
}

.answer-box {
  border-left: 3px solid var(--primary-color);
  background: color-mix(in srgb, var(--surface-color) 80%, transparent);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin: 0 0 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.map {
  margin-top: 1rem;
  min-height: 360px;
  border-radius: 0.6rem;
  border: 1px solid var(--border-color);
}

.airport-data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  table-layout: fixed;
}

.airport-data-table th,
.airport-data-table td {
  border: 1px solid var(--border-color);
  text-align: left;
  padding: 0.68rem 0.72rem;
  word-break: break-word;
}

@media (max-width: 600px) {
  .airport-data-table th,
  .airport-data-table td {
    padding: 0.5rem 0.4rem;
    font-size: 0.9rem;
  }
  
  .table-wrap {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

@media (min-width: 768px) {
  .airport-listing-table {
    min-width: 580px;
  }

  .route-listing-table {
    min-width: 900px;
  }

  .airline-listing-table {
    min-width: 500px;
  }
}

.airport-listing-table th:first-child,
.airport-listing-table td:first-child {
  width: 15%;
}

.country-listing-table th:first-child,
.country-listing-table td:first-child {
  width: 35%;
}

.country-listing-table th:nth-child(2),
.country-listing-table td:nth-child(2) {
  width: 15%;
}

.route-listing-table th:nth-child(2),
.route-listing-table th:nth-child(3) {
  width: 23%;
}

.airline-name,
.airline-heading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.airline-heading {
  margin-bottom: 1rem;
}

.airline-heading .airport-detail-title {
  margin-bottom: 0.25rem;
}

.airline-logo {
  flex: none;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 0.4rem;
}

.route-detail-page {
  max-width: 1050px;
}

.route-detail-heading {
  text-align: center;
  padding: 1.5rem 0 2rem;
}

.route-detail-heading h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0.6rem 0;
}

.route-detail-heading p,
.route-details > p,
.route-widget > p {
  color: var(--muted-text);
}

.route-detail-airline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  font-weight: 700;
}

.route-detail-airline a,
.route-endpoint a,
.route-details a {
  color: var(--primary-color);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.route-card {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  background: var(--surface-color);
}

.route-card-banner {
  text-align: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--primary-color) 12%, var(--surface-color));
}

.route-card-banner > span,
.route-endpoint-label {
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route-card-banner .route-note {
  margin: 0.5rem 0 0;
}

.route-journey {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(3rem, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.route-endpoint {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.route-endpoint strong {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.route-endpoint--destination {
  text-align: right;
}

.route-journey-line {
  position: relative;
  border-top: 1px solid var(--primary-color);
  text-align: center;
}

.route-journey-line span {
  position: relative;
  top: -0.85rem;
  padding: 0 0.5rem;
  color: var(--primary-color);
  background: var(--surface-color);
}

.route-details {
  padding: 1.5rem 2rem 2rem;
  border-top: 1px solid var(--border-color);
}

.route-details h2,
.route-widget h2,
.route-map-section h2 {
  font-size: 1.3rem;
}

.route-map-section {
  padding: 0 2rem 1rem;
}

.route-map {
  min-height: 340px;
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  overflow: hidden;
}

.route-map-status,
.route-map-note {
  color: var(--muted-text);
  font-size: 0.9rem;
}

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

@media (max-width: 600px) {
  .route-journey {
    gap: 0.5rem;
    padding: 1.25rem;
  }
  .route-details {
    padding: 1.25rem;
  }
  .route-map-section {
    padding: 0 1.25rem 1rem;
  }
  .route-map {
    min-height: 260px;
  }
}

.route-heading {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.route-note {
  color: var(--muted-text);
  margin: 0 0 1rem;
}

.airport-data-table a,
.grid .card a,
.search-result a {
  color: var(--primary-color);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.airport-data-table a:hover,
.grid .card a:hover,
.search-result a:hover {
  text-decoration-thickness: 2px;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 600px) {
  .route-listing-table th:nth-child(4),
  .route-listing-table td:nth-child(4),
  .route-listing-table th:nth-child(3),
  .route-listing-table td:nth-child(3) {
    display: none;
  }
  
  .airline-name,
  .airline-heading {
    gap: 0.4rem;
  }
  
  .airline-logo {
    width: 32px;
    height: 32px;
  }
}

.airport-detail-layout {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.airport-detail-layout--with-map {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.airport-detail-layout .airport-data-table {
  margin-bottom: 0;
}

.airport-detail-layout .map {
  min-width: 0;
  margin-top: 0;
}

.pagination-nav {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-results {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.65rem;
}

.muted {
  color: var(--muted-text);
}

.tht-nav-inner {
  align-items: center;
}

.tht-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  line-height: 1;
}

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

.tht-logo {
  width: 196px;
  height: auto;
  display: block;
}

.tht-tagline {
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted-text);
  font-weight: 500;
}

.tht-main-nav {
  flex-wrap: wrap;
}

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

@media (max-width: 720px) {
  html {
    font-size: 16px;
  }

  .hero-search {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .airport-detail-layout--with-map {
    grid-template-columns: minmax(0, 1fr);
  }

  .tht-nav-inner {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .tht-nav-inner > .flex {
    display: contents;
  }

  .tht-nav-inner > .flex > button {
    margin-left: auto;
  }

  .tht-main-nav {
    order: 1;
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .tht-main-nav a {
    flex: none;
    white-space: nowrap;
  }

}
