/* Kit index pages -- every page scripts/add-pages generates from
 * inventory/kit-index.json and templates/pages/kit-index.html. Loaded by those
 * pages alone, for the same reason as static/kit.css: a selector here that
 * escaped its as-kidx- prefix would otherwise restyle all seventy pages.
 *
 * It is linked immediately before the shim's stylesheet, so these rules win
 * over every Wix <style> block without !important.
 *
 * COLOURS AND FONTS as static/kit.css has them, so an index and the kits it
 * lists read as one set: the brand navy and yellow are the site theme's own
 * variables, questrial is the site's only face. The navy breadcrumb and
 * banner are the kit pages' too.
 *
 * TWO VIEWPORT WIDTHS, as on the kit pages: the mobile tree is pinned to
 * 320px and the desktop tree is never usefully narrower than 980px, so the
 * base rules are the phone and one media query adds the rest.
 */

/* ---- shared ------------------------------------------------------------- */

.as-kidx {
  --as-navy: rgb(var(--color_11));
  --as-yellow: rgb(var(--color_43));
  --as-ink: #1a1f36;
  --as-body: #4a5068;
  --as-dim: #626f8c;
  --as-on-navy: #d9ddee;
  --as-on-navy-dim: #b9c0d8;
  --as-panel: #eef1f7;
  --as-line: #dfe3ec;
  --as-line-strong: #cbcfd9;
  --as-blue-dark: #3a5bb4;

  box-sizing: border-box;
  padding-bottom: 56px;
  background: #f4f5f9;
  font-family: questrial, sans-serif;
  color: var(--as-body);
}

.as-kidx *,
.as-kidx *::before,
.as-kidx *::after { box-sizing: inherit; }

/* :where() so the reset adds no specificity -- see static/program.css. */
.as-kidx :where(p, h1, h2, ul, li) { margin: 0; padding: 0; }
.as-kidx :where(ul) { list-style: none; }

/* The search hides cards and themes with the hidden attribute. Every display
 * rule below would otherwise beat the browser's own [hidden] rule. */
.as-kidx [hidden] { display: none !important; }

.as-kidx-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

.as-kidx a:focus-visible,
.as-kidx-search-input:focus-visible {
  outline: 3px solid var(--as-yellow);
  outline-offset: 3px;
}

/* ---- breadcrumb and banner, as on the kit pages ------------------------- */

.as-kidx-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 14px;
  font-size: 15px;
  color: var(--as-on-navy);
  background: var(--as-navy);
  box-shadow: 0 0 0 100vmax var(--as-navy);
  clip-path: inset(0 -100vmax);
}

.as-kidx-crumbs a { color: #fff; text-decoration: underline; }
.as-kidx-crumbs a:hover,
.as-kidx-crumbs a:focus { color: var(--as-yellow); }
.as-kidx-crumbs [aria-current] { color: #fff; font-weight: bold; }

.as-kidx-hero {
  padding: 16px 0 24px;
  background: var(--as-navy);
}

.as-kidx-hero-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.as-kidx-h1 {
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  line-height: 1.15;
}

.as-kidx-intro {
  margin-top: 8px;
  color: var(--as-on-navy);
  font-size: 16px;
  line-height: 1.5;
}

.as-kidx-search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--as-on-navy-dim);
  font-size: 13px;
}

.as-kidx-search-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--as-ink);
  font-family: questrial, sans-serif;
  font-size: 16px;
}

/* ---- jump links, count, generic template -------------------------------- */

.as-kidx-main { padding-top: 22px; }

.as-kidx-jumps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.as-kidx-jumps-label {
  margin-right: 4px;
  color: var(--as-dim);
  font-size: 14px;
}

.as-kidx-jump {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--as-line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--as-navy);
  font-size: 14px;
  text-decoration: none;
}

.as-kidx-jump:hover { background: var(--as-panel); color: var(--as-navy); }

.as-kidx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 16px;
}

.as-kidx-count {
  color: var(--as-dim);
  font-size: 15px;
}

.as-kidx-generic {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--as-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--as-navy);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.as-kidx-generic:hover { background: var(--as-panel); color: var(--as-navy); }

/* ---- themes and cards --------------------------------------------------- */

.as-kidx-theme {
  padding-top: 28px;
  scroll-margin-top: 16px;
}

.as-kidx-h2 {
  margin-bottom: 14px;
  color: var(--as-ink);
  font-size: 22px;
  font-weight: bold;
  line-height: 1.25;
}

.as-kidx-h2-count {
  margin-left: 8px;
  color: var(--as-dim);
  font-size: 14px;
  font-weight: normal;
}

/* One column on the 320px phone: the flyer is the reason to look. */
.as-kidx-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.as-kidx-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--as-line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.as-kidx-card:hover { color: inherit; }

/* Every flyer is shown whole. The box is the print flyer's shape (8.5 x 11
 * in, exported 1545x2000), the tallest flyer there is, so cards in a row
 * line up; a 4:5 social flyer sits in it with a thin band above and below
 * rather than having its bottom strip cut off. */
.as-kidx-flyer {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1545 / 2000;
  object-fit: contain;
  background: #fff;
}

.as-kidx-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 16px;
}

.as-kidx-card-title {
  color: var(--as-ink);
  font-size: 17px;
  font-weight: bold;
  line-height: 1.3;
}

.as-kidx-card-line {
  font-size: 14px;
  line-height: 1.4;
}

.as-kidx-card-link {
  margin-top: auto;
  padding-top: 10px;
  color: var(--as-blue-dark);
  font-size: 15px;
  font-weight: bold;
}

.as-kidx-none {
  margin-top: 24px;
  padding: 28px;
  border: 1px dashed var(--as-line-strong);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  text-align: center;
}

/* ---- trailer ------------------------------------------------------------ */

.as-kidx-trailer { padding-top: 40px; }

.as-kidx-video .as-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 724 / 484;
  border-radius: 12px;
  background: #000;
}

.as-kidx-trailer-caption {
  margin-top: 10px;
  color: var(--as-ink);
  font-size: 18px;
  text-align: center;
}

/* ---- wider screens ------------------------------------------------------ */

@media (hover: hover) {
  .as-kidx-card:hover {
    box-shadow: 0 8px 20px rgba(46, 63, 102, 0.18);
    transform: translateY(-2px);
  }
}

@media (min-width: 601px) {
  .as-kidx-hero-grid {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px 40px;
  }

  .as-kidx-hero-text { flex: 1 1 420px; min-width: 0; }
  .as-kidx-search { flex: 0 1 360px; min-width: 240px; }
  .as-kidx-h1 { font-size: 34px; }
  .as-kidx-h2 { font-size: 24px; }

  .as-kidx-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  .as-kidx-video { max-width: 724px; margin: 0 auto; }
}
