/* ========================================================================== 
   CULTURA TRINACIONAL — Página Cidades (lista) e Cidade (detalhe)
   ========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ---- Carrossel trinacional do topo (cidades.html) ---- */

.cities-showcase {
  position: relative;
  overflow: hidden;
  padding: 22px 0 24px;
  background:
    radial-gradient(circle at 78% 30%, rgba(34, 211, 238, 0.11), transparent 38%),
    linear-gradient(135deg, rgba(8, 18, 39, 0.98), rgba(5, 7, 15, 0.98));
}

.cities-showcase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 4vw, 54px);
}

.cities-showcase-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.cities-showcase h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 8.8vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: #fff;
}

.cities-showcase .subtitle {
  max-width: 430px;
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(15px, 3.6vw, 20px);
  line-height: 1.28;
}

.cities-showcase .slogan {
  display: inline-block;
  margin: 0;
  padding-bottom: 8px;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(12px, 2.8vw, 16px);
  font-weight: 750;
  line-height: 1.25;
  background: linear-gradient(90deg, #22d3ee 0 25%, #20c963 25% 50%, #f4c430 50% 75%, #ef3340 75% 100%) left bottom / 100% 4px no-repeat;
}

.country-carousel {
  position: relative;
  min-width: 0;
  width: clamp(230px, 28vw, 330px);
  padding: 0;
  background: transparent;
  isolation: isolate;
}

.country-carousel::before,
.country-carousel::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border: 0;
  transform: none;
}

.country-carousel::before {
  inset: -9px -7px -11px -16px;
  border-radius: 55% 10% 44% 12% / 26% 9% 24% 10%;
  background: conic-gradient(from 214deg at 48% 50%, #22d3ee 0 24%, #20c963 24% 49%, #f4c430 49% 73%, #ef3340 73% 100%);
  opacity: 0.92;
}

.country-carousel::after {
  inset: -3px -2px -4px -8px;
  border-radius: 53% 9% 42% 11% / 25% 8% 22% 9%;
  background: var(--bg-base);
}

.country-carousel-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  z-index: 1;
  border-radius: 52% 8% 41% 10% / 24% 7% 21% 8%;
  background: #071225;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.country-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.035);
  transition: opacity 0.7s ease, transform 1.4s ease, visibility 0.7s;
}

.country-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 1;
}

.country-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.country-slide[data-country="AR"] img { object-position: 58% center; }
.country-slide[data-country="BR"] img { object-position: 50% center; }
.country-slide[data-country="PY"] img { object-position: 50% center; }

.country-slide-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 43%, rgba(3, 8, 20, 0.82) 100%);
}

.country-slide-label {
  position: absolute;
  z-index: 2;
  left: 13px;
  right: 13px;
  bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.country-slide-label strong {
  font-size: clamp(14px, 2.2vw, 18px);
  line-height: 1;
}

.country-slide-label span {
  font-size: clamp(9px, 1.4vw, 11px);
  font-weight: 650;
  text-align: right;
}

.country-carousel-dots {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 6px;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
}

.country-carousel-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.country-carousel-dots button.is-active {
  width: 18px;
  background: #22d3ee;
}

.country-photo-credits {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  width: max-content;
  max-width: 100%;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
}

.country-photo-credits a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

html[data-theme="light"] .cities-showcase {
  background:
    radial-gradient(circle at 78% 30%, rgba(34, 211, 238, 0.18), transparent 42%),
    linear-gradient(135deg, #fff 0%, #f4f8ff 100%);
}

html[data-theme="light"] .cities-showcase h1 { color: #092453; }
html[data-theme="light"] .cities-showcase .subtitle { color: #203759; }
html[data-theme="light"] .cities-showcase .slogan { color: #10274a; }
html[data-theme="light"] .country-photo-credits { color: rgba(9, 36, 83, 0.58); }
html[data-theme="light"] .country-carousel {
  filter: drop-shadow(0 10px 18px rgba(18, 48, 93, 0.14));
}
html[data-theme="light"] .country-carousel::after { background: #f7fbff; }
html[data-theme="light"] .country-carousel-frame { box-shadow: 0 10px 22px rgba(18, 48, 93, 0.13); }

/* ---- Grade de cidades (cidades.html) ---- */

.city-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0 32px;
}

.city-grid-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.city-grid-card:hover { transform: translateY(-3px); border-color: var(--border-glow); }

.city-grid-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}

.city-grid-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(5,7,15,0.94) 100%);
}

.city-grid-card .info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px;
  z-index: 2;
}

.city-grid-card .name { font-weight: 800; font-size: 17px; line-height: 1.2; margin-bottom: 4px; }
.city-grid-card .country { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.city-grid-card .desc {
  font-size: 12px; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 8px;
}

@media (max-width: 520px) {
  .cities-showcase { padding: 17px 0 24px; }
  .cities-showcase-layout {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .cities-showcase h1 { font-size: clamp(34px, 11.2vw, 46px); }
  .cities-showcase .subtitle { margin-bottom: 11px; font-size: clamp(14px, 4vw, 17px); }
  .cities-showcase .slogan { font-size: 11px; }
  .country-carousel {
    width: clamp(132px, 39vw, 170px);
  }
  .country-carousel-frame {
    aspect-ratio: 4 / 5;
    border-radius: 55% 8% 44% 10% / 20% 7% 18% 8%;
  }
  .country-slide-label {
    left: 12px;
    right: 12px;
    bottom: 15px;
    display: block;
  }
  .country-slide-label strong { display: block; margin-bottom: 3px; }
  .country-slide-label span { display: block; text-align: left; }
  .country-photo-credits {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 7px;
  }
}

@media (max-width: 360px) {
  .cities-showcase-layout { grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr); }
  .cities-showcase h1 { font-size: 32px; }
  .cities-showcase .subtitle { font-size: 13px; }
  .cities-showcase .slogan { font-size: 10px; }
  .country-carousel { width: 124px; }
}

@media (min-width: 640px) {
  .city-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .city-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .country-slide { transition: none; }
}

/* ---- Hero da cidade (cidade.html) ---- */

.city-hero {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(180deg, rgba(5,7,15,0.2) 0%, rgba(5,7,15,0.7) 65%, var(--bg-base) 100%),
    var(--city-hero-image, linear-gradient(135deg, #0b1a3a, #06101f));
  background-size: cover;
  background-position: center;
}

.city-hero-content { padding: 40px 20px 28px; width: 100%; }

.city-hero h1 { font-size: clamp(26px, 7vw, 42px); font-weight: 800; margin-bottom: 8px; }

.city-hero .country-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 14px;
}

.city-about {
  padding: 24px 0 8px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.city-events-heading {
  font-size: 20px;
  font-weight: 800;
  margin: 32px 0 4px;
}

@media (min-width: 900px) {
  .city-hero { min-height: 380px; }
}

/* Destaque do topo da cidade: foto maior, nome forte e país na cor do país */
.city-hero {
  min-height: 360px;
  margin: 0 16px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}
.city-hero-content { padding: 32px 20px 22px; }
.city-hero h1 { font-size: clamp(34px, 9vw, 52px); letter-spacing: -0.03em; text-shadow: 0 2px 18px rgba(0,0,0,0.55); }
.city-hero .country-label {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(5,7,15,0.55);
  backdrop-filter: blur(6px);
  color: #fff;
}
.city-hero[data-country="AR"] .country-label { box-shadow: inset 0 0 0 1px #20aaff; }
.city-hero[data-country="BR"] .country-label { box-shadow: inset 0 0 0 1px #2bc676; }
.city-hero[data-country="PY"] .country-label { box-shadow: inset 0 0 0 1px #f04c5d; }
.city-hero .country-bar { margin-bottom: 0; }
.city-about { padding-top: 22px; }
.back-link + #city-loading, .back-link { margin-bottom: 10px; }
@media (min-width: 900px) {
  .city-hero { min-height: 420px; max-width: 1060px; margin: 0 auto; }
}
