:root {
  --ink: #243e34;
  --muted: #65716a;
  --line: #dfe4de;
  --paper: #fafbf8;
  --green: #365c47;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #9d722f;
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 10;
  background: white;
  padding: 12px;
}
.skip-link:focus {
  top: 12px;
}

main {
  max-width: 1248px;
  margin: auto;
  padding: 0 32px 48px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 36px 0 24px;
}
h1 {
  font:
    48px/1.1 Georgia,
    serif;
  margin: 0;
  letter-spacing: -1px;
}
.quiz-link {
  font-size: 14px;
  text-decoration: none;
}
.quiz-link span {
  margin-left: 8px;
}
#bird-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 290px) auto;
  gap: 16px;
  align-items: end;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
input[type='search'],
select {
  width: 100%;
  height: 48px;
  border: 1px solid #cdd6cd;
  background: white;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  min-width: 0;
}
select {
  text-overflow: ellipsis;
}
button {
  color: var(--ink);
  border: 1px solid #cdd6cd;
  background: white;
  border-radius: 6px;
  padding: 11px 18px;
  min-height: 44px;
}
button:hover:not(:disabled) {
  background: #edf2ea;
}
#reset-filters {
  height: 48px;
}
.catalog-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.catalog-status p {
  margin: 0;
}
.photo-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
}
.photo-filter input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}
.bird-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 20px;
}
.bird-card {
  min-width: 0;
}
.bird-image-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  aspect-ratio: 4/3;
  background: #e9eee5;
  position: relative;
}
.bird-image-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.bird-image-button:hover img {
  transform: scale(1.025);
}
.image-status {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px;
  font-size: 13px;
  color: var(--muted);
}
.bird-card h2 {
  font-size: 16px;
  line-height: 1.4;
  margin: 12px 0 2px;
  font-weight: 600;
}
.bird-name {
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  text-align: left;
  border-radius: 0;
  font: inherit;
}
.bird-name:hover:not(:disabled) {
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.scientific {
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  overflow-wrap: anywhere;
}
.bird-family {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
.card-credit {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}
.card-credit a {
  text-decoration: none;
}
.card-credit a:hover {
  text-decoration: underline;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 38px 0 20px;
  font-size: 13px;
}
.source-note {
  font-size: 12px;
  color: var(--muted);
  margin: 28px 0 0;
}
#catalog-error,
#empty-catalog {
  padding: 36px 0;
  color: var(--muted);
}
footer {
  max-width: 1184px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}
footer p {
  margin: 0;
}
#bird-profile {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(960px, calc(100% - 40px));
  max-height: 90dvh;
  overflow: auto;
}
#bird-profile::backdrop {
  background: rgba(15, 30, 22, 0.6);
}
.close-profile {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px -56px 0;
  z-index: 2;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 28px;
  border-radius: 50%;
  box-shadow: 0 2px 10px #0001;
}
.profile-layout {
  display: grid;
  grid-template-columns: 44% minmax(0, 1fr);
  min-height: 450px;
}
.profile-media {
  padding: 24px 0 24px 24px;
  min-width: 0;
}
.profile-media img {
  display: block;
  width: 100%;
  max-height: 470px;
  object-fit: contain;
  border-radius: 7px;
  background: #e9eee5;
}
.profile-media .image-status {
  min-height: 240px;
  background: #e9eee5;
  border-radius: 7px;
}
.profile-body {
  padding: 32px 32px 32px 28px;
  min-width: 0;
}
.profile-body h2 {
  font:
    32px/1.15 Georgia,
    serif;
  margin: 4px 28px 8px 0;
}
.profile-body h3 {
  font-size: 14px;
  margin: 24px 0 6px;
}
.profile-body p {
  font-size: 14px;
  line-height: 1.75;
}
.profile-body .scientific {
  font-size: 15px;
}
.profile-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 20px;
  margin: 24px 0;
  font-size: 13px;
}
.profile-facts dt {
  color: var(--muted);
}
.profile-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.profile-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 24px 0 0;
  font-size: 14px;
  font-weight: 600;
}
.wiki-credit {
  font-size: 11px !important;
  color: var(--muted);
}
audio {
  width: 100%;
  height: 42px;
  margin-top: 6px;
}
.audio-credit {
  font-size: 11px !important;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .bird-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  footer {
    margin: 0 32px;
  }
}
@media (max-width: 700px) {
  main {
    padding: 0 20px 32px;
  }
  .page-heading {
    padding: 28px 0 22px;
  }
  h1 {
    font-size: 40px;
  }
  .quiz-link {
    font-size: 12px;
  }
  #bird-filters {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .search-field {
    grid-column: 1/-1;
  }
  .bird-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 14px;
  }
  .bird-card h2 {
    font-size: 14px;
  }
  .scientific {
    font-size: 12px;
  }
  .bird-family {
    font-size: 11px;
  }
  .card-credit {
    font-size: 9px;
  }
  .catalog-status {
    font-size: 12px;
  }
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-media {
    padding: 20px 20px 0;
  }
  .profile-media img {
    max-height: 300px;
  }
  .profile-body {
    padding: 20px;
  }
  .profile-body h2 {
    font-size: 30px;
  }
  #bird-profile {
    width: calc(100% - 24px);
    max-height: 94dvh;
  }
  .pagination {
    gap: 14px;
  }
  .pagination button {
    padding: 10px 12px;
  }
  footer {
    margin: 0 20px;
    flex-direction: column;
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bird-image-button img {
    transition: none;
  }
}

@media (max-width: 360px) {
  .pagination {
    gap: 8px;
    font-size: 12px;
  }
  .pagination button {
    padding: 10px 8px;
    font-size: 12px;
  }
}

.bird-image-button:hover img[style] {
  transform: none;
}
