/* * index.css */

/* ---------- Сводная таблица стран ---------- */
.nations-summary-wrap {
  overflow: visible;
  margin-top: 20px;
  border: 1px solid rgba(201, 184, 150, .16);
  background: rgba(255, 255, 255, .018);
}


.hero-title-main {
  font-size: clamp(2rem, 10vw, 5rem);
  letter-spacing: clamp(1px, 1vw, 4px);
  color: var(--gold);
  font-family: var(--font-serif);
  text-transform: uppercase;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}


.nations-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.nations-table th,
.nations-table td {
  overflow-wrap: anywhere;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(201, 184, 150, .10);
  color: #ddd8ce;
  /* Увеличили размер шрифта для основного текста в таблице */
  font-size: clamp(0.85rem, 1vw, 1.1rem);
  line-height: 1.4;
  /* Сделали межстрочный интервал чуть больше для читаемости */
  text-align: left;
  vertical-align: top;
}

.nations-table th {
  background: rgba(255, 255, 255, .03);
  color: var(--gold);
  font-family: var(--font-serif);
  text-transform: uppercase;
  letter-spacing: .8px;
  font-size: clamp(0.75rem, 0.85vw, 0.95rem);
  font-weight: 700;
  white-space: normal;
}

.nations-table tbody tr:hover td,
.nations-table tbody tr:hover th {
  background: rgba(201, 184, 150, 0.05);
}

.nations-table tr:last-child th,
.nations-table tr:last-child td {
  border-bottom: none;
}

.nations-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

.nations-table .country-col {
  width: 15%;
  background: rgba(16, 16, 16, .72);
}

.nations-table thead .country-col {
  background: rgba(24, 24, 24, .72);
}

.nations-table .is-hidden {
  display: none;
}

.nations-table .total-col {
  color: #f0eadf;
  font-weight: 700;
  background: rgba(139, 58, 58, .10);
}

.nations-table .muted-cell {
  color: rgba(221, 216, 206, .64);
  font-weight: 500;
}

.sort-btn {
  position: relative;
  width: 100%;
  min-height: 28px;
  padding: 0 12px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  text-transform: inherit;
}

.sort-btn::after {
  content: "↕";
  position: absolute;
  right: 0;
  top: 0;
  color: rgba(201, 184, 150, .55);
  font-family: sans-serif;
  /* Увеличили размер стрелочек */
  font-size: 0.9rem;
}

[data-sort-direction="asc"] .sort-btn::after {
  content: "↑";
  color: var(--gold);
}

[data-sort-direction="desc"] .sort-btn::after {
  content: "↓";
  color: var(--gold);
}

.val-positive {
  color: #91c48b;
}

.val-negative {
  color: #c77d7d;
}

.nations-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 20px 0 16px;
  padding: 14px;
  border: 1px solid rgba(201, 184, 150, .16);
  background: rgba(255, 255, 255, .018);
}

.nations-filter-title {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nations-filter-option {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(201, 184, 150, .14);
  color: #ddd8ce;
  cursor: pointer;
  font-size: .86rem;
  user-select: none;
}

.nations-filter-option:hover {
  background: rgba(201, 184, 150, .06);
}

.nations-filter-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
}

.mobile-toggle-btn {
  display: none;
  width: 100%;
  padding: 15px;
  margin-bottom: 10px;
  font-size: 1rem;
}

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

  #nationsTableWrapper {
    display: none;
    animation: fadeIn 0.5s ease;
  }

  #nationsTableWrapper.is-open {
    display: block;
  }

  .nations-summary-wrap {
    overflow: visible;
    border: none;
    background: transparent;
  }

  .nations-table {
    min-width: 0;
  }

  .nations-table thead {
    display: none;
  }

  .nations-table,
  .nations-table tbody,
  .nations-table tr,
  .nations-table th,
  .nations-table td {
    display: block;
    width: 100%;
  }

  .nations-table tr {
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(201, 184, 150, 0.20);
    background: rgba(15, 15, 15, 0.84);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.30);
  }

  .nations-filter {
    align-items: stretch;
    margin-top: 16px;
  }

  .nations-filter-title {
    width: 100%;
  }

  .nations-filter-option {
    flex: 1 1 145px;
  }

  .nations-table .country-col {
    position: static;
    min-width: 0;
    width: 100%;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(139, 58, 58, .70);
    background: rgba(139, 58, 58, 0.14);
    box-shadow: none;
    color: var(--gold);
    text-align: center;
    font-size: .82rem;
    word-break: break-word;
    hyphens: auto;
  }

  .nations-table .country-col.total-col {
    background: rgba(139, 58, 58, 0.22);
  }

  .nations-table td {
    position: relative;
    min-height: 44px;
    padding: 12px 10px 12px 48%;
    border-bottom: 1px dashed rgba(201, 184, 150, 0.12);
    text-align: right;
    white-space: normal;
  }

  .nations-table td:last-child {
    border-bottom: none;
  }

  .nations-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: calc(48% - 18px);
    color: var(--gold);
    font-family: var(--font-serif);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.3;
    text-align: left;
    text-transform: uppercase;
    white-space: normal;
  }

  .nations-table .total-col {
    background: rgba(139, 58, 58, .12);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}






@media (max-width: 480px) {
  .hero-title-main {
    font-size: clamp(1.6rem, 8.5vw, 2.4rem);
    letter-spacing: 1px;
  }

  .nations-filter-option {
    flex: 1 1 100%;
  }

  .nations-table td {
    padding: 10px 8px 10px 44%;
  }

  .nations-table td::before {
    width: calc(44% - 14px);
    font-size: .72rem;
  }

  .mobile-toggle-btn {
    font-size: .9rem;
    padding: 12px 10px;
  }
}
