/* "Dalen din" (improvement loop, round 26): the taste map remembers where the visitor has been. Loaded with assets/valley.js. */

/* ---------- Under the map: how far the visitor has come, and where to go next ---------- */
.fb-vly__panel { min-height: 5.2rem; margin: 16px 0 0; color: var(--skifer); }
.fb-vly__panel:not(.is-ready) { visibility: hidden; }
.fb-vly-has .fb-vly__panel { min-height: 16.5rem; }
.fb-vly-off .fb-vly-chip, .fb-vly-off .fb-vlyt { display: none; } /* a browser that will not keep the marks is not offered the switch on the coffee page or the stamps */
/* The room kept for the panel is measured at 320, 390, 768 and 1440 px, for no marks, one, three and six or more. */
@media (max-width: 560px) { .fb-vly__panel { min-height: 6.9rem; } .fb-vly-has .fb-vly__panel { min-height: 20.5rem; } }
@media (max-width: 380px) { .fb-vly__panel { min-height: 8.2rem; } .fb-vly-has .fb-vly__panel { min-height: 25rem; } }
.fb-vly__panel p { margin: 0 0 10px; }
.fb-vly__count { font-size: 1rem; }
.fb-vly__count b { color: var(--blekk); }
.fb-vly__next { max-width: 46rem; padding: 12px 16px; border: 1px solid var(--rimfrost); border-radius: 12px; background: var(--nysno); color: var(--blekk); line-height: 1.45; }
.fb-vly__next a { font-weight: 700; }
.fb-vly__box .fb-btn { justify-content: center; max-width: 100%; text-align: center; text-wrap: balance; }
.fb-vly__names { display: block; margin-top: 8px; color: var(--skifer); font-size: 0.9rem; }
.fb-vly__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; margin: 0; font-size: 0.9rem; }
.fb-vly__link { min-height: 44px; padding: 0; border: 0; background: none; color: var(--blatimen); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fb-vly__priv { color: var(--skifer); font-size: 0.85rem; }

/* ---------- The three-way switch: Ikke smakt, Smakt, Favoritt ---------- */
.fb-vly__card { margin: 0 0 14px; }
.fb-vly__sw { display: inline-flex; min-width: 0; max-width: 100%; margin: 0 0 8px; padding: 3px; border: 1px solid var(--skifer); border-radius: 999px; background: var(--nysno); }
.fb-vly__sw label { position: relative; display: block; margin: 0; cursor: pointer; } /* the theme gives a label a bottom margin, which made the last option taller than the others */
.fb-vly__sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fb-vly__sw span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--skifer); font-size: 0.92rem; font-weight: 700; white-space: nowrap; transition: background-color 160ms var(--fb-ease), color 160ms var(--fb-ease); }
.fb-vly__sw svg { width: 16px; height: 16px; flex: none; }
.fb-vly__sw input:checked + span { background: var(--blekk); color: var(--nysno); }
/* every checked option is ink: the cup and the star tell the two kinds of mark apart, so the switch adds no colour */
.fb-vly__sw input:focus-visible + span { outline: 3px solid var(--blatimen); outline-offset: 2px; }
.fb-vly__sw.is-example { opacity: 0.6; }
.fb-vly__line { margin: 0 0 8px; color: var(--skifer); font-size: 0.92rem; line-height: 1.4; }
.fb-vly__line a { font-weight: 700; }
@media (max-width: 380px) { .fb-vly__sw span { padding: 0 10px; font-size: 0.86rem; } }
@media (max-width: 340px) { .fb-vly__sw span { gap: 4px; padding: 0 7px; font-size: 0.8rem; } .fb-vly__sw svg { width: 14px; height: 14px; } }

/* ---------- On the map ---------- */
.fb-vly__trail { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; filter: drop-shadow(0 0 4px rgba(242, 169, 59, 0.85)); }
.fb-vly__trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fb-vly__case { stroke: rgba(23, 25, 28, 0.34); stroke-width: 6; }
.fb-vly__gold { stroke-width: 3.2; }
.fb-vly__hi { stroke: rgba(242, 236, 226, 0.85); stroke-width: 1; }
.fb-vly__badge { position: absolute; right: -5px; bottom: -5px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--nysno); color: var(--blekk); box-shadow: 0 0 0 2px var(--vinduslys), 0 2px 6px rgba(23, 25, 28, 0.4); pointer-events: none; }
.fb-vly__badge svg { width: 14px; height: 14px; }
.fb-map__pin.is-fav .fb-vly__badge { background: var(--blekk); color: var(--nysno); box-shadow: 0 0 0 2px var(--vinduslys), 0 2px 6px rgba(23, 25, 28, 0.4); }
/* The place the visitor is led to glows like the lantern in the Nattevakt picture. */
.fb-map__pin.is-next::before { content: ''; position: absolute; inset: -30px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 169, 59, 0) 0 50%, rgba(242, 169, 59, 0.9) 61%, rgba(242, 169, 59, 0.42) 80%, rgba(242, 169, 59, 0) 100%); pointer-events: none; animation: fb-vly-pulse 3.4s ease-in-out 3 both; }
@keyframes fb-vly-pulse { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
.fb-map--still .fb-map__pin.is-next::before, .fb-map--fxoff .fb-map__pin.is-next::before { animation: none; opacity: 0.85; }

/* ---------- On the cards ---------- */
.fb-vly__host { position: relative; }
.fb-vly__pill { position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 4px 10px 5px; border-radius: 999px; background: rgba(242, 236, 226, 0.94); color: var(--blekk); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.02em; line-height: 1.1; box-shadow: 0 1px 6px rgba(23, 25, 28, 0.25); pointer-events: none; }
.fb-vly__pill.is-new { background: var(--vinduslys); color: var(--blekk); }
.fb-vly__pill.is-fav { background: var(--blekk); color: var(--nysno); }
.fb-vly__pill.is-tasted { color: var(--skifer); }

/* ---------- On a coffee's own page ---------- */
.fb-vly-chip { min-height: 10.4rem; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rimfrost); }
.fb-vly-chip:not(.is-ready) { visibility: hidden; }
/* A small script printed with the chip says before the first paint whether this coffee is marked (is-m) or not while others are (is-n), so the room kept is the room needed. */
.fb-vly-chip.is-m { min-height: 7.9rem; }
.fb-vly-chip.is-n { min-height: 11.2rem; }
@media (max-width: 560px) { .fb-vly-chip.is-n { min-height: 12.4rem; } }
.fb-vly__head { margin: 0 0 8px; color: var(--skifer); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- The thank-you page ---------- */
.fb-vlyt { position: relative; margin: 0 0 32px; padding: clamp(18px, 3vw, 32px); overflow: hidden; border-radius: 14px; background: var(--nysno); box-shadow: inset 0 0 0 1px var(--rimfrost); }
.fb-vlyt h2 { margin: 0 0 8px; font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.08; letter-spacing: -0.02em; }
.fb-vlyt__lead { max-width: 46rem; margin: 0 0 20px; color: var(--skifer); }
.fb-vlyt__stage { display: flex; flex-wrap: wrap; gap: 18px 28px; margin: 0 0 22px; }
.fb-vlyt__slot { position: relative; width: 120px; margin: 0; padding-top: 128px; text-align: center; }
.fb-vlyt__img { position: absolute; left: 24px; top: 24px; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--rimfrost); filter: grayscale(1); opacity: 0.5; transition: filter 600ms ease, opacity 600ms ease; }
.fb-vlyt__img--plain { display: block; }
.fb-vlyt__dash { position: absolute; left: 4px; top: 4px; width: 112px; height: 112px; border: 2px dashed var(--isfoss); border-radius: 50%; }
.fb-vlyt__slot.is-stamped .fb-vlyt__img { filter: none; opacity: 1; }
.fb-vlyt__ring { position: absolute; left: 0; top: 0; width: 120px; height: 120px; color: var(--ink, var(--blatimen)); mix-blend-mode: multiply; transform: rotate(var(--tilt, 0deg)); filter: url(#fb-vly-rough); }
.fb-vlyt__ring text { fill: currentColor; font-size: 8px; font-weight: 800; letter-spacing: 0; }
.fb-vlyt__slot figcaption { font-size: 0.95rem; font-weight: 800; }
.fb-vlyt__slot.is-new .fb-vlyt__ring { animation: fb-vly-press 640ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.fb-vlyt__slot.is-new .fb-vlyt__img { animation: fb-vly-colour 800ms ease-out 260ms both; }
.fb-vlyt__slot.is-new::after { content: ''; position: absolute; left: 6px; top: 6px; width: 108px; height: 108px; border-radius: 50%; background: radial-gradient(circle, rgba(46, 87, 121, 0.38), rgba(46, 87, 121, 0) 66%); pointer-events: none; animation: fb-vly-bloom 900ms ease-out 330ms both; }
@keyframes fb-vly-press { 0% { opacity: 0; transform: rotate(calc(var(--tilt, 0deg) - 22deg)) scale(1.7); } 55% { opacity: 1; } 100% { opacity: 1; transform: rotate(var(--tilt, 0deg)) scale(1); } }
@keyframes fb-vly-colour { from { filter: grayscale(1); opacity: 0.5; } to { filter: none; opacity: 1; } }
@keyframes fb-vly-bloom { 0% { opacity: 0; transform: scale(0.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }
.fb-vlyt__acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.fb-vlyt__note { margin: 0; color: var(--skifer); font-size: 0.88rem; }
.fb-vlyt[hidden], .fb-vlyt [hidden] { display: none !important; } /* the buttons set their own display, which would beat the hidden attribute */

/* Forced colours (high-contrast mode): the checked option, the badges and the trail keep their meaning in system colours. */
@media (forced-colors: active) {
	.fb-vly__sw { border-color: CanvasText; }
	.fb-vly__sw input:checked + span, .fb-vly__sw label:last-of-type input:checked + span { forced-color-adjust: none; background: Highlight; color: HighlightText; }
	.fb-vly__badge, .fb-map__pin.is-fav .fb-vly__badge { forced-color-adjust: none; background: Canvas; color: CanvasText; border: 2px solid Highlight; box-shadow: none; }
	.fb-vly__pill, .fb-vly__next, .fb-vlyt { border: 1px solid CanvasText; }
	.fb-vly__trail { forced-color-adjust: none; filter: none; }
	.fb-vly__case { stroke: Canvas; }
	.fb-vly__gold { stroke: Highlight; }
	.fb-vly__hi { stroke: none; }
}

@media (prefers-reduced-motion: reduce) {
	.fb-map__pin.is-next::before { animation: none; opacity: 0.85; }
	.fb-vlyt__slot.is-new .fb-vlyt__ring, .fb-vlyt__slot.is-new .fb-vlyt__img, .fb-vlyt__slot.is-new::after { animation: none; }
	.fb-vlyt__img, .fb-vly__sw span { transition: none; }
}
@media print { .fb-vly__panel, .fb-vly-chip, .fb-vly__pill, .fb-vly__trail { display: none !important; } }
