/* =====================================================================
   SMAKSSTIGEN, stiler, «smaker omtrent som» og match
   Stigen er Vinvetts eget kjennetegn: en linje fra lett til kraftig,
   der hver vin og hvert øl har sin plass.
   ===================================================================== */

.stige {
  --stige-farge: linear-gradient(90deg, #f1e3a6 0%, #f0c9b4 30%, #e7a1a4 42%, #a9435a 62%, #7b2541 80%, #3e0f20 100%);
  position: relative;
  margin: 10px 0 6px;
}
body[data-mode='ol'] .stige {
  --stige-farge: linear-gradient(90deg, #f6dc7a 0%, #e9b64c 35%, #c97a2a 60%, #7a3e14 82%, #2a1608 100%);
}
.stige-linje {
  position: relative;
  height: 12px;
  border-radius: 99px;
  background: var(--stige-farge);
  box-shadow: inset 0 0 0 1px rgba(28, 23, 21, 0.18);
}
.stige-ender {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 13px;
  color: var(--stone);
}

/* Markøren «Her» på vin- og ølsiden */
.stige-her {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ink);
}
.stige-her span {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.stilblokk .stige {
  margin-top: 34px;
}

/* Stilene som små merker på linjen (vin-/ølsiden) */
.stige:not(.klikkbar) .stige-stiler {
  position: absolute;
  inset: 0 0 auto 0;
  height: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.stige:not(.klikkbar) .stige-stiler li {
  position: absolute;
  top: 50%;
  left: calc(var(--x) * 100%);
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.stige:not(.klikkbar) .stige-navn {
  display: none;
}

/* ---------- Klikkbar stige på Lær-siden ---------- */
.stige.klikkbar {
  margin: 18px 0 8px;
  padding: 44px 56px 44px;
}
.stige.klikkbar .stige-ender {
  margin-top: 0;
  position: absolute;
  left: 56px;
  right: 56px;
  bottom: 10px;
}
.stige.klikkbar .stige-stiler {
  position: absolute;
  inset: 0 56px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stige.klikkbar .stige-stiler li {
  position: absolute;
  left: calc(var(--x) * 100%);
  transform: translateX(-50%);
  top: 0;
}
.stige.klikkbar .stige-stiler li:nth-child(even) {
  top: auto;
  bottom: 22px;
}
.stige.klikkbar .stige-stiler li:nth-child(odd) {
  top: 2px;
}
.stige.klikkbar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--card-line);
  border-radius: 99px;
  background: #fff;
  color: var(--ink);
  font: 500 14px var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.stige.klikkbar button:hover {
  border-color: var(--garnet);
}
.stige.klikkbar button[aria-pressed='true'] {
  background: var(--garnet);
  border-color: var(--garnet);
  color: #fff;
}
.stige-prikk {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

/* Smal skjerm: stigen står loddrett, som en ekte stige */
@media (max-width: 820px) {
  .stige.klikkbar {
    padding: 0 0 0 30px;
  }
  .stige.klikkbar .stige-stiler {
    inset: auto;
  }
  .stige.klikkbar .stige-linje {
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 12px;
    height: auto;
    background: var(--stige-farge);
    background-image: linear-gradient(180deg, #f1e3a6 0%, #f0c9b4 30%, #e7a1a4 42%, #a9435a 62%, #7b2541 80%, #3e0f20 100%);
  }
  body[data-mode='ol'] .stige.klikkbar .stige-linje {
    background-image: linear-gradient(180deg, #f6dc7a 0%, #e9b64c 35%, #c97a2a 60%, #7a3e14 82%, #2a1608 100%);
  }
  .stige.klikkbar .stige-stiler {
    position: static;
    display: grid;
    gap: 6px;
  }
  .stige.klikkbar .stige-stiler li,
  .stige.klikkbar .stige-stiler li:nth-child(odd),
  .stige.klikkbar .stige-stiler li:nth-child(even) {
    position: static;
    transform: none;
  }
  .stige.klikkbar button {
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
  }
  .stige.klikkbar .stige-ender {
    display: none;
  }
}

/* ---------- Lær-siden: valgt stil ---------- */
.stilguide {
  margin-top: 56px;
}
.stil-valgt {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid var(--card-line);
  border-radius: var(--r);
  background: var(--surface);
}
.stil-navn {
  margin: 0 0 4px;
  font-family: var(--title);
  font-weight: 400;
  font-size: 24px;
}
.stil-valgt > p {
  margin: 0 0 8px;
  font-size: 16px;
}
.stil-liste,
.lik-liste {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.stil-kort,
.lik-kort {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.stil-kort:hover,
.lik-kort:hover {
  border-color: var(--garnet);
}
.stil-kort .swatch,
.lik-kort .swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.stil-kort span,
.lik-kort span {
  display: grid;
  min-width: 0;
}
.stil-kort b,
.lik-kort b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stil-kort small,
.lik-kort small {
  color: var(--stone);
  font-size: 13px;
}
.lik-liste {
  grid-template-columns: 1fr;
}

/* ---------- Vin-/ølsiden: seksjoner ---------- */
.dblokk,
.stilblokk {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.dblokk .profile-bars {
  margin-top: 4px;
}
.dblokk .foods {
  margin: 4px 0 0;
}
.stil-om {
  margin: 8px 0 0;
}
.match {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0 6px;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: var(--r-sm);
  background: #fff;
}
.match-tall {
  font-family: var(--title);
  font-size: 28px;
  color: var(--garnet);
  line-height: 1;
}
.match span:last-child {
  display: grid;
  font-weight: 600;
}
.match small {
  font-weight: 400;
  color: var(--stone);
  font-size: 13px;
}
.match-tom {
  margin: 12px 0 0;
}

#detail .dblokk .section-h,
#detail .stilblokk .section-h,
.dblokk .section-h,
.stilblokk .section-h {
  font-size: 20px !important;
  margin: 0 0 8px;
}
.stilblokk .section-h + .lik-liste {
  margin-top: 4px;
}
.stilblokk .match-tom + .section-h,
.stilblokk .match + .section-h {
  margin-top: 20px;
}
#detail .stilblokk .section-h:not(:first-child) {
  margin-top: 24px !important;
}

/* Forsiden */
.home-stige .stige.klikkbar {
  margin-top: 8px;
}
.home-stige > p {
  max-width: 62ch;
}
