/* Elements of the site's kit that no board draws (plans/platform/09-home-page-and-editor.md, D10; src/ui/kitSite.tsx):
   ClipCard, NewsSwitch, StatTile, Columns, ActionRow, Questions and ActionBand. Made for the home page and usable on
   any page. Every file under css/ loads on every page, so every rule here is under a .ks- class. No script: what
   opens or switches does so by :hover, :focus-within and :has(), and nothing depends on hover alone (each rule says
   what a device with no pointer and a keyboard get). */

/* The elements that sit in the kit's frame (src/ui/frame.tsx): the variables a host gives its frame, as
   components.css gives them to its own hosts. */
.ks-clip, .ks-news__stage, .ks-row {
  position: relative; isolation: isolate;
  --fr-line: var(--bronze-600); --fr-line-lo: var(--bronze-700); --fr-orn: var(--fr-line); --fr-orn-lo: var(--fr-line-lo); --fr-halo: transparent;
  --fr-echo: rgba(137, 109, 81, 0.5); --fr-gem: var(--gold-500);
  --fr-c: var(--surface-200); --fr-m: var(--surface-100); --fr-e: var(--surface-000);
  --fr-dirt: var(--gold-500); --fr-dirt-a: 0.045;
}
/* Over a picture the linework is the kit's picture frame: gold, with a dark halo under it. */
.ks-clip, .ks-news__stage { --fr-line: var(--gold-400); --fr-line-lo: var(--bronze-600); --fr-orn: var(--gold-400); --fr-orn-lo: var(--bronze-600); --fr-halo: rgba(0, 0, 0, 0.55); }

/* ---------- ClipCard ---------- */
/* A card that is all clip: a still (always there), a short silent video over it when the card has one, the title on a
   strip that fades up from the bottom, and the description under the title. The description opens when the card is
   pointed at or holds the keyboard's focus; a device with no pointer shows it open; it is in the page either way, so a
   screen reader reads it. The card keeps 16 to 9 and grows only when its words need more room than that. */
.ks-clips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ks-clip { display: grid; aspect-ratio: 16 / 9; color: var(--text); }
.ks-clip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ks-clip__in { position: relative; grid-area: 1 / 1; display: grid; align-content: end; min-width: 0; overflow: hidden; }
.ks-clip__screen { position: absolute; inset: 0; background: var(--surface-100); }
.ks-clip .ks-clip__still, .ks-clip__video { position: absolute; inset: 0; width: 100%; height: 100%; }
.ks-clip__video { display: block; object-fit: cover; }
.ks-clip__body { position: relative; isolation: isolate; display: flex; flex-direction: column; padding: 56px 22px 16px; background: linear-gradient(transparent, rgba(8, 4, 1, .86) 62%); }
/* A second, deeper shade under the words while the description is open: it fades in, and has no edge of its own. */
.ks-clip__body::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent, rgba(8, 4, 1, .62) 42%); opacity: 0; transition: opacity .25s; }
.ks-clip .ks-clip__title { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 28px; color: var(--parchment-50); text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
/* The description's row opens from nothing to its own height (no fixed height to outgrow). */
.ks-clip__more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s, opacity .25s; }
.ks-clip__words { min-height: 0; overflow: hidden; color: var(--text); }
.ks-clip__words > span { display: block; padding-top: 6px; }
.ks-clip:hover .ks-clip__more, .ks-clip:focus-within .ks-clip__more, .ks-clip:focus .ks-clip__more { grid-template-rows: 1fr; opacity: 1; }
.ks-clip:hover .ks-clip__body::before, .ks-clip:focus-within .ks-clip__body::before, .ks-clip:focus .ks-clip__body::before { opacity: 1; }
@media (hover: none) {
  .ks-clip__more { grid-template-rows: 1fr; opacity: 1; }
  .ks-clip__body::before { opacity: 1; }
}
/* Less motion asked for: the still, never the clip. The sources' own media condition keeps the file from being
   fetched; this hides the element as well, for a browser that reads the sources without it. */
@media (prefers-reduced-motion: reduce) {
  .ks-clip__video { display: none; }
}
@media (forced-colors: active) {
  .ks-clip__body { background: Canvas; }
  .ks-clip__body::before { display: none; }
  .ks-clip .ks-clip__title { color: CanvasText; text-shadow: none; }
  .ks-clip__more { grid-template-rows: 1fr; opacity: 1; }
}
@media (max-width: 760px) {
  .ks-clips { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ks-clip__body { padding: 44px 16px 14px; }
}

/* ---------- NewsSwitch ---------- */
/* One post shown large, and the list of posts beside it. The posts lie on top of each other in one cell, so the
   stage is as tall as the tallest; the newest shows until another is pointed at, or holds the focus, in the list. The
   list's posts are links: a device with no pointer shows the newest and plain links, and a keyboard reaches every
   post through the list. One post: the stage alone. */
.ks-news { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.ks-news--one { grid-template-columns: minmax(0, 1fr); }
.ks-news__stage { display: grid; min-height: 400px; }
.ks-news__in { position: relative; grid-area: 1 / 1; display: grid; min-width: 0; overflow: hidden; }
.ks-news__panel { position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 28px; isolation: isolate; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.ks-news__panel:first-child { opacity: 1; visibility: visible; }
.ks-news:has(.ks-news__item:not(:first-child):is(:hover, :focus-within)) .ks-news__panel:first-child { opacity: 0; visibility: hidden; }
.ks-news:has(.ks-news__item:nth-child(2):is(:hover, :focus-within)) .ks-news__panel:nth-child(2),
.ks-news:has(.ks-news__item:nth-child(3):is(:hover, :focus-within)) .ks-news__panel:nth-child(3),
.ks-news:has(.ks-news__item:nth-child(4):is(:hover, :focus-within)) .ks-news__panel:nth-child(4) { opacity: 1; visibility: visible; }
.ks-news .ks-news__cover { position: absolute; inset: 0; z-index: -2; }
.ks-news__panel--cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(8, 4, 1, .1) 20%, rgba(8, 4, 1, .9) 78%); }
.ks-news__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; line-height: 19px; color: var(--text); }
.ks-news__meta .st-tag, .ks-news__item .st-tag { background: rgba(0, 0, 0, .5); }
.ks-news .ks-news__title { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 34px; max-width: 20ch; }
.ks-news .ks-news__title a { color: var(--parchment-50); text-decoration: none; }
.ks-news .ks-news__title a:hover { color: var(--gold-100); text-decoration: underline; }
.ks-news__sum { max-width: 52ch; color: var(--text); }
.ks-news__go { font-size: 15px; }
.ks-news__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ks-news__item { flex: 1; display: flex; }
.ks-news .ks-news__item a { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 14px 18px; text-decoration: none; background: var(--surface-100); border: 1px solid var(--bronze-700); border-left: 3px solid var(--bronze-700); }
.ks-news .ks-news__item a:focus-visible { outline-offset: -2px; }
.ks-news__t { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 23px; color: var(--text); }
/* The post that shows is marked in the list: the newest, until another is pointed at. */
.ks-news .ks-news__item:first-child a, .ks-news .ks-news__item:is(:hover, :focus-within) a { border-left-color: var(--gold-100); background: var(--surface-200); }
.ks-news__item:first-child .ks-news__t, .ks-news__item:is(:hover, :focus-within) .ks-news__t { color: var(--gold-100); }
.ks-news:has(.ks-news__item:not(:first-child):is(:hover, :focus-within)) .ks-news__item:first-child a { border-left-color: var(--bronze-700); background: var(--surface-100); }
.ks-news:has(.ks-news__item:not(:first-child):is(:hover, :focus-within)) .ks-news__item:first-child .ks-news__t { color: var(--text); }
@media (forced-colors: active) {
  .ks-news__panel--cover::after { background: Canvas; }
  .ks-news .ks-news__cover { display: none; }
}
@media (max-width: 760px) {
  .ks-news { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ks-news__stage { min-height: 340px; }
  .ks-news__panel { padding: 20px; }
  .ks-news .ks-news__title { font-size: 24px; line-height: 28px; }
}

/* ---------- StatTile ---------- */
/* The boards' number tile (.st-tile, site.css) as an element: `lg` for a figure that carries a part of a page,
   `strong` for the one of a pair the eye should land on. */
.ks-stat--lg { padding: 20px 22px 18px; }
.ks-stat--lg .st-tile__v { font-size: 48px; line-height: 52px; }
.ks-stat--lg .st-tile__s { font-size: 14px; line-height: 20px; margin-top: 4px; }
.ks-stat--strong { border-color: var(--gold-300); background: rgba(60, 38, 16, .55); }
@media (max-width: 760px) {
  .ks-stat--lg { padding: 16px 16px 14px; }
  .ks-stat--lg .st-tile__v { font-size: 34px; line-height: 38px; }
}

/* ---------- Columns ---------- */
/* A few short columns, each under a thin gold rule: a title and its words. */
.ks-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px; }
.ks-col { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--gold-300); }
@media (max-width: 760px) {
  .ks-cols { gap: 22px; }
}

/* ---------- ActionRow ---------- */
/* One sentence and its button, in a frame: where a part of a page hands over to another page. */
.ks-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; padding: 20px 24px; }
.ks-row__text { font-family: var(--font-display); font-size: 20px; line-height: 28px; max-width: 56ch; color: var(--text); }
@media (max-width: 760px) {
  .ks-row { padding: 18px 16px; }
  .ks-row__text { font-size: 18px; line-height: 26px; }
  .ks-row .mh-btn { width: 100%; }
}

/* ---------- Questions ---------- */
/* Questions that open on a click or a key, each the browser's own disclosure. Two columns that keep their own
   questions (a balanced column layout would move one across when another opens); one column on a phone. */
.ks-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; align-items: start; }
.ks-faq__q { border-top: 1px solid var(--bronze-700); padding: 16px 0; }
.ks-faq__q > summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 26px; color: var(--gold-100); }
.ks-faq__q > summary::marker { color: var(--gold-300); }
.ks-faq__q > .ks-faq__a { margin-top: 8px; color: var(--text-muted); max-width: 52ch; }
@media (max-width: 760px) {
  .ks-faq { grid-template-columns: minmax(0, 1fr); }
  .ks-faq__q > summary { font-size: 18px; line-height: 24px; }
}

/* ---------- ActionBand ---------- */
/* A page's closing band over a picture (.st-band, site.css): a heading, a sentence and the page's one action, so a
   visitor who read to the end doesn't scroll back up for it. */
.ks-band { border-top: 1px solid var(--bronze-700); border-bottom: 0; }
.ks-band .ks-band__in { padding-block: 64px 68px; gap: 14px; }
.ks-band__acts { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: 100%; max-width: 560px; margin-top: 4px; }
.ks-band__acts > form { width: 100%; }
@media (max-width: 760px) {
  .ks-band .ks-band__in { padding-block: 40px 44px; }
  .ks-band__acts > .mh-btn { width: 100%; }
}
