/* -----------------------------
   Root variables
------------------------------ */
:root {
  --ps-green: #006633;
  --ps-white: #fff;
  --ps-text: #222;
  --ps-border: #e5ebe8;
  --radius: 10px;
}

/* -----------------------------
   Global styles
------------------------------ */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--ps-text);
  background: #fff;
}

a {
  text-decoration: none;
  color: inherit;
}

main h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 20px 0 20px 0;
  color: var(--ps-green);
  padding-bottom: 0;
  border-bottom: none;
}

h3, h4 {
  margin: 0;
}

p a {
  color: var(--ps-green);
  text-decoration: underline;
  font-weight: bold;
}

p a:hover {
  color: #004d26;
  text-decoration: none;
}

/* -----------------------------
   Header
------------------------------ */
.headerContainer {
  background: var(--ps-green);
  color: var(--ps-white);
}

.header {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.logo-and-text {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header img.headerImage {
  height: 60px;
}

.header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.headerTop {
  font-size: 1rem;
  font-style: italic;
}

.headerMiddle {
  font-size: 2rem;
  font-weight: bold;
}

.headerBottom {
  font-size: 1.1rem;
}

/* -----------------------------
   Navigation + Search
------------------------------ */
.standardTable {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.standardTable a {
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 500;
}

.standardTable a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.standardTable input[type="text"] {
  padding: 4px 6px;
  border-radius: 6px;
  border: none;
  margin-left: 4px;
}

.standardTable input[type="submit"] {
  padding: 4px 8px;
  border-radius: 6px;
  border: none;
  background: #fff;
  color: var(--ps-green);
  font-weight: bold;
  cursor: pointer;
}

/* Hamburger toggle for mobile */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}


/* -----------------------------
   Main
------------------------------ */
main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

/* -----------------------------
   Footer
------------------------------ */
footer {
  background-color: var(--ps-green);
  color: #ecf0f1;
  padding: 20px 0;
  text-align: center;
  font-family: Arial, sans-serif;
  margin-top: 40px;
}

.footer-links {
  margin-top: 10px;
}

.footer-links a {
  color: #ecf0f1;
  text-decoration: none;
  margin: 0 15px;
  font-size: 16px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #3498db;
}

/* -----------------------------
   Grid layout
------------------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  grid-auto-flow: dense;
}

/* -----------------------------
   Cards
------------------------------ */
.card {
  background: #f9f9f9;
  border: 1px solid var(--ps-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
}

.card img {
  width: 100%;
  max-height: 240px;
  height: auto;
  object-fit: contain;
}

.card h3,
.card p,
.card a {
  padding: 0 16px;
}

.card h3 {
  margin-top: 12px;
  margin-bottom: 8px;
  color: var(--ps-green);
}

.card p {
  margin: 0 0 12px;
  flex-grow: 1;
}

.card a {
  display: inline-block;
  margin-bottom: 16px;
  font-weight: bold;
  color: var(--ps-green);
}

/* -----------------------------
   Slideshow & Thumbnails (Updated)
------------------------------ */
.slideshow-container {
  max-width: 568px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 320px;
  background: #f9f9f9;
  border-radius: var(--radius);
  padding: 0;
  box-sizing: border-box;
}

.slides-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  overflow: hidden;
}

.slide-item {
  flex: 0 0 100%;
  display: none;
  flex-direction: column;
  align-items: center;
}

.slide-item.active {
  display: flex;
}

.slide-item img {
  width: 100%;
  max-width: 568px;
  object-fit: contain;
  display: block;
}

.slide-caption {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ps-green);
  margin-top: 8px;
  max-width: 90%;
  display: block;
  padding: 0;
  background: none;
  border-radius: 0;
}

/* Slideshow buttons below image */
.slideshow-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.slideshow-controls button {
  background-color: var(--ps-green);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.slideshow-controls button:hover {
  background-color: #004d26;
}

/* Expand button */
.expand-btn-container {
  text-align: center;
  margin-bottom: 12px;
}

.expand-btn {
  background-color: var(--ps-green);
  color: var(--ps-white);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.expand-btn:hover,
.expand-btn:focus {
  background-color: #004d26;
  transform: scale(1.05);
}

/* Thumbnails as grid */
.thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  justify-items: center;
  width: 100%;
  max-width: 568px;
}

.thumbnail-item {
  width: 80px;
  height: 60px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  border-radius: 4px;
  transition: border 0.2s ease;
}

.thumbnail-item.active {
  border: 2px solid var(--ps-green);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* -----------------------------
   Modal slideshow
------------------------------ */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
}

.modal-content {
  position: relative;
  margin: 0 auto;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
}

.modal-slideshow-container {
  position: relative;
  max-width: 568px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  min-height: 480px;
}

.modal-slides-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.modal-slides-wrapper .slide-item img {
  max-width: 100%;
  max-height: 426px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
}

.modal-slides-wrapper .slide-caption {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ps-white);
  margin-top: 10px;
  max-width: 90%;
  display: block;
  padding: 0;
}

.modal-slideshow-container .prev,
.modal-slideshow-container .next {
  background: rgba(0,0,0,0.3);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease;
  z-index: 100;
}

.modal-slideshow-container .prev:hover,
.modal-slideshow-container .next:hover {
  background: rgba(0,0,0,0.6);
}

.close-modal {
  position: absolute;
  top: 5px;
  right: 5px;
  color: var(--ps-white);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1002;
  transition: color 0.2s ease;
}

.close-modal:hover,
.close-modal:focus {
  color: #ffcc00;
}



/* -----------------------------
   Right-column Slideshow Card
------------------------------ */
.slideshow-card img {
  width: 100%;
  max-width: 568px;
  height: auto;
  object-fit: contain;
  display: block;
}

.slideshow-card h3 {
  font-size: 1.2rem;
  color: var(--ps-green);
  margin-bottom: 8px;
  text-align: center;
}

.slideshow-card .slide-item img {
  width: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.slideshow-card .slide-caption {
  font-size: 0.9rem;
  color: var(--ps-text);
  text-align: center;
  margin-bottom: 8px;
}

.slideshow-card .slideshow-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.slideshow-card .slideshow-controls button {
  background-color: var(--ps-green);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-card .slideshow-controls button:hover {
  background-color: #004d26;
}

/* Expand button in slideshow-card */
.slideshow-card .expand-btn-container {
  margin-bottom: 8px;
}

.slideshow-card .expand-btn {
  font-size: 0.95rem;
  padding: 6px 12px;
}

/* Thumbnails in slideshow-card */
.slideshow-card .thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 6px;
  justify-items: center;
  width: 100%;
}

.slideshow-card .thumbnail-item {
  width: 60px;
  height: 45px;
  border: 2px solid transparent;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  transition: border 0.2s ease;
}

.slideshow-card .thumbnail-item.active {
  border: 2px solid var(--ps-green);
}

.slideshow-card .thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* -----------------------------
   Right column list boxes for slideshow
------------------------------ */
.list-box-slideshow {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 12px 16px;
  max-height: 500px;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  width: 100%;
  max-width: 568px;
  box-sizing: border-box;
}

.list-box-slideshow h4 {
  margin-top: 0;
  font-size: 1.2em;
  color: var(--ps-green);
}

.list-box-slideshow ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.list-box-slideshow li {
  margin: 4px 0;
  line-height: 1.4em;
}

.list-box-slideshow li a {
  color: var(--ps-green);
  text-decoration: underline;
  transition: color 0.2s, text-decoration 0.2s;
}

.list-box-slideshow li a:hover {
  color: #004d26;
  text-decoration: none;
}



/* -----------------------------
   Right column
------------------------------ */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 568px;
  margin: 0 auto;
}

.overall-description, .list-box {
  background: #eef4f0;
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.overall-description {
  background-color: #f9f9f9;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  margin-bottom: 16px;
  font-family: Arial, sans-serif;
  color: #222;
}

/* Top line (common name / Latin) */
.overall-description > :first-child {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.overall-description ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
}

.overall-description ul li {
  padding: 4px 0;
  border-bottom: 1px solid #eee;
  line-height: 1.4;
}

/* Label styling inline with value */
.overall-description .label {
  font-weight: bold;
  color: #006633;
  margin-right: 4px;
  min-width: 80px;
}

.overall-description .value {
  color: #222;
}

/* Paragraph styling */
.overall-description p {
  margin: 10px 0 0 0;
  color: #444;
  line-height: 1.4;
}

.taxon-group {
  margin: 10px 0;
}

.taxon-header {
  cursor: pointer;
  padding: 8px;
  background-color: #f0f0f0;
  border-radius: 3px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.taxon-header:hover {
  background-color: #e0e0e0;
}

.taxon-header::after {
  content: '▼';
  font-size: 0.8em;
}

.taxon-header.collapsed::after {
  content: '▶';
}

.taxon-content {
  padding-left: 20px;
  display: block;
}

.taxon-content.collapsed {
  display: none;
}

.taxon-content ul {
  list-style-type: none;
  padding: 0;
}

.taxon-content li {
  padding: 5px 0;
}

.taxon-content a {
  color: #0066cc;
  text-decoration: none;
}

.taxon-content a:hover {
  text-decoration: underline;
}

.slideshow-grid {
  display: grid;
  grid-template-columns: minmax(0, 580px) 1fr; /* slideshow-card max 580px, right-column fills rest */
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0 10px;
}

.slideshow-card {
  width: 100%;      /* fills its grid column */
  max-width: 580px; /* don't get wider than 580px */
  min-width: 320px; /* maintain min width on narrow screens */
  padding: 8px;
  box-sizing: border-box;
  margin: 0;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;  /* allow shrinking */
}

.card-featured {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-featured {
    grid-column: 1 / -1; /* spans all columns on large screens */
}

.card-featured ul {
    padding-left: 20px;
}

.card-featured li {
    margin-bottom: 10px;
}

.card-search h3,
#instructions h3 {
    margin-bottom: 12px;
    border-bottom: 2px solid #1a73e8;
    padding-bottom: 6px;
    font-size: 1.3em;
}

/* ------------------------------
   Instructions Card
------------------------------ */
#instructions {
    background-color: #f0f8ff;
    border-left: 4px solid #1a73e8;
    padding: 10px 16px;       /* compact */
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Instructions text */
#instructions p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

/* ------------------------------
   Sub-links (green, like slideshow-card)
------------------------------ */
.card-search li {
    list-style: none;
    margin-bottom: 10px;
}

.card-search li a {
    display: block;                  /* full card clickable */
    background-color: #f5fff5;       /* light green */
    color: #006400;                  /* dark green text */
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    font-weight: 500;
}

.card-search li a:hover {
    background-color: #e0ffe0;
    box-shadow: 0 4px 10px rgba(0,100,0,0.2);
    transform: translateY(-2px);
}

/* Optional: alternate row shading for species */
#species_results li:nth-child(odd) a {
    background-color: #f7fff7;
}
#species_results li:nth-child(even) a {
    background-color: #f0fff0;
}

/* ------------------------------
   Species List Scrollable
------------------------------ */
#species_results {
    max-height: 600px;       /* scroll if long */
    overflow-y: auto;
    padding-left: 0;
}

/* ------------------------------
   Other Lists
------------------------------ */
.card-search ul,
#species_results ul {
    padding-left: 0;
}

/* ------------------------------
   Empty Section Messages
------------------------------ */
.card-search p {
    font-style: italic;
    color: #555;
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: 6px;
}

/* Make Instructions card span all columns */
#instructions {
    grid-column: 1 / -1; /* spans entire row */
}

/* Keep species scrollable and natural height for other cards */
#species_results {
    max-height: 600px;
    overflow-y: auto;
}

/* ------------------------------
   Grid Container
------------------------------ */
.grid-search {
    display: grid;
    grid-template-columns: 1fr; /* default single column */
    gap: 20px;
    margin: 20px;
    font-family: Arial, sans-serif;
}
/* ------------------------------
   Card Base Style
------------------------------ */
.card-search,
#species_results,
#site_results,
#trip_results,
#lifelist_results,
#album_results {
    background-color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    flex: 0 0 auto;  /* natural height, do not stretch */
}

.card-search h3,
#instructions h3 {
    margin-bottom: 12px;
    border-bottom: 2px solid #1a73e8;
    padding-bottom: 6px;
    font-size: 1.3em;
}

/* ------------------------------
   Instructions Card
------------------------------ */
#instructions {
    background-color: #f0f8ff;
    border-left: 4px solid #1a73e8;
    padding: 10px 16px;       /* compact */
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Instructions text */
#instructions p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

/* ------------------------------
   Sub-links (green, like slideshow-card)
------------------------------ */
.card-search li {
    list-style: none;
    margin-bottom: 10px;
}

.card-search li a {
    display: block;                  /* full card clickable */
    background-color: #f5fff5;       /* light green */
    color: #006400;                  /* dark green text */
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    font-weight: 500;
}

.card-search li a:hover {
    background-color: #e0ffe0;
    box-shadow: 0 4px 10px rgba(0,100,0,0.2);
    transform: translateY(-2px);
}

/* Optional: alternate row shading for species */
#species_results li:nth-child(odd) a {
    background-color: #f7fff7;
}
#species_results li:nth-child(even) a {
    background-color: #f0fff0;
}

/* ------------------------------
   Species List Scrollable
------------------------------ */
#species_results {
    max-height: 600px;       /* scroll if long */
    overflow-y: auto;
    padding-left: 0;
}

/* ------------------------------
   Other Lists
------------------------------ */
.card-search ul,
#species_results ul {
    padding-left: 0;
}

/* ------------------------------
   Empty Section Messages
------------------------------ */
.card-search p {
    font-style: italic;
    color: #555;
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: 6px;
}

/* Medium screens: 2 columns */
@media (min-width: 768px) {
    .grid-search {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Make Instructions card span all columns */
#instructions {
    grid-column: 1 / -1; /* spans entire row */
}

/* Keep species scrollable and natural height for other cards */
#species_results {
    max-height: 600px;
    overflow-y: auto;
}

/* Mobile-first approach */
.expand-btn-container {
  order: 1;
}
.thumbnails {
  order: 2;
}

/* Large screens: 3 columns */
@media (min-width: 1200px) {
    .grid-search {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* On small screens, reverse the order */
@media (max-width: 700px) {
  .expand-btn-container {
    order: 0; /* show before thumbnails */
  }
  .thumbnails {
    order: 1;
  }

  .slideshow-card {
    display: flex;
    flex-direction: column;
  }
}

/* -----------------------------
   Responsive adjustments
------------------------------ */
@media (max-width: 700px) {
  .slideshow-container {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
  }
  .slide-item img {
    max-height: 300px;
  }
  .slideshow-controls button {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  .thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
}

@media (max-width: 360px) {
  .slideshow-controls button {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
  .thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  }
}
@media (max-width: 768px) {
  .footer-links {
    display: block;
    margin-top: 10px;
  }

  .footer-links a {
    display: block;
    margin: 5px 0;
  }
}
/* -----------------------------
   Responsive adjustments for slideshow-card
------------------------------ */
@media (max-width: 700px) {
  .slideshow-card .slide-item img {
    max-height: 220px;
  }
  .slideshow-card .slideshow-controls button {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
  .slideshow-card .thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  }
}
/* Media query for smaller screens */
@media (max-width: 700px) {
  .list-box-slideshow {
    max-width: 100%;
    width: 100%;
  }
  .list-box-slideshow ul li {
    padding: 10px 0;
  }
  .list-box-slideshow ul li a {
    font-size: 0.95rem;
  }
}
/* Optional: reduce width on smaller screens */
@media (max-width: 768px) {
    .card-featured {
        grid-column: auto; /* spans single column */
    }
}
@media (max-width: 1000px) {
  .slideshow-grid {
    grid-template-columns: 1fr; /* stack card and right-column */
  }

  .slideshow-card,
  .right-column {
    width: 100%;
    max-width: 100%;
  }
}

/* Medium screens: 2 columns */
@media (min-width: 768px) {
    .grid-search {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screens: 3 columns */
@media (min-width: 1200px) {
    .grid-search {
        grid-template-columns: repeat(3, 1fr);
    }
}











