@import url('featured.css');

:root {
  --max-width: 1200px;
  --header-height: 40px;

  --offset-x: 0.25rem;
  --offset-y: 0.25rem;
  --blur-radius: 0.25rem;
  --spread-radius: 0;
  --box-shadow: var(--offset-x) var(--offset-x) var(--blur-radius) black;
  --text-shadow: 0 0 1em var(--primary-color-light);

  --primary-color-light: hsl(75deg 100% 85%);
  --primary-color: hsl(75deg 61% 48%);
  --primary-color-dark: hsl(75deg 61% 22%);
  --secondary-color-light: hsl(232deg 100% 85%);
  --secondary-color: hsl(232deg 61% 48%);
  --secondary-color-dark: hsl(232deg 61% 22%);
  --action-color-light: hsl(75deg 100% 85%);
  --action-color-bright: hsl(62deg 100% 65%);
  --action-color: hsl(15deg 61% 25% / 75%);
  --action-color: #672c19;
  --action-color-active: hsl(15deg 61% 25% / 100%);
  --action-color-dark: hsl(15deg 61% 10% / 100%);
  --action-color-current: hsl(0deg 61% 48%);
  --background-color: #e9f7e5;
  --gradient: linear-gradient(3deg, #2c621e 0%, #2c621e 33.5%, var(--primary-color) 120%);
  --font-family: "Nunito", "Roboto", Arial, sans-serif;
  --header-font-family: "Raleway", Arial, sans-serif;
  --border: 0.125em solid black;
}

/* ── Reset & base ────────────────────────────────────────────────────────── */

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

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: #222;
  background: var(--background-color);
}

a {
  color: var(--action-color);
  /* text-decoration: none; */
}

a:hover {
  text-decoration: underline;
}

em {
  font-style: italic;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--header-font-family);
}

button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

::selection {
  background-color: var(--action-color-bright);
}

.site-header {
  background: var(--gradient);
  height: var(--header-height);
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  justify-content: center;
}

.site-header .content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0;
  padding-right: 1em;
  width: var(--max-width);
  max-width: var(--max-width);
  min-width: 350px;
}

.site-title {
  display: inline-block;
  width: 262px;
  height: var(--header-height);
}

/* 
.site-title:hover {
  text-decoration: none;
  opacity: 0.85;
}
 */

/* .site-header nav {
  font-size: 20px;
} */

.breadcrumb {
  padding: 0.5rem 2rem;
}

.breadcrumb a {
  color: var(--action-color);
}

main {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  margin-top: var(--header-height);
  margin-bottom: calc(var(--header-height) + 1em);
  padding-left: 1em;
  padding-right: 1em;
}

main>h1,
.static-page>h1 {
  position: sticky;
  top: var(--header-height);
  background: linear-gradient(3deg, hsl(15deg 61% 35%) 0%, hsl(15deg 61% 30%) 33.5%, var(--action-color-active) 120%);
  color: var(--primary-color-light);
  font-size: 1.25em;
  padding: 0.125em;
  padding-left: 0.5em;
  margin-left: -1em;
  margin-right: -1em;
  border: var(--border);
  /* padding: 0; */
  /* border-bottom: var(--primary-border);
  border-left: var(--primary-border);
  border-right: var(--primary-border); */
}

main p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  line-height: 120%;
}

.site-footer {
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  padding-left: 1em;
  padding-right: 1em;
  position: fixed;
  background: var(--gradient);
  height: var(--header-height);
}

.static-page.features img,
.static-page.order img {
  float: right;
  border: var(--border);
  width: 40vw;
}

.static-page ul {
  padding-left: 1em;
}

.static-page dt {
  font-weight: bold;
}

.static-page dd {
  padding-left: 1em;
}

.static-page table {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.static-page.home>h1 {
  display: none;
}

.static-page.references ul,
#list>ol {
  column-count: auto;
  column-width: 18em;
  display: block;
}

#list li>a~p {
  display: none;
}

#list .sep {
  font-size: 1.5em;
  color: var(--action-color-light);
  background: var(--gradient);
  padding-left: 0.5em;
}

#list>ol>li {
  padding-left: 0.5em;
  padding-right: 0.5em;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.gallery-intro,
.genus-count,
.species-count,
.search-result-count {
  color: #666;
  margin-bottom: 1.5rem;
}


.site-header {
  font-family: var(--header-font-family);
  align-items: center;
}

.site-title {
  color: #00000000;
  font-size: 1.25rem;
  font-weight: bold;
  background-image: url('/images/xidservices.png');
  background-repeat: no-repeat;
  background-size: contain;
}

.site-footer {
  color: var(--primary-color-light);
  font-size: 0.8rem;
  font-family: var(--header-font-family);
  font-weight: bold;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
}

/* ── Alphabet index ──────────────────────────────────────────────────────── */

.alpha-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.alpha-index__letter {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 3rem;
  padding: 0.4rem 0;
  border: 1px solid #c8d8c8;
  border-radius: 4px;
  background: #fff;
  color: #2c4a2c;
  transition: background 0.15s;
}

.alpha-index__letter:hover {
  background: #e8f0e8;
  text-decoration: none;
}

.alpha-index__char {
  font-size: 1.1rem;
  font-weight: bold;
}

.alpha-index__count {
  font-size: 0.7rem;
  color: #888;
}

/* ── Search form ─────────────────────────────────────────────────────────── */

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  max-width: 480px;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

.search-form input[type="search"]:focus {
  outline: 2px solid #3a6e3a;
  outline-offset: 1px;
}

.search-form button {
  padding: 0.5rem 1rem;
  background: #3a6e3a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

.search-form button:hover {
  background: #2c4a2c;
}

.search-no-results {
  color: #888;
}

/* ── Card grids ──────────────────────────────────────────────────────────── */

.genus-grid,
.species-grid,
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  list-style: none;
  margin-bottom: 2rem;
}

.genus-card a,
.species-card a,
.featured-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  color: inherit;
}

.genus-card a:hover,
.species-card a:hover,
.featured-card a:hover {
  text-decoration: none;
  opacity: 0.85;
}

.genus-card img,
.species-card img,
.featured-card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  background: #e8e8e4;
}

.no-image {
  width: 100px;
  height: 100px;
  border-radius: 4px;
  background: #e8e8e4;
}

.genus-name {
  font-size: 0.9rem;
  font-style: italic;
}

.species-name {
  font-size: 0.85rem;
}

.species-count {
  font-size: 0.75rem;
  color: #888;
}

/* ── Featured section ────────────────────────────────────────────────────── */

.featured-section h2 {
  margin-bottom: 1rem;
}

.featured-card__name {
  font-size: 0.8rem;
  color: #444;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Species page ────────────────────────────────────────────────────────── */

.species-description {
  max-width: 680px;
  margin-bottom: 2rem;
  color: #333;
  white-space: pre-wrap;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  list-style: none;
}

.image-card img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.image-card--featured img {
  outline: 2px solid #3a6e3a;
  outline-offset: 2px;
}

.image-caption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #666;
}

/* ── Alpha jump (letter page back link) ──────────────────────────────────── */

.alpha-jump {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  main {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .genus-grid,
  .species-grid,
  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
}

/* ── Static pages ─────────────────────────────────────────────────────────── */


/* ── Site nav ─────────────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-nav {
  display: flex;
  /* gap: 2em; */
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  height: var(--header-height);
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}

.site-nav__item {
  margin-left: 2em;
  list-style: none;
  height: var(--header-height);
}

.site-nav__item a {
  text-decoration: none;
  color: var(--primary-color-light);
  font-weight: bold;
  font-size: 1em;
  transition: background 0.15s, color 0.15s;
  line-height: 200%;
  white-space: nowrap;
}

.site-nav__item a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
}

.site-nav__item:first-child,
.site-nav-drop__item:first-child {
  display: none;
}

.site-nav-drop {
  position: absolute;
  z-index: 1000;
  top: 100%;
  right: 1em;
  background: var(--action-color-light);
  list-style: none;
  border: var(--border);
  padding: 1em;
}

.site-nav-drop a {
  text-decoration: none;
  color: var(--action-color);
  font-weight: bold;
  font-size: 1.25em;
  line-height: 200%;
  white-space: nowrap;
}

.site-nav-drop__control {
  height: var(--header-height);
  margin-left: 1em;
}

.site-nav-drop__control svg .foreground {
  fill: var(--action-color);
}

.site-nav-drop__control svg .background {
  fill: transparent;
}

nav.hidden {
  display: none;
}

/* ── Image page ───────────────────────────────────────────────────────────── */

.image-page {
  max-width: 960px;
}

.image-page__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.image-page__back {
  color: #3a6e3a;
}

.image-page__count {
  color: #888;
}

.image-page__figure {
  margin: 0 0 1rem;
}

.image-page__img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.image-page__caption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: #555;
  font-style: italic;
}

.image-page__flags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.image-flag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.image-flag--featured {
  background: #e8f0e8;
  color: #3a6e3a;
}

.image-flag--key {
  background: #f0ece0;
  color: #7a6020;
}

.image-flag--album-key {
  background: #e8f0f8;
  color: #204070;
}

.image-page__nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.image-page__nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  max-width: 48%;
  transition: background 0.15s;
}

.image-page__nav-btn:hover {
  background: #f0f0ec;
  text-decoration: none;
}

.image-page__nav-btn--next {
  flex-direction: row-reverse;
}

.image-page__nav-btn--disabled {
  color: #bbb;
  border-color: #eee;
  max-width: 48%;
  padding: 0.5rem;
}

.image-page__nav-btn img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Alpha jump (letter page back link) ──────────────────────────────────── */

.alpha-jump {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  main {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .genus-grid,
  .species-grid,
  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }

  .site-nav {
    display: none;
  }

  .blocks {
    grid-template-columns: 1fr;
  }
}

/* ── Search match hint ────────────────────────────────────────────────────── */
.search-match-hint {
  font-size: 0.7rem;
  color: #888;
  font-style: italic;
  margin-top: 0.1rem;
}

.search-status {
  font-size: 0.85rem;
  color: #888;
  min-height: 1.4em;
  margin-bottom: 0.5rem;
}