/* The Product page (views/sw_product.templ), on the kit in swiss.css. */

/* The first screen: the mono label in the 312px column beside the title and its line, then the index of the six
   areas, each under an ink rule. 120px from the bar, 96px between the words and the index at 1440. */
.swprod-intro {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 6.67vw, 96px);
  width: min(var(--sw-col), 100% - 2 * var(--sw-gutter));
  margin-inline: auto;
  padding-top: clamp(56px, 8.33vw, 120px);
}
.swprod-intro__top {
  display: flex;
  gap: 24px;
}
.swprod-intro__label {
  flex-shrink: 0;
  width: var(--sw-label);
  padding-top: 14px;
  font-family: var(--sw-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 16px;
  color: var(--db-fg);
}
.swprod-intro__words {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}
.swprod-intro .sw-display {
  max-width: none;
  text-wrap: initial;
}
.swprod-intro .sw-sub {
  max-width: 620px;
}

/* The six areas as tabs, standing in a column like a product's menu: each tab its pictogram beside its number and
   name, with a bar in its area's field down its left edge. The chosen tab takes the field's soft colour and runs
   straight into its panel on the right, like a folder; the others lighten to it under the pointer. */
.swprod-areas {
  display: grid;
  grid-template-columns: var(--sw-label) minmax(0, 1fr);
  width: min(var(--sw-col), 100% - 2 * var(--sw-gutter));
  margin: calc(var(--sw-gap) * -0.4) auto 0;
}
.swprod-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 0;
}
.swprod-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px 12px 12px;
  border-left: 4px solid var(--db-field);
  color: var(--db-fg);
  text-decoration: none;
  cursor: pointer;
}
.swprod-tab:hover {
  background: color-mix(in srgb, var(--db-field-soft) 55%, transparent);
}
.swprod-tab[aria-selected="true"] {
  background: var(--db-field-soft);
}
.swprod-tab:focus-visible {
  outline: 2px solid var(--db-fg);
  outline-offset: -2px;
}
.swprod-tab .sw-pict {
  width: 77px;
  height: 66px;
}
.swprod-tab__words {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.swprod-tab__n {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  color: var(--db-field-text);
}
.swprod-tab__name {
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 26px;
}
.swprod-tab[aria-selected="true"] .swprod-tab__name {
  font-weight: 500;
}
.swprod-pict__tick {
  stroke: var(--db-field-ink);
  stroke-width: 3;
}
.swprod-pict__faint {
  stroke: var(--db-fg-4);
}

/* The chosen area's panel, in the tab's soft colour: its sentence, nine features as white tiles each with a tick in the
   field, then a pill in the field to the area's own page. */
.swprod-panel {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 40px;
  padding: clamp(28px, 4vw, 56px);
  background: var(--db-field-soft);
}
.swprod-panel[hidden] {
  display: none;
}
/* without the script, a tab's link still opens its panel */
.swprod-areas:not(.is-tabs) .swprod-panel[hidden]:target {
  display: flex;
}
.swprod-areas:not(.is-tabs):has(.swprod-panel:target) .swprod-panel:not(:target) {
  display: none;
}
.swprod-title {
  max-width: 860px;
  font-size: clamp(30px, 1.4rem + 1.6vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.09;
}
.swprod-feats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.swprod-feats li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 20px;
  border-radius: 14px;
  background: var(--db-raised);
}
.swprod-feat__tick {
  margin-bottom: 6px;
  fill: var(--db-field);
  stroke: var(--db-field-ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.swprod-feat__tick path {
  fill: none;
}
.swprod-feat__t {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 23px;
}
.swprod-feat__d {
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 21px;
  color: var(--db-fg-2);
}
.sw-page a.swprod-go {
  display: inline-flex;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--db-field);
  color: var(--db-field-ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
}
.sw-page a.swprod-go:hover {
  background: var(--db-field-hover);
}

@media (max-width: 1200px) {
  .swprod-feats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .swprod-areas {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .swprod-tab .sw-pict {
    width: 56px;
    height: 48px;
  }
  .swprod-tab__name {
    font-size: 19px;
    line-height: 24px;
  }
}
@media (max-width: 900px) {
  .swprod-title br {
    display: none;
  }
  .swprod-intro__top {
    flex-direction: column;
    gap: 24px;
  }
  .swprod-intro__label {
    width: auto;
    padding-top: 0;
  }
}
/* Below 900 the tabs lie down in one row that scrolls sideways, each topped by its bar, over the panel. */
@media (max-width: 900px) {
  .swprod-areas {
    display: block;
  }
  .swprod-tabs {
    flex-direction: row;
    margin-inline: calc(var(--sw-gutter) * -1);
    padding-inline: var(--sw-gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--sw-gutter);
    scrollbar-width: none;
  }
  .swprod-tabs::-webkit-scrollbar {
    display: none;
  }
  .swprod-tab {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: start;
    gap: 8px;
    min-width: 128px;
    padding: 14px 14px 16px;
    border-left: 0;
    border-top: 4px solid var(--db-field);
    scroll-snap-align: start;
  }
}
@media (max-width: 600px) {
  .swprod-feats {
    grid-template-columns: minmax(0, 1fr);
  }
}
