/* Styles des pages Top 10. */

/* 1. INTRODUCTION MOBILE
   Le hero ordinateur/tablette contient déjà ce texte : modern.css masque donc
   ce bloc au-dessus de 700 px grâce à .mobile-only-intro. */
.top10-static-artwork {
  overflow: hidden;
  background: #087bc2;
}

/* Les textes d’introduction et de comparaison remplissent leur conteneur. */
@media (min-width:1051px) {
  .top10-intro-title,
  .top10-intro-content,
  .top10-intro p,
  .page-top10 .ranking-head,
  .page-top10 .ranking-head .lead,
  .comparison-chart-head,
  .comparison-chart-head .lead {
    width:100%!important;
    max-width:none!important
  }
  .top10-intro-title {
    max-width:850px!important
  }
  .page-top10 .ranking-head h2,
  .comparison-chart-head h2 {
    max-width:1050px
  }
}

.top10-static-artwork img {
  display: block;
  width: min(100%, 793px);
  height: auto;
  margin: 0 auto;
}

.top10-intro {
  padding: clamp(34px, 5vw, 72px) 0 clamp(24px, 4vw, 52px);
}

.top10-intro-title {
  max-width: 850px;
}

#classement {
  scroll-margin-top: 110px;
}

#budget {
  scroll-margin-top: 110px;
}

@media (max-width: 700px) {
  /* Règle du modèle mobile commun à toutes les pages Top 10. */
  .page-top10 .hero-proof,
  .page-top10 .hero-proof-mobile {
    display: none !important;
  }

}

/* 2. CARTES DU CLASSEMENT */
.page-top10 .ranking-head h2 {
  max-width: 1050px;
  line-height: 1.12;
}

/* Classement : numéro placé devant le pays, jamais sur la photographie. */
.page-top10 .destination-media .rank {
  display: none;
}

.page-top10 .capital {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: -50px;
  text-decoration: none;
}

.page-top10 .capital .rank {
  position: static;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(9, 39, 70, .14);
}

.page-top10 .capital small {
  color: var(--ink);
  font-size: .76em;
  font-weight: 800;
  text-transform: uppercase;
}

.page-top10 .capital:hover > span:last-child,
.page-top10 .capital:focus-visible > span:last-child {
  color: var(--blue);
}

/* 3. COMPARATIF VISUEL ET FILTRES DE BUDGET */
.comparison-chart-section {
  background: var(--paper);
}

.comparison-chart-head {
  max-width: 1050px;
  margin-bottom: 30px;
}

.comparison-chart-head h2 {
  margin: 10px 0 14px;
  text-transform: uppercase;
}

.comparison-chart-head .lead {
  max-width: 900px;
  margin: 0;
}

.comparison-chart-card {
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.comparison-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
}

.comparison-chart-toolbar p,
.comparison-chart-source {
  margin: 0;
}

.comparison-chart-toolbar strong,
.comparison-chart-toolbar small {
  display: block;
}

.comparison-chart-toolbar small {
  margin-top: 3px;
  color: var(--muted);
}

.comparison-chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-action {
  min-height: 42px;
  padding: .65rem 1rem;
  border-color: var(--blue);
  background: #fff;
  color: var(--blue);
  font-size: .8rem;
  font-weight: 850;
}

.chart-action-primary {
  background: var(--blue);
  color: #fff;
}

.comparison-chart-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 54px 8px 218px;
  color: var(--muted);
  font-size: .7rem;
}

.comparison-chart-scale span:last-child {
  text-align: right;
}

.comparison-chart {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comparison-chart li {
  display: grid;
  grid-template-columns: 32px 160px minmax(180px, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.chart-rank {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
}

.chart-track {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #eef3f7 0, #eef3f7 calc(25% - 1px), #dbe5ec calc(25% - 1px), #dbe5ec 25%);
}

.chart-track > span {
  display: block;
  width: var(--chart-value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), #e92578 55%, var(--blue));
}

.comparison-chart li b {
  color: var(--ink);
  text-align: right;
}

.comparison-chart-source {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}

.comparison-chart-card.is-expanded {
  position: fixed;
  inset: 18px;
  z-index: 10000;
  max-width: 1500px;
  margin: auto;
  overflow: auto;
}

body.chart-is-expanded {
  overflow: hidden;
}

/* Les tableaux de fréquentation utilisent des valeurs globales, sans unité
   journalière. Cette variante conserve exactement la mise en page commune. */
.page-top10-visitors .budget-table td:nth-child(n+2)::after {
  content: none;
}

.page-top10-visitors .comparison-chart li b {
  white-space: nowrap;
}

@media (max-width: 700px) {
  .comparison-chart-head {
    margin-bottom: 20px;
  }

  .comparison-chart-card {
    padding: 18px 14px;
    border-radius: 18px;
  }

  .comparison-chart-toolbar {
    display: grid;
    margin-bottom: 20px;
  }

  .comparison-chart-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .comparison-chart-scale {
    margin: 0 42px 7px 112px;
    font-size: .58rem;
  }

  .comparison-chart {
    gap: 9px;
  }

  .comparison-chart li {
    grid-template-columns: 24px 76px minmax(70px, 1fr) 42px;
    gap: 6px;
    font-size: .72rem;
  }

  .chart-rank {
    width: 22px;
    height: 22px;
    font-size: .62rem;
  }

  .chart-track {
    height: 16px;
  }

  .comparison-chart-card.is-expanded {
    inset: 8px;
  }

  .page-top10 .ranking {
    padding: 56px 0;
  }

  .page-top10 .ranking-head {
    margin-bottom: 28px;
  }

  .page-top10 .destination-body {
    padding: 22px 18px 24px;
  }

  .page-top10 .capital {
    gap: 6px;
    width: 100%;
    margin-left: 0;
    font-size: 1rem;
    line-height: 1.2;
  }

  .page-top10 .capital .rank {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    font-size: .72rem;
    box-shadow: 0 3px 8px rgba(9, 39, 70, .12);
  }

  .page-top10 .capital small {
    font-size: .68em;
    white-space: nowrap;
  }

  .page-top10 .capital > span:last-child {
    min-width: 0;
    white-space: nowrap;
  }

  .page-top10 .destination-body p {
    margin-left: 0;
    font-size: .92rem;
    line-height: 1.55;
    text-align: left;
  }

  .page-top10 .stats {
    margin-left: 0;
  }

  .page-top10 .card-links {
    width: 100%;
    margin: 18px 0 0;
  }

  .page-top10 .card-links .text-link {
    width: 100%;
  }

  /* Tableau mobile : le classement et le pays restent visibles pendant
     le défilement horizontal des colonnes de budget. */
  .page-top10 .budget-table tbody {
    counter-reset: top10-rank;
  }

  .page-top10 .budget-table th:first-child,
  .page-top10 .budget-table td:first-child {
    position: sticky;
    left: 0;
    width: 190px;
    min-width: 190px;
  }

  .page-top10 .budget-table th,
  .page-top10 .budget-table td {
    padding: 10px 14px;
  }

  .page-top10 .budget-table th {
    font-size: .72rem;
  }

  .page-top10 .budget-table td {
    font-size: .9rem;
    line-height: 1.25;
  }

  .page-top10 .budget-table th:first-child {
    z-index: 3;
    box-shadow: 8px 0 14px rgba(16, 37, 63, .14);
  }

  .page-top10 .budget-table td:first-child {
    z-index: 2;
    background: #fff;
    box-shadow: 8px 0 14px rgba(16, 37, 63, .08);
    white-space: nowrap;
  }

  .page-top10 .budget-table tbody td:first-child::before {
    counter-increment: top10-rank;
    content: counter(top10-rank);
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--coral);
    color: #fff;
    font-size: .62rem;
    font-weight: 900;
    vertical-align: middle;
  }
}
