/*
 * Catalog + landing sections.
 *
 * The layouts here mirror the marketplace reference page-by-page: the catalog
 * hero, the popular pill row, the category card grid, the skill columns, the
 * curated collections and the A–Z category index.
 *
 * Loads after site.css, so these win on equal specificity.
 */

/* ---- tabs ---------------------------------------------------------------- */

/*
 * The homepage's middle sections used to render everything at once — ten skill
 * columns, then three process steps, then plans — which read as an
 * unmanageable wall. Tabs are how the reference handles the same content, and
 * they collapse it to one view at a time without hiding anything.
 *
 * Progressive enhancement: every panel is in the markup, and the tab controls
 * are links to anchors, so the content is all reachable and indexable with
 * JavaScript disabled. JS upgrades it to an interactive tablist.
 */
.mk-tabs {
  margin: 0;
}

/* Positioned frame for the scrolling strip. The fades and the arrows live here
   rather than on .mk-tabs__list itself, because anything inside an
   overflow-x container scrolls with the content and would slide away. */
.mk-tabs__scroll {
  position: relative;
  margin: 0 0 22px;
}

.mk-tabs__scroll::before,
.mk-tabs__scroll::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 1px;
  width: 56px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 1;
}

.mk-tabs__scroll::before {
  left: 0;
  background: linear-gradient(to right, var(--surface), transparent);
}

.mk-tabs__scroll::after {
  right: 0;
  background: linear-gradient(to left, var(--surface), transparent);
}

/* JS sets these from the real scroll position; without it the strip is
   either fully visible or has nothing to scroll, so nothing is hidden. */
.mk-tabs__scroll.has-left::before { opacity: 1; }
.mk-tabs__scroll.has-right::after { opacity: 1; }

/* On a tinted section the fade has to match that section's own background or it
   reads as a grey smear. The tint is --surface-3, not --surface-2. */
.mk-section--tint .mk-tabs__scroll::before {
  background: linear-gradient(to right, var(--surface-3), transparent);
}

.mk-section--tint .mk-tabs__scroll::after {
  background: linear-gradient(to left, var(--surface-3), transparent);
}

.mk-tabs__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: -18px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, color .15s ease, border-color .15s ease;
}

.mk-tabs__nav--prev { left: -6px; }
.mk-tabs__nav--next { right: -6px; }

.mk-tabs__scroll.has-left .mk-tabs__nav--prev,
.mk-tabs__scroll.has-right .mk-tabs__nav--next {
  opacity: 1;
  pointer-events: auto;
}

.mk-tabs__nav:hover {
  color: var(--brand-700);
  border-color: var(--brand-600);
}

.mk-tabs__nav:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

.mk-tabs__list {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0 0 1px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}

.mk-tabs__list::-webkit-scrollbar {
  display: none;
}

.mk-tabs__tab {
  position: relative;
  flex: 0 0 auto;
  padding: 11px 16px 13px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease;
}

.mk-tabs__tab:hover {
  color: var(--ink);
}

.mk-tabs__tab:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: -2px;
  border-radius: var(--r-sm);
}

.mk-tabs__tab[aria-selected='true'],
.mk-tabs__tab.is-active {
  color: var(--brand-700);
  font-weight: 600;
}

.mk-tabs__tab[aria-selected='true']::after,
.mk-tabs__tab.is-active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-600);
}

/* Without scripting the tabs cannot switch anything, and their hrefs point at
   ids that only exist once the script has run. So the tab strip is dropped and
   every panel is shown stacked — the visitor loses the one-at-a-time view and
   keeps all the content, which is the right way round. */
.no-js .mk-tabs__list { display: none; }
.no-js .mk-tabs__panel[hidden] { display: block; }
.no-js .mk-tabs__panel + .mk-tabs__panel { margin-top: 28px; }

.mk-tabs__panel[hidden] {
  display: none;
}

.mk-tabs__panel:focus-visible {
  outline: none;
}

/* ---- section rhythm ------------------------------------------------------ */

.mk-section--flush {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* Split banner under the hero: promise on one side, explanation on the other. */
.mk-split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}

.mk-split h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 10px 0 0;
}

.mk-split > p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
}

@media (max-width: 820px) {
  .mk-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---- popular searches ---------------------------------------------------- */

.mk-searches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.mk-searches a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}

.mk-searches a:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
}

.mk-searches svg {
  flex: 0 0 auto;
  color: var(--muted-2);
}

/* ---- skill columns ------------------------------------------------------- */

.mk-skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

/* Inside a tab panel there is one department per view, so the columns can go
   two-up with room for the description rather than ten cramped columns. */
.mk-skills--split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 32px;
  align-items: start;
}

@media (max-width: 760px) {
  .mk-skills--split {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.mk-skills__lede {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* A row of links inside a tab panel: label on one line, price on the right.
   Replaces the old ten-column dump where every price stacked under its title. */
.mk-linkrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color .12s ease, color .12s ease;
}

.mk-linkrow:hover {
  background: var(--surface-2);
  color: var(--brand-700);
}

.mk-linkrow:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: -2px;
}

.mk-linkrow span {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.mk-skills__col h3 {
  font-size: 14px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.mk-skills__col h3 a {
  color: var(--ink);
  text-decoration: none;
}

.mk-skills__col h3 a:hover {
  color: var(--brand-700);
}

.mk-skills__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mk-skills__col li a {
  display: block;
  padding: 5px 0;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
}

.mk-skills__col li em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.mk-skills__col li a:hover {
  color: var(--brand-700);
}

/* ---- catalog hero -------------------------------------------------------- */

.mk-cataloghero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(800px 260px at 15% -50%, rgba(12, 135, 234, .12), transparent 70%),
    var(--surface);
}

.mk-cataloghero h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -.025em;
  margin: 0 0 14px;
  max-width: 20ch;
}

.mk-cataloghero p {
  max-width: 62ch;
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* The line under the hero search that says how many of these are hourly. Sits
   closer to the search than the paragraph above does, and is deliberately
   quieter — it is a caveat about the prices, not a pitch. */
.mk-cataloghero__hint {
  max-width: none;
  margin: 12px 0 20px;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---- pill row ------------------------------------------------------------ */

.mk-pillrow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mk-pillrow a {
  display: inline-block;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}

.mk-pillrow a:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
}

/* ---- category card grid -------------------------------------------------- */

/* Deliberately NOT .mk-cats. That class is the horizontal pill strip, and its
   `.mk-cats a { white-space: nowrap }` is what makes a pill one line. Sharing
   the base class gave every department blurb nowrap too: each ~120-char
   sentence rendered as one 800px line inside a 256px card, and the page grew a
   544px horizontal scrollbar. Two components, two class names. */
.mk-catgrid {
  display: grid;
  /* auto-fit, not auto-fill: the shop sells exactly three departments, and
     auto-fill reserves tracks for cards that do not exist — three cards laid
     into a five-column track covered only three-fifths of the page width.
     auto-fit collapses the empty tracks, so the cards stretch across the
     full measure. The 218px floor keeps the same wrapping behaviour if a
     fourth department is ever added. */
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: 14px;
}

/* Below 760px the three-across row no longer fits without squeezing the
   blurb, and two columns leave a ragged half-empty second row — so the cards
   stack, each one full width. */
@media (max-width: 760px) {
  .mk-catgrid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mk-catgrid__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}

/* The <picture> around the card art is a passthrough — the img keeps the
   flex slot it had when it was emitted bare. */
.mk-catgrid__card picture { display: contents; }

.mk-catgrid__card:hover {
  border-color: var(--brand-600);
  transform: translateY(-2px);
}

/* The hosted department illustration. Full-bleed to the card's content box
   above the title, 16:9 to match the source raster. The image is decorative
   (alt="") — the card's strong text is the real label. */
.mk-catgrid__img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.mk-catgrid__card strong {
  font-size: 15.5px;
  color: var(--ink);
}

.mk-catgrid__card span {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-700);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mk-catgrid__card em {
  font-style: normal;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ---- catalogue search state --------------------------------------------- */

/* The head itself is styled in site.css alongside the sort control. Only the
   active-query line is new, and it sits under the title inside the head's first
   column — so it aligns to the title's left edge rather than stretching. */
.mk-results__active {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.mk-results__active::before {
  content: 'Matching ';
  color: var(--muted-2);
}

.mk-empty__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ---- get inspired -------------------------------------------------------- */

/* Three columns of real entry points. The section used to be a heading with
   nothing under it, so it is worth making the columns line up: same heading
   baseline, same list rhythm, links that all look the same. */
.mk-inspire {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Infographic cards: tinted icon tile, headline stat, outlined index. */
.mk-inspire__col {
  --inspire-accent: var(--brand-600);
  position: relative;
  overflow: hidden;
  padding: 22px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.mk-inspire__col--fast { --inspire-accent: #f5a623; }
.mk-inspire__col--price { --inspire-accent: #7c6cf6; }
.mk-inspire__col--skills { --inspire-accent: var(--brand-600); }

.mk-inspire__col:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--inspire-accent) 38%, var(--line));
  box-shadow: 0 14px 30px -16px rgba(24, 24, 27, .18);
}

/* Big outlined index numeral (01/02/03) top-right — set marker. */
.mk-inspire__col::before {
  content: attr(data-num);
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: color-mix(in srgb, var(--inspire-accent) 18%, transparent);
  font-variant-numeric: tabular-nums;
}

.mk-inspire__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--inspire-accent) 13%, #fff);
  color: color-mix(in srgb, var(--inspire-accent) 72%, #18181b);
}

.mk-inspire__col h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 750;
}

.mk-inspire__col > p {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
}

.mk-inspire__stat {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 12px;
  padding: 10px 13px;
  border: 1px solid color-mix(in srgb, var(--inspire-accent) 26%, #fff);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--inspire-accent) 8%, #fff);
}

.mk-inspire__stat strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: color-mix(in srgb, var(--inspire-accent) 74%, #18181b);
  font-variant-numeric: tabular-nums;
}

.mk-inspire__stat span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #646975;
}

.mk-inspire__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-inspire__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.mk-inspire__list a:hover {
  background: color-mix(in srgb, var(--inspire-accent) 7%, #fff);
  color: color-mix(in srgb, var(--inspire-accent) 82%, #18181b);
  box-shadow: inset 3px 0 0 var(--inspire-accent);
}

.mk-inspire__list a:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: -2px;
}

.mk-inspire__list span {
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  color: #646975;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .mk-inspire { grid-template-columns: 1fr; gap: 18px; }
}

/*
 * "Show N more" under the capped results grid. The default view shows a
 * decision-sized slice; this reveals the rest without a page load.
 */
.mk-more {
  display: block;
  margin: 18px auto 0;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font: 650 13.5px/1 var(--font);
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
}

.mk-more:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
}

/* ---- A–Z category index -------------------------------------------------- */

/* Removed: the catalogue listed all ten departments twice, once as cards near
   the top and again as this index at the bottom. The cards are the better
   entry point, so the index went rather than the cards. */

@media (max-width: 760px) {
  .mk-allycats {
    columns: 1;
  }
}