/* 
  Omea Consent Consent Manager
*/

/* --------------------------------
  Global Styles
-------------------------------- */
/* Wrapper (Global) */
#omea-consent-wrapper {
  --boxShadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;
  --fontFamily: Helvetica Neue, Segoe UI, Arial, sans-serif;
  --primaryColor: #F9D000;
  --buttonBackgroundColor: var(--primaryColor);
  --buttonTextColor: var(--backgroundColor);
  --buttonHoverTextColor: var(--textColor);
  --linkColor: var(--primaryColor);
  /* Text and icons drawn in the accent on the banner background (outline buttons,
     the close icon). The light theme sets a dark one: yellow on white is unreadable. */
  --accentTextColor: var(--buttonBackgroundColor);
  --backgroundColor: #050505;
  --textColor: #F4F0DF;
  --backdropBackgroundColor: #00000077;
  --backdropBackgroundBlur: 0px;
  --iconColor: #050505;
  --iconBackgroundColor: #F9D000;
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  pointer-events: none;
  border: 0px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --------------------------------
Links
-------------------------------- */
#omea-consent-wrapper a {
  all: unset;
  display: inline-block;
  color: var(--linkColor);
  text-decoration: underline;
}

#omea-consent-wrapper a:hover {
  cursor: pointer;
  color: var(--textColor);
}

/* --------------------------------
Focus Styles
-------------------------------- */
#omea-consent-wrapper a:focus-visible,
#omea-consent-wrapper #omea-consent-banner button:focus-visible,
#omea-consent-wrapper #omea-consent-modal button:focus-visible,
#omea-consent-wrapper #omea-consent-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--backgroundColor), 0 0 0 4px #ffffff;
  border-radius: 5px;
}

#omea-consent-wrapper #omea-consent-icon:focus-visible {
  border-radius: 50%;
}

/* --------------------------------
General Styles
-------------------------------- */
#omea-consent-wrapper .omea-consent-button {
  color: var(--buttonTextColor);
  background-color: var(--buttonBackgroundColor);
  border: 2px solid var(--buttonBackgroundColor);
  padding: 9px 18px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  font-family: var(--fontFamily);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  border-radius: 5px;
}

#omea-consent-wrapper .omea-consent-button-primary:hover {
  background-color: var(--backgroundColor);
  color: var(--buttonHoverTextColor);
}

#omea-consent-wrapper .omea-consent-button-secondary {
  background-color: var(--backgroundColor);
  color: var(--accentTextColor);
  border-color: var(--buttonBackgroundColor);
}

#omea-consent-wrapper .omea-consent-button-secondary:hover {
  background-color: var(--buttonBackgroundColor);
  color: var(--buttonTextColor);
}

/* --------------------------------
Banner
-------------------------------- */
#omea-consent-banner {
  font-family: var(--fontFamily);
  color: var(--textColor);
  background-color: var(--backgroundColor);
  box-sizing: border-box;
  padding: 32px;
  border-radius: 12px;
  pointer-events: auto;
  border: 0px;
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 600px;
  overflow: auto;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 32px);
  transform: translate(0, -20px);
  opacity: 0;
  animation: omea-consent-slide-down 350ms ease-out;
  animation-delay: 0.3s;
  box-shadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;
}

#omea-consent-banner.omea-consent-loaded {
  opacity: 1;
  transform: none;
  animation: none;
}

#omea-consent-banner:focus {
  border-radius: 50%;
}

#omea-consent-banner.omea-consent-pos-center {
  top: 50%;
  left: 50%;
  bottom: auto;
  right: auto;
  position: fixed;
  transform: translate(-50%, calc(-50% - 20px));
  animation: omea-consent-slide-down-center 350ms ease-out forwards;
}

#omea-consent-banner.omea-consent-pos-bottom-left {
  bottom: 16px;
  left: 16px;
  position: fixed;
}

#omea-consent-banner.omea-consent-pos-bottom-center {
  bottom: 16px;
  left: 50%;
  position: fixed;
  transform: translate(-50%, -20px);
  animation: omea-consent-slide-down-bottom-center 350ms ease-out forwards;
}

#omea-consent-banner.omea-consent-pos-bottom-right {
  bottom: 16px;
  right: 16px;
}

/* Full-width bars (bottom or top edge) */
#omea-consent-banner.omea-consent-pos-bar-bottom,
#omea-consent-banner.omea-consent-pos-bar-top {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  padding: 20px 32px;
  border-radius: 0;
}

#omea-consent-banner.omea-consent-pos-bar-bottom {
  top: auto;
  bottom: 0;
}

#omea-consent-banner.omea-consent-pos-bar-top {
  top: 0;
  bottom: auto;
  transform: translate(0, -20px);
}

@media (min-width: 900px) {
  #omea-consent-banner.omea-consent-pos-bar-bottom,
  #omea-consent-banner.omea-consent-pos-bar-top {
    display: flex;
    align-items: center;
    gap: 32px;
  }

  #omea-consent-banner.omea-consent-pos-bar-bottom .omea-consent-banner-description,
  #omea-consent-banner.omea-consent-pos-bar-top .omea-consent-banner-description {
    flex: 1 1 auto;
    min-width: 0;
  }

  #omea-consent-banner.omea-consent-pos-bar-bottom .omea-consent-banner-description p,
  #omea-consent-banner.omea-consent-pos-bar-top .omea-consent-banner-description p {
    margin-bottom: 4px;
  }

  #omea-consent-banner.omea-consent-pos-bar-bottom .omea-consent-actions,
  #omea-consent-banner.omea-consent-pos-bar-top .omea-consent-actions {
    flex: 0 0 auto;
    margin-top: 0;
  }
}

#omea-consent-banner .omea-consent-preferences-button {
  display: flex;
  gap: 5px;
  border: 2px solid var(--buttonBackgroundColor);
  border-radius: 5px;
  padding: 9px 18px;
  background-color: transparent;
  color: var(--accentTextColor);
  cursor: pointer;
  font-family: var(--fontFamily);
  font-size: 14px;
  line-height: 20px;
}

#omea-consent-banner .omea-consent-preferences-button span {
  display: block;
  white-space: nowrap;
  text-decoration: none;
}

#omea-consent-banner .omea-consent-preferences-button:hover {
  background-color: var(--buttonBackgroundColor);
  color: var(--buttonTextColor);
}

#omea-consent-banner p {
  font-size: 14px;
  line-height: 21px;
  color: var(--textColor);
  margin: 0px 0px 15px;
}

#omea-consent-banner a {
  display: inline-block;
  /* The Link color setting (it used to be ignored here). */
  color: var(--linkColor);
  /* At least 24 px tall as a target (WCAG 2.5.8). */
  padding-block: 2px;
  text-decoration: underline;
  background-color: var(--backgroundColor);
}

#omea-consent-banner a:hover {
  color: var(--textColor);
}

#omea-consent-banner a.omea-consent-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  fill: var(--primaryColor); /* passed down to svg > path */
  margin-left: auto;
  width: 48px;
  height: 48px;
  text-decoration: none;
}

#omea-consent-banner .omea-consent-actions {
  display: flex;
  gap: 16px;
  flex-direction: column;
  margin-top: 24px;
}

@media (min-width: 600px) {
  #omea-consent-banner .omea-consent-actions {
    flex-direction: row;
    align-items: center;
  }
}

#omea-consent-banner .omea-consent-actions-row {
  display: flex;
  gap: 16px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
}

/* Stacked on phones: Preferences as wide as Accept all and Reject all. */
@media (max-width: 599px) {
  #omea-consent-banner .omea-consent-actions-row .omea-consent-preferences-button {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* --------------------------------
Modal
-------------------------------- */
#omea-consent-modal {
  display: none;
  pointer-events: auto;
  overflow: auto;
  width: 800px;
  max-width: 100%;
  max-height: 100%;
  border: 0px;
  transform: translate(0px, -20px);
  opacity: 0;
  animation: omea-consent-slide-up-center 350ms ease-out forwards;
  box-shadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;
  font-family: var(--fontFamily);
  color: var(--textColor);
  flex-direction: column;
  padding: 30px;
  background-color: var(--backgroundColor);
  border-radius: 12px;
  box-sizing: border-box;
}

/* --------------------------------
Modal - Header
-------------------------------- */
#omea-consent-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

#omea-consent-modal h2 {
  font-family: var(--fontFamily);
  color: var(--textColor);
  font-size: 19px;
  line-height: 26px;
  font-weight: 600;
  margin: 0px;
}

#omea-consent-modal .omea-consent-modal-close {
  display: inline-flex;
  border: none;
  padding: 10px;
  cursor: pointer;
  background: var(--backgroundColor);
  color: var(--accentTextColor);
}

#omea-consent-modal .omea-consent-modal-close svg {
  fill: var(--accentTextColor);
}

/* --------------------------------
Modal - Content
-------------------------------- */
#omea-consent-modal section {
  flex: 1;
  margin-top: 32px;
}

#omea-consent-modal section::-webkit-scrollbar {
  display: block; /* Force scrollbars to show */
  width: 5px; /* Width of the scrollbar */
}

#omea-consent-modal section::-webkit-scrollbar-thumb {
  background-color: var(--textColor); /* Color of the scrollbar thumb */
  border-radius: 10px; /* Rounded corners for the thumb */
}

#omea-consent-modal p {
  font-size: 14px;
  line-height: 21px;
  color: var(--textColor);
  margin: 0px 0px 15px;
}

#omea-consent-modal p:last-of-type {
  margin: 0px;
}

#omea-consent-modal fieldset {
  padding: 0px;
  border: none;
  margin: 0px 0px 32px;
}

#omea-consent-modal fieldset:last-of-type {
  margin: 0px;
}

#omea-consent-modal legend {
  padding: 0px;
  margin: 0px 0px 10px;
  font-weight: 700;
  color: var(--textColor);
  font-size: 14px;
}

#omea-consent-modal .omea-consent-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;  
}

#omea-consent-modal .omea-consent-description {
  font-size: 14px;
  line-height: 21px;
  color: var(--textColor);
}

/* --------------------------------
Modal - Switches
-------------------------------- */
#omea-consent-modal .omea-consent-toggle {
  flex-shrink: 0;
  position: relative;
  /* The labels share one grid cell, so a longer translated label ("PÄÄLLÄ")
     widens the switch instead of spilling out of it. */
  display: inline-grid;
  height: 34px;
  min-width: 74px;
  cursor: pointer;
}

#omea-consent-modal .omea-consent-toggle:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px var(--backgroundColor), 0 0 0 4px #ffffff;
  border-radius: 25px;
}

#omea-consent-modal .omea-consent-toggle input {
  opacity: 0;
  position: absolute;
}

/* Unchecked Switch Styles */
#omea-consent-modal .omea-consent-toggle-track {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--textColor);
  border-radius: 25px;
}

#omea-consent-modal .omea-consent-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  display: block;
  height: 30px;
  width: 30px;
  background: var(--backgroundColor);
  border-radius: 50%;
  transition: left 150ms ease-out;
}

#omea-consent-modal .omea-consent-toggle-off,
#omea-consent-modal .omea-consent-toggle-on {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  /* "Off" sits on the text-colored track, "On" on the button-colored one. */
  color: var(--backgroundColor);
  position: relative;
  grid-area: 1 / 1;
  /* Full track height and centred, so the label does not ride on an
     inherited line-height. The admin preview and the frontend theme supply
     different ones, which offset the label vertically. */
  height: 34px;
  padding: 0 8px 0 40px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 1;
  transition: opacity 150ms ease-out;
}

#omea-consent-modal .omea-consent-toggle-off {
  opacity: 1;
}

#omea-consent-modal .omea-consent-toggle-on {
  color: var(--buttonTextColor);
  /* Beside the thumb on the right. */
  padding: 0 40px 0 8px;
  opacity: 0;
}

/* Checked Switch Styles */
#omea-consent-modal .omea-consent-toggle input:checked + .omea-consent-toggle-track {
  background: var(--buttonBackgroundColor);
}

#omea-consent-modal .omea-consent-toggle input:checked ~ .omea-consent-toggle-thumb {
  left: calc(100% - 32px);
}

#omea-consent-modal .omea-consent-toggle input:checked ~ .omea-consent-toggle-off {
  opacity: 0;
}

#omea-consent-modal .omea-consent-toggle input:checked ~ .omea-consent-toggle-on {
  opacity: 1;
}

#omea-consent-modal .omea-consent-toggle input:disabled + .omea-consent-toggle-track {
  /* Derive from the theme text colour so the locked track stays visible on
     dark and stays soft on light. A hardcoded black vanished into the dark
     theme background. */
  background: var(--textColor);
  opacity: 0.38;
  cursor: not-allowed;
}

/* --------------------------------
Modal - Footer
-------------------------------- */
#omea-consent-modal footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

@media (min-width: 600px) {
  #omea-consent-modal footer {
    flex-direction: row;
    align-items: center;
  }
}

#omea-consent-modal .omea-consent-id-line {
  margin: 20px -30px -30px;
  padding: 12px 30px;
  border-top: 1px solid rgba(127, 127, 127, 0.25);
  font-size: 11px;
  line-height: 16px;
  opacity: 0.7;
  overflow-wrap: anywhere;
}

#omea-consent-modal footer a {
  margin-left: auto;
  padding: 0;
}

#omea-consent-modal footer a.omea-consent-credit-link {
  text-decoration: none;
}

#omea-consent-modal footer a.omea-consent-credit-link:hover {
  text-decoration: underline;
}

/* Cookie Icon */
#omea-consent-icon {
  display: none;
  position: fixed;
  bottom: 10px;
  left: 10px;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0px;
  border: none;
  background-color: var(--iconColor);
  cursor: pointer;
  box-shadow: 0px 0px 6px 0px #0000001a;
  pointer-events: auto;
  animation: omea-consent-fade-in 0.3s ease-in-out forwards;
}

#omea-consent-icon.omea-consent-pos-bottom-right {
  left: auto;
  right: 10px;
}

#omea-consent-icon svg {
  fill: var(--iconBackgroundColor);
}

/* --------------------------------
Backdrop
-------------------------------- */
#omea-consent-backdrop {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--backdropBackgroundColor);
  backdrop-filter: blur(var(--backdropBackgroundBlur));
  pointer-events: all;
}

/* --------------------------------
Animations
-------------------------------- */
@keyframes omea-consent-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes omea-consent-slide-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes omea-consent-slide-down-center {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 20px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes omea-consent-slide-down-bottom-center {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes omea-consent-slide-up-center {
  from {
    opacity: 0;
    transform: translate(0px, 20px);
  }
  to {
    opacity: 1;
    transform: translate(0px, 0px);
  }
}

/* --------------------------------
Animation - backdrop click feedback
-------------------------------- */
@keyframes omea-consent-nudge {
  0%, 100% { right: 16px; }
  10%, 30%, 50%, 70%, 90% { right: 20px; }
  20%, 40%, 60%, 80% { right: 12px; }
}

/* Apply to banner */
#omea-consent-banner.omea-consent-nudge {
  animation: omea-consent-nudge 1s ease-in-out;
}

/* Apply to modal */
#omea-consent-modal.omea-consent-nudge {
  animation: omea-consent-nudge 0.5s ease-in-out;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  #omea-consent-banner.omea-consent-nudge,
  #omea-consent-modal.omea-consent-nudge {
    animation: omea-consent-pulse 0.5s ease-in-out;
  }
  
  @keyframes omea-consent-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
  }
}

/* Optional × (Settings › Appearance): closes like "Reject all". */
#omea-consent-banner .omea-consent-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accentTextColor);
  cursor: pointer;
}

#omea-consent-banner .omea-consent-banner-close svg {
  fill: currentColor;
}

#omea-consent-banner .omea-consent-banner-close:focus-visible {
  outline: 2px solid var(--accentTextColor);
  outline-offset: 2px;
}

/* --------------------------------
Opt-out notice (US state laws) and Global Privacy Control
-------------------------------- */
#omea-consent-banner.omea-consent-notice .omea-consent-opt-out {
  white-space: normal;
}

#omea-consent-banner .omea-consent-gpc-status {
  margin: 16px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--buttonBackgroundColor);
  font-size: 13px;
  line-height: 1.45;
}

#omea-consent-modal .omea-consent-gpc-note {
  margin: 6px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

/* --------------------------------
Embed placeholders (YouTube, Vimeo, Maps … held until consent)
-------------------------------- */
.omea-consent-embed {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #1d2327;
  color: #f6f7f7;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  overflow: auto;
}

.omea-consent-embed__inner {
  max-width: 460px;
}

.omea-consent-embed .omea-consent-embed__title,
.omea-consent-embed .omea-consent-embed__text {
  margin: 0 0 8px;
  color: inherit;
}

.omea-consent-embed .omea-consent-embed__title {
  font-size: 16px;
  font-weight: 600;
}

.omea-consent-embed__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 10px;
}

.omea-consent-embed .omea-consent-embed__button {
  appearance: none;
  margin: 0;
  padding: 8px 16px;
  border: 2px solid var(--omea-consent-embed-button-bg, #F9D000);
  border-radius: 5px;
  background: var(--omea-consent-embed-button-bg, #F9D000);
  color: var(--omea-consent-embed-button-text, #050505);
  font: inherit;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.omea-consent-embed .omea-consent-embed__button.is-secondary {
  background: transparent;
  color: inherit;
}

.omea-consent-embed .omea-consent-embed__button:focus-visible,
.omea-consent-embed .omea-consent-embed__settings:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.omea-consent-embed .omea-consent-embed__settings {
  color: inherit;
  font-size: 13px;
  text-decoration: underline;
}
