/* ============================================================
   COLOUR VARIABLES
   Change a colour here and it updates everywhere it's used on
   the site. This is the ONLY place hex values should live —
   never hardcode a colour inline in HTML/Python again.
   ============================================================ */
:root {
  /* --- Core palette --- */
  --bg: #1B2B22;          /* page background, dark green */
  --card: #F0EAD6;        /* cream card background */
  --text-dark: #1A1A1A;   /* body text sitting on cream cards */
  --text-light: #F0EAD6;  /* body text sitting on the dark background */

  /* --- Accent (decorative use only: icons, left-border strips, badges) --- */
  --accent: #C97A3D;      /* orange */
  --accent2: #3D6B63;     /* teal */

  /* --- Text-safe accent ---
     WCAG AA checked: 5.25:1 against --bg (needs 4.5:1 minimum).
     --accent itself only reaches 4.48:1 as text on --bg, which fails.
     Use --accent-text for anything readable (links), --accent for
     anything decorative (borders, icon fills, badge backgrounds). */
  --accent-text: #D08A4D;

  /* --- Project category colours (used on the homepage cards) ---
     Each project gets tagged with one of these so visitors can tell
     "AI project" from "systems project" from "hobby project" at a
     glance. Two versions each:
       - plain version  = bright, used for icons + left-border strip
       - "-text" version = darkened, used ONLY for the category label
                            text sitting on the cream card (WCAG AA
                            checked against --card, 4.5:1+) */
  --cat-birds:          #3D6B63;  /* teal, reuses --accent2 */
  --cat-birds-text:     #3D6B63;  /* already passes at 5.0:1, no change needed */

  --cat-server:         #5A7A9E;  /* blue — systems / networking projects */
  --cat-server-text:    #44607F;  /* darkened to pass 5.4:1 as text */

  --cat-warhammer:      #C97A3D;  /* orange, reuses --accent */
  --cat-warhammer-text: #925222;  /* darkened to pass 5.1:1 as text */

  --cat-hardware:       #8B5A8C;  /* purple — hardware/electronics builds (e.g. CatCam) */
  --cat-hardware-text:  #76487A;  /* darkened to pass 5.9:1 as text */
  --cat-research:       #6B7D3D;  /* olive/moss — research papers */
  --cat-research-text:  #55642F;  /* darkened to pass contrast as text */
  --cat-gis:            #C9A23D;  /* sandy gold — GIS/mapping projects */
  --cat-gis-text:       #9C7A28;  /* darkened to pass contrast as text */
  --cat-tourism:        #C9496B;  /* rose — data viz/tourism projects */
  --cat-tourism-text:   #A02F4E;  /* darkened to pass contrast as text */
}

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

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text-light);
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.5;
}

h1, h2, h3 { font-family: 'Lora', Georgia, serif; }

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid rgba(240,234,214,0.2);
}

nav a {
  color: var(--text-light);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* was var(--accent) — failed contrast at 4.48:1, fixed to --accent-text */
nav a:hover { color: var(--accent-text); }


/* ============================================================
   SEARCH BOX (bird species pages)
   ============================================================ */
#search-box {
  margin: 1.5rem 2rem;
  padding: 0.6rem 1rem;
  width: calc(100% - 4rem);
  max-width: 400px;
  background: var(--card);
  border: none;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
}
.hero {
  padding: 2rem 2rem 0;
}


/* ============================================================
   PROJECT/SPECIES CARD GRID
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  padding: 0 2rem 3rem;
}

.card {
  background: var(--card);
  color: var(--text-dark);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: transform 0.15s ease;
}

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

.card-icon {
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.card-body { padding: 0 1rem 1rem; }

.card-body h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }

.card-body .sci { font-style: italic; font-size: 0.8rem; color: #555; margin-bottom: 0.5rem; }

.count-badge {
  display: inline-block;
  background: var(--accent2);
  color: var(--text-light);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

/* --- Homepage project cards: left colour strip by category ---
   .project-card is a variant of .card used only on the hub homepage.
   The category colour is set inline per-card via --project-cat
   (see build_hub.py) so one CSS rule handles every category. */
.project-card {
  background: var(--card);
  color: var(--text-dark);
  border-left: 4px solid var(--project-cat, var(--accent));
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
  text-decoration: none;
  display: block;
  transition: transform 0.15s ease;
}

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

.project-card .cat-icon {
  font-size: 28px;
  line-height: 1;
  color: var(--project-cat, var(--accent));
  margin-bottom: 8px;
  display: block;
}

.project-card .cat-label {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.05em;
  color: var(--project-cat-text, var(--accent));
  margin-bottom: 4px;
  text-transform: uppercase;
}

.project-card h3 { font-size: 15px; margin-bottom: 4px; }

.project-card p { color: #555; font-size: 12px; }

/* --- Coming soon variant ---
   Used for projects that don't have a page yet (e.g. CatCam).
   Rendered as a <div>, not a link (see build_hub.py) — no href
   to a page that doesn't exist. Dimmed and no hover lift, so it
   visually reads as "not clickable" rather than a broken link. */
.project-card.coming-soon {
  opacity: 0.6;
  cursor: default;
}

.project-card.coming-soon:hover { transform: none; }

.coming-soon-badge {
  display: inline-block;
  background: rgba(26,26,26,0.08);
  color: var(--text-dark);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-top: 6px;
}

/* ============================================================
   PHOTO GALLERY (bird species pages)
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  padding: 0 2rem 3rem;
}

.photo-card {
  background: var(--card);
  border-radius: 6px;
  overflow: hidden;
}

.photo-card img { width: 100%; display: block; cursor: pointer; }

.conf-tag {
  display: block;
  text-align: center;
  padding: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-dark);
  font-weight: bold;
}

.conf-high { background: #A8C99A; }
.conf-mid { background: #E8C77E; }
.conf-review { background: #E0A87A; }

/* ============================================================
   ABOUT / INFO BOXES
   ============================================================ */
.about {
  margin: 2rem 2rem 4rem;
  padding: 1.5rem;
  background: rgba(240,234,214,0.08);
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.about a {
  color: var(--accent-text);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 2rem;
  border-top: 1px solid rgba(240,234,214,0.2);
  font-size: 0.8rem;
  color: rgba(240,234,214,0.6);
}

/* was var(--accent) — failed contrast, fixed to --accent-text */
footer a { color: var(--accent-text); }

/* ============================================================
   PREV/NEXT NAVIGATION (species pages)
   ============================================================ */
.nav-links {
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  margin: 1rem 0;
}

/* was var(--accent) — failed contrast, fixed to --accent-text */
.nav-links a {
  color: var(--accent-text);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-links a:hover { text-decoration: underline; }

/* ============================================================
   LIGHTBOX (full-size photo viewer)
   ============================================================ */
#lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
}
/* Cover-photo thumbnails on homepage/index cards, with a subtle zoom on hover */
.card-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.card:hover .card-thumb {
  transform: scale(1.06);
}
