/* Silent Honor Foundation: the programs carousel on the homepage.

   A row of program cards you slide sideways, after the Gary Sinise
   Foundation's "How We Serve": about three and a quarter cards show on a
   laptop, so the one cut off at the edge says there is more; round arrow
   buttons move it one card at a time; a phone swipes it. It never moves by
   itself. A slide that rotates on a timer takes the text away while
   somebody is reading it, and it is the first thing screen reader users
   ask sites to switch off.

   Each card is a photo on top and the words underneath. Until a program has
   its own photograph, the photo space shows the site's own map texture and
   the program's icon. It is not a stand-in image and it does not say
   "photo coming soon". To give a card a photo, replace its .prog-art block
   with <img src="images/programs/NAME.jpg" alt="..."> inside .prog-media. */

.programs{overflow-x:clip}
.prog{container-type:inline-size;--prog-gap:20px}

.prog-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:20px 24px;margin-bottom:36px}
.prog-arrows{display:flex;gap:10px}
.prog-arrow{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:50%;
  background:#FFFFFF;color:#17202F;border:1px solid #E1E3E8;box-shadow:0 4px 14px rgba(0,0,0,.28);cursor:pointer;
  transition:transform .16s ease,opacity .16s ease}
.prog-arrow:hover:not(:disabled){transform:translateY(-1px)}
.prog-arrow:disabled{opacity:.35;cursor:default;box-shadow:none}
.prog-arrow:focus-visible{outline:2px solid var(--gold-2);outline-offset:3px}
.prog-arrow svg{width:18px;height:18px}
.prog-arrows[hidden]{display:none}

/* The track runs past the right edge of the page column to the edge of the
   screen, so the next card is visibly cut off rather than neatly boxed in.
   100cqw is the width of the page column; the difference to 100vw is the
   margin either side of it. */
.prog-track{list-style:none;margin:0 calc((100cqw - 100vw) / 2) 0 0;padding:4px 0 26px;
  display:grid;grid-auto-flow:column;gap:var(--prog-gap);
  grid-auto-columns:calc((100cqw - 2 * var(--prog-gap)) / 3.25);
  overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scroll-behavior:smooth;
  scrollbar-width:none}
.prog-track::-webkit-scrollbar{display:none}
.prog-track:focus-visible{outline:2px solid var(--gold-2);outline-offset:6px;border-radius:12px}
@media(prefers-reduced-motion:reduce){.prog-track{scroll-behavior:auto}}

.prog-card{scroll-snap-align:start;display:flex}
.prog-card > a,.prog-card > div{display:flex;flex-direction:column;width:100%;background:#FFFFFF;color:#1F2430;
  border-radius:12px;overflow:hidden;text-decoration:none;
  box-shadow:0 16px 34px -18px rgba(0,0,0,.8);transition:transform .2s ease,box-shadow .2s ease}
.prog-card > a:hover{transform:translateY(-4px);box-shadow:0 22px 40px -18px rgba(0,0,0,.9)}
.prog-card > a:focus-visible{outline:2px solid var(--gold-2);outline-offset:4px}
@media(prefers-reduced-motion:reduce){.prog-card > a{transition:none}.prog-card > a:hover{transform:none}}

/* Until a card has a photo, the panel has to read as part of the card and
   not as a hole in it: a step lighter than the page, and not as tall. A
   photo gets the full 4:3. */
.prog-media{position:relative;aspect-ratio:16 / 10;background:linear-gradient(160deg,#1C2B48,#121E35);overflow:hidden}
.prog-media:has(img){aspect-ratio:4 / 3}
.prog-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.prog-art{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.prog-art .terrain{opacity:.42}
.prog-art svg{position:relative;z-index:1;width:58px;height:58px;color:var(--gold-2)}
.prog-card:nth-child(1) .terrain{-webkit-mask-position:12% 30%;mask-position:12% 30%}
.prog-card:nth-child(2) .terrain{-webkit-mask-position:70% 20%;mask-position:70% 20%}
.prog-card:nth-child(3) .terrain{-webkit-mask-position:35% 80%;mask-position:35% 80%}
.prog-card:nth-child(4) .terrain{-webkit-mask-position:88% 62%;mask-position:88% 62%}
.prog-card:nth-child(5) .terrain{-webkit-mask-position:50% 50%;mask-position:50% 50%}

.prog-body{display:flex;flex-direction:column;flex:1;padding:20px 22px 22px}
.prog-body h3{font:700 17.5px/1.3 var(--body);letter-spacing:-.005em;color:#1F2430;margin:0}
.prog-body p{font-size:15px;line-height:1.6;color:#545A66;margin:8px 0 0}
.prog-go{margin-top:auto;padding-top:16px;font:600 14px/1.3 var(--body);color:var(--red)}
.prog-go.dev{color:#8A6410}

.prog-foot{margin-top:6px}
.prog-foot a{font:600 15px/1.3 var(--body);color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.prog-foot a:hover{color:var(--gold-2)}

@media(max-width:900px){.prog-track{grid-auto-columns:calc((100cqw - var(--prog-gap)) / 2.2)}}
@media(max-width:640px){
  .prog{--prog-gap:14px}
  .prog-track{grid-auto-columns:84cqw}
  .prog-head{margin-bottom:26px}
}
