/* ============================================
   GeoPântano - Estilos
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700;900&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #0B5D5E;
  --primary-light: #0E7C7D;
  --primary-dark: #094A4B;
  --accent: #2E8B57;
  --accent-light: #48A871;
  --water: #3A7CA5;
  --water-light: #5BA3CC;
  --sand: #C4A35A;
  --sand-light: #E8D5A0;
  --bg: #F7F9F7;
  --bg-alt: #EDF2EE;
  --text: #2C3E2D;
  --text-light: #5A6B5C;
  --white: #FFFFFF;
  --border: #D1DDD3;
  --danger: #C75B39;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(11,93,94,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.3;
  color: var(--primary-dark);
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; }

/* === HEADER === */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: all 0.3s;
}
.site-header.scrolled {
  background: rgba(255,255,255,0.97);
  border-bottom-color: var(--border);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  font-family: 'Merriweather', serif; font-size: 1.05rem; font-weight: 700;
  color: var(--primary-dark); letter-spacing: -0.3px;
}
.logo svg { color: var(--primary); }
.nav-desktop { display: flex; gap: 4px; align-items: center; }
.nav-link {
  background: none; border: none; cursor: pointer;
  padding: 8px 14px; border-radius: 6px;
  font-size: 0.88rem; font-weight: 400;
  color: var(--text); font-family: 'Source Sans 3', sans-serif;
  transition: all 0.2s;
}
.nav-link:hover { background: rgba(11,93,94,0.05); }
.nav-link.active {
  background: rgba(11,93,94,0.08);
  font-weight: 600; color: var(--primary);
}
.mobile-toggle {
  display: none; background: none; border: none; cursor: pointer; padding: 8px;
}
.mobile-menu {
  display: none; position: absolute; top: 64px; left: 0; right: 0;
  background: white; border-bottom: 1px solid var(--border);
  padding: 8px 0; box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.mobile-menu.open { display: block; }
.mobile-menu .nav-link {
  display: block; width: 100%; text-align: left; padding: 12px 24px; font-size: 0.95rem;
}

@media (max-width: 900px) {
  .nav-desktop { display: none; }
  .mobile-toggle { display: block; }
}

/* === HERO === */
.hero {
  position: relative; height: 85vh; min-height: 520px; overflow: hidden;
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 1.2s ease;
  /* Quando tiver fotos reais, use background-image aqui */
  background-size: cover; background-position: center;
}
.hero-slide.active { opacity: 1; }
.hero-slide:nth-child(1) { background: linear-gradient(135deg, #1a5e2a 0%, #2e8b57 40%, #5ba3cc 100%); }
.hero-slide:nth-child(2) { background: linear-gradient(135deg, #3A7CA5 0%, #0B5D5E 50%, #2E8B57 100%); }
.hero-slide:nth-child(3) { background: linear-gradient(135deg, #2E8B57 0%, #48A871 40%, #C4A35A 100%); }
.hero-slide:nth-child(4) { background: linear-gradient(135deg, #094A4B 0%, #0E7C7D 50%, #3A7CA5 100%); }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.4) 100%);
}
.hero-content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 0 24px; text-align: center; color: white;
}
.hero-tag {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 3px; margin-bottom: 16px; opacity: 0.8;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900;
  margin-bottom: 8px; max-width: 800px; line-height: 1.15; color: white;
}
.hero-subtitle {
  font-family: 'Merriweather', serif;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  max-width: 700px; opacity: 0.9; margin-bottom: 12px; font-weight: 300;
}
.hero-desc {
  font-size: 1rem; max-width: 680px; opacity: 0.75; margin-bottom: 36px; line-height: 1.6;
}
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-caption {
  position: absolute; bottom: 40px; left: 24px; right: 24px; text-align: center; z-index: 2;
}
.hero-caption p:first-child { font-size: 0.85rem; opacity: 0.7; margin-bottom: 4px; }
.hero-caption p:last-of-type { font-size: 0.75rem; opacity: 0.5; }
.hero-dots {
  display: flex; gap: 8px; justify-content: center; margin-top: 12px;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 4px;
  background: rgba(255,255,255,0.4);
  border: none; cursor: pointer; transition: all 0.3s;
}
.hero-dot.active { width: 28px; background: white; }

/* === SECTIONS === */
.section { max-width: 1200px; margin: 0 auto; padding: 80px 24px; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 2rem; margin-bottom: 8px; color: var(--primary-dark);
}
.section-title.center { text-align: center; }
.section-subtitle {
  font-size: 1.05rem; color: var(--text-light);
  margin-bottom: 48px; max-width: 720px;
}
.section-subtitle.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-text {
  font-size: 1.05rem; line-height: 1.8; margin-bottom: 28px; max-width: 800px;
}
.section-text.center { margin-left: auto; margin-right: auto; text-align: center; }

/* === PAGE BANNER === */
.page-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
  padding: 120px 24px 60px; text-align: center;
}
.page-banner h1 { color: white; font-size: 2.2rem; margin-bottom: 8px; animation: fadeInUp 0.6s ease; }
.page-banner p { color: rgba(255,255,255,0.75); font-size: 1.05rem; max-width: 640px; margin: 0 auto; animation: fadeInUp 0.6s ease; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif; font-weight: 600; font-size: 0.95rem;
  border: none; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); color: white; }
.btn-white { background: white; color: var(--primary-dark); font-weight: 700; }
.btn-white:hover { background: #f0f0f0; color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-ghost { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.5); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* === CARDS === */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.card h3 { font-size: 1rem; margin-bottom: 4px; }
.card p { font-size: 0.85rem; color: var(--text-light); }

/* === TAGS === */
.tag {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.tag-published { background: #E8F5E9; color: #2E7D32; }
.tag-submitted { background: #FFF3E0; color: #E65100; }
.tag-preparation { background: #E3F2FD; color: #1565C0; }
.tag-type { background: var(--bg-alt); color: var(--text-light); }

/* === GRIDS === */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-info { grid-template-columns: 1fr 1fr; gap: 12px; }

/* === STATS === */
.stat { text-align: center; padding: 20px; }
.stat-value {
  font-family: 'Merriweather', serif;
  font-size: 2rem; font-weight: 900;
}
.stat-label { font-size: 0.88rem; color: var(--text-light); }

/* === INFO BOX === */
.info-box {
  background: var(--bg-alt); padding: 16px; border-radius: 8px;
}
.info-box-label {
  font-size: 0.75rem; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px;
}
.info-box-value { font-size: 1.05rem; font-weight: 600; color: var(--primary-dark); }

/* === INSTITUTIONS === */
.inst-bar { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.inst-badge {
  padding: 12px 24px; background: white; border-radius: 8px;
  border: 1px solid var(--border); font-size: 0.92rem; font-weight: 600;
  color: var(--text-light); cursor: default;
}

/* === QUICK ACCESS === */
.quick-card {
  cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 12px;
}

/* === OBJECTIVE LIST === */
.obj-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 48px; }
.obj-item { display: flex; gap: 12px; align-items: flex-start; }
.obj-item svg { margin-top: 3px; flex-shrink: 0; color: var(--accent); }

/* === MAP PAGE === */
.map-page { padding-top: 64px; display: flex; height: calc(100vh - 64px); overflow: hidden; }
.map-sidebar {
  width: 340px; min-width: 340px; background: white;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: margin-left 0.3s;
}
.map-sidebar.collapsed { margin-left: -340px; }
.sidebar-tabs { display: flex; border-bottom: 1px solid var(--border); }
.sidebar-tab {
  flex: 1; padding: 12px 8px; border: none; cursor: pointer;
  background: var(--bg-alt); display: flex; align-items: center;
  justify-content: center; gap: 6px;
  font-size: 0.8rem; font-weight: 400; color: var(--text-light);
  font-family: 'Source Sans 3', sans-serif;
  border-bottom: 2px solid transparent;
}
.sidebar-tab.active {
  background: white; font-weight: 600;
  color: var(--primary); border-bottom-color: var(--primary);
}
.sidebar-content { flex: 1; overflow: auto; padding: 16px; }
.sidebar-label {
  font-size: 0.75rem; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
  margin-bottom: 16px;
}

/* Layer groups */
.layer-group { margin-bottom: 6px; }
.layer-group-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: none; cursor: pointer;
  background: transparent; border-radius: 8px;
  font-size: 0.86rem; font-weight: 600;
  color: var(--primary-dark); font-family: 'Source Sans 3', sans-serif;
}
.layer-group-btn.open { background: rgba(11,93,94,0.06); }
.layer-group-btn svg { color: var(--primary); }
.layer-group-btn span { flex: 1; text-align: left; }
.layer-group-layers { padding-left: 16px; padding-top: 4px; display: none; }
.layer-group-layers.open { display: block; }
.layer-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border: none; cursor: pointer;
  background: transparent; border-radius: 6px;
  font-size: 0.82rem; color: var(--text);
  font-family: 'Source Sans 3', sans-serif;
}
.layer-btn.off { opacity: 0.5; }
.layer-btn span { flex: 1; text-align: left; }
.layer-swatch {
  width: 14px; height: 14px; border-radius: 3px; border: 2px solid;
}
.layer-swatch.active { background: inherit; }

/* Legend items */
.legend-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.legend-swatch { width: 16px; height: 12px; border-radius: 2px; }
.legend-label { font-size: 0.82rem; }

/* Map area */
.map-area {
  flex: 1; position: relative; background: var(--bg-alt);
}
.map-container {
  width: 100%; height: 100%;
}
.map-placeholder {
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 30% 45%, rgba(46,139,87,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 65% 55%, rgba(58,124,165,0.1) 0%, transparent 40%),
    linear-gradient(180deg, #EDF2EE 0%, #e4ebe5 100%);
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--text-light);
}
.map-controls {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  display: flex; flex-direction: column; gap: 4px;
}
.map-ctrl-btn {
  background: white; border: 1px solid var(--border); border-radius: 6px;
  width: 36px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.map-toggle {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  background: white; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 500; color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-family: 'Source Sans 3', sans-serif;
}
.map-info {
  position: absolute; bottom: 16px; left: 16px; right: 16px; z-index: 10;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  border-radius: 10px; padding: 14px 20px;
  border: 1px solid var(--border); box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.map-info p { font-size: 0.82rem; color: var(--text-light); }

/* Year selector */
.year-selector { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.year-btn {
  padding: 6px 14px; border-radius: 6px;
  border: 1px solid var(--border); background: white;
  color: var(--text); cursor: pointer;
  font-size: 0.82rem; font-weight: 500;
  font-family: 'Source Sans 3', sans-serif;
}
.year-btn.active { border-color: var(--primary); background: var(--primary); color: white; }

/* Charts */
.chart-container { margin-bottom: 24px; }
.chart-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; color: var(--primary-dark); }
.chart-canvas { width: 100% !important; }

/* === RESULTS === */
.result-card { display: flex; flex-direction: column; gap: 16px; }
.result-card-header { display: flex; align-items: center; gap: 12px; }
.result-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.result-card p { font-size: 0.92rem; line-height: 1.7; color: var(--text-light); flex: 1; }

/* === PUBLICATIONS === */
.pub-card { padding: 28px; }
.pub-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.pub-card h3 {
  font-size: 1.05rem; margin-bottom: 8px; line-height: 1.4;
  font-family: 'Merriweather', serif;
}
.pub-authors { font-size: 0.88rem; color: var(--text-light); margin-bottom: 4px; }
.pub-venue { font-size: 0.85rem; color: var(--text-light); font-style: italic; margin-bottom: 16px; }

/* === GALLERY === */
.gallery-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.filter-btn {
  padding: 8px 18px; border-radius: 20px; border: 1px solid var(--border);
  background: white; color: var(--text); cursor: pointer;
  font-size: 0.85rem; font-weight: 500;
  font-family: 'Source Sans 3', sans-serif; transition: all 0.2s;
}
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.gallery-item {
  border: none; cursor: pointer; border-radius: 10px; overflow: hidden;
  position: relative; padding-bottom: 70%; background: none;
}
.gallery-item-inner {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
}
.gallery-item-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
}
.gallery-item-info {
  position: relative; padding: 16px; text-align: left; width: 100%;
}
.gallery-item-cat {
  font-size: 0.72rem; color: rgba(255,255,255,0.7);
  text-transform: uppercase; letter-spacing: 1px;
}
.gallery-item-caption {
  font-size: 0.85rem; color: white; font-weight: 500; margin-top: 4px; line-height: 1.4;
}

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.85);
  align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  background: none; border: none; cursor: pointer; color: white;
}
.lightbox-img {
  max-width: 800px; width: 100%; border-radius: 12px; overflow: hidden;
  padding-bottom: 60%; position: relative;
  background-size: cover; background-position: center;
}
.lightbox-caption { color: white; text-align: center; margin-top: 16px; font-size: 1rem; }
.lightbox-cat { color: rgba(255,255,255,0.5); text-align: center; margin-top: 4px; font-size: 0.85rem; }

/* === PARTICIPANTS === */
.participant-card { display: flex; flex-direction: column; gap: 4px; }
.participant-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.participant-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(11,93,94,0.12), rgba(46,139,87,0.12));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--primary);
  font-family: 'Merriweather', serif; flex-shrink: 0;
}
.participant-links { display: flex; gap: 8px; margin-top: auto; }
.participant-link {
  font-size: 0.78rem; padding: 5px 12px;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  text-decoration: none;
}

/* === FOOTER === */
.site-footer {
  background: var(--primary-dark); color: rgba(255,255,255,0.7);
  padding: 48px 24px 32px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px; margin-bottom: 32px;
}
.footer-title {
  color: white; font-size: 0.82rem; font-weight: 600; margin-bottom: 12px;
  font-family: 'Source Sans 3', sans-serif;
  text-transform: uppercase; letter-spacing: 1px;
}
.footer-link {
  display: block; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.6); font-size: 0.85rem; padding: 3px 0;
  font-family: 'Source Sans 3', sans-serif; text-align: left;
}
.footer-link:hover { color: rgba(255,255,255,0.9); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px; text-align: center; font-size: 0.78rem;
}

/* === CHART WRAPPER === */
.chart-wrapper {
  background: white; border-radius: var(--radius); padding: 24px;
  border: 1px solid var(--border);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.6s ease both; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* === PAGES HIDDEN BY DEFAULT === */
.page { display: none; }
.page.active { display: block; }
.page-maps.active { display: flex; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero { min-height: 480px; }
  .hero h1 { font-size: 1.8rem; }
  .section { padding: 48px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-info { grid-template-columns: 1fr; }
  .map-sidebar { width: 280px; min-width: 280px; }
  .page-banner { padding: 100px 16px 40px; }
  .page-banner h1 { font-size: 1.6rem; }
}

/* Leaflet override */
.leaflet-container { height: 100%; width: 100%; }
.logos-bar {
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.institution-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: grayscale(20%);
  opacity: 0.85;
  transition: opacity 0.2s;
}
.institution-logo:hover {
  opacity: 1;
  filter: none;
}
.footer-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}