:root {
  --ink: #222;
  --muted: #666;
  --line: #d0d0cc;
  --line-dark: #8c8c86;
  --paper: #fff;
  --soft: #f5f5f1;
  --header: #2e332d;
  --link: #24567a;
  --clean: #2f663d;
  --unclean: #8a332d;
  --shell: 1000px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: var(--link); }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: #1f211e; }
.shell { width: min(calc(100% - 32px), var(--shell)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.placeholder { display: grid; place-items: center; background: #ecece7; color: #777; font-family: Georgia, "Times New Roman", serif; }

.site-header { background: var(--header); border-bottom: 1px solid #1c201b; }
.header-row { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 21px; text-decoration: none; white-space: nowrap; }
.primary-nav { display: flex; gap: 22px; }
.primary-nav a { color: #efefeb; font-size: 12px; text-decoration: none; }
.primary-nav a:hover { text-decoration: underline; }

.home-page { padding: 32px 0 48px; }
.home-heading { max-width: 780px; }
.home-heading h1 { margin: 0; font-size: 34px; line-height: 1.15; font-weight: normal; }
.home-heading p { margin: 8px 0 0; color: #555; font-size: 15px; }
.hero-search { margin-top: 19px; max-width: 720px; }
.search-box { position: relative; display: flex; }
.search-box input { width: 100%; height: 39px; padding: 7px 10px; border: 1px solid #999; border-right: 0; border-radius: 0; background: #fff; }
.search-box button { width: 86px; border: 1px solid #555; border-radius: 0; background: #555; color: #fff; font-weight: bold; }
.search-box button:hover { background: #444; }
.search-box input:focus, .filters input:focus, .filters select:focus { outline: 2px solid #9ba99a; outline-offset: 1px; }
.search-suggestions { position: absolute; z-index: 20; top: 39px; left: 0; width: calc(100% - 86px); border: 1px solid #999; background: #fff; }
.suggestion { display: flex; align-items: center; gap: 12px; padding: 7px 9px; border-bottom: 1px solid #ddd; color: var(--ink); text-decoration: none; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover { background: #f3f3ef; }
.suggestion strong { font-size: 13px; }
.suggestion small { color: var(--muted); }
.suggestion .status { margin-left: auto; }

.home-columns { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 42px; margin-top: 34px; align-items: start; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; border-bottom: 2px solid #555; padding-bottom: 5px; margin-bottom: 0; }
.section-heading h2 { margin: 0; font-size: 21px; font-weight: normal; }
.section-heading a { font-size: 12px; }
.lookup-list { border-bottom: 1px solid var(--line); }
.lookup-row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.lookup-row:last-child { border-bottom: 0; }
.lookup-row:hover strong { text-decoration: underline; }
.lookup-thumb { width: 76px; height: 56px; overflow: hidden; border: 1px solid #bbb; }
.lookup-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lookup-thumb.placeholder span { font-size: 25px; }
.lookup-title { display: flex; align-items: baseline; gap: 8px; }
.lookup-title strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: normal; }
.lookup-copy p { margin: 3px 0 0; color: #5b5b58; font-size: 12px; line-height: 1.4; }
.status { font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: .02em; }
.status-clean { color: var(--clean); }
.status-unclean { color: var(--unclean); }

.home-sidebar { font-size: 12px; }
.reference-box { border-top: 2px solid #555; padding-top: 7px; }
.reference-box + .reference-box { margin-top: 28px; }
.reference-box h2 { margin: 0 0 8px; font-size: 17px; font-weight: normal; }
.reference-box p { margin: 7px 0; color: #555; }
.rule-list { margin: 0; }
.rule-list div { padding: 7px 0; border-bottom: 1px solid var(--line); }
.rule-list dt { font-weight: bold; color: #333; }
.rule-list dd { margin: 1px 0 0; color: #666; }
.reference-note { padding-top: 3px; }

.page-wrap { padding: 27px 0 48px; }
.page-title-row { border-bottom: 1px solid var(--line-dark); padding-bottom: 10px; }
.page-title-row h1 { margin: 0; font-size: 29px; font-weight: normal; }
.page-title-row p { margin: 4px 0 0; color: #666; }
.filters { display: flex; align-items: end; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.filters > div { min-width: 145px; }
.filters .filter-search { flex: 1 1 330px; }
.filters label { display: block; margin-bottom: 3px; color: #555; font-size: 11px; font-weight: bold; }
.filters input, .filters select { width: 100%; height: 34px; border: 1px solid #999; border-radius: 0; background: #fff; padding: 5px 7px; }
.filters button { height: 34px; padding: 0 14px; border: 1px solid #555; border-radius: 0; background: #555; color: #fff; font-weight: bold; }
.clear-filter { align-self: center; font-size: 12px; margin-left: 2px; }
.results-head { display: flex; align-items: baseline; gap: 7px; padding: 13px 0 6px; border-bottom: 2px solid #555; }
.results-head h2 { margin: 0; font-size: 19px; font-weight: normal; }
.results-head span { color: #666; font-size: 12px; }
.result-list { border-bottom: 1px solid var(--line); }
.result-row { display: grid; grid-template-columns: 82px minmax(0,1fr) 120px; gap: 13px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.result-row:last-child { border-bottom: 0; }
.result-row:hover h3 { text-decoration: underline; }
.result-thumb { width: 82px; height: 61px; border: 1px solid #bbb; overflow: hidden; }
.result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-thumb.placeholder span { font-size: 25px; }
.result-title-line { display: flex; align-items: baseline; gap: 9px; }
.result-title-line h3 { margin: 0; font-size: 18px; font-weight: normal; line-height: 1.15; }
.scientific { margin: 1px 0 3px; color: #777; font-family: Georgia, "Times New Roman", serif; font-size: 12px; font-style: italic; }
.scientific.large { margin: 2px 0 6px; font-size: 14px; }
.result-main > p:last-child { margin: 2px 0 0; color: #555; font-size: 12px; }
.result-meta { display: flex; flex-direction: column; gap: 3px; color: #777; font-size: 11px; text-align: right; }
.empty-state { padding: 24px 0; }
.empty-state h2 { margin: 0; font-size: 21px; font-weight: normal; }
.empty-state p { margin: 5px 0 0; color: #666; }

.breadcrumb { margin: 0 0 13px; color: #777; font-size: 11px; }
.breadcrumb a { color: var(--link); }
.animal-header { display: grid; grid-template-columns: 290px minmax(0,1fr); gap: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line-dark); }
.animal-photo { width: 290px; height: 217px; border: 1px solid #aaa; overflow: hidden; }
.animal-photo img { width: 100%; height: 100%; object-fit: cover; }
.animal-photo.placeholder span { font-size: 60px; }
.category-line { margin: 0 0 3px; color: #777; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.animal-intro h1 { margin: 0; font-size: 38px; line-height: 1.1; font-weight: normal; }
.classification-text { margin: 7px 0 0; font-size: 14px; font-weight: bold; letter-spacing: .04em; }
.classification-text.clean { color: var(--clean); }
.classification-text.unclean { color: var(--unclean); }
.animal-summary { max-width: 600px; margin: 9px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.45; }
.quick-record { display: flex; gap: 26px; margin: 0; font-size: 12px; }
.quick-record div { display: flex; gap: 5px; }
.quick-record dt { color: #777; }
.quick-record dd { margin: 0; font-weight: bold; }
.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 230px; gap: 44px; padding-top: 25px; }
.article-section { margin-bottom: 28px; }
.article-section h2 { margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line-dark); font-size: 21px; font-weight: normal; }
.article-section > p { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; }
.trait-list { margin: 13px 0 0; border-top: 1px solid var(--line); }
.trait-list div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.trait-list dt { color: #777; font-size: 11px; }
.trait-list dd { margin: 0; }
.reference-list { list-style: none; margin: 0; padding: 0; }
.reference-list li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.reference-list li:first-child { border-top: 1px solid var(--line); }
.note { color: #777 !important; font-family: Arial, Helvetica, sans-serif !important; font-size: 11px !important; }
.terms-line { font-family: Arial, Helvetica, sans-serif !important; font-size: 13px !important; color: #444; }
.related-panel { border-top: 2px solid #555; padding-top: 6px; }
.related-panel h2 { margin: 0 0 5px; font-size: 17px; font-weight: normal; }
.related-panel ul { list-style: none; margin: 0; padding: 0; }
.related-panel li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.related-panel li .status { float: right; }

.document-page { max-width: 760px; padding: 30px 0 50px; }
.document-header { padding-bottom: 10px; margin-bottom: 18px; border-bottom: 1px solid var(--line-dark); }
.document-header h1 { margin: 0; font-size: 30px; font-weight: normal; }
.document-header p { margin: 5px 0 0; color: #666; }
.document-page > section { margin-bottom: 23px; }
.document-page h2 { margin: 0 0 5px; font-size: 21px; font-weight: normal; }
.document-page p { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; }
.document-page .lead { font-size: 17px; }
.document-page .reference { color: #4c6a4f; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }

.site-footer { margin-top: 20px; border-top: 1px solid #b8b8b3; background: #f1f1ed; }
.site-footer p { margin: 0; padding: 16px 0; color: #777; font-size: 11px; }

@media (max-width: 800px) {
  .home-columns, .article-layout { grid-template-columns: 1fr; }
  .home-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .reference-box + .reference-box { margin-top: 0; }
  .animal-header { grid-template-columns: 230px minmax(0,1fr); gap: 20px; }
  .animal-photo { width: 230px; height: 173px; }
  .filters { flex-wrap: wrap; }
  .filters .filter-search { flex-basis: 100%; }
}

@media (max-width: 620px) {
  .shell { width: min(calc(100% - 22px), var(--shell)); }
  .header-row { height: auto; min-height: 55px; display: block; padding: 12px 0 9px; }
  .brand { display: block; font-size: 19px; }
  .primary-nav { margin-top: 7px; gap: 15px; }
  .home-page { padding-top: 23px; }
  .home-heading h1 { font-size: 29px; }
  .home-columns { margin-top: 27px; }
  .home-sidebar { display: block; }
  .reference-box + .reference-box { margin-top: 24px; }
  .filters > div { flex: 1 1 calc(50% - 10px); }
  .filters .filter-search { flex-basis: 100%; }
  .result-row { grid-template-columns: 66px minmax(0,1fr); gap: 10px; }
  .result-thumb { width: 66px; height: 50px; }
  .result-meta { grid-column: 2; flex-direction: row; gap: 9px; text-align: left; }
  .animal-header { grid-template-columns: 1fr; }
  .animal-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; max-width: 420px; }
  .animal-intro h1 { font-size: 32px; }
  .quick-record { display: block; }
  .quick-record div { margin-top: 3px; }
}

/* Scripture references */
.scripture-link {
  color: #2f5d36;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.scripture-link:hover { color: #183a1e; }
.reference-list .scripture-link { font-weight: bold; }

/* Internal Bible reader */
.bible-page { max-width: 820px; padding: 27px 0 52px; }
.bible-header { padding-bottom: 10px; border-bottom: 1px solid var(--line-dark); }
.bible-header h1 { margin: 0; font-size: 30px; font-weight: normal; }
.bible-header p { margin: 5px 0 0; color: #666; font-size: 13px; }
.bible-testaments { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-top: 22px; }
.bible-testaments h2 { margin: 0 0 7px; padding-bottom: 5px; border-bottom: 1px solid var(--line-dark); font-size: 20px; font-weight: normal; }
.book-list { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 26px; }
.book-list li { break-inside: avoid; padding: 3px 0; font-size: 13px; }
.chapter-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.chapter-nav { display: flex; justify-content: flex-end; gap: 18px; font-size: 11px; white-space: nowrap; }
.bible-text { max-width: 720px; padding-top: 20px; }
.bible-verse { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; margin: 0; padding: 5px 7px 5px 0; font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.55; scroll-margin-top: 14px; }
.bible-verse.referenced { background: #fff4c9; border-left: 3px solid #c3a23c; padding-left: 7px; }
.verse-number { color: #777; font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; line-height: 2.25; text-align: right; text-decoration: none; }
.verse-number:hover { color: var(--link); text-decoration: underline; }
.chapter-nav-bottom { max-width: 720px; justify-content: space-between; margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line-dark); }

@media (max-width: 620px) {
  .primary-nav { flex-wrap: wrap; row-gap: 4px; }
  .bible-testaments { grid-template-columns: 1fr; gap: 28px; }
  .book-list { columns: 2; }
  .chapter-heading { display: block; }
  .chapter-heading .chapter-nav { justify-content: flex-start; margin-top: 9px; }
  .bible-verse { grid-template-columns: 24px minmax(0, 1fr); gap: 7px; font-size: 15px; }
}

/* Food-to-animal search */
.food-match-section { margin-top: 24px; }
.food-result-list { border-top: 1px solid var(--line-dark); }
.food-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 165px;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}
.food-result-link {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 7px 0;
  color: inherit;
  text-decoration: none;
}
.food-result-link:hover strong { text-decoration: underline; }
.food-result-copy { display: block; min-width: 0; }
.food-result-copy strong { display: block; color: var(--link); font-size: 17px; font-weight: normal; }
.food-result-copy small { display: block; margin-top: 3px; color: #6c6c69; font-size: 11px; }
.food-status-cell { text-align: right; }
.questionable-label {
  display: block;
  margin-top: 4px;
  color: #806717;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.question-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 3px;
  border: 1px solid #9b8537;
  border-radius: 50%;
  color: #6f5c16;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  text-decoration: none;
  vertical-align: -1px;
}
.question-mark:hover { background: #fff3c7; color: #4e410f; }
.animal-results-head { margin-top: 26px; }

/* Food context on the animal profile */
.selected-food-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 175px;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
  padding: 7px 0;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.selected-food-thumb { width: 76px; height: 56px; overflow: hidden; border: 1px solid #bbb; }
.selected-food-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selected-food-thumb.placeholder { display: flex; align-items: center; justify-content: center; background: #efefea; }
.selected-food-copy { min-width: 0; }
.selected-food-copy > * { display: block; }
.selected-food-label { margin-bottom: 2px; color: #777; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.selected-food-copy strong { font-size: 17px; font-weight: normal; }
.selected-food-copy > span:last-child { margin-top: 2px; color: #666; font-size: 11px; }
.selected-food-status { text-align: right; }
.sinew-inline-note { border-left: 3px solid #b49a45; padding-left: 12px; }
.sinew-page strong { letter-spacing: .02em; }

/* Autocomplete: food results are visually distinct without becoming card UI. */
.suggestion { align-items: center; }
.suggestion-thumb {
  flex: 0 0 auto;
  width: 50px;
  height: 38px;
  border: 1px solid #ccc;
  object-fit: cover;
}
.suggestion-copy { min-width: 0; flex: 1 1 auto; }
.suggestion-copy strong, .suggestion-copy small { display: block; }
.suggestion-copy small { margin-top: 2px; color: #777; font-size: 10px; }
.suggestion-status { margin-left: auto; text-align: right; }
.suggestion-questionable { display: block; margin-top: 3px; color: #806717; font-size: 9px; text-transform: uppercase; }

@media (max-width: 620px) {
  .food-result-row { grid-template-columns: minmax(0, 1fr) 104px; gap: 9px; }
  .food-result-link { grid-template-columns: 66px minmax(0, 1fr); gap: 10px; }
  .food-result-copy strong { font-size: 15px; }
  .selected-food-row { grid-template-columns: 64px minmax(0, 1fr); }
  .selected-food-thumb { width: 64px; height: 48px; }
  .selected-food-status { grid-column: 2; text-align: left; }
  .selected-food-status .questionable-label { display: inline-block; margin: 0 0 0 7px; }
}

/* Species-level fish results */
.fish-match-section { margin-top: 26px; }
.fish-index-page .page-title-row p { max-width: 760px; }
.fish-filters #fish-family { min-width: 150px; }
.fish-result-row .result-main > p:last-child { color: #666; font-size: 11px; }
.more-results { margin: 9px 0 0; font-size: 12px; }
.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding-top: 11px;
  border-top: 1px solid var(--line-dark);
  font-size: 12px;
}
.pagination a:last-child { text-align: right; }
.pagination > span:nth-child(2) { color: #666; }
.sync-note code {
  padding: 1px 4px;
  border: 1px solid #ccc;
  background: #f4f4f1;
  font-family: Menlo, Monaco, monospace;
  font-size: 12px;
}
.fish-taxonomy div { grid-template-columns: 130px minmax(0, 1fr); }

@media (max-width: 620px) {
  .pagination { grid-template-columns: 1fr 1fr; }
  .pagination > span:nth-child(2) { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .pagination a:first-child { grid-column: 1; }
  .pagination a:last-child { grid-column: 2; }
}

/* Keep footer at bottom of every page */
html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

body > main {
    flex: 1 0 auto;
}

body > footer {
    margin-top: auto;
}
