/* ===== Ark Farm - Global Styles ===== */
:root {
  --green-dark: #1b5e20;
  --green-mid: #2e7d32;
  --green-light: #4caf50;
  --green-pale: #e8f5e9;
  --bg: #f4f8f4;
  --white: #ffffff;
  --text: #333;
  --text-light: #666;
  --shadow: 0 2px 6px rgba(0,0,0,0.05);
  --radius: 12px;
}

/* Hidden species (died / no longer on farm) */
.card[data-hidden="true"] { opacity: 0.4; position: relative; }
.card[data-hidden="true"]::after {
  content: "⛔ Hidden";
  position: absolute; top: 8px; right: 8px;
  background: #c62828; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}
body.hide-hidden .card[data-hidden="true"] { display: none; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ===== Header / Nav ===== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header {
  background: var(--green-dark);
  color: #fff;
  padding: 0 15px;
}
.site-header .container {
  max-width: 1000px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-header .logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.site-header .logo span { color: var(--green-light); }

.nav-right { display: flex; align-items: center; gap: 10px; }

/* Header search icon - always visible */
.header-search {
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  line-height: 1;
}
.header-search:hover { opacity: 0.8; text-decoration: none; }

/* Language toggle */
.lang-toggle {
  background: var(--green-light);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.lang-toggle:hover { background: #43a047; }

.nav-toggle { display: block; background: none; border: none; color: #fff; font-size: 26px; cursor: pointer; }

/* Left-side drawer */
.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 98;
}
.nav-overlay.open { display: block; }

.nav-links {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--green-dark);
  padding: 0 0 30px;
  gap: 0;
  list-style: none;
  z-index: 99;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.nav-links.open { transform: translateX(0); }

/* Drawer header row */
.nav-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.nav-drawer-title { color: #fff; font-size: 16px; font-weight: 700; }
.nav-close-btn {
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0;
}

.nav-links a { color: #fff; font-size: 15px; font-weight: 500; padding: 4px 0; }
.nav-links a:hover { color: var(--green-pale); text-decoration: none; }

/* Nav group headers (Flora / Fauna) */
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between;
  color: #fff; font-size: 15px; font-weight: 700;
  padding: 12px 20px 10px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  user-select: none;
}
.nav-group-toggle .nav-arrow { font-size: 11px; transition: transform 0.2s; }
.nav-group-toggle.open .nav-arrow { transform: rotate(180deg); }
.nav-group-items {
  display: none; flex-direction: column; gap: 0;
  padding-left: 0; background: rgba(0,0,0,0.15);
}
.nav-group-items.open { display: flex; }
.nav-group-items li { list-style: none; }
.nav-group-items a { font-size: 14px; font-weight: 400; padding: 9px 20px 9px 32px; display: block; border-bottom: 1px solid rgba(255,255,255,0.06); }
.nav-home-link { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.15); display: block; }
.nav-group-toggle.open .nav-arrow { transform: rotate(180deg); }
.nav-group-items {
  display: none; flex-direction: column; gap: 0;
  padding-left: 12px;
}
.nav-group-items.open { display: flex; }
.nav-group-items li { list-style: none; }
.nav-group-items a { font-size: 14px; font-weight: 400; padding: 5px 0; display: block; }
.nav-home-link { padding: 8px 0 4px; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 4px; }

@media (max-width: 700px) {
  .nav-links { padding: 10px 20px 20px; }
}

.container { max-width: 1000px; margin: auto; padding: 15px; }

.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green-light));
  color: #fff;
  text-align: center;
  padding: 50px 20px;
}
.hero h1 { font-size: 2em; margin-bottom: 10px; }
.hero p { font-size: 1.1em; opacity: 0.9; max-width: 600px; margin: auto; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  padding: 20px 0;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-3px); }
.card img { width: 100%; height: 180px; object-fit: cover; }
.card-body { padding: 14px; }
.card-body h3 { color: var(--green-mid); margin-bottom: 4px; font-size: 16px; }
.card-body p { font-size: 13px; color: var(--text-light); }

/* Flora / Fauna tabs */
.tab-bar {
  display: flex; gap: 0; margin: 20px 0 0;
  border-bottom: 2px solid #e0e0e0;
}
.tab-btn {
  padding: 10px 28px; font-size: 15px; font-weight: 600;
  background: none; border: none; border-bottom: 3px solid transparent;
  cursor: pointer; color: #777; margin-bottom: -2px; transition: color 0.2s;
}
.tab-btn.active { color: #2e7d32; border-bottom-color: #2e7d32; }
.tab-btn:hover { color: #2e7d32; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
  background: var(--white);
  margin-bottom: 15px;
  padding: 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.top-card img { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); margin-bottom: 10px; }
.top-card h1 { color: var(--green-mid); margin-top: 0; }
.key-grid p { margin: 5px 0; font-size: 14px; }

details {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  padding: 12px 15px;
}
summary {
  font-weight: 600;
  font-size: 16px;
  color: var(--green-mid);
  cursor: pointer;
  outline: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: " ▼"; font-size: 12px; }
details[open] summary::after { content: " ▲"; }

table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
table td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: top; }

.photo-gallery img { width: 100%; max-height: 350px; object-fit: cover; margin-bottom: 10px; border-radius: 10px; }

.search-box {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--green-light);
  border-radius: var(--radius);
  font-size: 16px;
  outline: none;
  margin-bottom: 20px;
}
.search-box { border-color: var(--green-mid); }
.search-results { list-style: none; }
.search-results li { padding: 0; background: var(--white); margin-bottom: 8px; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.search-results li a { font-weight: 600; }
.search-results .category-tag { font-size: 12px; color: var(--text-light); margin-left: 8px; }

.search-result-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; padding: 10px;
}
.search-result-link:hover { background: #f1f8f1; }
.search-result-img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 6px; flex-shrink: 0;
}
.search-result-body {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.search-result-name { font-weight: 600; color: #1b5e20; font-size: 15px; }
.search-result-sci { font-size: 12px; color: #777; font-style: italic; }
.search-result-desc { font-size: 12px; color: #555; margin-top: 2px; }
.no-results { text-align: center; color: var(--text-light); padding: 30px; }

.breadcrumb { font-size: 13px; margin-bottom: 12px; color: var(--text-light); }
.breadcrumb a { color: var(--green-mid); }

.site-footer {
  text-align: center;
  font-size: 12px;
  color: #777;
  padding: 25px 15px;
  border-top: 1px solid #e0e0e0;
  margin-top: 20px;
}

/* ===== Share Button ===== */
.share-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-mid);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.share-btn:hover { background: var(--green-dark); }

@media print {
  .share-btn { display: none; }
  .card[data-hidden="true"] { display: none; }
}
