body {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #fcfbf9;
  /* Creamy Editorial Background */
  color: #001A33;
  line-height: 1.6;
}

header {
  background-color: #003366;
  /* Deep Teal */
  color: white;
  padding: 30px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
}

.card-box {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 20px;
}

.card {
  border: 1px solid rgba(0, 51, 102, 0.1);
  border-radius: 12px;
  padding: 20px;
  width: 200px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.card h4 {
  margin-bottom: 0;
  color: #003366;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 51, 102, 0.15);
}

iframe {
  border: none;
  width: 100%;
  height: calc(100vh - 70px);
  overflow: hidden;
}

#dendrogram {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.link {
  fill: none;
  stroke: #ccc;
  stroke-width: 2px;
}

.node {
  fill: #FF9933;
  /* Sandy Beige */
  stroke: #003366;
  stroke-width: 2px;
}

.node-label {
  cursor: pointer;
}

.leaf {
  cursor: pointer;
}

.btn-back {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 8px 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  background-color: #003366;
  color: #FF9933;
  border: none;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-back:hover {
  background-color: #FF9933;
  color: #003366;
  transform: scale(1.05);
}

/* Species Profile Layout */
.post {
  max-width: 900px;
  margin: 40px auto;
  background: white;
  padding: 60px;
  border-radius: 30px;
  box-shadow: 0 10px 40px rgba(0, 51, 102, 0.05);
}

.post h1 {
  font-weight: 800;
  color: #003366;
  font-size: 2.8rem;
  margin-bottom: 10px;
  letter-spacing: -1px;
}

.post h4 {
  font-family: 'Playfair Display', serif;
  color: #E68A00;
  /* Muted Gold/Editorial Tan */
  margin-bottom: 40px;
  font-weight: 400;
  font-style: italic;
  font-size: 1.4rem;
  display: block;
}

.post h5 {
  color: #003366;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9rem;
  margin-top: 40px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.post h5::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 2px;
  background: #FF9933;
  margin-right: 15px;
}

/* Botanical Classification Card */
.post ul {
  list-style: none;
  padding: 30px;
  background: #fdfcf8;
  border: 1px solid rgba(0, 51, 102, 0.08);
  border-radius: 15px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  position: relative;
}

.post ul li {
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
  padding-bottom: 5px;
}

.post ul li b {
  color: #003366;
}

/* Image Slider - Premium Gallery Stage */
.img-container {
  position: relative;
  margin: 40px -60px;
  padding: 100px 0;
  /* High-end stage look */
  background: #061325;
  /* Neutral Charcoal */
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border-radius: 4px;
}

.slider-container {
  width: 100%;
  height: 400px;
  position: relative;
  overflow: visible;
  /* Let images peek correctly */
}

.slider {
  display: flex;
  position: absolute;
  left: 50%;
  /* Start from center */
  transform: translateX(0);
  /* Offset will be handled via JS */
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  align-items: center;
}

.slider img {
  width: 600px;
  height: 400px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  margin: 0 40px;
  transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 0.4;
  transform: scale(0.8);
  cursor: zoom-in;
  filter: grayscale(0.5);
}

.slider img.active {
  opacity: 1;
  transform: scale(1);
  filter: grayscale(0);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border-radius: 50% !important;
  font-size: 1.5rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 100;
  border: none;
  cursor: pointer;
}

.slider-nav:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: #FF9933 !important;
  transform: translateY(-50%) scale(1.1);
}

#prev {
  left: 40px;
}

#next {
  right: 40px;
}

/* +++++++++++++++++++++++++ */

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow: auto;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 85%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.close {
  color: white;
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #999;
  text-decoration: none;
  cursor: pointer;
}

.caption {
  text-align: center;
  margin-top: 10px;
  color: white;
  font-size: 16px;
}

/* Footer */
footer {
  background: #003366;
  color: #FF9933;
  padding: 60px 10% 20px;
  text-align: center;
  margin-top: 60px;
}

footer .logo {
  font-size: 1.5rem;
  font-weight: 600;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  margin-top: 40px;
  font-size: 0.8rem;
}

.footer-bottom a {
  color: #138808;
  text-decoration: none;
}