/* Black Hills Wildflowers: design C1 "Clean", with the Flower + leaf photo frame.
   Layout: a color rail on the left (desktop) or a sticky chip bar (phone); the current color
   runs into the page header, so a reader always sees which color they're in.
   Light only: this is a field guide read outdoors. */
:root{
  --paper:#fcfbf8;--ink:#241a22;--plum:#3f1430;--berry:#6a2350;--muted:#5f5560;
  --line:#e6e1d9;--line-2:#e0dacf;--pill:#cfc8bc;--soft:#f3f0ea;--foot:#2a1424;--foot-ink:#f7f1ea;
  --serif:"Instrument Serif",Georgia,serif;--sans:"Instrument Sans","Segoe UI",sans-serif;
  --gutter:max(16px,env(safe-area-inset-left,0px));--gutter-r:max(16px,env(safe-area-inset-right,0px));
  color-scheme:light;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.5 var(--sans)}
img{display:block;max-width:100%;height:auto}
a{color:var(--berry)}a:hover{color:var(--plum)}
h1,h2,h3{font-family:var(--serif);font-weight:400;margin:0;text-wrap:balance}
p{margin:0}
:focus-visible{outline:2px solid var(--berry);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Section colors. Each page or chip sets --sec and --sec-ink through one of these classes. */
.s-white{--sec:#fff;--sec-ink:#241a22;--sec-edge:#e0dacf}
.s-yellow{--sec:#f5cf3f;--sec-ink:#241a22;--sec-edge:#f5cf3f}
.s-orange-red{--sec:#e8703e;--sec-ink:#24110a;--sec-edge:#e8703e}
.s-pink{--sec:#f0a3bd;--sec-ink:#241a22;--sec-edge:#f0a3bd}
.s-purple{--sec:#7b4aa6;--sec-ink:#fff;--sec-edge:#7b4aa6}
.s-blue{--sec:#3e5bb5;--sec-ink:#fff;--sec-edge:#3e5bb5}
.s-green-brown{--sec:#5f6e45;--sec-ink:#fff;--sec-edge:#5f6e45}
.s-trees-shrubs{--sec:#d5dcc2;--sec-ink:#241a22;--sec-edge:#d5dcc2}
.s-other-plants{--sec:#cfe0d6;--sec-ink:#241a22;--sec-edge:#cfe0d6}
.s-mushrooms{--sec:#e4d9c3;--sec-ink:#241a22;--sec-edge:#e4d9c3}
.s-home{--sec:#f3f0ea;--sec-ink:#241a22;--sec-edge:#f3f0ea}

/* Top bar: name, banner and search share one bar on wide screens (owner's request). */
.top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 24px;padding:12px var(--gutter-r) 12px var(--gutter);border-bottom:1px solid var(--line)}
.mark{flex:none;font-family:var(--serif);font-size:26px;line-height:1;color:var(--plum);text-decoration:none}
.mark span{display:block}
.search{position:relative;flex:1 1 150px;min-width:0;max-width:300px}
.search label{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 14px;border:1px solid var(--pill);border-radius:999px;background:#fff;font-size:15px;font-weight:500}
.search input{flex:1;min-width:0;width:100%;border:0;outline:0;background:transparent;font:16px var(--sans);color:var(--ink)}
.search label:focus-within{outline:2px solid var(--berry);outline-offset:2px}
.results{position:absolute;z-index:40;top:calc(100% + 6px);right:0;width:min(360px,calc(100vw - 32px));max-height:70vh;overflow:auto;margin:0;padding:6px;list-style:none;background:#fff;border:1px solid var(--line-2);border-radius:6px;box-shadow:0 10px 30px rgba(36,26,34,.18)}
.results a{display:flex;align-items:center;gap:10px;min-height:52px;padding:4px 6px;border-radius:4px;color:var(--ink);text-decoration:none}
.results a:hover,.results a:focus-visible,.results a.on{background:var(--soft)}
.results img{flex:none;width:44px;height:44px;object-fit:cover}
.results b{display:block;font-weight:600;line-height:1.2}
.results i{display:block;font-size:14px;color:var(--berry);line-height:1.2}
.results .none{padding:10px;color:var(--muted)}

/* Banners. Sizes are reserved so nothing jumps when blackhills.biz's code fills them. */
.ad{display:flex;align-items:center;gap:6px;max-width:100%}
.ad-label{font-size:12px;line-height:1;color:var(--muted)}
.ad-slot{display:flex;align-items:center;justify-content:center;gap:16px;max-width:100%;box-sizing:border-box;background:var(--soft);color:var(--ink);text-decoration:none}
.ad-name{font-family:var(--serif);line-height:1;color:var(--berry)}
.adtop{order:3;flex:1 1 100%;flex-direction:column;gap:3px;justify-content:center}
.adtop .ad-slot{width:320px;height:50px;padding:0 12px;justify-content:space-between}
.adtop .ad-name{font-size:22px}
.adtop .ad-tag{display:none}
.ad-mid{flex-direction:column;justify-content:center;gap:6px;padding:10px;background:var(--soft);border-radius:4px}
.ad-mid .ad-slot{flex-direction:column;gap:2px;width:320px;height:100px;background:#fff;border:1px solid var(--line-2);text-align:center}
.ad-mid .ad-name{font-size:24px;line-height:1.1}
.ad-mid .ad-tag{font-size:13px;color:var(--muted)}

/* Color rail: sticky chips on a phone, tabs on a wide screen. */
.rail{position:sticky;top:0;z-index:30;display:flex;gap:8px;overflow-x:auto;padding:8px var(--gutter-r) 8px var(--gutter);background:var(--paper);border-bottom:1px solid var(--line);scrollbar-width:none}
.rail::-webkit-scrollbar{display:none}
.rail-label{display:none}
.rail a{flex:none;display:flex;align-items:center;min-height:44px;padding:0 14px;border-radius:999px;background:var(--sec);border:1px solid var(--sec-edge);color:var(--sec-ink);font-weight:600;font-size:15px;line-height:1.15;text-decoration:none;white-space:nowrap}
.rail a[aria-current]{box-shadow:0 0 0 2px var(--paper),0 0 0 4px var(--ink)}

/* Page header band, in the section's color. */
.band{padding:18px var(--gutter-r) 22px var(--gutter);background:var(--sec);color:var(--sec-ink)}
.s-white .band,.s-home .band{border-bottom:1px solid var(--line-2)}
.crumbs{display:flex;flex-wrap:wrap;gap:6px 8px;font-size:14.5px}
.crumbs a{color:inherit}
.band h1{margin:8px 0 6px;font-size:clamp(38px,8vw,60px);line-height:1.02}
.band .sci{margin:0 0 8px;font-family:var(--serif);font-style:italic;font-size:23px;line-height:1.15}
.band .sci .sci-also{font-family:var(--sans);font-style:normal;font-size:15px}
.band .sci .sci-also i{font-style:italic}
.lede{max-width:760px;font-size:17px;line-height:1.45}
.pad{padding-left:var(--gutter);padding-right:var(--gutter-r)}

/* Flower + leaf frame: colors sampled from each plant's best shot (--f flower, --l leaf). */
.frame{display:block;margin:4px;padding:3px;background:#fff;border:2px solid var(--f,#8a7a9c);outline:1px solid var(--l,#5f6e45);outline-offset:3px}

/* Month filter */
.months{display:flex;gap:8px;overflow-x:auto;align-items:center;padding:12px var(--gutter-r) 12px var(--gutter);border-bottom:1px solid var(--line);scrollbar-width:none}
.months::-webkit-scrollbar{display:none}
.months span{flex:none;margin-right:4px;font-weight:500}
.months button{flex:none;min-height:44px;min-width:50px;padding:0 13px;border:1px solid var(--pill);border-radius:999px;background:#fff;color:var(--ink);font:15px var(--sans);cursor:pointer}
.months button[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.count{padding:10px var(--gutter-r) 0 var(--gutter);font-size:14.5px;color:var(--muted)}

/* Plant cards */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(150px,44%),1fr));gap:22px 14px;padding:18px var(--gutter-r) 30px var(--gutter)}
.card{display:block;min-width:0;color:var(--ink);text-decoration:none}
a.card:hover h2,a.card:hover h3{text-decoration:underline}
.card img{width:100%;aspect-ratio:1/1;object-fit:cover}
.card h2,.card h3{margin:9px 0 0 4px;font-size:21px;line-height:1.1}
.card .sci{margin:2px 0 0 4px;font-style:italic;font-size:14px;color:var(--berry);overflow-wrap:anywhere}
.card .meta{margin:3px 0 0 4px;font-size:13.5px;color:var(--muted)}
.cards .ad-mid{grid-column:1/-1}

/* Home */
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:18px var(--gutter-r) 8px var(--gutter)}
.tile{display:flex;flex-direction:column;min-width:0;background:var(--sec);border:1px solid var(--sec-edge);border-radius:4px;color:var(--sec-ink);text-decoration:none;overflow:hidden}
.tile img{width:100%;aspect-ratio:4/3;object-fit:cover}
.tile span{flex:1;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:0 10px;padding:9px 12px 10px}
.tile b{font-family:var(--serif);font-weight:400;font-size:25px;line-height:1.1}
.tile small{font-size:13.5px}
.tile:hover b{text-decoration:underline}
.home-h{padding:24px var(--gutter-r) 0 var(--gutter);font-size:30px;line-height:1.1}
.also{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));gap:14px;padding:14px var(--gutter-r) 8px var(--gutter)}
.also a{display:flex;align-items:center;gap:14px;padding:10px;background:var(--soft);border-radius:4px;color:var(--ink);text-decoration:none}
.also img,.also .ico{flex:none;width:104px;height:84px;object-fit:cover;border-radius:3px}
.also .ico{display:flex;align-items:center;justify-content:center;background:var(--sec)}
.also b{display:block;font-family:var(--serif);font-weight:400;font-size:25px;line-height:1.1}
.also small{font-size:14.5px}
.quote{padding:26px var(--gutter-r) 34px var(--gutter)}
.quote blockquote{margin:0;max-width:860px;font-family:var(--serif);font-style:italic;font-size:22px;line-height:1.28}
.quote figcaption{margin-top:6px;font-size:14px;color:var(--muted)}

/* Plant page */
.plant{display:flex;flex-direction:column;gap:24px;padding:16px var(--gutter-r) 8px var(--gutter)}
.plant-photos,.plant-facts{min-width:0;display:flex;flex-direction:column;gap:14px}
.hero{display:block;margin:4px}
.hero img{width:100%}
.thumbs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.thumbs .frame{margin:4px;padding:2px;border-width:2px;cursor:zoom-in}
.thumbs img{width:100%;aspect-ratio:1/1;object-fit:cover}
/* Free photos from other sources: no frame and no stamp, so they read as someone else's. */
.free{display:flex;flex-direction:column;gap:8px}
.free-h{font-size:24px;line-height:1.15}
.free-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px}
.free-grid figure{margin:0;min-width:0}
.free-img{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;padding:8px;background:var(--soft);font-size:13px;color:var(--muted);text-align:center}
.free-grid img{width:100%;aspect-ratio:1/1;object-fit:cover}
.free-grid figcaption{margin-top:5px;font-size:13.5px;line-height:1.3;overflow-wrap:anywhere}
table{width:100%;border-collapse:collapse;font-size:15px;line-height:1.38}
caption{text-align:left;padding-bottom:8px;font-family:var(--serif);font-size:28px;line-height:1.1}
th,td{padding:7px 0;border-top:1px solid var(--line);vertical-align:top;text-align:left;overflow-wrap:anywhere}
th{width:92px;padding-right:10px;font-weight:600}
.h2{margin:4px 0 5px;font-size:28px;line-height:1.1}
.facts-p{margin:0 0 6px;font-size:15px;line-height:1.42}
.facts-p strong{font-weight:600}
.qa{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));gap:16px 30px;padding:18px var(--gutter-r) 8px var(--gutter)}
.qa h2{margin:0 0 4px;font-size:25px;line-height:1.12}
.qa p{font-size:15.5px}
.compare{padding:22px var(--gutter-r) 12px var(--gutter)}
.compare .cards{padding:12px 0 0;grid-template-columns:repeat(auto-fill,minmax(min(150px,44%),1fr))}
.sources{padding:10px var(--gutter-r) 30px var(--gutter);font-size:14px;color:var(--muted)}
.pending{padding:10px 12px;background:var(--soft);border-radius:4px;font-size:15px;color:var(--muted)}

/* Simple text pages */
.text{max-width:66ch;padding:20px var(--gutter-r) 40px var(--gutter);display:flex;flex-direction:column;gap:12px}
.text h2{margin-top:10px;font-size:28px;line-height:1.1}
.empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:44px 16px;text-align:center}
.empty p{font-family:var(--serif);font-size:28px;line-height:1.15}

/* Footer */
.foot{background:var(--foot);color:var(--foot-ink)}
.foot-in{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));gap:22px 44px;padding:28px var(--gutter-r) 30px var(--gutter);font-size:15px;line-height:1.5}
.foot a{color:var(--foot-ink)}
.foot h2{margin:0 0 3px;font-size:26px;line-height:1.2}

/* Photo viewer */
dialog.lb{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;padding:0;border:0;background:rgba(20,10,18,.96);color:#fff}
dialog.lb::backdrop{background:rgba(20,10,18,.96)}
.lb-in{display:flex;flex-direction:column;height:100%}
.lb-img{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:8px}
.lb-img img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.lb-bar{display:flex;align-items:center;gap:8px;padding:8px max(12px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))}
.lb-bar p{flex:1;min-width:0;font-size:14.5px}
.lb button{flex:none;min-width:48px;min-height:48px;border:1px solid rgba(255,255,255,.45);border-radius:4px;background:transparent;color:#fff;font:16px var(--sans);cursor:pointer}

@media (min-width:560px){
  .tiles{grid-template-columns:repeat(4,minmax(0,1fr))}
  .thumbs{grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}
  .free-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
}
@media (min-width:760px){
  .top{padding:12px 32px}
  .mark{font-size:36px}
  .search{flex:none;width:260px}
  .adtop{flex-direction:row;gap:6px}
  .adtop .ad-label{writing-mode:vertical-rl;transform:rotate(180deg)}
  .adtop .ad-slot{width:728px;height:90px;padding:0 22px}
  .adtop .ad-name{font-size:30px}
  .adtop .ad-tag{display:block;flex:1 1 auto;font-size:16.5px;line-height:1.25}
  .layout{display:grid;grid-template-columns:176px minmax(0,1fr);align-items:start}
  .rail{position:relative;top:auto;z-index:1;flex-direction:column;gap:0;overflow:visible;padding:18px 0 24px;border:0;background:none}
  .rail-label{display:block;margin:0 0 8px 18px;font-size:13.5px;font-weight:500;color:var(--muted)}
  .rail-label+a{margin-top:0}
  .rail .rail-label:not(:first-child){margin-top:24px}
  .rail a{min-height:58px;padding:0 18px;border-radius:0;border-width:1px 1px 0 1px;font-size:16px;white-space:normal}
  .rail a[aria-current]{margin-right:-14px;box-shadow:none}
  .band,.cards,.tiles,.home-h,.also,.quote,.plant,.qa,.compare,.sources,.text,.months,.count{padding-left:36px;padding-right:36px}
  .band{padding-top:22px;padding-bottom:28px}
  .cards{grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:28px 18px;padding-top:26px;padding-bottom:34px}
  .compare .cards{padding:12px 0 0}
  .card h2,.card h3{font-size:23px}
  .plant{flex-direction:row;flex-wrap:wrap;align-items:flex-start;gap:30px;padding-top:28px}
  .plant-photos{flex:1.5 1 440px}
  .plant-facts{flex:1 1 300px}
  .foot-in{padding:30px 32px}
  .empty{padding:90px 36px 110px}
  .empty p{font-size:30px}
}
@media (min-width:1260px){
  .adtop{order:0;flex:0 1 auto}
}
@media (prefers-reduced-motion:no-preference){.rail{scroll-behavior:smooth}}
