/* Birds of Portugal page (/birds/) */
:root{--sil:#cfd4db;--tile-empty:#f0f2f5}
@media (prefers-color-scheme:dark){:root{--sil:#3a3f49;--tile-empty:#1b1e24}}
main.wide{max-width:62rem}
.lede{font-size:1.2rem;color:var(--muted);margin:0 0 1.5rem;max-width:38rem}
.progress{margin:0 0 2rem;max-width:38rem}
.progress p{margin:0 0 .5rem}
.progress .stat{font-size:1.15rem}
.progress .note{margin-top:.5rem}
.bar{height:6px;border-radius:999px;background:var(--line);overflow:hidden}
.bar i{display:block;height:100%;background:var(--accent);border-radius:999px}
.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1rem;padding:1rem 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--bg)}
.toolbar[hidden]{display:none}
@media (min-width:36rem){.toolbar{position:sticky;top:0;z-index:2}}
.filters{display:flex;gap:.25rem;border:1px solid var(--line);border-radius:8px;padding:3px;background:var(--card)}
.filters button{font:inherit;font-size:.95rem;font-weight:500;border:0;background:none;color:var(--muted);padding:.3rem .8rem;border-radius:6px;cursor:pointer}
.filters button[aria-pressed="true"]{background:var(--bg);color:var(--fg);box-shadow:0 0 0 1px var(--line)}
.filters button:focus-visible,.search input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.search{flex:1 1 14rem;max-width:22rem;margin-left:auto}
.search input{width:100%;font:inherit;font-size:.95rem;color:var(--fg);background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:.45rem .75rem}
.family h2{display:flex;flex-wrap:wrap;align-items:baseline;gap:.15rem .6rem;font-size:1.3rem;margin:2.5rem 0 1rem}
.family h2 .fam{font-size:.95rem;font-weight:400;font-style:italic;color:var(--muted)}
.family h2 .count{margin-left:auto;font-size:.95rem;font-weight:500;color:var(--muted);font-variant-numeric:tabular-nums}
.grid{list-style:none;padding:0;margin:0;display:grid;gap:1rem;grid-template-columns:repeat(2,minmax(0,1fr))}
@media (min-width:36rem){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (min-width:56rem){.grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.tile{background:var(--card);border:1px solid var(--line);border-radius:10px;overflow:hidden;display:flex;flex-direction:column}
.media{position:relative;aspect-ratio:4/3;background:var(--tile-empty);display:grid;place-items:center}
.media img{width:100%;height:100%;object-fit:cover;display:block}
.sil{width:62%;height:auto;fill:var(--sil);stroke:var(--sil)}
.tag{position:absolute;left:.5rem;top:.5rem;font-size:.68rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);background:var(--bg);border:1px solid var(--line);padding:.05rem .4rem;border-radius:4px}
.names{padding:.65rem .8rem .8rem;line-height:1.3;overflow-wrap:anywhere}
.names p{margin:0}
.pt{font-weight:600;font-size:1rem}
.en{font-size:.92rem;color:var(--muted);margin-top:.1rem}
.sci{font-size:.85rem;color:var(--muted)}
.when{font-size:.82rem;color:var(--fg);margin-top:.45rem!important;padding-top:.45rem;border-top:1px solid var(--line)}
.tile:not(.seen) .pt{color:var(--muted);font-weight:500}
.tile:not(.seen){border-style:dashed}
.apart{margin:3rem 0 0;border-top:1px solid var(--line);padding-top:1rem}
.apart summary{cursor:pointer;font-size:1.3rem;font-weight:700;padding:.5rem 0;list-style-position:inside}
.apart summary .count{font-size:.95rem;font-weight:500;color:var(--muted);margin-left:.5rem}
.apart .note{margin:.25rem 0 1rem;max-width:38rem}
.empty{display:none;color:var(--muted);margin:2rem 0}
.credits{margin-top:3.5rem;padding-top:1.5rem;border-top:1px solid var(--line)}
.credits h2{font-size:1rem;margin:0 0 .5rem}
.credits ul{margin:0;padding-left:1.1rem}
.credits li{margin:.2rem 0}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hidden{display:none!important}
/* Photo viewer */
.viewer{border:0;padding:0;margin:0;width:100vw;height:100vh;max-width:none;max-height:none;background:rgba(10,11,14,.94);color:#e9ebee}
.viewer::backdrop{background:rgba(10,11,14,.94)}
.viewer[open]{display:flex;flex-direction:column}
.viewer .stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:3.5rem 4.5rem 1rem;touch-action:pan-y}
.viewer .stage img{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px;user-select:none;-webkit-user-drag:none}
.viewer .cap{flex:0 0 auto;max-width:44rem;width:100%;margin:0 auto;padding:0 1.25rem 1.5rem;line-height:1.4}
.viewer .cap .who{margin:0;font-weight:600}
.viewer .cap .who i{font-weight:400;color:#b3b9c4;margin-left:.4rem}
.viewer .cap .when{margin:.3rem 0 0!important;padding:0;border:0;color:#e9ebee;font-size:.92rem}
.viewer .cap .note{margin:.5rem 0 0;color:#cfd4db;font-size:.95rem}
.viewer .cap .note[hidden]{display:none}
.viewer .pos{position:absolute;left:1.25rem;top:1.1rem;font-size:.9rem;color:#b3b9c4;font-variant-numeric:tabular-nums}
.viewer button{font:inherit;color:#e9ebee;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);border-radius:999px;width:2.75rem;height:2.75rem;display:grid;place-items:center;cursor:pointer}
.viewer button:hover{background:rgba(255,255,255,.16)}
.viewer button:focus-visible{outline:2px solid #8cc4ff;outline-offset:2px}
.viewer button svg{width:1.25rem;height:1.25rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.viewer .close{position:absolute;right:1rem;top:.75rem}
.viewer .prev,.viewer .next{position:absolute;top:50%;transform:translateY(-50%)}
.viewer .prev{left:1rem}.viewer .next{right:1rem}
.viewer.single .prev,.viewer.single .next,.viewer.single .pos{display:none}
@media (max-width:36rem){
  .viewer .stage{padding:3.5rem .5rem .75rem}
  .viewer .prev,.viewer .next{top:auto;bottom:1rem;transform:none}
  .viewer .cap{padding:0 1rem 4.5rem}
}
/* Maps (Leaflet, OpenStreetMap tiles) */
.off{display:none!important}
.views{margin-left:auto}
.views + .search{margin-left:0}
.map-view{margin:1.5rem 0 0}
.map-view[hidden]{display:none}
#sightings{height:min(70vh,560px);border:1px solid var(--line);border-radius:10px;background:var(--tile-empty);z-index:0}
.map-view .note{margin:.5rem 0 0}
.viewer .cap{display:flex;gap:1.25rem;align-items:flex-start}
.viewer .cap .txt{flex:1 1 auto;min-width:0}
.viewer .minimap{flex:0 0 220px;height:132px;border-radius:6px;overflow:hidden;border:1px solid rgba(255,255,255,.14);background:#1e2128}
.viewer .minimap[hidden]{display:none}
.viewer .minimap .leaflet-control-attribution{font-size:9px;line-height:1.3}
@media (max-width:36rem){
  .viewer .cap{flex-direction:column;gap:.75rem}
  .viewer .minimap{flex:none;width:100%;height:110px}
  .views{margin-left:0}
}
