/* Visiopipe – evästebanneri (vp-consent.js). Brändi: Poppins, lämmin musta,
   kultaliuku CTA:ssa, valkoinen pinta ja hiusrajat. Liike: vain transform/opacity. */
.vpc {
  --vpc-ink: #201d19;
  --vpc-soft: #5f584f;
  --vpc-mute: #6f675d;
  --vpc-hair: #ebe8e4;
  --vpc-hair-2: #dcd7d0;
  --vpc-mist: #f7f6f4;
  --vpc-gold: #c18228;
  --vpc-gold-deep: #8a5a14;
  --vpc-gold-cta: linear-gradient(128deg, #cf9a45 0%, #cd9333 24%, #bd8126 50%, #ac7018 74%, #c98f34 100%);
  --vpc-ease: cubic-bezier(.16, 1, .3, 1);
  position: fixed; inset: auto 0 0 0; z-index: 2147483600;
  display: none; pointer-events: none;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--vpc-ink);
  -webkit-font-smoothing: antialiased;
}
.vpc.is-open { display: block; }
.vpc *, .vpc *::before, .vpc *::after { box-sizing: border-box; }

.vpc-scrim {
  position: fixed; inset: 0; background: rgba(26, 23, 19, .32);
  opacity: 0; pointer-events: none; transition: opacity .5s var(--vpc-ease);
}
.vpc.is-settings.is-in .vpc-scrim { opacity: 1; pointer-events: auto; }

.vpc-card {
  position: relative; pointer-events: auto;
  max-width: 1040px; margin: 0 auto;
  background: #fff; border: 1px solid var(--vpc-hair); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(32, 29, 25, .05), 0 18px 48px -18px rgba(32, 29, 25, .28);
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s var(--vpc-ease), transform .8s var(--vpc-ease);
  outline: none;
}
.vpc.is-in .vpc-card { opacity: 1; transform: none; }
.vpc.is-in.is-swap .vpc-card { opacity: 0; transform: translateY(8px); transition: opacity .18s var(--vpc-ease), transform .18s var(--vpc-ease); }
/* Poistuminen nopeampi kuin sisääntulo ja valmis ennen piilotusta (close() 380 ms) */
.vpc:not(.is-in) .vpc-card { transition: opacity .28s var(--vpc-ease), transform .32s var(--vpc-ease); }

.vpc-title {
  margin: 0; font-family: inherit; font-weight: 600; font-size: 17px; line-height: 1.3;
  letter-spacing: -.01em; color: var(--vpc-ink); outline: none;
}
.vpc-text { margin: 6px 0 0; font-weight: 400; font-size: 13.5px; line-height: 1.6; color: var(--vpc-soft); max-width: 68ch; }
.vpc-text a { color: var(--vpc-ink); text-decoration: underline; text-decoration-color: var(--vpc-hair-2); text-underline-offset: 3px; transition: text-decoration-color .2s; }


/* ---- Kerros 1 ---- */
.vpc-intro { display: flex; align-items: center; gap: 40px; padding: 20px 22px 20px 26px; }
.vpc-intro__txt { flex: 1 1 auto; min-width: 0; }
.vpc-intro__act { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.vpc-intro__act .vpc-link { order: -1; margin-right: 6px; }

/* ---- Napit ---- */
.vpc-b {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border-radius: 999px;
  font: 600 14px/1 "Poppins", system-ui, sans-serif; letter-spacing: .005em; white-space: nowrap;
  transition: transform .2s var(--vpc-ease), background-color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.vpc-b:active { transform: scale(.98); }
.vpc-gold {
  color: #fff; border: 0; background: var(--vpc-gold-cta);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 16px -8px rgba(150, 100, 26, .55);
  text-shadow: 0 1px 1px rgba(110, 68, 10, .45);
}

.vpc-line { color: var(--vpc-ink); background: #fff; border: 1px solid var(--vpc-hair-2); }
@media (hover: hover) and (pointer: fine) {
  .vpc-text a:hover { text-decoration-color: var(--vpc-gold); }
  .vpc-link:hover { color: var(--vpc-ink); text-decoration-color: var(--vpc-gold); }
  .vpc-gold:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 22px -10px rgba(150, 100, 26, .65); }
  .vpc-line:hover { border-color: #bdb6ad; background: var(--vpc-mist); }
  .vpc-back:hover { background: var(--vpc-mist); color: var(--vpc-ink); }
  .vpc-more:hover span { text-decoration: underline; text-underline-offset: 3px; }
}
.vpc-link {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 0 4px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 13.5px/1.2 "Poppins", system-ui, sans-serif; color: var(--vpc-soft);
  text-decoration: underline; text-decoration-color: var(--vpc-hair-2); text-underline-offset: 3px;
}

.vpc-b:focus-visible, .vpc-link:focus-visible, .vpc-more:focus-visible, .vpc-back:focus-visible, .vpc-text a:focus-visible {
  outline: 3px solid rgba(193, 130, 40, .5); outline-offset: 2px; border-radius: 999px;
}

/* ---- Kerros 2 ---- */
.vpc-set { display: none; }
.vpc.is-settings .vpc-intro { display: none; }
.vpc.is-settings .vpc-set { display: flex; flex-direction: column; max-height: min(720px, calc(100vh - 32px)); max-height: min(720px, calc(100dvh - 32px)); }
.vpc.is-settings .vpc-card { max-width: 620px; }
.vpc.is-settings .vpc-set { animation: vpc-fade .45s var(--vpc-ease) both; }
@keyframes vpc-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.vpc-set__head { display: flex; align-items: center; gap: 6px; padding: 16px 20px 12px 14px; border-bottom: 1px solid var(--vpc-hair); }
.vpc-back {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--vpc-soft);
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; flex: 0 0 auto;
  transition: background-color .2s, color .2s;
}
.vpc-back svg { width: 20px; height: 20px; }
.vpc-set__body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 24px 8px; }
.vpc-text-set { margin: 12px 0 6px; }

.vpc-cat { padding: 16px 0 14px; border-bottom: 1px solid var(--vpc-hair); }
.vpc-cat:last-child { border-bottom: 0; }
.vpc-cat__head { display: flex; align-items: flex-start; gap: 18px; }
.vpc-cat__txt { flex: 1 1 auto; min-width: 0; }
.vpc-cat__name { margin: 0; font: 600 14.5px/1.35 "Poppins", system-ui, sans-serif; color: var(--vpc-ink); }
.vpc-cat__desc { margin: 3px 0 0; font-weight: 400; font-size: 13px; line-height: 1.55; color: var(--vpc-soft); }
.vpc-always { flex: 0 0 auto; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--vpc-gold-deep); white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: #faf3e8; }

.vpc-sw { position: relative; flex: 0 0 auto; width: 44px; height: 26px; margin-top: 1px; cursor: pointer; }
.vpc-sw input { position: absolute; inset: -9px -4px; width: auto; height: auto; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.vpc-sw__t { position: absolute; inset: 0; border-radius: 999px; background: #8f877c; transition: background-color .25s var(--vpc-ease); }
.vpc-sw__t::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(32, 29, 25, .25), 0 2px 6px rgba(32, 29, 25, .12);
  transition: transform .35s var(--vpc-ease);
}
.vpc-sw input:checked + .vpc-sw__t { background: var(--vpc-gold); }
.vpc-sw input:checked + .vpc-sw__t::after { transform: translateX(18px); }
.vpc-sw input:focus-visible + .vpc-sw__t { outline: 3px solid rgba(193, 130, 40, .5); outline-offset: 2px; }

.vpc-more {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0; margin-top: 0; margin-bottom: -10px; min-height: 44px;
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 13px/1.2 "Poppins", system-ui, sans-serif; color: var(--vpc-gold-deep);
}
.vpc-more svg { width: 12px; height: 12px; transition: transform .3s var(--vpc-ease); }
.vpc-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.vpc-cat__list:not([hidden]) { animation: vpc-fade .35s var(--vpc-ease) both; }
.vpc-list { list-style: none; margin: 8px 0 2px; padding: 0; border: 1px solid var(--vpc-hair); border-radius: 12px; background: var(--vpc-mist); }
.vpc-list li { padding: 10px 14px; border-bottom: 1px solid var(--vpc-hair); }
.vpc-list li:last-child { border-bottom: 0; }
.vpc-list__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.vpc-list__name { font-size: 12.5px; font-weight: 600; color: var(--vpc-ink); word-break: break-word; }
.vpc-list__meta { font-size: 12px; color: var(--vpc-mute); white-space: nowrap; }
.vpc-list p { margin: 3px 0 0; font-weight: 400; font-size: 12.5px; line-height: 1.5; color: var(--vpc-soft); }
.vpc-empty { margin: 8px 0 2px; font-size: 12.5px; color: var(--vpc-mute); }
.vpc-rec { margin: 14px 0 2px; font-size: 12px; line-height: 1.5; color: var(--vpc-mute); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.vpc-set__act { display: flex; align-items: center; gap: 10px; padding: 14px 20px 16px 24px; border-top: 1px solid var(--vpc-hair); }
.vpc-set__act .vpc-link { order: -1; margin-right: auto; }

/* ---- Kapeat näkymät ---- */
@media (max-width: 900px) {
  .vpc-intro { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 18px 14px; }
  .vpc-intro__act { flex-wrap: wrap; }
  .vpc-intro__act .vpc-b { flex: 1 1 0; }
  .vpc-intro__act .vpc-link { order: 3; flex: 1 0 100%; margin: -8px 0 -10px; padding: 0; text-align: center; }
}
@media (max-width: 560px) {
  .vpc { padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .vpc-card { border-radius: 16px; }
  .vpc-title { font-size: 16px; }
  .vpc-text { font-size: 14px; line-height: 1.55; }
  .vpc-cat__desc { font-size: 13.5px; }
  .vpc-intro { padding: 16px 16px 10px; gap: 12px; }
  .vpc-intro__act { gap: 8px; }
  .vpc-b { min-height: 46px; padding: 0 14px; font-size: 14px; }
  .vpc-intro__act .vpc-b, .vpc-set__act .vpc-b { min-width: 0; padding: 0 10px; font-size: 13.5px; }
  .vpc.is-settings .vpc-set { max-height: min(86vh, calc(100vh - 24px)); max-height: min(86dvh, calc(100dvh - 24px)); }
  .vpc-set__head { padding: 12px 14px 10px 8px; }
  .vpc-cat__head { gap: 14px; }
  .vpc-always { font-size: 11.5px; padding: 3px 9px; }
  .vpc-set__body { padding: 2px 16px 6px; }
  .vpc-set__act { flex-wrap: wrap; gap: 8px; padding: 12px 16px 14px; }
  .vpc-set__act .vpc-b { flex: 1 1 0; }
  .vpc-set__act .vpc-link { order: 3; flex: 1 0 100%; margin: -4px 0 -6px; padding: 0; text-align: center; }
}

/* Kapeimmat puhelimet (< 380 px): napit rinnakkain tiiviimmin */
@media (max-width: 379px) {
  .vpc-intro { padding: 14px 12px 8px; }
  .vpc-intro__act { gap: 6px; }
  .vpc-intro__act .vpc-b { font-size: 13px; padding: 0 8px; letter-spacing: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .vpc-card, .vpc-scrim, .vpc-sw__t, .vpc-sw__t::after, .vpc-more svg { transition: none; }
  .vpc.is-settings .vpc-set, .vpc-cat__list:not([hidden]) { animation: none; }
  .vpc-card { transform: none; }
}

/* Varmistus siirtymävaiheeseen: jos GTM:n Cookiebot-tagi on vielä päällä,
   sen ikkuna ei näy päällekkäin uuden bannerin kanssa. */
#CybotCookiebotDialog, #CybotCookiebotDialogBodyUnderlay, #CookiebotWidget { display: none !important; }
.vpc-title[tabindex="-1"]:focus { outline: none; }
