:root {
  --bg-paper: #fafaf7;
  --bg-card: #ffffff;
  --text-main: #2c302e;
  --text-muted: #6b726c;
  --accent-green: #3b5a40;
  --border-light: #e4e3db;
  --hero-bg: #2c3e50;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  background-color: var(--bg-paper);
  color: var(--text-main);
  line-height: 1.6;
}

header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.logo-emblem {
  height: 64px;
  width: auto;
  display: block;
  transition: transform 0.2s ease-in-out;
}

.logo-container:hover .logo-emblem {
  transform: scale(1.05);
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-text-group h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  color: var(--accent-green);
  font-weight: 600;
  line-height: 1.1;
}

.logo-text-group span {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Capa / Banner da Espécie */
.especie-banner {
  position: relative;
  width: 100%;
  height: 350px;
  background-color: var(--hero-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.especie-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.especie-banner-content {
  position: absolute;
  text-align: center;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.especie-banner h2 {
  font-family: "Playfair Display", serif;
  font-size: 3.5rem;
  margin: 0;
  line-height: 1.1;
}
.especie-banner .sci-name {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 1.5rem;
  color: #d1d9dd;
  margin-top: 5px;
}

main {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 5%;
}

.meta-info {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* Galeria em Grade */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.galeria-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s;
  position: relative;
}
.galeria-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.galeria-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.galeria-caption {
  padding: 12px;
  font-size: 0.9rem;
  background: var(--bg-card);
}
.galeria-caption a {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 600;
  display: block;
}
.galeria-caption a:hover {
  text-decoration: underline;
}
.galeria-caption .data {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Selo de Capa Oficial */
.badge-capa {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #f1c40f;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 20px;
  padding: 4px 10px;
  border: 1px solid #f1c40f;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Modal Lightbox */
#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#lightbox img {
  max-width: 90%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
}
#lightbox-caption {
  color: white;
  margin-top: 15px;
  font-size: 1rem;
  text-align: center;
}
#lightbox-caption a {
  color: #4ade80;
  text-decoration: none;
  font-weight: bold;
}
#lightbox-caption a:hover {
  text-decoration: underline;
}
.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: 0.2s;
}
.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
#prevBtn {
  left: 20px;
}
#nextBtn {
  right: 20px;
}
#closeLightbox {
  position: absolute;
  top: 20px;
  right: 30px;
  background: transparent;
  color: white;
  border: none;
  font-size: 2.5rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  .logo-emblem {
    height: 48px;
  }
  .logo-text-group h1 {
    font-size: 1.4rem;
  }
}
