/* Learning the Flower Names: flashcards (owner, 2026-11-10; one-screen layout 2026-11-11: "put the group choices at
   the top and let the person tick the ones they want and click on 'start' ... make it more dense ... make the slide
   pic smaller ... show the cards info on the right side of the screen, like in columns"; later the same day: "make
   the group and color choices smaller. Bring the card's pic and it's info closer together"). Loaded on learn.html only.
   Wide screens: tick boxes, timer and Start on top; the photo on the left, the name, facts and buttons in a column
   right beside it. Phones (and screens under 500px tall): Start opens the cards over the whole screen (.is-full).
   Frames and colors are the plant pages' own: --bd is the plant's section dark color, --bg its tint. --w/--h are
   the photo's width and height and --edge its frame's padding and border, all set on the stage. */

/* Heading: kept short so the cards sit high on the page. */
.l-band{padding-top:8px;padding-bottom:8px}
.l-band .crumbs{display:none}  /* the rail and the logo lead home; the height goes to the cards */
.l-band h1{margin:0 0 2px;font-size:clamp(28px,3.6vw,36px)}
.l-band .lede{max-width:none;font-size:15px;line-height:1.4}
.learn-nojs{padding:14px var(--gutter-r) 18px var(--gutter);font-size:16px}

/* The choice: one chip per group, ticked = filled with its color. */
.l-pick{display:flex;flex-direction:column;gap:8px;padding:10px var(--gutter-r) 10px var(--gutter);border-bottom:1px solid var(--line)}
.l-groups{display:flex;flex-wrap:wrap;gap:6px}
.lg{display:inline-flex;align-items:center;gap:5px;min-height:34px;padding:0 10px 0 8px;border:2px solid var(--sec-edge);border-radius:999px;background:#fff;color:var(--ink);font-size:13.5px;line-height:1.1;cursor:pointer;user-select:none}
.lg.s-white{border-color:var(--pill)}
.lg input{flex:none;width:16px;height:16px;margin:0;accent-color:var(--ink);cursor:pointer}
.lg b{font-weight:600}
.lg small{font-size:12px;color:var(--muted)}
.lg:has(input:checked){background:var(--sec);color:var(--sec-ink)}
.lg:has(input:checked) small{color:inherit;opacity:.85}
.lg:has(input:focus-visible){outline:2px solid var(--berry);outline-offset:2px}
.l-opts{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.l-quick{display:flex;gap:6px}
.l-quick button,.l-groups-btn{min-height:34px;padding:0 11px;border:1px solid var(--pill);border-radius:999px;background:#fff;color:var(--ink);font:500 13.5px var(--sans);cursor:pointer}
.l-groups-btn{min-height:44px;padding:0 13px;font-size:14.5px}
.l-speed{display:flex;align-items:center;overflow:hidden;border:1px solid var(--pill);border-radius:999px;background:#fff}
.l-speed button{min-height:34px;padding:0 11px;border:0;background:#fff;color:var(--ink);font:500 13.5px var(--sans);white-space:nowrap;cursor:pointer}
.l-speed button small{margin-left:4px;font-size:12px;color:var(--muted)}
.l-speed button[aria-pressed="true"]{background:var(--ink);color:#fff}
.l-speed button[aria-pressed="true"] small{color:#e8e2da}
.l-sel{margin:0;font-size:14px;font-weight:600;color:var(--muted)}
.l-start{margin-left:auto;min-height:40px;padding:0 24px;border:0;border-radius:999px;background:var(--berry);color:#fff;font:600 16px var(--sans);cursor:pointer;box-shadow:0 3px 0 var(--plum)}
.l-start:hover{background:var(--plum)}
.l-start:disabled{opacity:.45;cursor:default}

/* The cards. */
.learn-stage{--edge:12px;display:flex;flex-direction:column;gap:8px;padding:10px var(--gutter-r) 14px var(--gutter);background:var(--paper)}
.learn-stage.is-free{--edge:22px}
.learn.is-full .learn-stage{position:fixed;inset:0;z-index:60;padding:max(8px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
.l-top{display:none;flex:none;align-items:center;gap:8px;min-height:44px}
.learn.is-full .l-top{display:flex}
.l-top .l-count{flex:1;text-align:center}
.l-count{margin:0;font-size:14.5px;font-weight:600;color:var(--muted)}
.learn.is-full .l-side .l-count{display:none}
/* The timer: a thin, quiet line (owner, 2026-11-11: the 6px bar was "too big ... distracting"). */
.l-bar{flex:none;height:3px;overflow:hidden;border-radius:2px;background:rgba(36,26,34,.06)}
.l-bar i{display:block;height:100%;background:var(--bd,#6b6659);opacity:.45;transform:scaleX(0);transform-origin:left}
.l-bar i.hold{background:var(--muted);opacity:.3}
/* No timer (the page opens on it): no line, no Pause; a tap shows the name, the next tap moves on. */
.is-untimed .l-bar,.is-untimed #l-pause{display:none}
.is-untimed .l-ctl{grid-template-columns:1fr 1.5fr}

/* The photo: as big as its box allows, in its own shape. cqw/cqh are the box's width and height (a size
   container); --w/--h the photo's. */
.l-photo{flex:1 1 0;min-height:0;position:relative;container-type:size;display:flex;align-items:center;justify-content:center;cursor:pointer}
.l-frame{box-sizing:border-box;max-width:100%;max-height:100%;padding:3px;border:3px solid var(--bd,#6b6659);background:#fff;transition:opacity .18s;
  width:min(100cqw,calc((100cqh - var(--edge)) * var(--w,4) / var(--h,3) + var(--edge)))}
.l-frame.free{padding:8px;background:var(--soft)}
.l-frame img{display:block;width:100%;height:auto;aspect-ratio:var(--w,4)/var(--h,3);object-fit:cover;background:var(--soft)}
.l-frame img:not([src]){visibility:hidden}
.is-loading .l-frame{opacity:.35}
.is-loading .l-photo::after{content:"Loading the photo…";position:absolute;left:0;right:0;top:50%;text-align:center;font-weight:600;color:var(--muted)}
.l-credit{flex:none;margin:-2px 0 0;font-size:12.5px;line-height:1.3;text-align:center;color:var(--muted);overflow-wrap:anywhere}

/* Before Start (wide screens only; a phone shows the cards only once started). */
.l-idle{display:none}
.is-idle .l-photo{cursor:default;border:2px dashed var(--line-2);border-radius:8px;background:var(--soft)}
.is-idle .l-idle{display:block;max-width:22em;margin:0;padding:0 16px;font-family:var(--serif);font-size:24px;line-height:1.2;text-align:center;color:var(--muted)}
.is-idle .l-frame,.is-idle .l-credit,.is-idle .l-ctl,.is-idle .l-bar i,.is-idle .l-ask span{display:none}

/* The info column: count, the name box (the plant page's tint and border), facts, buttons. */
.l-side{flex:none;display:flex;flex-direction:column;gap:8px;min-width:0}
.l-name{display:flex;align-items:center;min-height:92px;padding:8px 14px;border:3px solid var(--bd,#6b6659);border-radius:8px;background:var(--bg,var(--soft));color:var(--ink)}
.l-ask{width:100%;margin:0;text-align:center}
.l-ask b{display:block;font:400 clamp(24px,6vw,30px)/1.1 var(--serif)}
.l-ask span{display:block;margin-top:2px;font-size:14px;color:var(--muted)}
.l-answer{width:100%}
.l-cn{margin:0;font:400 clamp(26px,6vw,36px)/1.05 var(--serif);text-wrap:balance}
.l-sn{margin:2px 0 0;font:italic 400 clamp(17px,4vw,21px)/1.2 var(--serif);color:var(--berry)}
.l-aka{margin:4px 0 0;font-size:14px;line-height:1.35;overflow-wrap:anywhere}   /* "Also called", as on the plant page */
.l-aka b{font-weight:600}
.l-aka[hidden]{display:none}
.l-facts{display:grid;grid-template-columns:auto minmax(0,1fr);gap:1px 10px;margin:8px 0 0;font-size:14px;line-height:1.35}
.l-facts:empty{display:none}
.l-facts dt{font-weight:600}
.l-facts dd{margin:0;overflow-wrap:anywhere}
.l-go{display:inline-flex;align-items:center;min-height:36px;margin-top:4px;font-size:14.5px;font-weight:600;color:var(--berry);text-underline-offset:3px}
.l-ctl{display:grid;grid-template-columns:1fr 1fr 1.5fr;gap:8px}
.l-ctl button,.l-end button{min-height:50px;border:2px solid var(--ink);border-radius:10px;background:#fff;color:var(--ink);font:600 17px var(--sans);cursor:pointer}
.l-ctl .l-main,.l-end .l-main{background:var(--ink);color:#fff}
.l-ctl button:disabled{opacity:.4;cursor:default}

/* The end of the cards: no score, just a way round again. */
.l-end{display:none;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:260px;padding:12px;text-align:center}
.l-end h2{font-size:clamp(28px,6vw,40px);line-height:1.1}
.l-end p{margin:0;color:var(--muted)}
.l-cta{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.l-end button{padding:0 22px}
.is-end .l-end{display:flex;flex:1}
.is-end .l-bar,.is-end .l-photo,.is-end .l-credit,.is-end .l-side{display:none}

/* Phones: the choice fills the page; the cards appear only when started, over the whole screen. */
@media (max-width:759px){
  .rail{display:none}                  /* the page's own color tick boxes do its job here; two rows of look-alike pills confuse */
  .learn:not(.is-full) .learn-stage{display:none}
  .l-band{padding-top:5px;padding-bottom:5px}
  .l-band .lede{font-size:14px;line-height:1.35}
  .l-pick{gap:6px;padding-top:8px}
  .l-groups{gap:5px}
  .lg{min-height:30px;padding:0 9px 0 7px;font-size:13px;gap:4px}
  .lg input{width:15px;height:15px}
  .lg small{font-size:11.5px}
  .l-sel{flex:none}
  .l-start{flex:1 1 auto;margin-left:0}
}
/* A short phone: the intro goes, so Start stays on the first screen (the ticks and Start explain themselves). */
@media (max-width:759px) and (max-height:700px){.l-band .lede{display:none}}
@media (max-height:650px){
  .l-ask span{display:none}
  .l-name{min-height:78px}
}

/* Wide screens: everything on one screen; the photo kept modest. */
@media (min-width:760px){
  .l-pick,.learn-stage,.learn-nojs{padding-left:36px;padding-right:36px}
  /* the chips and the controls flow as one block: about two rows */
  .l-pick{flex-direction:row;flex-wrap:wrap;align-items:center;gap:5px 6px;padding-top:8px;padding-bottom:8px}
  .l-groups,.l-opts{display:contents}
  .lg,.l-quick button,.l-speed button{min-height:30px}
  .lg{padding:0 9px 0 7px;font-size:13px;gap:4px;border-width:1.5px}
  .lg input{width:15px;height:15px}
  .lg small{font-size:11.5px}
  .l-quick button,.l-speed button{padding:0 10px;font-size:13px}
  .l-sel{font-size:13.5px}
  .l-start{min-height:34px;padding:0 20px;font-size:15px}
}
/* Two columns, the card's info right beside the photo (owner, 2026-11-11: spread apart, they "looks funny"):
   the photo's column is exactly as wide as the photo at the box's height (--ph), or as wide as the screen
   leaves beside the info column (--sw); the pair sits at the left, under the tick boxes. */
@media (min-width:760px){
  .learn:not(.is-full) .learn-stage{--ph:clamp(240px,46vh,420px);--sw:clamp(270px,30vw,360px);display:grid;
    grid-template-columns:min(calc((var(--ph) - var(--edge)) * var(--w,4) / var(--h,3) + var(--edge)), calc(100% - var(--sw) - 20px)) var(--sw);
    grid-template-areas:"bar bar" "photo side" "credit side" "end end";grid-template-rows:auto auto 1fr auto;gap:8px 20px;align-items:start;justify-content:start}
  .learn:not(.is-full) .l-bar{grid-area:bar}
  .learn:not(.is-full) .l-photo{grid-area:photo;container-type:normal;height:auto}
  .learn:not(.is-full) .l-frame{width:100%}
  .learn:not(.is-full) .learn-stage.is-idle .l-photo{height:var(--ph)}
  .learn:not(.is-full) .l-credit{grid-area:credit}
  .learn:not(.is-full) .l-side{grid-area:side}
  .learn:not(.is-full) .l-end{grid-area:end}
  .learn:not(.is-full) .l-name{min-height:150px;align-items:flex-start;padding:12px 18px}
  .learn:not(.is-full) .l-ask{text-align:left}
  .learn:not(.is-full) .is-end .l-end{min-height:clamp(240px,46vh,420px)}
}
/* A phone on its side (full screen): the photo left, the name and buttons beside it. */
@media (orientation:landscape) and (max-height:520px){
  .learn.is-full .learn-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,38%);grid-template-rows:auto auto minmax(0,1fr) auto;gap:8px 14px}
  .learn.is-full .l-top{grid-area:1/1/2/3}
  .learn.is-full .l-bar{grid-area:2/1/3/3}
  .learn.is-full .l-photo{grid-area:3/1/5/2;justify-content:flex-end}   /* the photo up against its name, as on a wide screen */
  .learn.is-full .l-side{grid-area:3/2/4/3;min-height:0}
  .learn.is-full .l-credit{grid-area:4/2/5/3;margin:0;text-align:left}
  .learn.is-full .l-end{grid-area:3/1/5/3}
  .learn.is-full .l-name{min-height:0;padding:6px 12px;overflow:hidden}
  .learn.is-full .l-cn{font-size:clamp(20px,3.4vw,26px)}
  .learn.is-full .l-sn{font-size:clamp(15px,2.6vw,18px)}
  .learn.is-full .l-facts{display:none}
  .learn.is-full .l-aka:not([hidden]){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:13px}
  .learn.is-full .l-ask b{font-size:clamp(22px,3.6vw,26px)}
  .learn.is-full .l-ctl{grid-template-columns:1fr 1fr}
  .learn.is-full .l-ctl .l-main{grid-column:1/-1;grid-row:1}
  .learn.is-full .l-ctl button{min-height:44px}
  .learn.is-full .is-untimed .l-ctl{grid-template-columns:1fr 1.5fr}
  .learn.is-full .is-untimed .l-ctl .l-main{grid-column:auto;grid-row:auto}
}
