/* This is the basic styling for the Flink Cookie Consent module. Styling based on defaults.
 *
 * To overwite for changing fonts or colors add to your project:
 *
 * a :root {} selector (if not present already) containing overwrites for the following values:
 *

    --_cookie-consent__font-family:                                   Arial, Sans-serif;
    --_cookie-consent__heading-font-family:                           var(--_cookie-consent__font-family);

    --_cookie-consent__link-color:                                    #000 or var(--projectCustomPropery);
    --_cookie-consent__link-color-hover:                              #000;

    --_cookie-consent__button-border-radius:                          3px;

    --_cookie-consent__button-bg-color:                               #000;
    --_cookie-consent__button-border-color:                           #000;
    --_cookie-consent__button-text-color:                             #000;
    --_cookie-consent__button-bg-color-hover:                         #000;
    --_cookie-consent__button-border-color-hover:                     #000;
    --_cookie-consent__button-text-color-hover:                       #000;

    --_cookie-consent__error-bg-color:                                #efefef;

 *
 */

:root {
  --_cookie-consent__font-family:                                     Arial, Sans-serif;
  --_cookie-consent__heading-font-family:                             var(--_cookie-consent__font-family);
}

@keyframes cookieConsentFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes cookieConsentSlideUp {
  0% {
    opacity: 0;
    transform: translateY(100%);
  }
  100% {
    opacity: 1;
    transform: translateY(0%);
  }
}

/* helper css */
/* http://hugogiraudel.com/2016/10/13/css-hide-and-seek/ Screenreaders-only sr-only */
.invisible-accessible,
.sr-only {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  -webkit-clip-path: inset(50%) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  white-space: nowrap !important;
}

.cookie-consent {
  animation: cookieConsentFadeIn forwards 0.5s;
  font-family: var(--_cookie-consent__font-family);
  box-sizing: border-box;
  position: fixed;
  z-index: 10000;
  bottom: 0px;
  left: 0px;
  width: 100%;
  max-width: 720px;

  border-radius: 4px;
  background-color: #fff;
  padding: 24px;
  box-shadow: 0px 0px 40px 0px rgba(0, 0, 0, 0.10);
  line-height: 1.4;

  /* scroll on smaller screens */
  max-height: 80vh;
  overflow-y: auto;
}

/* reset styles */

.cookie-consent button,
.cookie-consent label {
  font-family: var(--_cookie-consent__font-family);
  text-transform: unset;
}

.cookie-consent h2,
.cookie-consent h3 {
  font-family: var(--_cookie-consent__heading-font-family);
  text-transform: unset;
}

/*.cookie-consent a {*/
/*  color: blue;*/
/*}*/

.cookie-consent a:link,
.cookie-consent a:visited {
  color: var(--_cookie-consent__link-color, #000);
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.cookie-consent a:hover,
.cookie-consent a:focus-visible,
.cookie-consent a:active {
  color: var(--_cookie-consent__link-color-hover, #000);
  text-decoration: none;
  text-decoration-color: currentColor;
}

/* Generic/primary button style cookies-consent, uses fallback basis. Style in project by setting custom property in :root */
.cookie-consent button {
  background-color: var(--_cookie-consent__button-bg-color, #000);
  border: 1px solid var(--_cookie-consent__button-border-color, #000);
  color: var(--_cookie-consent__button-text-color, #fff);
  border-radius: var(--_cookie-consent__button-border-radius, 3px);

  padding: 8px 24px;
  transition: background-color 200ms, border-color 200ms, color 200ms;
}

.cookie-consent button:hover,
.cookie-consent button:active,
.cookie-consent button:focus {
  background-color: var(--_cookie-consent__button-bg-color-hover, #000);
  border-color: var(--_cookie-consent__button-border-color-hover, #000);
  color: var(--_cookie-consent__button-text-color-hover, #fff);
}


.cookie-consent fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.cookie-consent legend {
  font-weight: bold;
  padding: 0;
  margin-bottom: 0;
}

/* custom styles on elements */

.cookie-consent__button,
.cookie-consent .button,
.cookie-consent button {
  border-radius: var(--_cookie-consent__button-border-radius, 3px);
  font-size: 16px;
  margin: 0;
}

.cookie-consent__title {
  font-size: 24px;
  margin: 0 0 8px;
}

.cookie-consent__intro {
  font-size: 16px;
  margin: 0 0 24px;
}

p.cookie-consent__intro:last-child {
  /*fix the rule that we have in older websites a lot*/
  margin-bottom: 24px;
}

.cookie-consent__button-row {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cookie-consent .button__icon .icon {
  display: inline-block;
  width: 1em;
  height: 1em;
}

.cookie-consent__option-row {
  border-top: 1px solid #999;
  border-bottom: 1px solid #999;
}

.cookie-consent__option-row + .cookie-consent__option-row {
  border-top: none;
}

.cookie-consent__option__inner {
  padding: 12px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cookie-consent__option__toggles {
  flex-shrink: 0;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-start;
}

.cookie-consent__option-row:has(:focus-visible) {
  border: 2px solid #000;
}


p.cookie-consent__item__text__intro {
  margin: 0;
  font-size: 14px;
}


/* styling the active toggles */

/* Extend .sr-only through repeating css */
.cookie-consent input[type='radio'] {
  /* http://hugogiraudel.com/2016/10/13/css-hide-and-seek/ Screenreaders-only sr-only */
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  -webkit-clip-path: inset(50%) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  white-space: nowrap !important;
}

.cookie-consent__toggle-label {
  display: block;
  line-height: 1;
  position: relative;
}

.cookie-consent__toggle-label__icon {
  position: absolute;
  top: 14px;
  left: 11px;
}

.cookie-consent__toggle-label__icon .icon {
  width: 21px;
  height: 16px;
  fill: #000;
  stroke: none;
}

input[type='radio'] + .cookie-consent__toggle-label:before  {
  content: '';
  display: inline-block;
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 50%;
  border: 1px solid #333;
}

input[type='radio']:checked + .cookie-consent__toggle-label--yes:before  {
  background: #333;
}

input[type='radio']:checked + .cookie-consent__toggle-label--no:before  {
  background: #333;
}

input[type='radio']:checked + .cookie-consent__toggle-label .icon {
  fill: #fff;
}


/* styling the inactive / necessary toggles */
.cookie-consent__item--inactive input[type='radio'] + .cookie-consent__toggle-label:before  {
  opacity: 0.55;
}

.cookie-consent__item--inactive input[type='radio'] + .cookie-consent__toggle-label--no .icon  {
  opacity: 0.55;
}

/* responsive behaviour */
@media screen and (min-width: 600px) {
  /* smaller tablets */
  .cookie-consent {
    bottom: 24px;
    left: 24px;
    width: calc(100% - 48px);
  }

  .cookie-consent__button-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
  }

  .cookie-consent__option__inner {
    padding: 8px 0;
    flex-direction: row;
    gap: 24px;
  }
}

@media screen and (min-width: 1000px) {
  /* desktop */

  .cookie-consent {
    bottom: 40px;
    left: 40px;
    max-height: none;
    overflow-y: hidden;
  }

  .cookie-consent__option__inner {
    gap: 40px;
  }
}

.cookie-error {
  background: var(--_cookie-consent__error-bg-color, #efefef);
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 0px;
  position: relative;
}

.cookie-error .cookie-error__inner {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cookie-error .cookie-error__inner > * {
  flex: 0 0 auto;
  text-align: center;
}

.cookie-error .button {
  margin-bottom: 0;
}

/* add extra specific styling to avoid default overrides from the base */

.cookie-consent label.cookie-consent__toggle-label {
  padding: 0;
  width: 44px;
  height: 44px;
}

.cookie-consent input[type='radio'] + .cookie-consent__toggle-label:before  {
  top: 0;
}

.cookie-consent input[type='radio'] + .cookie-consent__toggle-label:after {
  display: none;
}
