body {
  font-family: "Cabin", sans-serif;
  font-weight: 400;
  margin: 0;
  padding: 0;
  background: #e6e6e6;
  color: #000;
}



h1 {
  font-weight: 600; /* semibold */
  letter-spacing: 0.01em;
  margin-bottom: 0.3rem;
}

h2 {
  margin-top: 2rem;
  border-bottom: 1px solid #000;
}


label {
  display: block;
  margin-top: 1rem;
}


input, select, textarea {
  width: 100%;
  margin-top: 0.5rem;
}


textarea {
  height: 120px;
}


button {
  margin-top: 2rem;
  padding: 0.5rem 1rem;
}


.hint {
  font-size: 0.9em;
  opacity: 0.8;
}


.checkbox-group label {
  display: inline-block;
  margin-right: 1rem;
}


.entry {
  border-bottom: 1px solid #000;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
}

/* Editable pixel grid (Fieldwork) */
/* Editable pixel grid (Fieldwork) */
#pixelGrid {
  display: grid;
  grid-template-columns: repeat(16, 16px);
  gap: 0;
  margin: 1rem 0;

  width: 256px;
  height: 256px;

  position: relative; /* ✅ NODIG VOOR CLICK-LAYERING */

  background-image:
    linear-gradient(#381109 1px, transparent 1px),
    linear-gradient(90deg, #381109 1px, transparent 1px);
  background-size: 16px 16px;

  outline: 1px solid #381109;
  outline-offset: -1px;

  overflow: hidden;
}


/* Static pixel grid (Sidebar + Encyclopedia) */
.pixelGrid.static {
  display: grid;
  grid-template-columns: repeat(16, 16px);
  gap: 0;
  margin: 0;

  width: 256px;
  height: 256px;

  background-image:
    linear-gradient(#381109 1px, transparent 1px),
    linear-gradient(90deg, #381109 1px, transparent 1px);
  background-size: 16px 16px;

  outline: 1px solid #381109;
  outline-offset: -1px;

  overflow: hidden;
}


/* Individual pixel */
.pixel {
  width: 16px;
  height: 16px;
  position: relative;
  background: transparent;

  pointer-events: auto; /* ✅ DIT FIXT HET TEKENEN */
  cursor: pointer;
  z-index: 1;
}


/* Disable clicking in static grids */
.pixelGrid.static .pixel {
  pointer-events: none;
}



.pixel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color, #000);
  transform: rotate(var(--rot, 0deg));
  transform-origin: center;
  opacity: 0;
}


.pixel.square::before {
  clip-path: inset(0);
  opacity: 1;
}

.pixel.triangle::before {
  clip-path: polygon(0 0, 100% 0, 0 100%);
  opacity: 1;
}

.pixel.quarter::before {
  clip-path: circle(100% at 0 0);
  opacity: 1;
}

.grid-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0.25rem;
  flex-wrap: wrap;
}

.grid-toolbar button {
  font-family: inherit;
  border: 1px solid #000;
  background: #fff;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.grid-toolbar button:hover {
  background: #ddd;
}

.tool-label {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-right: 0.25rem;
}

.legend {
  font-size: 0.8rem;
  opacity: 0.75;
}

.intro {
  max-width: 600px;
  font-style: italic;
}


#searchInput {
  width: 100%;
  padding: 0.7rem 0.8rem;
  margin: 0.5rem 0 1.5rem; /* closer to title */
  font-size: 1rem;
  font-family: "Cabin", sans-serif;

  border: none;
  outline: none;
  background: transparent;

  box-shadow:
    inset 6px 0 0 #000,
    inset -6px 0 0 #000,
    inset 0 2px 0 #000,
    inset 0 -2px 0 #000;
}



#azIndex {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.5rem;
}


#azIndex a {
  text-decoration: none;
  padding: 2px 6px;
  border: 1px solid #000;
  color: #000;
}


#azIndex a.inactive {
  opacity: 0.3;
  pointer-events: none;
}

.page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;               /* ← SPACE BETWEEN COLUMNS */
  min-height: 100vh;
  border-left: 2px solid #000;
  padding: 2rem 3rem;      /* ← SPACE FROM SCREEN EDGE */
  box-sizing: border-box;
}


.sidebar {
  padding: 2rem 1.5rem;
  border-right: 1px solid #000; /* lighter divider */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 0.9rem;
}


.sidebar-title {
  font-size: 1.1rem;
  line-height: 1.1;
  text-transform: lowercase;
  margin: 0;
}

.sidebar-text {
  line-height: 1.4;
}

.sidebar-box {
  height: 160px;
  border: 2px solid #000;
  margin: 1rem 0;
  padding: 0.5rem;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* shrink preview grid to fit sidebar */
.sidebar-box .pixelGrid {
  transform: scale(0.6);
  transform-origin: center;
}

.sidebar-button {
  display: block;
  padding: 0.8rem;
  background: #d0d0d0;
  border: 2px solid #000;
  font-weight: 600;
  text-align: left;
  cursor: default;
}

.sidebar-link {
  display: block;
  padding: 0.6rem;
  border: 2px solid #000;
  text-decoration: none;
  color: #000;
}

.content {
  padding: 2rem 3rem;
}

.content h1 {
  margin-top: 0;
}

/* ---------- PAGE-LIKE ENCYCLOPEDIA ---------- */

/* Header stays fixed (already exists, reinforced) */
.encyclopedia-header {
  position: sticky;
  top: 0;
  background: #e6e6e6;
  border-bottom: 2px solid #000;
  z-index: 10;
}

/* Centered encyclopedia header column */
.encyclopedia-header-inner {
  max-width: 900px;          /* controls how centered/narrow it feels */
  margin: 0 auto;            /* centers it */
  padding: 2rem 0 1.5rem;    /* vertical spacing */
}

/* Title alignment */
.encyclopedia-header-inner h1 {
  margin: 0 0 1rem 0;
}

/* Narrower search bar */
#searchInput {
  max-width: 600px;          /* ← THIS fixes the over-wide search */
  display: block;
}

/* Center the A–Z index under the search */
#azIndex {
  max-width: 900px;
}

.back-to-fieldwork {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: #000;
  border-bottom: 1px solid #000;
  padding-bottom: 2px;
  width: fit-content;
}

.back-to-fieldwork:hover {
  opacity: 0.6;
}


body {
  background:
    radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0),
    #e6e6e6;
  background-size: 4px 4px;
}

.corner-label {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  font-size: 1.4rem; /* almost double */
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}


#encyclopediaPage {
  height: calc(100vh - 260px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;

  padding-top: 2rem;
  padding-bottom: 4rem;   /* ← breathing room at the end */
  padding-right: 3rem;
}

.encyclopedia-page-inner {
  max-width: 900px;       /* matches header width */
  margin: 0 auto;         /* center it */
  padding-bottom: 2rem;   /* extra calm at the end */
}

/* ---------- ENCYCLOPEDIA PAGE LAYOUT ---------- */


/* Single encyclopedia entry */
.encyclopedia-entry {
  display: grid;
  grid-template-columns: 20px 260px 1fr;
  column-gap: 4.5rem;
    --dot-offset: calc(-6px + (12px * var(--rand)));
}


.entry-visual .pixelGrid {
  margin-bottom: 0.3rem;
} 

.entry-meta {
  padding-top: 0.5rem;
}

/* Seen-in-the-wild checkbox */
.spotted-box {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.spotted-box input {
  width: auto;
  margin: 0;
  accent-color: #000;
}

.spotted-count {
  font-size: 1.05rem;
}


.entry-visual {
  display: flex;
  flex-direction: column;
  gap: 0;
}


.entry-visual .name,
.entry-visual .latin {
  background: #cfcfcf;
  padding: 0.25rem 0.4rem;
  width: 220px; /* matches grid column */
  box-sizing: border-box;
}


.entry-visual .name {
  font-weight: bold;
}

.entry-visual .latin {
  font-style: italic;
  font-size: 0.85em;
}

.entry-meta {
  text-transform: lowercase;
}

/* Meta text */
.entry-meta p {
  margin: 0.25rem 0;
  line-height: 1.35;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

/* Labels (Habitat, Response, etc.) */
.entry-meta strong {
  font-weight: 800; /* Cabin Medium */
  letter-spacing: 0.01em;
}

/* Answers (player-entered text) */
.entry-meta .entry-value {
  font-weight: 400; /* Cabin Regular */
}

.entry-dot {
  width: 10px;
  height: 10px;
  background: #000;
  border-radius: 50%;
  position: relative;
  top: calc(var(--dot-offset, 0px));
}


/* Pagination */
.page-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
}

.page-nav button {
  padding: 0.3rem 0.8rem;
}

/* Vertical page navigation */
.page-nav-vertical {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-nav-vertical button {
  width: 40px;
  height: 80px;
  font-size: 2rem;
  background: transparent;
  border: 2px solid #000;
  cursor: pointer;
}

#pageIndicator {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.9rem;
}


