/* Design System & Estilos Globais - Associação Três Fronteiras */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
  /* Identidade 4c */
  --color-primary-dark: #0f2b1d;
  --color-primary: #1b4332;
  --color-primary-light: #2d6a4f;
  --color-accent-gold: #d97706;
  --color-accent-amber: #b45309;
  --color-leaf: #40916c;
  --color-mint: #74c69d;
  --color-sprout: #b7e4c7;
  --color-bg-light: #fbfbf8;
  --color-bg-alt: #f3f4ee;
  --color-surface: #ffffff;
  --color-text-main: #1c2826;
  --color-text-muted: #526159;
  --color-border: #e2e8e0;

  /* Todas as Fontes: Inter */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Efeitos */
  --shadow-sm: 0 2px 8px -2px rgba(15, 43, 29, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(15, 43, 29, 0.08), 0 8px 10px -6px rgba(15, 43, 29, 0.04);
  --shadow-lg: 0 20px 40px -10px rgba(15, 43, 29, 0.12), 0 12px 16px -8px rgba(15, 43, 29, 0.06);
  --shadow-gold: 0 12px 30px -5px rgba(217, 119, 6, 0.25);
  --shadow-glow: 0 0 25px rgba(45, 106, 79, 0.2);
}

/* Section Scroll Offsets for Sticky Header */
section[id], div[id="transparencia"], div[id="cotacoes"], div[id="inicio"] {
  scroll-margin-top: 5rem;
}

/* Base Universal Styles */
*, body, button, input, select, textarea, table, th, td, code, pre, .font-mono, .font-mono-tag {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--color-bg-light);
  color: var(--color-text-main);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.025em;
  font-weight: 800;
}

/* Accessibility Focus States */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.35);
  border-radius: 0.75rem;
}

/* Standardized Button System */
.btn-emerald, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #ffffff !important;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-emerald:hover, .btn-primary:hover {
  background: linear-gradient(135deg, #143527 0%, #22543d 100%);
  box-shadow: 0 6px 18px rgba(27, 67, 50, 0.28);
  transform: translateY(-2px);
}

.btn-emerald:active, .btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-gold, .btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff !important;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-gold:hover, .btn-accent:hover {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
  transform: translateY(-2px);
}

.btn-gold:active, .btn-accent:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  color: #1f2937 !important;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover, .btn-outline:hover {
  background-color: #f9fafb;
  border-color: #1b4332;
  color: #1b4332 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.btn-secondary:active, .btn-outline:active {
  transform: translateY(0) scale(0.98);
}

.btn-sm {
  padding: 0.5rem 1rem !important;
  font-size: 0.7rem !important;
  border-radius: 0.625rem !important;
}

/* Navbar Styles */
.glass-nav,
header {
  background-color: #ffffff !important;
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.glass-nav.nav-scrolled {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06) !important;
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(45, 106, 79, 0.1);
  box-shadow: var(--shadow-md);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(45, 106, 79, 0.25);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.glass-card-dark {
  background: rgba(15, 43, 29, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(116, 198, 157, 0.18);
  color: #fbfbf8;
}

/* Logo 4c Animated SVG */
.logo-4c-svg {
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-4c-wrapper:hover .logo-4c-svg {
  transform: rotate(60deg) scale(1.05);
}

.logo-4c-svg ellipse {
  transition: stroke 0.4s ease, opacity 0.4s ease;
}

.logo-4c-wrapper:hover .logo-4c-svg ellipse:nth-child(1) {
  stroke: #2d6a4f;
}
.logo-4c-wrapper:hover .logo-4c-svg ellipse:nth-child(2) {
  stroke: #40916c;
}
.logo-4c-wrapper:hover .logo-4c-svg ellipse:nth-child(3) {
  stroke: #d97706;
}

/* Variante monocromática (rodapé): mantém o símbolo branco também no hover */
.logo-4c-wrapper--white:hover .logo-4c-svg ellipse {
  stroke: #ffffff;
}

/* Lockup da marca: o subtítulo ocupa exatamente a largura do título.
   A largura da coluna vem do título (max-content); o subtítulo é
   justificado para preencher essa mesma medida em qualquer breakpoint. */
.logo-lockup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: max-content;
}

.logo-lockup__title {
  white-space: nowrap;
}

.logo-lockup__sub {
  width: 100%;
  white-space: nowrap;
  text-align: justify;
  text-align-last: justify;
}

/* Minimalist Hero Background */
.hero-minimalist-bg {
  background-color: #fbfbf8;
  background-image: 
    radial-gradient(at 10% 20%, rgba(45, 106, 79, 0.06) 0px, transparent 40%),
    radial-gradient(at 90% 80%, rgba(217, 119, 6, 0.05) 0px, transparent 45%),
    radial-gradient(rgba(45, 106, 79, 0.12) 0.75px, transparent 0.75px);
  background-size: 100% 100%, 100% 100%, 28px 28px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: #f1f3ed;
}
::-webkit-scrollbar-thumb {
  background: #2d6a4f;
  border-radius: 6px;
  border: 2px solid #f1f3ed;
}
::-webkit-scrollbar-thumb:hover {
  background: #1b4332;
}

/* Modern Category Badges */
.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1.3;
}

.badge-category::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Balanços & Finanças (Verde Esmeralda) */
.badge-financas {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.badge-financas::before {
  background-color: #059669;
}

/* Estatutos & Atas (Slate / Neutro) */
.badge-atas {
  background-color: #f3f4f6;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}
.badge-atas::before {
  background-color: #4b5563;
}

/* Editais & Compras (Âmbar / Dourado) */
.badge-editais {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.badge-editais::before {
  background-color: #d97706;
}

/* Relatórios ESG (Verde Folha) */
.badge-relatorios {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.badge-relatorios::before {
  background-color: #16a34a;
}

/* Convênios & Projetos (Azul Sky) */
.badge-projetos {
  background-color: #f0f9ff;
  color: #075985;
  border: 1px solid #bae6fd;
}
.badge-projetos::before {
  background-color: #0284c7;
}

/* Auditoria & Compliance (Indigo) */
.badge-auditoria {
  background-color: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}
.badge-auditoria::before {
  background-color: #4f46e5;
}

/* Category Filter Bar Buttons */
.cat-filter-btn {
  font-family: var(--font-body);
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.45rem 0.95rem;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #374151;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.cat-filter-btn:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.cat-filter-btn.active {
  background-color: #1b4332 !important;
  border-color: #1b4332 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px -1px rgba(27, 67, 50, 0.35) !important;
}

/* Tab & Switcher Buttons */
.tab-btn {
  position: relative;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background-color: #1b4332 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(27, 67, 50, 0.25);
}

.tab-btn.active svg {
  stroke: #ffffff;
}

/* Pulse animation for Live Ticker */
@keyframes pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.15); }
}

.live-dot {
  animation: pulse-soft 2s infinite ease-in-out;
}

/* Document Row Hover */
.doc-row {
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.doc-row:hover {
  background-color: rgba(243, 245, 238, 0.85);
  transform: translateX(4px);
}

/* Custom Modal Backdrop & Animation */
.custom-modal {
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.custom-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.custom-modal .modal-content {
  transform: scale(0.96) translateY(15px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Ripple button effect */
.btn-emerald {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #ffffff;
  transition: all 0.3s ease;
}
.btn-emerald:hover {
  background: linear-gradient(135deg, #143527 0%, #22543d 100%);
  box-shadow: 0 8px 20px rgba(27, 67, 50, 0.3);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  transition: all 0.3s ease;
}
.btn-gold:hover {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
  transform: translateY(-2px);
}

/* Ticker Marquee */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
}
.ticker-move {
  display: inline-block;
  animation: ticker-animation 38s linear infinite;
}
.ticker-move:hover {
  animation-play-state: paused;
}
@keyframes ticker-animation {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Timeline vertical line */
.timeline-stem {
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #1b4332 0%, #40916c 50%, #d97706 100%);
}

/* Componentes Institucionais */

/* Top Ticker Commodities */
.aiba-ticker-bar {
  background-color: #0f2b1d;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ticker-track-smooth {
  display: flex;
  align-items: center;
  gap: 2rem;
  animation: ticker-slide 45s linear infinite;
  white-space: nowrap;
}

.ticker-track-smooth:hover {
  animation-play-state: paused;
}

@keyframes ticker-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Feature Cards (3 Pilares) */
.feature-card-aiba {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card-aiba:hover {
  border-color: #1b4332;
  box-shadow: 0 12px 30px -5px rgba(27, 67, 50, 0.12);
  transform: translateY(-4px);
}

.feature-icon-circle {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1b4332;
  margin-bottom: 1.25rem;
  transition: transform 0.3s ease;
}

.feature-card-aiba:hover .feature-icon-circle {
  transform: scale(1.08);
}

/* Publications Tab System */
.publication-tab-btn {
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #374151;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.publication-tab-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.publication-tab-btn.active {
  background: #1b4332 !important;
  color: #ffffff !important;
  border-color: #1b4332 !important;
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.25);
}

/* Bulletin Row */
.boletim-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  transition: all 0.25s ease;
}

.boletim-row-item:hover {
  border-color: #2d6a4f;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transform: translateX(4px);
}

/* ESG Impact Capsule */
.impact-capsule-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  transition: all 0.25s ease;
}

.impact-capsule-item:hover {
  border-color: #16a34a;
  background: #f0fdf4;
  transform: translateX(4px);
}

/* News Hero Card & Editorial List */
.news-hero-img-box {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12);
}

.news-hero-overlay {
  background: linear-gradient(180deg, rgba(15, 43, 29, 0.1) 0%, rgba(15, 43, 29, 0.92) 85%);
}

.editorial-news-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  transition: all 0.25s ease;
}

.editorial-news-item:hover {
  border-color: #2d6a4f;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

/* Custom Range Slider & Simulator Styles */
input[type="range"]#sim-hectares {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #143527;
  border-radius: 9999px;
  border: 1px solid rgba(116, 198, 157, 0.3);
  outline: none;
}

input[type="range"]#sim-hectares::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  cursor: pointer;
  box-shadow: 0 0 14px rgba(217, 119, 6, 0.6), 0 2px 5px rgba(0, 0, 0, 0.3);
  border: 2.5px solid #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]#sim-hectares::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.8), 0 3px 8px rgba(0, 0, 0, 0.4);
}

input[type="range"]#sim-hectares::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  cursor: pointer;
  box-shadow: 0 0 14px rgba(217, 119, 6, 0.6), 0 2px 5px rgba(0, 0, 0, 0.3);
  border: 2.5px solid #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   Ajustes de Mobile
   ========================================================================== */

/* O drawer fecha com -translate-y-full, que o desloca apenas pela própria
   altura a partir de top:4rem — sobrando 4rem visíveis exatamente sobre o
   header. Como o drawer tem fundo próprio, ele escondia logo e botão de menu.
   Aqui o estado fechado passa a limpar também o offset do topo. */
#mobile-menu-drawer.-translate-y-full {
  transform: translateY(calc(-100% - 4rem));
}

@media (min-width: 640px) {
  #mobile-menu-drawer.-translate-y-full {
    transform: translateY(calc(-100% - 72px));
  }
}

/* Em uma faixa rolável horizontalmente, justify-content:center torna o
   conteúdo que transborda à esquerda inalcançável pela rolagem.
   "safe center" centraliza só enquanto couber e alinha ao início ao transbordar. */
.justify-safe-center {
  justify-content: safe center;
}

/* Alvos de toque: mínimo de 44px em telas pequenas. */
@media (max-width: 640px) {
  .cat-filter-btn,
  .empresa-filter-btn,
  .publication-tab-btn,
  .view-toggle-btn,
  .btn-download-pdf,
  .sim-cultura-btn,
  .btn-link-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  #mobile-menu-drawer .mobile-nav-link:not(.w-full) {
    padding-block: 0.625rem;
  }

  /* Links de rodapé e botões de compartilhar ganham área de toque */
  .footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  .share-btn,
  #associado-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .sim-preset-ha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
  }
}

/* ==========================================================================
   Galeria de máquinas — ampliar foto em tela cheia
   ========================================================================== */

/* O container da foto virou botão: reseta a aparência padrão e sinaliza,
   pelo cursor, que a imagem pode ser ampliada. */
.zoom-trigger {
  padding: 0;
  border: 0;
  cursor: zoom-in;
  appearance: none;
  background-color: #f3f4f6;
}

/* Véu escuro + selo "Ampliar" que surgem no hover e no foco por teclado. */
.zoom-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(to top, rgba(15, 43, 29, 0.55), rgba(15, 43, 29, 0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.zoom-hint > span {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 43, 29, 0.75);
  backdrop-filter: blur(2px);
}

.zoom-hint svg {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.zoom-trigger:hover .zoom-hint,
.zoom-trigger:focus-visible .zoom-hint {
  opacity: 1;
}

.zoom-trigger:focus-visible {
  outline: 3px solid #40916c;
  outline-offset: -3px;
}

/* --- Visualizador em tela cheia --- */
#lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  /* Estado fechado — também é o ponto de chegada da animação de saída. */
  opacity: 0;
  transform: scale(0.96);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.25s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

#lightbox[open] {
  opacity: 1;
  transform: scale(1);

  @starting-style {
    opacity: 0;
    transform: scale(0.96);
  }
}

#lightbox::backdrop {
  background-color: rgba(15, 43, 29, 0);
  transition:
    display 0.25s allow-discrete,
    overlay 0.25s allow-discrete,
    background-color 0.25s ease-out;
}

#lightbox[open]::backdrop {
  background-color: rgba(12, 24, 18, 0.92);

  @starting-style {
    background-color: rgba(15, 43, 29, 0);
  }
}

.lightbox-figura {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3.5rem 1rem 1.5rem;
  cursor: zoom-out;
}

.lightbox-figura img {
  max-width: 100%;
  /* Desconta o respiro vertical do padding e a área da legenda. */
  max-height: calc(100dvh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  cursor: default;
}

.lightbox-figura figcaption {
  max-width: 60ch;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #e5e7eb;
  cursor: default;
}

.lightbox-fechar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-fechar:hover,
.lightbox-fechar:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .zoom-hint,
  #lightbox {
    transition-duration: 0.1s;
  }

  #lightbox {
    transform: none;
  }

  @starting-style {
    #lightbox[open] {
      transform: none;
    }
  }
}

/* ==========================================================================
   Aviso de privacidade e cookies (LGPD)
   ========================================================================== */

.lgpd-aviso {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 1rem;
  background: #0f2b1d;
  border-top: 1px solid rgba(183, 228, 199, 0.25);
  box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, 0.45);
  color: #e5e7eb;
  animation: lgpd-entrada 0.35s ease-out;
}

@keyframes lgpd-entrada {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.lgpd-aviso--saindo {
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease-in, opacity 0.3s ease-in;
}

.lgpd-aviso__conteudo {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lgpd-aviso__titulo {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b7e4c7;
  margin: 0 0 0.35rem;
}

.lgpd-aviso__texto p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #d1d5db;
}

.lgpd-aviso__texto strong {
  color: #fff;
  font-weight: 700;
}

.lgpd-aviso__detalhes {
  margin-top: 0.65rem;
}

.lgpd-aviso__detalhes > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b7e4c7;
  cursor: pointer;
  list-style: none;
}

.lgpd-aviso__detalhes > summary::-webkit-details-marker {
  display: none;
}

/* Seta que gira ao abrir, desenhada em CSS para não depender de imagem. */
.lgpd-aviso__detalhes > summary::after {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
}

.lgpd-aviso__detalhes[open] > summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

.lgpd-aviso__detalhes > summary:hover,
.lgpd-aviso__detalhes > summary:focus-visible {
  color: #fff;
}

.lgpd-aviso__detalhes-corpo {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  max-height: 40vh;
  overflow-y: auto;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 0.7rem;
}

.lgpd-aviso__detalhes-corpo p {
  font-size: 0.75rem;
  line-height: 1.7;
}

.lgpd-aviso__detalhes-corpo a {
  color: #b7e4c7;
  font-weight: 600;
  text-decoration: underline;
}

.lgpd-aviso__detalhes-corpo a:hover {
  color: #fff;
}

.lgpd-aviso__situacao {
  margin-top: 0.5rem !important;
  font-size: 0.75rem !important;
  color: #b7e4c7 !important;
}

.lgpd-aviso__acoes {
  flex-shrink: 0;
  display: flex;
  gap: 0.65rem;
}

/* Aceitar e recusar têm o mesmo tamanho e o mesmo peso: recusar não pode
   ser mais difícil que aceitar. */
.lgpd-aviso__botao {
  flex: 1 1 0;
  min-width: 8.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 0.9rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lgpd-aviso__botao--aceitar {
  border: 2px solid #d97706;
  background: #d97706;
  color: #fff;
}

.lgpd-aviso__botao--aceitar:hover {
  background: #b45309;
  border-color: #b45309;
}

.lgpd-aviso__botao--recusar {
  border: 2px solid rgba(183, 228, 199, 0.45);
  background: transparent;
  color: #e5e7eb;
}

.lgpd-aviso__botao--recusar:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #b7e4c7;
}

.lgpd-aviso__botao:focus-visible {
  outline: 3px solid #b7e4c7;
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .lgpd-aviso {
    padding: 1.25rem 1.5rem;
  }

  .lgpd-aviso__conteudo {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  .lgpd-aviso__acoes {
    align-self: center;
  }

  .lgpd-aviso__botao {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lgpd-aviso {
    animation: none;
  }

  .lgpd-aviso--saindo {
    transition-duration: 0.01s;
  }

  .lgpd-aviso__detalhes > summary::after {
    transition: none;
  }
}
