/* "Threatened Wildlife of Bangladesh" content pages: the hub page
   (threatened-wildlife.php) and its five category pages (threatened-birds,
   -mammals, -reptiles, -fishes, -plants .php). Shared here because all six
   pages reuse the same intro/table/callout/switcher components.
   Loaded site-wide from partials/head.php, same as field-stories.css. */

.tw-section { padding: 70px 0; }
.tw-section + .tw-section { padding-top: 0; }

.tw-lead {
  max-width: 880px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--body-color);
  margin-bottom: 20px;
}
.tw-lead:last-child { margin-bottom: 0; }

/* ---- group switcher: the 5 category buttons, reused on every page ---- */
.tw-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 0;
}
.tw-switcher-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 100px;
  background: rgba(29, 50, 21, 0.05);
  border: 1.5px solid rgba(29, 50, 21, 0.12);
  color: var(--theme-color-3);
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.tw-switcher-link i { color: var(--theme-color); font-size: 15px; }
.tw-switcher-link:hover {
  background: var(--theme-color-3);
  border-color: var(--theme-color-3);
  color: #fff;
  transform: translateY(-2px);
}
.tw-switcher-link:hover i { color: var(--theme-color-2); }
.tw-switcher-link.is-active {
  background: var(--theme-color-3);
  border-color: var(--theme-color-3);
  color: #fff;
}
.tw-switcher-link.is-active i { color: var(--theme-color-2); }

.tw-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--theme-color);
  text-decoration: none;
}
.tw-back-link:hover { color: var(--theme-color-3); }

/* ---- hub page: "Explore by group" cards ---- */
.tw-groups-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 36px;
}
.tw-group-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 30px 24px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(29, 50, 21, 0.08);
  box-shadow: 0 12px 30px -18px rgba(29, 50, 21, 0.35);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.tw-group-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -20px rgba(29, 50, 21, 0.45);
  border-color: rgba(29, 50, 21, 0.18);
}
.tw-group-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--theme-color-3);
  color: var(--theme-color-2);
  font-size: 22px;
}
.tw-group-card h3 {
  font-size: 19px;
  margin: 0;
  color: var(--theme-color-3);
}
.tw-group-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--body-color);
  margin: 0;
  flex: 1;
}
.tw-group-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-color);
}
.tw-group-card:hover .tw-group-cta { gap: 12px; color: var(--theme-color-3); }

/* ---- species tables ---- */
.tw-group-block { margin-bottom: 56px; }
.tw-group-block:last-child { margin-bottom: 0; }
.tw-group-title {
  font-size: 24px;
  color: var(--theme-color-3);
  margin-bottom: 14px;
}
.tw-group-intro {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--body-color);
  max-width: 840px;
  margin-bottom: 22px;
}

.tw-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(29, 50, 21, 0.1);
}
.tw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 560px;
}
.tw-table thead th {
  text-align: left;
  background: var(--theme-color-3);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 14px 18px;
}
.tw-table tbody td {
  padding: 13px 18px;
  border-top: 1px solid rgba(29, 50, 21, 0.08);
  color: var(--body-color);
  vertical-align: top;
}
.tw-table tbody tr:nth-child(odd) { background: rgba(29, 50, 21, 0.025); }
.tw-table .tw-species-name {
  font-weight: 700;
  color: var(--theme-color-3);
  white-space: nowrap;
}
.tw-table .tw-sci-name {
  font-style: italic;
  color: var(--theme-color);
  white-space: nowrap;
}

/* ---- single-species prose blurb (e.g. Monitor lizards, no table) ---- */
.tw-species-note {
  background: rgba(29, 50, 21, 0.04);
  border-left: 3px solid var(--theme-color);
  border-radius: 0 12px 12px 0;
  padding: 18px 24px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--body-color);
  max-width: 840px;
}

/* ---- callouts ---- */
.tw-callout {
  border-radius: 16px;
  padding: 28px 30px;
  margin-bottom: 56px;
  max-width: 900px;
}
.tw-callout h4 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.tw-callout p {
  font-size: 15px;
  line-height: 1.75;
  margin: 0;
}
.tw-callout--lost {
  background: #FBF3E9;
  border: 1px solid #EBD8BC;
}
.tw-callout--lost h4 { color: #9A5B13; }
.tw-callout--lost p { color: #6D4C2E; }

.tw-callout--connection {
  background: var(--theme-color-3);
  max-width: none;
}
.tw-callout--connection h4 { color: var(--theme-color-2); }
.tw-callout--connection p { color: rgba(255, 255, 255, 0.85); }

/* ---- bullet lists: "why declining" / "how you can help" ---- */
.tw-bullets {
  max-width: 840px;
  margin: 0 0 56px;
  padding: 0;
  list-style: none;
}
.tw-bullets li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 14px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--body-color);
}
.tw-bullets li:last-child { margin-bottom: 0; }
.tw-bullets li .tw-bullet-icon {
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--theme-color-3);
  background: var(--theme-color-2);
  border-radius: 50%;
}
.tw-bullets li strong { color: var(--theme-color-3); }

/* ---- numbered steps (Plants: "Bringing them back") ---- */
.tw-steps {
  max-width: 840px;
  margin: 0 0 56px;
  padding: 0;
  list-style: none;
  counter-reset: tw-step;
}
.tw-steps li {
  counter-increment: tw-step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 18px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--body-color);
}
.tw-steps li::before {
  content: counter(tw-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--theme-color-3);
  color: var(--theme-color-2);
  font-weight: 800;
  font-size: 13px;
}

.tw-section-heading {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--theme-color);
  margin-bottom: 16px;
}

.tw-footnote {
  max-width: 840px;
  padding-top: 24px;
  border-top: 1px solid rgba(29, 50, 21, 0.1);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(109, 76, 65, 0.75);
}

/* ---- responsive ---- */
@media (max-width: 1200px) {
  .tw-groups-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .tw-section { padding: 48px 0; }
  .tw-groups-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .tw-group-card { padding: 22px 18px; }
  .tw-callout { padding: 22px 20px; }
  .tw-switcher { gap: 8px; }
  .tw-switcher-link { padding: 10px 16px; font-size: 13.5px; }
}
@media (max-width: 575px) {
  .tw-groups-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tw-group-card, .tw-switcher-link, .tw-group-cta { transition: none !important; }
}
