/* Additions to formate.css for the species catalogue and the image viewer */
body { margin: 0; background: #fff; }
.frame { width: 1000px; max-width: 100%; margin: 0 auto; background: #fff; border-left: 1px solid #330000; border-right: 1px solid #330000; padding: 12px 0 0; box-sizing: border-box; }
.inner { padding: 0 12px; }
.topbar { background: url(../images/balk.gif); text-align: center; line-height: 0; }
.topbar img { border: 0; vertical-align: top; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.line { border: 0; border-top: 1px solid #99cc33; margin: 4px 0 10px; }
.muted { color: #666; }
.error { color: #990000; font-weight: bold; }
footer { margin: 24px 0 16px; }
footer img { vertical-align: middle; border: 0; }

/* list page */
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 4px 0 12px; }
.filters fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 4px; align-items: center; }
.filters legend { float: left; margin-right: 4px; font-weight: bold; }
.btn { font: inherit; font-size: 14px; border: 1px solid #b5b58f; background: #f6f6ea; color: #333300; padding: 5px 10px; cursor: pointer; border-radius: 2px; }
.btn:hover { background: #ebf5d6; }
.btn[aria-pressed="true"] { background: #99cc33; border-color: #7aa526; color: #fff; font-weight: bold; }
.filters input[type=search] { font: inherit; font-size: 15px; padding: 5px 8px; width: 320px; border: 1px solid #b5b58f; }
.notice { background: #f6f6ea; padding: 4px 8px; margin-bottom: 8px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; color: #333300; font-size: 15px; padding: 6px 8px; border-bottom: 1px solid #99cc33; }
table.list td { padding: 5px 8px; vertical-align: top; }
table.list tbody tr:nth-child(even) td { background: #f8f8f0; }
table.list tr.group td { background: none; padding-top: 12px; }
table.list tr.group h2 { margin: 0; }

/* species page */
.jump { margin: 0 0 10px; }
.jump select { font: inherit; font-size: 15px; padding: 3px; }
.chapter { display: grid; grid-template-columns: 380px 1fr; gap: 6px 24px; margin-bottom: 16px; }
.chapter h3 { grid-column: 1 / -1; margin: 0; }
.chapter .text { white-space: pre-line; line-height: 1.45; }
.chapter.wide .text { grid-column: 1 / -1; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.thumbs button { padding: 0; border: 1px solid #ddd; background: none; cursor: zoom-in; line-height: 0; }
.thumbs button:hover, .thumbs button:focus-visible { border-color: #99cc33; outline: 1px solid #99cc33; }
.thumbs img { width: 84px; height: 120px; object-fit: cover; }
.pager { display: flex; justify-content: space-between; margin-top: 8px; }

/* image viewer (replaces schnitt.php / schnitt_micro.php popups) */
.viewer { border: 0; padding: 0; background: #fff; max-width: 96vw; max-height: 96vh; box-shadow: 0 6px 30px rgba(0,0,0,.5); font-family: Verdana, Geneva, Arial, sans-serif; font-size: 15px; }
.viewer::backdrop { background: rgba(20,20,10,.75); }
.viewer figure { margin: 0; padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.viewer .vtitle { font-size: 16px; color: #333300; padding-right: 26px; }
.viewer .vimg { display: block; max-width: calc(96vw - 20px); max-height: calc(96vh - 110px); width: auto; height: auto; margin: 0 auto; }
.viewer figcaption { display: flex; align-items: center; gap: 8px; }
.viewer figcaption img { vertical-align: middle; }
.viewer .count { margin-left: auto; color: #666; }
.viewer .close { position: absolute; top: 6px; right: 6px; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 18px; padding: 8px 10px; opacity: .85; }
.viewer .nav.prev { left: 14px; }
.viewer .nav.next { right: 14px; }
.viewer .nav[hidden] { display: none; }

@media (max-width: 1020px) {
  .frame { width: auto; }
  .topbar a img, .topbar > img { max-width: 100%; height: auto; }
  .chapter { grid-template-columns: 1fr; }
  .head { flex-direction: column; gap: 0; }
}
