/*
Theme Name: Hanno Müller Photography
Theme URI: https://hannomuller.com
Author: Hanno Müller
Description: Minimal photography theme for hannomuller.com. Plain PHP, CSS and JavaScript, no dependencies.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hannomuller
*/
:root{
  --paper:#fff; --ink:#1e1e1e; --stone:#6b6b6b; --mist:#c9c9c9; --veil:#f3f3f2; --frame:#e9e9e8;
  --fx:0px; --fy:0px; --compact-h:2.75rem; --pad:12px; --gap:8px; --row-h:0; --thumb-h:72px; --peek-h:90px; --head-h:6rem;
  font-size:16px;
}
@media (min-width:768px){:root{--fx:max(24px,3vw);--fy:var(--fx);--pad:var(--fx);--gap:12px;--row-h:280px;--thumb-h:90px}}
@media (min-width:1600px){:root{--gap:16px;--row-h:480px;--thumb-h:110px;font-size:18px}}
@media (min-width:3000px){:root{--gap:24px;--row-h:720px;--thumb-h:150px;--peek-h:120px;font-size:20px}}

*{box-sizing:border-box}
[hidden]{display:none!important}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;background:var(--frame);scrollbar-gutter:stable}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto} *{transition:none!important;animation:none!important}}
body{margin:0;padding:var(--fy) var(--fx);background:var(--frame);color:var(--ink);font:400 1rem/1.5 "Hanken Grotesk",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;min-height:100vh;display:flex;flex-direction:column}
.sheet{background:var(--paper);flex:1;display:flex;flex-direction:column}
a{color:inherit;text-decoration:none}
a:hover,button.link:hover{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.25em}
:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
button.link{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
img{display:block;max-width:100%}

/* header: name | e-mail | subscribe on one line, menu beneath; only the menu stays when scrolled */
#topsentinel{position:absolute;top:0;height:1px;width:1px}
header{position:sticky;top:0;z-index:5;background:var(--paper);padding:0}
.mast{display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows .3s ease,opacity .25s ease,padding .3s ease;padding:1.5rem var(--pad) 1.3rem}
.mast-in{min-height:0;overflow:hidden;display:grid;grid-template-columns:auto auto;justify-content:center;align-items:baseline;row-gap:.45rem}
.mast-in .name{grid-column:1/-1;text-align:center}
.name{font-size:1.5rem;font-weight:500;letter-spacing:-.01em;white-space:nowrap}
.mast-in .mail,.mast-in .sub{color:var(--stone)}
.mast-in .sub::before{content:"|";display:inline-block;color:var(--mist);margin:0 1rem;text-decoration:none}
.menu{display:flex;justify-content:center;align-items:center;gap:1.75rem;position:relative;background:var(--frame);min-height:var(--compact-h);padding:0 var(--pad);transition:font-size .3s ease}
.menu a[aria-current]{font-weight:500;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.4em}
html[data-compact] header{background:var(--frame)}
html[data-compact] .menu{font-size:1.0625rem}
html[data-compact] .mast{grid-template-rows:0fr;opacity:0;padding-top:0;padding-bottom:0;pointer-events:none}
/* round back-to-top button in the bottom right corner once scrolled */
.totop{display:none;position:fixed;right:.9rem;bottom:.9rem;z-index:6;width:2.5rem;height:2.5rem;border-radius:50%;background:rgba(255,255,255,.92);border:1px solid var(--mist);align-items:center;justify-content:center;color:var(--ink)}
.totop svg{width:1.1rem;height:1.1rem;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
html[data-compact] .totop{display:flex}
.burger,.mobile{display:none}
@media (max-width:767px){
  header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:.8rem var(--pad)}
  .mast,html[data-compact] .mast{display:block;margin:0;padding:0;opacity:1;pointer-events:auto}
  .mast-in{display:block}
  .name{font-size:1.2rem}
  .mast-in .mail,.mast-in .sub,.menu{display:none}
  .burger{display:block;width:1.6rem;height:1.2rem;padding:0;border:0;background:none;position:relative;cursor:pointer}
  .burger span,.burger::before,.burger::after{content:"";position:absolute;left:0;right:0;height:1px;background:var(--ink)}
  .burger::before{top:0}.burger span{top:50%}.burger::after{bottom:0}
  html[data-menu] .mobile{display:flex}
  .mobile{position:absolute;top:100%;left:0;right:0;z-index:5;flex-direction:column;gap:.55rem;padding:1rem var(--pad) 1.2rem;background:var(--paper);border-bottom:1px solid var(--mist);box-shadow:0 12px 16px -12px rgba(0,0,0,.2)}   /* overlays the page instead of pushing it down */
  .mobile a[aria-current]{font-weight:500}
  .mobile .mail,.mobile .sub{color:var(--stone);margin-top:.2rem;text-align:left;align-self:flex-start}
  html[data-compact] header{background:var(--paper)}
}

main{flex:1;padding:1.25rem var(--pad) 2rem}
body.box{padding:0}
body.box main{padding-top:0;padding-bottom:0}
.box .strip{top:0;padding:.8rem 0 .7rem}

/* footer: on the grey frame; Privacy | address | information, both text blocks three lines at the same size */
footer{display:grid;grid-template-columns:max-content max-content minmax(0,max-content);justify-content:center;column-gap:3rem;align-items:start;padding:calc(.8rem + var(--fy)) var(--pad) .8rem;margin-bottom:calc(-1 * var(--fy));color:var(--stone);font-size:.8125rem;line-height:1.6}
footer .narrow{display:none}
footer p{margin:0;max-width:60ch}
footer .privacy{font-size:1rem;color:var(--ink);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.3em;margin-right:3rem;line-height:1.3}
@media (max-width:767px){footer{grid-template-columns:1fr;row-gap:.8rem;justify-items:center;text-align:center;padding:1.4rem var(--pad) 1rem}footer .privacy{margin:0}footer .wide{display:none}footer .narrow{display:inline}}

/* gallery: JS places tiles absolutely (see site.js); phone falls back to one column */
.gallery{position:relative;margin-top:1.25rem}
.gallery a{display:block;position:absolute;transition:opacity .25s,transform .25s}
.gallery img{width:100%;height:100%;object-fit:cover;background:var(--veil)}
.gallery:hover a:not(:hover){opacity:.6}
.gallery a:hover{transform:scale(1.05);z-index:1}
.cap{position:absolute;left:0;right:0;top:100%;background:var(--paper);color:var(--ink);font-size:.875rem;line-height:1.3;padding:.45rem .75rem;transform:scaleY(0);transform-origin:top;transition:transform .25s;box-shadow:0 1px 0 var(--mist)}
.cap i{color:var(--stone);margin-left:.6em}
.gallery a:hover .cap{transform:none}
@media (hover:none){.gallery:hover a:not(:hover){opacity:1}.gallery a:hover{transform:none}.gallery a:hover .cap{transform:scaleY(0)}}
@media (max-width:767px){.gallery{display:flex;flex-direction:column;gap:var(--gap)}.gallery a{position:static}}
.sentinel{height:1px}

/* dialogs: centred panels, dimmed page */
dialog{position:fixed;border:0;padding:0;background:var(--paper);color:var(--ink)}
dialog::backdrop{background:rgba(0,0,0,.4)}
.panel{width:clamp(26rem,28vw,56rem);max-width:calc(100vw - 2rem);max-height:80vh;padding:2rem;overflow:auto;line-height:1.55}
.x{position:absolute;top:.4rem;right:.6rem;font:inherit;font-size:1.6rem;line-height:1;background:none;border:0;color:var(--stone);cursor:pointer;padding:.3rem .5rem}
.x:hover{color:var(--ink)}
.panel h2{font-size:1.25rem;font-weight:500;margin:0 2rem 1rem 0}
.panel form{display:grid;gap:1rem}
.panel input[type=email]{font:inherit;padding:.5rem 0;border:0;border-bottom:1px solid var(--mist);background:none;color:inherit;border-radius:0}
.panel input[type=email]:focus{outline:0;border-bottom-color:var(--ink)}
.panel label{display:flex;gap:.6rem;align-items:flex-start;color:var(--stone);font-size:.9375rem}
.panel button[type=submit]{font:inherit;justify-self:start;padding:.5rem 1.25rem;background:var(--ink);color:var(--paper);border:0;cursor:pointer}

/* lightbox (Home) and viewer (species page) share the stage */
.lightbox{width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;inset:0;overflow:hidden}
.lightbox::backdrop{background:var(--paper)}
.lightbox[open]{display:grid;grid-template-rows:2.75rem 1fr auto}
.lightbox .head{position:relative}
.lightbox .head .x{right:calc(var(--pad) - .5rem)}
.stage{position:relative;display:grid;grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr);place-items:center;min-height:0;padding:0 var(--pad)}
.stage img{max-width:100%;max-height:100%;width:auto;height:auto;min-height:0;object-fit:contain}
.info{position:absolute;background:rgba(40,40,40,.72);color:var(--paper);padding:1.5rem;overflow:auto;line-height:1.55;font-size:.9375rem}
.bar{display:grid;grid-template-columns:auto 1fr auto;align-items:center;padding:.5rem var(--pad) .9rem;color:var(--stone)}
.bar .mid{text-align:center;color:var(--ink)}
.bar .caption span,.bar .caption i,.strip .current i{color:var(--stone);margin-left:.4em}
@media (max-width:767px){.bar .caption span,.bar .caption i{display:block;margin:0}.bar .mid{line-height:1.35}}
.arrow{font:inherit;font-size:1.75rem;line-height:1;background:none;border:0;color:var(--stone);cursor:pointer;padding:.2rem .8rem}
.arrow:hover{color:var(--ink)}
.ibtn{font:inherit;font-size:.8em;background:none;border:1px solid var(--mist);border-radius:50%;width:1.5em;height:1.5em;line-height:1;color:var(--stone);cursor:pointer;margin-left:.7em;vertical-align:.1em}
.ibtn:hover{color:var(--ink);border-color:var(--ink)}
.ov{position:absolute;top:0;bottom:0;width:15%;border:0;background:none;color:rgba(30,30,30,.25);font-size:3rem;cursor:pointer;transition:color .2s}
.ov:hover{color:rgba(30,30,30,.65)}
.ov.prev{left:var(--pad);text-align:left;padding-left:.5rem}.ov.next{right:var(--pad);text-align:right;padding-right:.5rem}

/* species page: strip + viewer with filmstrip */
.strip{position:sticky;top:var(--head-h);z-index:4;background:var(--paper);display:grid;grid-template-columns:1fr auto 1fr;gap:1rem;align-items:baseline;padding:.6rem 0 .7rem;border-bottom:1px solid var(--mist)}
.strip .prev{color:var(--stone)}.strip .prev::before{content:"‹ "}
.strip .right{display:flex;justify-content:flex-end;align-items:baseline;gap:1.5rem;color:var(--stone)}
.strip .next::after{content:" ›"}
.strip .right .x{position:static;font-size:1.4rem;padding:0 .2rem;margin-left:.25rem}
.strip .current{text-align:center;display:flex;flex-wrap:wrap;justify-content:center;gap:0 1rem;align-items:baseline}
.strip .current b{font-weight:500;font-size:1.25rem}
.strip .current span{color:var(--stone)}
.viewer{display:grid;grid-template-rows:1fr auto;gap:.75rem;padding:.75rem 0 1rem;min-height:24rem}
.film{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5rem;height:var(--thumb-h)}
.farrow{font:inherit;font-size:1.5rem;background:none;border:0;color:rgba(30,30,30,.35);cursor:pointer;padding:0 .4rem;height:100%}
.farrow:hover{color:var(--ink)}
.thumbs{display:flex;gap:.5rem;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;height:100%}
.thumbs::-webkit-scrollbar{display:none}
.thumbs img{height:100%;width:auto;flex:none;cursor:pointer;opacity:.7;border-bottom:2px solid transparent;transition:opacity .2s}
.thumbs img:hover{opacity:1}
.thumbs img[aria-current]{opacity:1;border-bottom-color:var(--ink)}

/* birds: explanation, search row, centred list of collapsible families */
.explain{margin:1.5rem auto 0;background:var(--veil);padding:.9rem 1.25rem 1rem;font-size:1rem;line-height:1.55}
@media (min-width:1600px){.explain{max-width:72%}}
.explain .cols{display:grid;grid-template-columns:1fr;gap:0 3rem;text-align:justify;hyphens:auto}   /* each paragraph in its own cell: first left, second right */
.explain .cols p:last-child{margin-bottom:0}
@media (min-width:768px){.explain .cols{grid-template-columns:1fr 1fr}.explain .cols p{margin-bottom:0}}
.explain summary{cursor:pointer;color:var(--stone);list-style:none;display:inline-flex;align-items:baseline;gap:.5rem}
.explain summary::-webkit-details-marker{display:none}
.explain summary::before{content:"›";display:inline-block;transition:transform .2s}
.explain[open] summary::before{transform:rotate(90deg)}
.explain p{margin:0 0 .75em}.explain .cols{margin-top:.75em}
.searchrow{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:.75rem 2.5rem;padding:1.25rem 0 1rem}
.search{display:flex;align-items:center;gap:.6rem;background:var(--veil);padding:.55rem 1rem;width:min(28rem,100%);border-radius:2px}
.search svg{width:1.1em;height:1.1em;stroke:var(--stone);fill:none;stroke-width:2;flex:none}
.search input{font:inherit;color:inherit;background:none;border:0;width:100%;outline:0;padding:0}
.search input::placeholder{color:var(--stone)}
.birds{columns:1;column-gap:3rem;padding:.5rem 0 2rem;margin:0 auto}
@media (min-width:768px){.birds{columns:2}}
@media (min-width:1600px){.birds{columns:2;max-width:72%}}
@media (min-width:3000px){.birds{columns:3}}
.region{column-span:all;font-size:1.25rem;font-weight:500;margin:0 0 .75rem}
.family{display:inline-block;width:100%;padding:0 0 .6rem;margin:0;break-inside:avoid}
.family summary,.family h2{list-style:none;cursor:pointer;display:flex;justify-content:space-between;align-items:baseline;gap:1rem;font-size:1.0625rem;font-weight:500;margin:0;padding:.3rem 0;border-bottom:1px solid var(--veil)}
.family h2{cursor:default}
.family summary::-webkit-details-marker{display:none}
.family .fc{font-size:.8125rem;font-weight:400;color:var(--stone);white-space:nowrap}
.family .fc.none{color:var(--mist)}
.family ul{list-style:none;margin:.3rem 0 .6rem;padding:0}
.family li{line-height:1.45;display:grid;grid-template-columns:36% 32% 32%;gap:0 .75rem;align-items:baseline}
.family li .sub{display:contents}
.family li .n2,.family li .sci{color:var(--stone);font-size:.875rem}
.family li .sci{font-style:italic}
.family li.missing,.family li.missing .n2,.family li.missing .sci{color:var(--mist)}
@media (max-width:767px){.family li{display:block;padding:.1rem 0 .3rem}.family li .sub{display:block;font-size:.8125rem;line-height:1.3}}
.peek{position:fixed;z-index:8;width:max-content;max-width:none;background:var(--paper);border:1px solid var(--mist);padding:.4rem;display:grid;grid-auto-flow:column;gap:.3rem;pointer-events:none}
.peek img{height:var(--peek-h);width:auto;max-width:none}

/* text pages */
.prose{max-width:70ch;padding:1.5rem 0 2rem;font-size:1.0625rem;line-height:1.55}
.prose h1{font-size:1.5rem;font-weight:500;margin:0 0 1rem}
.prose h2{font-size:1.0625rem;font-weight:500;margin:2rem 0 .5rem}
.prose p{margin:0 0 1em}
.prose a[data-open]{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.25em}
.update{text-align:center;margin:0 auto;padding-top:2rem}
.about{display:grid;gap:2rem var(--pad);padding-top:1.5rem}
@media (min-width:768px){.about{grid-template-columns:minmax(12rem,18rem) minmax(0,70ch);align-items:stretch;justify-content:center}}
.about .prose{padding-top:0}
.about .prose p{text-align:justify;hyphens:auto}
.portrait-box{position:relative;min-height:16rem}
.portrait{position:absolute;inset:0;width:100%;height:61%;object-fit:contain;object-position:left top}   /* golden ratio of the text height */
@media (max-width:767px){.portrait-box{min-height:0;height:auto}.portrait{position:static;width:100%;height:auto;max-width:none}}   /* phone upright: full width */
@media (orientation:landscape) and (max-height:520px){.about{grid-template-columns:auto minmax(0,1fr);align-items:start;justify-content:start;gap:1.5rem}.portrait-box{min-height:0;height:auto;width:auto;display:block}.portrait{position:static;width:auto;max-width:none;height:calc(100dvh - var(--head-h) - var(--fy) - 3.75rem)}}   /* phone on its side: portrait left of the text, fills the height below the header */
.region{margin-top:2.5rem;padding-top:2.25rem;border-top:1px solid var(--mist)}
.region .fc{font-size:.8125rem;font-weight:400;color:var(--stone);margin-left:1rem}
.region.first{margin:1.5rem auto 0;padding-top:0;border-top:0}
@media (min-width:1600px){.region.first{max-width:72%}}
.subregion{column-span:all;font-size:.9375rem;font-weight:400;color:var(--stone);margin:1rem 0 .3rem}
/* species page on phones: top line = previous | next ×; the name (three rows) sits directly above the image, both centred vertically */
.stage .current{display:none}
@media (max-width:767px){
  .strip{position:static;display:flex;justify-content:space-between;align-items:baseline;gap:1rem}
  .strip .current{display:none}
  .strip .prev,.strip .right{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .strip .right{gap:.9rem}
  .viewer{min-height:60vh}
  .box .viewer .ov{display:none}
  .box .viewer .stage{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0}
  .box .viewer .stage img{flex:0 1 auto;min-height:0;max-width:100%;width:auto;height:auto}
  .stage .current{display:grid;grid-template-columns:1fr auto;gap:0 .75rem;width:100%;text-align:left;margin-bottom:.6rem;line-height:1.3}
  .stage .current b{font-weight:500;font-size:1.25rem}
  .stage .current b,.stage .current span,.stage .current i{grid-column:1}
  .stage .current span,.stage .current i{display:block;color:var(--stone);margin:0}
  .stage .current .ibtn{grid-column:2;grid-row:1/4;align-self:center;margin:0}
}
