﻿/* =========================
   BASE / TOKENS
   ========================= */
.rg-page {
  --orange: #ff8000;
  --orange-dark: #ff8c00;
  --navy: #001e40;
  --navy-mid: #003366;
  --navy-light: #29235c;
  --blue: #004ea6;
  --muted: #64748b;
  --slate: #94a3b8;
  --white: #ffffff;
  --bg: #f7f9fc;
  --card-shadow: 6px 5px 8.8px 0px rgba(0, 30, 64, 0.2);
}

.rg-page, .rg-page *, .rg-page *::before, .rg-page *::after {
  box-sizing: border-box;
}

.rg-page h1,
.rg-page h2,
.rg-page h3{
  margin: 0;
}

.rg-page {
  font-family: "Roboto", sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* =========================
   COMPONENTES GERAIS (BOTOES)
   ========================= */
.rg-btn-primary,
.rg-btn-secondary,
.rg-institutes__btn-all {
  --mg-btn-swap-duration: 0.9s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.rg-btn-primary {
  background: var(--orange);
  color: var(--white);
  font-family: "Roboto", sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.rg-btn-primary:hover {
  background: #e67200;
  color: var(--white);
  transform: translateY(-1px);
}

.rg-btn-primary svg {
  flex-shrink: 0;
}

.rg-btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-family: "Roboto", sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  backdrop-filter: blur(4px);
}

.rg-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--white);
  transform: translateY(-1px);
}

/* =========================
   SECTION: HERO
   ========================= */
.rg-hero {
  position: relative;
  width: 100%;
  min-height: 455px;
  background-color: rgba(0, 30, 64, 1);
}

.rg-hero__bg-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}

.rg-hero__bg-img {
	width: 1500px;
	height: auto;
	object-fit: cover;
	object-position: 0 33%;
	opacity: 0.55;
	flex-shrink: 0;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 1) 10%,
    rgba(0, 0, 0, 1) 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 1) 10%,
    rgba(0, 0, 0, 1) 90%,
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.rg-hero__overlay {
  position: absolute;
  inset: 0;
  /* background: linear-gradient(112.51deg, rgba(0, 30, 64, 0.96) 38%, rgba(0, 78, 166, 0) 100%); */
  pointer-events: none;
}

.rg-hero__inner {
  position: relative;
  z-index: 2;
  padding: 96px 0 48px;
}

.rg-hero__content {
  max-width: 520px;
}

.rg-hero__title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  color: var(--orange);
  line-height: 1.1;
  margin-bottom: 24px;
}

.rg-hero__title strong{
  display:block;
  font-weight:800;
  color:#ffffff;
}

.rg-hero__title span{
  display:block;
  font-weight:300;
  color:inherit;
  font-size:.7em;
  line-height:1.05;
  margin-top:8px;
}

.rg-hero__desc {
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
  margin-bottom: 48px;
  max-width: 487px;
}

.rg-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.rg-hero__cards-row {
  position: absolute;
  z-index: 3;
  width: 100%;
}

/* Os cards começam 20px acima da borda inferior do hero (ficam "montados" na transição), em qualquer largura e
   independentemente do tamanho do texto do hero. A altura que fica para fora do hero é compensada pelo
   padding-top do mapa (desktop/tablet) e pelo margin-bottom do hero (celular, onde o mapa não aparece). */
.rg-hero__cards-row {
  top: calc(100% - 20px);
}

.rg-hero__cards-row .row {
  margin: 0 -9px -18px;
}

.rg-hero__cards-row .row > [class*="col-"] {
  padding: 0 9px;
  margin-bottom: 18px;
  min-width: 0;
}

.rg-stat-card {
  background: var(--white);
  border-radius: 10px;
  border-top: 6px solid var(--orange-dark);
  padding: 24px 20px 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.rg-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 6px 10px 20px 0px rgba(0, 30, 64, 0.18);
}

.rg-stat-card__icon {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.rg-stat-card__value {
  font-size: clamp(24px, 3vw, 28px);
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.rg-stat-card__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 0;
}

/* HERO: Media Queries */
@media (max-width: 991.98px) {
  .rg-hero__inner {
    padding: 72px 0 32px;
  }

  .rg-hero__cards-row {
    margin-top: 0;
    margin-bottom: -50px;
  }

  .rg-hero__content {
    max-width: 100%;
  }

  .rg-hero__cards-row .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
  }

  .rg-hero__cards-row .row > [class*="col-"] {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    padding: 0;
    margin-bottom: 0;
  }

  .rg-hero__cards-row .row > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .rg-hero {
    min-height: 0;
    height: auto;
    margin-bottom: 340px; /* altura dos cards (1 + 2 colunas) que fica abaixo do hero + respiro */
  }
}

@media (max-width: 767.98px) {
  .rg-hero__inner {
    padding: 56px 0 24px;
  }

  .rg-hero__desc {
    max-width: 100%;
    margin-bottom: 36px;
  }

  .rg-hero__cards-row {
    margin: 0;
  }

  .rg-stat-card {
    padding: 20px 16px 16px;
  }
}

@media (max-width: 575.98px) {
  .rg-hero {
    margin-bottom: 440px;
  }

  .rg-hero__inner {
    padding: 48px 0 32px;
  }

  .rg-hero__cards-row .row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rg-hero__cards-row .row > :first-child {
    grid-column: auto;
  }

  /* As utilitárias mx-5 / px-5 do markup (com !important) deixavam os cards com ~170px no meio da tela. */
  .rg-hero__cards-row .row {
    margin: 0 !important;
  }

  .rg-hero__cards-row .row > [class*="col-"] {
    padding: 0 !important;
  }

  .rg-hero__desc {
    margin-top: 16px;
  }
}

@media (max-width: 397.98px) {
  .rg-hero {
    margin-bottom: 527px;
  }
}

/* =========================
   SECTION: MAPA (CONTAINER)
   ========================= */
.rg-map {
  background: var(--bg);
  padding-top: 190px; /* altura do card (~150px) que fica abaixo do hero + respiro */
  padding-bottom: 0;
}

.rg-map__header {
  text-align: center;
  margin-bottom: 20px;
}

.rg-map__desc {
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: 400;
  color: #000;
  line-height: 1.2;
  max-width: 560px;
  margin: 0 auto 12px;
}

.rg-map__desc strong {
  font-weight: 700;
  color: var(--navy);
}

.rg-map__accent {
  width: 100px;
  height: 4px;
  background: var(--orange);
  border-radius: 2px;
  margin: 0 auto;
}

.rg-map__frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 500;
  overflow: hidden;
}

.rg-map__frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* MAPA: Media Queries */
@media (max-width: 991.98px) and (min-width: 768px) {
  .rg-map {
    padding-top: 340px; /* tablet: cards em 2 linhas (o 1º ocupa a largura toda), 20px dentro do hero */
  }
}

@media (max-width: 767.98px) {
  .rg-map {
    display: none !important;
  }
}

@media (max-width: 767.98px) {
  .rg-map {
    padding-top: 80px;
  }

  .rg-map__frame-wrap {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 575.98px) {
  .rg-map {
    padding-top: 64px;
  }

  .rg-map__frame-wrap {
    aspect-ratio: 3 / 4;
  }
}

/* =========================
   MAPA: ESTILOS INTERNOS EXTRAIDOS
   ========================= */
.header-bar { background: #ffffff; border-bottom: 1px solid #e9ecef; }
.header-bar .navbar-brand { font-weight: 600; }
.map-page-shell {
  max-width: 1600px;
  margin: 0 auto;
}

.top-accent { width: 56px; height: 4px; background: #ff7043; margin: 4px auto 12px; border-radius: 2px; }

#map-wrapper {
  position: relative;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.85s ease, transform 0.85s ease;
  background: #f7f8fa;
  border-radius: 6px;
  overflow: hidden;
}

#map-wrapper.map-visible {
  opacity: 1;
  transform: translateY(0);
}

#map-svg { display: block; width: 100%; height: auto; }

#intro-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
  z-index: 10;
  transform-origin: center center;
}

:root { --dot-base-color: #c2cad6; }

.dot {
  fill: var(--dot-base-color);
  transition: transform 0.18s ease, fill 0.55s ease, opacity 0.45s ease;
  transform-origin: center;
  transform-box: fill-box;
}

.dot.magnet-active { transition: transform 0.08s linear, fill 0.18s ease, opacity 0.2s ease; }
.dot:hover { fill: #ff7043; cursor: pointer; }

.country-dots.selected .dot { fill: var(--country-color, #ff7043); }

.country-dots {
  transform-origin: center;
  transform-box: fill-box;
  transition: transform 0.22s ease;
}

.country-dots.country-hover { transform: scale(1.08); }
.country-dots.country-hover .dot { fill: var(--country-hover-color, #1e90ff) !important; }
.country-dots.selected.country-hover .dot { fill: var(--country-hover-color, #1e90ff) !important; }

.map-toolbox {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  margin-bottom: 14px;
}

.map-toolbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.tool-field label {
  display: block;
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 4px;
  font-weight: 600;
}

.tool-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.tool-inline input[type="checkbox"] { margin: 0; }

.tool-actions { display: flex; align-items: center; gap: 8px; }

.tool-range {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.tool-range span {
  font-size: 11px;
  color: #6c757d;
  min-width: 52px;
  text-align: right;
}

.config-share-box {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.map-fullscreen-btn,
.map-theme-btn {
  position: absolute;
  top: 8px;
  width: 34px;
  height: 34px;
  z-index: 65;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: rgba(255,255,255,0.95);
  color: #495057;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.map-fullscreen-btn { right: 8px; }
.map-theme-btn { right: 48px; }

.map-fullscreen-btn:hover { background: #ff7043; color: #fff; transform: scale(1.06); }
.map-fullscreen-btn.is-active { background: #e64a19; color: #fff; }
.map-theme-btn:hover { background: #334155; color: #fff; transform: scale(1.06); }
.map-theme-btn.is-active { background: #0f172a; color: #f8fafc; }

#map-wrapper:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  background: #f7f8fa !important;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 0;
}

#map-wrapper:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  background: #f7f8fa !important;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 0;
}

#map-wrapper:fullscreen #map-svg {
  max-height: 100vh;
  width: auto;
  height: 100vh;
  aspect-ratio: 960 / 500;
  margin: 0 auto;
  display: block;
  max-width: 100vw;
  background: #f7f8fa !important;
  object-fit: contain;
}

#map-wrapper:-webkit-full-screen #map-svg {
  max-height: 100vh;
  width: auto;
  height: 100vh;
  aspect-ratio: 960 / 500;
  margin: 0 auto;
  display: block;
  max-width: 100vw;
  background: #f7f8fa !important;
  object-fit: contain;
}

.flag-marker {
  pointer-events: none;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.7);
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform-origin: center;
  transform-box: fill-box;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
}

.flag-marker.is-entering {
  pointer-events: auto;
  opacity: 1;
  animation: flag-enter 1.3s ease forwards;
}

.flag-marker.is-exiting {
  pointer-events: none;
  animation: flag-exit 1.25s ease forwards;
}

.flag-marker.is-entering:hover { transform: scale(1.3); }
.flag-marker.active { opacity: 1; transform: scale(1.35); }

.flag-marker.force-visible {
  opacity: 1 !important;
  transform: scale(1) !important;
  animation: none !important;
  pointer-events: auto;
}

.flag-marker.force-hidden {
  opacity: 0 !important;
  animation: none !important;
  pointer-events: none;
}

.flag-marker.card-open-hidden {
  opacity: 0 !important;
  animation: none !important;
  pointer-events: none;
}

@keyframes flag-enter {
  0% { opacity: 0; transform: scale(0.55); }
  25% { opacity: 1; transform: scale(1.34); }
  62% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.95; transform: scale(1); }
}

@keyframes flag-exit {
  0% { opacity: 0.95; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.78); }
}

.country-card {
  position: absolute;
  width: 240px;
  z-index: 50;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.country-card.is-visible {
  opacity: 1;
  transform: scale(1);
}

.country-card .card {
  border: none;
  border-radius: 12px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: none;
  overflow: hidden;
  position: relative;
}

.country-card .card::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 72px;
  height: 72px;
  opacity: 0.22;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2064%2064%27%20fill%3D%27none%27%3E%3Ccircle%20cx%3D%2732%27%20cy%3D%2732%27%20r%3D%2730%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%272%27/%3E%3Cellipse%20cx%3D%2732%27%20cy%3D%2732%27%20rx%3D%2714%27%20ry%3D%2730%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%272%27/%3E%3Cline%20x1%3D%272%27%20y1%3D%2732%27%20x2%3D%2762%27%20y2%3D%2732%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%272%27/%3E%3Cpath%20d%3D%27M8%2018%20Q32%2024%2056%2018%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%272%27%20fill%3D%27none%27/%3E%3Cpath%20d%3D%27M8%2046%20Q32%2040%2056%2046%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%272%27%20fill%3D%27none%27/%3E%3C/svg%3E");
}

.country-card.pinned .card {
  box-shadow: 0 0 0 2px #ff7043;
}

.country-card .card-body { padding: 12px 14px; }
.cc-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.cc-flag {
  width: 40px;
  height: 30px;
  object-fit: cover;
  border-radius: 3px;
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cc-name { font-weight: 600; font-size: 15px; color: #ffffff; }
.cc-link { font-size: 13px; font-weight: 700; color: #ffffff; text-decoration: none !important; text-decoration-line: none !important; word-break: break-all; }
.cc-link:hover { text-decoration: none !important; text-decoration-line: none !important; color: #ffffff; }
.cc-empty { font-size: 12px; color: rgba(255, 255, 255, 0.65); font-style: italic; }

.clean-mode .header-bar,
.clean-mode .map-toolbox,
.clean-mode .top-accent,
.clean-mode .map-fullscreen-btn { display: none !important; }
.clean-mode .map-page-shell { padding: 0 !important; max-width: none !important; margin: 0 !important; }
.clean-mode body { background: #f7f8fa; margin: 0; padding: 0; }
.clean-mode .card { border: none !important; box-shadow: none !important; border-radius: 0 !important; background: transparent !important; }
.clean-mode .card-body { padding: 0 !important; }
.clean-mode #map-wrapper { border-radius: 0 !important; margin-top: 5vh; }

.final-mode,
.final-mode body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #f7f8fa;
}

.final-mode .header-bar,
.final-mode .map-toolbox,
.final-mode .top-accent {
  display: none !important;
}

.final-mode .map-page-shell {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.final-mode .map-page-shell > .card,
.final-mode .map-page-shell > .card > .card-body {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}

.final-mode #map-wrapper {
  width: 100vw;
  height: 100vh;
  margin: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.final-mode #map-svg,
.final-mode #intro-canvas {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 960 / 500;
  margin: 0;
  display: block;
}

#map-wrapper {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  transform: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  opacity: 1 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

#map-svg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
}

#map-wrapper:fullscreen #intro-canvas {
  position: absolute !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  height: 100vh !important;
  width: auto !important;
  max-height: 100vh !important;
  max-width: 100vw !important;
  aspect-ratio: 960 / 500 !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
}
#map-wrapper:-webkit-full-screen #intro-canvas {
  position: absolute !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  height: 100vh !important;
  width: auto !important;
  max-height: 100vh !important;
  max-width: 100vw !important;
  aspect-ratio: 960 / 500 !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
}

/* Modo escuro opcional do mapa (somente por escolha no icone). */
#map-wrapper.map-dark-mode:fullscreen {
  background: #0f172a !important;
}
#map-wrapper.map-dark-mode:-webkit-full-screen {
  background: #0f172a !important;
}

#map-wrapper.map-dark-mode:fullscreen #map-svg {
  background: #0f172a !important;
}
#map-wrapper.map-dark-mode:-webkit-full-screen #map-svg {
  background: #0f172a !important;
}

#map-wrapper.map-dark-mode .map-fullscreen-btn,
#map-wrapper.map-dark-mode .map-theme-btn {
  border-color: #334155;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
}

/* .map-fullscreen-btn {
  display: none !important;
} */

body.rg-map-fullscreen-enabled .map-fullscreen-btn {
  display: inline-flex !important;
}

/* =========================
   SECTION: INSTITUTOS
   ========================= */
.rg-institutes {
  --rg-inst-cols-desktop: 5;
  background-color: var(--navy);
  background-image: radial-gradient(128.54% 128.53% at 50% 50%, #000fa98c 10.98%, #2c3882 100%), url("../img/quem-somos/rede-global/rg-institutes-bg.webp");
  background-size: cover;
  background-position: center;
  padding: 72px 0 80px;
  position: relative;
}

/* Variante opcional com fade lateral.
   Rollback simples: remover a classe .rg-institutes--edge-fade do HTML. */
.rg-institutes--edge-fade {
  background-image: none;
  isolation: isolate;
}

.rg-institutes--edge-fade::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(128.54% 128.53% at 50% 50%, #000fa98c 10.98%, #2c3882 100%),
    url("../img/quem-somos/rede-global/rg-institutes-bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 1) 14%,
    rgba(0, 0, 0, 1) 86%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 1) 14%,
    rgba(0, 0, 0, 1) 86%,
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.rg-institutes--edge-fade::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(
      to right,
      rgba(44, 56, 130, 0.78) 0%,
      rgba(44, 56, 130, 0.56) 8%,
      rgba(44, 56, 130, 0.28) 16%,
      rgba(44, 56, 130, 0) 24%
    ),
    linear-gradient(
      to left,
      rgba(44, 56, 130, 0.78) 0%,
      rgba(44, 56, 130, 0.56) 8%,
      rgba(44, 56, 130, 0.28) 16%,
      rgba(44, 56, 130, 0) 24%
    );
}

/* Ultrawide: a arte para de crescer em 2560px e fica centrada — acima disso o
   `cover` só a esticava. As sobras laterais ficam no --navy da seção. As duas
   camadas são capadas juntas para o vinhetamento do ::after continuar alinhado
   com a foto — e AMBAS recebem o degradê. Mascarar só o ::before não resolve: o
   vinhetamento do ::after chega a rgba(44,56,130,.78) justamente na borda e
   pintaria por cima do fade, recriando o corte reto. O fade herdado (14%/86%,
   ≈358px no teto) vira explícito aqui em 400px. */
@media (min-width: 2560px) {
  .rg-institutes--edge-fade::before,
  .rg-institutes--edge-fade::after {
    width: 100%;
    max-width: 2560px;
    margin-inline: auto;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 400px, #000 calc(100% - 400px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 400px, #000 calc(100% - 400px), transparent 100%);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
  }
}

.rg-institutes--edge-fade > .container {
  position: relative;
  z-index: 1;
}

.rg-institutes[data-cols="4"] { --rg-inst-cols-desktop: 4; }
.rg-institutes[data-cols="5"] { --rg-inst-cols-desktop: 5; }
.rg-institutes[data-cols="6"] { --rg-inst-cols-desktop: 6; }

.rg-institutes__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.rg-institutes__title-block {
  flex: 1 1;
}

.rg-institutes__title {
  color: #fff;
  font-family: "Roboto", sans-serif;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 12px;
}

.rg-institutes__desc {
  color: rgba(255,255,255,0.75);
  font-size: 15px;
  line-height: 1.6;
  max-width: 380px;
  margin-bottom: 16px;
}

.rg-institutes__accent {
  width: 100px;
  height: 4px;
  background: var(--orange);
  border-radius: 2px;
}

.rg-institutes__search-wrap {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 6px;
}

.rg-institutes__controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.rg-institutes__search {
  position: relative;
  width: 280px;
}

.rg-institutes__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.rg-institutes__search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 8px;
  border: 1px solid rgba(2, 6, 23, 0.12);
  background: #ffffff;
  color: #001e40;
  font-size: 14px;
  font-family: "Roboto", sans-serif;
  outline: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rg-institutes__search-input::placeholder {
  color: #94a3b8;
}

.rg-institutes__search-input:focus {
  border-color: #a7cbf0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16), 0 0 0 4px rgba(167, 203, 240, 0.45);
}

.rg-institutes__grid {
  display: grid;
  grid-template-columns: repeat(var(--rg-inst-cols-desktop), 1fr);
  gap: 16px;
  margin-bottom: 40px;
  overflow: visible;
}

.rg-institutes__grid.rg-institutes__grid--animating {
  overflow: hidden;
}

.rg-institutes__layout-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.rg-layout-btn {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-family: "Roboto", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  min-width: 40px;
}

.rg-layout-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.rg-layout-btn.is-active {
  background: #ffffff;
  color: #001e40;
}

/* ---- Keyframe de entrada: só opacity + translate (property separada do transform) ---- */
@keyframes rg-card-enter {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}

.rg-inst-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition:
    transform     0.1s ease-out,
    box-shadow    0.1s ease-out,
    background    0.1s ease-out,
    outline-color 0.1s ease-out,
    color         0.1s ease-out !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  position: relative;
  overflow: hidden;
  outline: 1.5px solid transparent;
  will-change: transform, box-shadow;
}

/* overlay de brilho no hover — transição própria mas mesmo timing */
.rg-inst-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,78,166,0.07) 0%, rgba(255,128,0,0.04) 100%);
  opacity: 0;
  transition: opacity 0.1s ease-out;
  pointer-events: none;
  z-index: 0;
}

/* globo-icon decorativo */
.rg-inst-card::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 72px;
  height: 72px;
  opacity: 0;
  pointer-events: none;
  transform: translate(14px, 14px) scale(0.82);
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("../img/quem-somos/rede-global/globo-icon.webp");
  z-index: 0;
}

/* garante que conteúdo fique acima dos pseudo-elementos */
.rg-inst-card > * {
  position: relative;
  z-index: 1;
}

/* ---- HOVER: card normal (não-Brasil, não-indisponível) ---- */
.rg-inst-card:not(.rg-inst-card--brazil):not(.rg-inst-card--unavailable):hover {
  background: #ffffff;
  box-shadow:
    0 4px 6px  rgba(0,30,64,0.06),
    0 14px 30px rgba(0,30,64,0.17),
    0 0 0 1.5px rgba(0,78,166,0.16);
  transform: translateY(-5px) scale(1.03);
  z-index: 2;
  color: #001e40;
  text-decoration: none;
  outline-color: rgba(0,78,166,0.10);
}

.rg-inst-card:not(.rg-inst-card--brazil):not(.rg-inst-card--unavailable):hover::before {
  opacity: 1;
}

.rg-inst-card:not(.rg-inst-card--brazil):not(.rg-inst-card--unavailable):hover::after {
  opacity: 0.26;
  transform: translate(0, 0) scale(1);
}

/* ---- Card indisponível ---- */
.rg-inst-card--unavailable {
  cursor: default;
  opacity: 0.68;
}

.rg-inst-card--unavailable:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  background: #fff;
}

.rg-inst-card--unavailable:hover::before,
.rg-inst-card--unavailable:hover::after {
  opacity: 0;
}

/* ---- Card Brasil: sempre no estado "ativo" ---- */
.rg-inst-card--brazil {
  background: #a7cbf0;
  color: inherit;
  box-shadow: 0 4px 14px rgba(0,78,166,0.18);
  transform: translateY(-2px);
  z-index: 1;
  outline: 1.5px solid rgba(0,78,166,0.22);
}

.rg-inst-card--brazil::after {
  opacity: 0.26;
  transform: translate(0, 0) scale(1);
}

.rg-inst-card--brazil:hover {
  background: #a7cbf0;
  box-shadow: 0 4px 14px rgba(0,78,166,0.18);
  transform: translateY(-2px);
  z-index: 1;
}

/* ---- Filhos: sem transition própria — herdam o timing do card ---- */
.rg-inst-card__flag {
  width: 40px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.rg-inst-card__name {
  font-size: 17px;
  font-weight: 700;
  font-family: "Roboto", sans-serif;
  color: inherit;
  line-height: 1.2;
}

.rg-inst-card__link {
  font-size: 13px;
  color: #64748b;
  font-family: "Roboto", sans-serif;
  transition: color 0.1s ease-out;
}

.rg-inst-card:not(.rg-inst-card--brazil):not(.rg-inst-card--unavailable):hover .rg-inst-card__link {
  color: rgba(0, 78, 166, 0.75);
}

.rg-inst-card--brazil .rg-inst-card__link {
  color: rgba(0, 30, 64, 0.65);
}

/* ---- Animação de entrada (stagger) ---- */
.rg-inst-card--entering {
  animation: rg-card-enter 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ============================================================
   SKELETON LOADING — cards de países
   Dimensões idênticas ao card real para evitar reflow.
   ============================================================ */
@keyframes rg-skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes rg-skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.rg-inst-skeleton {
  /* Replica layout do .rg-inst-card */
  background: #fff;
  border-radius: 12px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  /* Altura mínima igual ao card real para garantir layout estável */
  min-height: 104px;
  animation: rg-skeleton-pulse 1.4s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

.rg-inst-skeleton__bar {
  display: block;
  border-radius: 6px;
  background:
    linear-gradient(
      90deg,
      rgba(226, 232, 240, 0.9) 0%,
      rgba(241, 245, 249, 1)   40%,
      rgba(255, 255, 255, 1)   50%,
      rgba(241, 245, 249, 1)   60%,
      rgba(226, 232, 240, 0.9) 100%
    );
  background-size: 200% 100%;
  animation: rg-skeleton-shimmer 1.6s linear infinite;
}

.rg-inst-skeleton__flag {
  width: 40px;
  height: 30px;
  border-radius: 4px;
}

.rg-inst-skeleton__name {
  width: 70%;
  height: 16px;
}

.rg-inst-skeleton__link {
  width: 55%;
  height: 12px;
}

/* Transição suave entre skeleton e card real */
.rg-inst-skeleton--leaving {
  animation: none;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.rg-inst-card--revealing {
  animation: rg-card-enter 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Respeita acessibilidade — reduz motion */
@media (prefers-reduced-motion: reduce) {
  .rg-inst-skeleton,
  .rg-inst-skeleton__bar {
    animation: none !important;
  }
  .rg-inst-skeleton--leaving {
    transition: none;
  }
}

.rg-inst-card--hidden {
  display: none;
}

.rg-inst-card--search-hidden {
  display: none;
}

.rg-institutes__footer {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.rg-institutes__btn-all {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 36px;
  font-size: 15px;
  font-weight: 700;
  font-family: "Roboto", sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}

.rg-institutes__btn-all:hover {
  background: #e06e00;
  transform: translateY(-1px);
}

.rg-institutes__no-results {
  display: none;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 32px 0;
  font-size: 15px;
  grid-column: 1 / -1;
}

/* INSTITUTOS: Media Queries */
@media (max-width: 1199px) {
  .rg-institutes__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .rg-institutes {
    padding: 52px 0 60px;
  }

  .rg-institutes__header {
    flex-direction: column;
    gap: 20px;
  }

  .rg-institutes__title {
    font-size: 28px;
  }

  .rg-institutes__controls {
    width: 100%;
    align-items: stretch;
  }

  .rg-institutes__search { width: 100%; }
  .rg-institutes__layout-toggle { width: 100%; justify-content: space-between; }

  .rg-institutes__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 479px) {
  .rg-institutes__grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .rg-inst-card {
    padding: 14px 14px 12px;
  }

  .rg-inst-card__flag {
    font-size: 26px;
  }

  .rg-inst-card__name {
    font-size: 14px;
  }

  .rg-inst-card__link {
    font-size: 11px;
  }
}

/* =========================
   HERO: card de estatística com valor em texto ("Presença global")
   ========================= */
.rg-stat-card__value--texto {
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.1;
}

/* =========================
   SECTION: PLANET LEAN (revista da LGN)
   ========================= */
.rg-planet {
  background: var(--bg);
  padding: 72px 0 24px;
}

.rg-planet__card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  border-top: 6px solid var(--orange-dark);
  padding: 40px 40px 36px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 40px;
  align-items: start;
}

.rg-planet__card--so-texto {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.rg-planet__card--so-texto .rg-planet__logo {
  margin-inline: auto;
}

.rg-planet__logo {
  display: block;
  width: 236px;
  max-width: 100%;
  height: auto;
  margin-bottom: 18px;
}

/* ".rg-page h2/h3 { margin: 0 }" tem mais especificidade que a classe sozinha: os títulos novos levam o prefixo. */
.rg-page .rg-planet__title {
  font-family: "Roboto", sans-serif;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 16px;
  text-wrap: balance;
}

.rg-planet__text {
  font-size: 15px;
  line-height: 1.65;
  color: #334155;
  margin: 0 0 22px;
}

.rg-planet__btn {
  margin-top: 4px;
}

.rg-page .rg-planet__recentes-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}

.rg-planet__recentes-note {
  font-size: 12px;
  color: var(--slate);
  margin: 0 0 14px;
}

.rg-planet__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.rg-planet__item-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: var(--white);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.rg-planet__item-link:hover,
.rg-planet__item-link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -8px rgba(0, 30, 64, 0.25);
  border-color: rgba(255, 128, 0, 0.5);
  color: inherit;
}

.rg-planet__item-link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.rg-planet__item-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  background: #e2e8f0;
}

.rg-planet__item-img--vazia {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.rg-planet__item-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 16px;
  flex: 1 1 auto;
}

.rg-planet__item-date {
  font-size: 12px;
  color: var(--muted);
}

.rg-planet__item-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rg-planet__item-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.rg-planet__item-cta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
}

/* =========================
   SECTION: O QUE OS MEMBROS DA LGN FAZEM
   ========================= */
.rg-atuacao {
  background: var(--bg);
  padding: 56px 0 72px;
}

.rg-atuacao__header {
  max-width: 820px;
  margin: 0 auto 36px;
  text-align: center;
}

/* Mesmo ritmo do FAQ (faq-module): título, 16px, linha laranja, depois o conteúdo. */
.rg-page .rg-atuacao__title {
  font-family: "Roboto", sans-serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 16px;
  text-wrap: balance;
}

.rg-atuacao__accent {
  width: 96px;
  height: 4px;
  background: var(--orange);
  border-radius: 2px;
  margin: 0 auto 28px;
}

.rg-atuacao__text {
  font-size: 15px;
  line-height: 1.65;
  color: #334155;
  margin: 0 0 12px;
}

.rg-atuacao__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.rg-atuacao__card {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  border-left: 5px solid var(--orange);
  padding: 26px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.rg-atuacao__card:hover {
  transform: translateY(-4px);
  box-shadow: 6px 10px 20px 0px rgba(0, 30, 64, 0.18);
}

.rg-atuacao__num {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--orange);
}

.rg-page .rg-atuacao__card-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 2px;
}

.rg-atuacao__card-text {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  margin: 0;
}

/* PLANET LEAN + ATUAÇÃO: Media Queries */
@media (max-width: 1199px) {
  .rg-atuacao__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .rg-planet__card {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 32px 24px 28px;
  }
}

@media (max-width: 767.98px) {
  .rg-planet {
    padding: 52px 0 16px;
  }

  .rg-planet__card {
    padding: 28px 18px 24px;
  }

  .rg-planet__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rg-planet__btn {
    width: 100%;
  }

  .rg-atuacao {
    padding: 40px 0 56px;
  }

  .rg-atuacao__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}
