/* ===========================================================================
   Applications — the Learn More tab on card 05, and the underpinning page it
   opens (5 Nov, the client's ask of 4 Nov). Everything here builds on
   site.css; the only rules of its that this file restates are the picture's
   gap under the card photographs (the tab has to end where the photograph
   does) and the recipe of the tab itself, which is Projects' "View Project"
   label.
   =========================================================================== */

/* --- the tab on card 05's photograph ----------------------------------------
   The link is laid over the photograph in the card's own "img" area, so it is
   the picture's size at every width and the card's grid is untouched: one
   more item in an area the photograph already holds, painted over it because
   it follows it in the source. Its foot has to meet the photograph's, so it
   gives up the same gap under it that site.css gives the photograph
   (.programs .card img), at the same three conditions; if that gap changes
   there, it changes here. Under 900px the photograph is the small one beside
   the number, and the link keeps to its width. */
.programs .card .learn {
  grid-area: img; align-self: stretch; justify-self: end;
  position: relative; display: block; overflow: hidden;
  width: clamp(7rem, 16vw, 13.5rem);
  border-radius: 4px; text-decoration: none;
}
@media (min-width: 900px) {
  .programs .card .learn { justify-self: stretch; width: auto; margin-bottom: .9rem; }
}
@media (min-width: 900px) and (min-height: 560px) and (max-height: 820px) and (prefers-reduced-motion: no-preference) {
  .programs .card .learn { margin-bottom: .6rem; }
}

/* The tab is .job-view from the Projects page, value for value (see site.css):
   bottom left, its whole right side cut on a slant, the deep green at 62% with
   the picture blurred under it, mid green under the pointer and the keyboard's
   focus, and set half a rem in from the picture's left edge so it can slide
   that half rem on without opening a gap; the link's overflow is what hides
   that half rem. It is a copy rather than the class because that class is
   keyed to the Projects cards and hidden without script, and this is a plain
   link that works without it. The label is the client's: "Learn More". The
   rest of the link's name is read, not shown. */
.learn-tab {
  position: absolute; left: -.5rem; bottom: 0;
  padding: .66em 2em .62em calc(.5rem + 1.05em);
  font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .1em;
  line-height: 1.2; text-transform: uppercase; white-space: nowrap; color: #fff;
  background: rgba(4, 25, 15, .62);
  -webkit-backdrop-filter: blur(8px) saturate(140%); backdrop-filter: blur(8px) saturate(140%);
  clip-path: polygon(0 0, 100% 0, calc(100% - 1em) 100%, 0 100%);
  transition: transform .4s var(--calm), background-color .2s ease;
}
/* The small photograph is 112px wide on a phone, and the tab at full size is
   about 111px, so it would cover the picture from edge to edge. Smaller type
   and shorter padding bring it to roughly four fifths of the width. */
@media (max-width: 899px) {
  .learn-tab { padding: .6em 1.6em .56em calc(.5rem + .9em); font-size: .6rem; letter-spacing: .08em; }
}
@media (prefers-reduced-transparency: reduce) {
  .learn-tab { background: rgba(4, 25, 15, .86); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (hover: hover) {
  .learn:hover .learn-tab { background: var(--kevin-mid); transform: translateX(.5rem); }
}
/* the keyboard gets the same, and a press shows at once, before the release */
.learn:focus-visible .learn-tab { background: var(--kevin-mid); transform: translateX(.5rem); }
.learn:active .learn-tab { background: var(--kevin-mid); }
/* as .job-view under reduced motion: the fill is state and stays, the slide goes */
@media (prefers-reduced-motion: reduce) {
  .learn-tab { transition: background-color .2s ease; }
  .learn:hover .learn-tab, .learn:focus-visible .learn-tab { transform: none; }
}

/* --- the underpinning page ---------------------------------------------------
   A head (the shared dark one), the client's infographic at the full width of
   the content, a way back, and the close. The graphic is a finished piece
   that fills its frame to the edge, so it is set on the page's white as it
   is, with the card's own lift and corner and nothing laid over it. */
.infographic { padding: clamp(2rem, 4vw, 3.5rem) 0 var(--pad); }
.infographic-open { display: block; color: inherit; text-decoration: none; border-radius: 10px; }
.infographic img {
  display: block; width: 100%; height: auto;
  border-radius: 10px; background: var(--l1);
  box-shadow: 0 1px 2px rgba(4, 25, 15, .07), 0 14px 30px -16px rgba(4, 25, 15, .40);
}
@media (hover: hover) { .infographic-open { cursor: zoom-in; } }

/* The graphic is 1536 wide and its smallest type is about 20px of that, so on
   a phone's 350px column it is five pixels and cannot be read. The picture is
   a link to the file itself, which every phone opens at the size it was made
   and lets the reader pinch into, and a line under it says so. From 900px the
   column is 700px or more, the type is legible where it stands, and the line
   is kept for readers who cannot see (it is still part of the link's name). */
.infographic-hint {
  display: inline-flex; align-items: center; gap: .55rem; margin-top: 1rem;
  color: var(--kevin-mid);   /* 6.3:1 on white */
}
.infographic-hint svg { width: 1.1em; height: 1.1em; flex: none; }
@media (min-width: 900px) {
  .infographic-hint {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap;
  }
}

/* The way back, in the label voice the site's small links use. It is the
   page's only exit besides the bar, which does not list this page. */
.infographic .back { margin: clamp(.9rem, 2vw, 1.6rem) 0 0; }
/* the padding makes a 44px target of an 18px line, and the margin above is
   shortened by what the padding adds */
.infographic .back a {
  display: inline-flex; align-items: center; gap: .55rem; padding: .8rem 0;
  color: var(--kevin-mid); text-decoration: none;
}
.infographic .back svg { width: 1.1em; height: 1.1em; flex: none; transition: transform .3s var(--calm); }
@media (hover: hover) {
  .infographic .back a:hover { text-decoration: underline; text-underline-offset: .3em; }
  .infographic .back a:hover svg { transform: translateX(-.25rem); }
}
@media (prefers-reduced-motion: reduce) {
  .infographic .back svg { transition: none; }
  .infographic .back a:hover svg { transform: none; }
}
