/* ============================================================
   knowyourwood.org — Stylesheet
   Brand: Dansbee Designs palette
   Fonts: Oswald (display) · Roboto Slab (body) · Josefin Sans (labels)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Roboto+Slab:wght@300;400&family=Josefin+Sans:wght@400;700&display=swap');

/* ── TOKENS ── */
:root {
  --dark-teal:   #0a2020;
  --deep-teal:   #123030;
  --mid-teal:    #2d6a6a;
  --accent-teal: #1e4444;
  --amber:       #e8913a;
  --amber-light: #e8c49a;
  --red:         #c0392b;
  --cream:       #d4cfc7;
  --white:       #ffffff;
  --text:        #d4cfc7;   /* cream on dark backgrounds */
  --text-dark:   #1a2a2a;   /* dark text on light backgrounds */
  --border:      #2d6a6a;
  --sidebar-bg:  #0d2828;
  --card-bg:     #102e2e;
  --hover-bg:    #1a3e3e;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto Slab', serif;
  background: var(--dark-teal);
  color: var(--cream);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  background: var(--dark-teal);
  border-bottom: 3px solid var(--amber);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-teal);
  text-decoration: none;
  transition: color 0.15s;
}

.site-name:hover {
  color: var(--amber);
}

.header-tagline {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid-teal);
}

/* ── HERO ── */
.hero {
  background: var(--deep-teal);
  padding: 3.5rem 2rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--accent-teal);
  position: relative;
  overflow: hidden;
}

/* Subtle cross-grain texture lines */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 60px,
    rgba(45, 106, 106, 0.08) 60px,
    rgba(45, 106, 106, 0.08) 61px
  );
  pointer-events: none;
}

.hero-logo {
  height: 130px;
  width: auto;
  display: block;
  margin: 0 auto 2rem;
  position: relative;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.4));
}

.hero h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.1;
  position: relative;
  margin-bottom: 0.75rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--amber);
}

.hero p {
  font-family: 'Roboto Slab', serif;
  font-weight: 300;
  color: var(--cream);
  max-width: 560px;
  margin: 0 auto 2rem;
  font-size: 1rem;
  position: relative;
  opacity: 0.85;
}

/* ── SEARCH ── */
.search-bar {
  display: flex;
  max-width: 540px;
  margin: 0 auto;
  position: relative;
}

.search-bar input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  font-family: 'Roboto Slab', serif;
  font-size: 0.9rem;
  font-weight: 300;
  border: 2px solid var(--mid-teal);
  border-right: none;
  background: var(--dark-teal);
  color: var(--white);
  outline: none;
  border-radius: 2px 0 0 2px;
  transition: border-color 0.2s;
}

.search-bar input::placeholder { color: var(--mid-teal); }
.search-bar input:focus { border-color: var(--amber); }

.search-bar button {
  padding: 0 1.5rem;
  background: var(--amber);
  color: var(--dark-teal);
  border: 2px solid var(--amber);
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0 2px 2px 0;
  transition: background 0.2s, border-color 0.2s;
}

.search-bar button:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ── FILTER BAR ── */
.filter-bar {
  background: var(--accent-teal);
  border-bottom: 1px solid var(--mid-teal);
  padding: 0.65rem 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-right: 0.4rem;
}

.filter-btn {
  padding: 0.28rem 0.85rem;
  border: 1.5px solid var(--mid-teal);
  background: transparent;
  border-radius: 2px;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--cream);
  transition: all 0.15s;
}

.filter-btn:hover {
  background: var(--mid-teal);
  border-color: var(--mid-teal);
  color: var(--white);
}

.filter-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--dark-teal);
}

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  height: calc(100vh - 64px - 38px - 41px); /* minus header, hero, filter */
  overflow: hidden;
}

/* ── SIDEBAR ── */
aside {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--accent-teal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-heading {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  padding: 1rem 1.25rem 0.6rem;
  border-bottom: 1px solid var(--accent-teal);
  flex-shrink: 0;
}

#speciesList {
  overflow-y: auto;
  flex: 1;
}

#speciesList::-webkit-scrollbar { width: 4px; }
#speciesList::-webkit-scrollbar-track { background: var(--dark-teal); }
#speciesList::-webkit-scrollbar-thumb { background: var(--mid-teal); border-radius: 2px; }

.species-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.12s;
  border-bottom: 1px solid rgba(45,106,106,0.2);
}

.species-list-item:hover {
  background: var(--hover-bg);
  border-left-color: var(--mid-teal);
}

.species-list-item.active {
  background: var(--accent-teal);
  border-left-color: var(--amber);
}

.species-list-item .common {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: var(--white);
  line-height: 1.2;
}

.species-list-item .scientific {
  font-family: 'Roboto Slab', serif;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--mid-teal);
  font-weight: 300;
}

.janka-pill {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  background: var(--dark-teal);
  border: 1px solid var(--mid-teal);
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  color: var(--amber);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── MAIN CONTENT ── */
main {
  overflow-y: auto;
  padding: 2rem;
  background: var(--dark-teal);
}

main::-webkit-scrollbar { width: 5px; }
main::-webkit-scrollbar-track { background: var(--dark-teal); }
main::-webkit-scrollbar-thumb { background: var(--mid-teal); border-radius: 2px; }

/* ── PLACEHOLDER ── */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1.5rem;
  color: var(--mid-teal);
  text-align: center;
}

.placeholder svg { opacity: 0.4; }

.placeholder p {
  font-family: 'Roboto Slab', serif;
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--mid-teal);
}

/* ── SPECIES HEADER ── */
.species-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--accent-teal);
  flex-wrap: wrap;
  gap: 1rem;
}

.species-name h2 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.05;
}

.species-name .sci {
  font-family: 'Roboto Slab', serif;
  font-style: italic;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--amber-light);
  margin-top: 0.25rem;
}

.species-name .aka {
  font-family: 'Roboto Slab', serif;
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--mid-teal);
  margin-top: 0.3rem;
}

/* ── BADGES ── */
.species-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: flex-start;
}

.badge {
  padding: 0.28rem 0.75rem;
  border-radius: 2px;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-domestic    { background: rgba(45,106,106,0.25); color: #7dcfcf; border: 1px solid var(--mid-teal); }
.badge-exotic      { background: rgba(232,145,58,0.15); color: var(--amber); border: 1px solid var(--amber); }
.badge-beginner    { background: rgba(45,106,106,0.25); color: #7dcfcf; border: 1px solid var(--mid-teal); }
.badge-premium     { background: rgba(192,57,43,0.15);  color: #e07a72; border: 1px solid var(--red); }
.badge-mid         { background: rgba(212,207,199,0.1); color: var(--cream); border: 1px solid rgba(212,207,199,0.3); }
.badge-affordable  { background: rgba(45,106,106,0.25); color: #7dcfcf; border: 1px solid var(--mid-teal); }
.badge-cites       { background: rgba(192,57,43,0.2);   color: #e07a72; border: 1px solid var(--red); }
.badge-sustainable { background: rgba(45,106,106,0.25); color: #7dcfcf; border: 1px solid var(--mid-teal); }

/* ── STAT GRID ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1px;
  background: var(--accent-teal);
  border: 1px solid var(--accent-teal);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.stat-cell {
  background: var(--card-bg);
  padding: 1rem 1.1rem;
}

.stat-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid-teal);
  margin-bottom: 0.3rem;
}

.stat-value {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--white);
  line-height: 1.2;
}

.stat-sub {
  font-family: 'Roboto Slab', serif;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--amber-light);
  margin-top: 0.15rem;
}

/* ── DANSBEE CALLOUT ── */
.dansbee-callout {
  background: var(--deep-teal);
  border-left: 4px solid var(--amber);
  border-radius: 0 3px 3px 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.callout-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.6rem;
}

.dansbee-callout p {
  font-family: 'Roboto Slab', serif;
  font-weight: 300;
  font-size: 0.92rem;
  color: var(--cream);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.callout-mistakes {
  border-top: 1px solid var(--accent-teal);
  padding-top: 0.85rem;
}

.mistake-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.callout-mistakes ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.callout-mistakes ul li {
  font-family: 'Roboto Slab', serif;
  font-size: 0.83rem;
  font-weight: 300;
  color: var(--cream);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.55;
}

.callout-mistakes ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--red);
  font-weight: 400;
}

/* ── SECTIONS ── */
.section {
  margin-bottom: 2rem;
}

.section-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--accent-teal);
}

/* ── COLOR SWATCHES ── */
.color-swatches {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.swatch {
  width: 60px;
  height: 60px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.1);
}

.swatch-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-teal);
}

.section p {
  font-family: 'Roboto Slab', serif;
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--cream);
  opacity: 0.8;
}

/* ── WORKABILITY ── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.work-item { }

.work-name {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 0.35rem;
}

.rating-bar {
  height: 5px;
  background: var(--accent-teal);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.rating-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.rating-fill.good { background: var(--mid-teal); }
.rating-fill.mid  { background: var(--amber); }
.rating-fill.hard { background: var(--red); }

.work-note {
  font-family: 'Roboto Slab', serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--mid-teal);
}

.work-notes-text {
  font-family: 'Roboto Slab', serif;
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--cream);
  opacity: 0.75;
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ── AVAILABILITY TABLE ── */
.avail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.avail-table th {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid-teal);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--accent-teal);
  text-align: left;
}

.avail-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(45,106,106,0.2);
  font-family: 'Roboto Slab', serif;
  font-weight: 300;
  color: var(--cream);
}

.avail-table tr:last-child td { border-bottom: none; }

.avail-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.dot-easy     { background: var(--mid-teal); }
.dot-regional { background: var(--amber); }
.dot-specialty{ background: var(--amber-light); opacity: 0.6; }
.dot-rare     { background: var(--red); }

.avail-label {
  font-family: 'Roboto Slab', serif;
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--cream);
  vertical-align: middle;
}

/* ── HEALTH GRID ── */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.health-item { }

.h-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid-teal);
  margin-bottom: 0.3rem;
}

.h-value {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--cream);
}

.h-value.risk-low      { color: var(--mid-teal); }
.h-value.risk-moderate { color: var(--amber); }
.h-value.risk-high     { color: var(--red); }

.h-notes {
  font-family: 'Roboto Slab', serif;
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--cream);
  opacity: 0.8;
  line-height: 1.6;
  grid-column: 1 / -1;
}

/* ── USES TAGS ── */
.uses-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.use-tag {
  background: var(--accent-teal);
  border: 1px solid var(--mid-teal);
  padding: 0.25rem 0.7rem;
  border-radius: 2px;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cream);
}

/* ── SUSTAINABILITY NOTE ── */
.sustainability-note {
  font-family: 'Roboto Slab', serif;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--mid-teal);
  padding-top: 1rem;
  border-top: 1px solid var(--accent-teal);
  line-height: 1.55;
}

/* ── FOOTER ── */
footer {
  background: var(--deep-teal);
  border-top: 1px solid var(--accent-teal);
  padding: 1rem 2rem;
  text-align: center;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid-teal);
}

footer a {
  color: var(--amber);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  aside {
    height: 260px;
    border-right: none;
    border-bottom: 1px solid var(--accent-teal);
  }

  main { padding: 1.25rem; }

  .hero { padding: 2.5rem 1.25rem 2rem; }

  header { padding: 0 1.25rem; }

  .header-tagline { display: none; }

  .species-header { flex-direction: column; }
  .species-badges { justify-content: flex-start; }
}
