/* 
  Silktide Consent Manager - https://silktide.com/consent-manager/  
*/

/* --------------------------------
  Global Styles
-------------------------------- */
/* Wrapper (Global) */
#stcm-wrapper {
  --boxShadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;
  --fontFamily: Helvetica Neue, Segoe UI, Arial, sans-serif;
  --primaryColor: #F9D000;
  --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
-------------------------------- */
#stcm-wrapper a {
  all: unset;
  display: inline-block;
  color: var(--primaryColor);
  text-decoration: underline;
}

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

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

#stcm-wrapper #stcm-icon:focus {
  border-radius: 50%;
}

/* --------------------------------
General Styles
-------------------------------- */
#stcm-wrapper .stcm-button {
  color: var(--backgroundColor);
  background-color: var(--primaryColor);
  border: 2px solid var(--primaryColor);
  padding: 10px 20px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  border-radius: 5px;
}

#stcm-wrapper .stcm-button-primary:hover {
  background-color: var(--backgroundColor);
  color: var(--primaryColor);
}

#stcm-wrapper .stcm-button-secondary {
  background-color: var(--backgroundColor);
  color: var(--primaryColor);
}

#stcm-wrapper .stcm-button-secondary:hover {
  background-color: var(--primaryColor);
  color: var(--backgroundColor);
}

/* --------------------------------
Banner
-------------------------------- */
#stcm-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: stcm-slide-down 350ms ease-out;
  animation-delay: 0.3s;
  box-shadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;
}

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

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

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

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

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

#stcm-banner .stcm-preferences-button {
  display: flex;
  gap: 5px;
  border: none;
  padding: 15px 0px;
  background-color: transparent;
  color: var(--primaryColor);
  cursor: pointer;
  font-size: 16px;
}

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

#stcm-banner .stcm-preferences-button span:hover {
  color: var(--textColor);
}

#stcm-banner p {
  font-size: 16px;
  line-height: 24px;
  color: var(--textColor);
  margin: 0px 0px 15px;
}

#stcm-banner a {
  display: inline-block;
  color: var(--primaryColor);
  text-decoration: underline;
  background-color: var(--backgroundColor);
}

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

#stcm-banner a.stcm-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;
}

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

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

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

/* --------------------------------
Modal
-------------------------------- */
#stcm-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: stcm-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
-------------------------------- */
#stcm-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

#stcm-modal h2 {
  font-family: var(--fontFamily);
  color: var(--textColor);
  font-size: 24px;
  font-weight: 500;
  margin: 0px;
}

#stcm-modal .stcm-modal-close {
  display: inline-flex;
  border: none;
  padding: 13px;
  cursor: pointer;
  background: var(--backgroundColor);
  color: var(--primaryColor);
}

#stcm-modal .stcm-modal-close svg {
  fill: var(--primaryColor);
}

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

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

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

#stcm-modal p {
  font-size: 16px;
  line-height: 24px;
  color: var(--textColor);
  opacity: 0.8;
  margin: 0px 0px 15px;
}

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

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

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

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

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

/* --------------------------------
Modal - Switches
-------------------------------- */
#stcm-modal .stcm-toggle {
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  height: 34px;
  width: 74px;
  cursor: pointer;
}

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

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

/* Unchecked Switch Styles */
#stcm-modal .stcm-toggle-track {
  position: relative;
  display: block;
  height: 34px;
  width: 74px;
  background: var(--textColor);
  border-radius: 25px;
}

#stcm-modal .stcm-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;
}

#stcm-modal .stcm-toggle-off,
#stcm-modal .stcm-toggle-on {
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 500;
  color: var(--backgroundColor);
  position: absolute;
  top: 8px;
  right: 8px;
  transition: right 150ms ease-out, opacity 150ms ease-out;
}

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

#stcm-modal .stcm-toggle-on {
  opacity: 0;
}

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

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

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-off {
  right: calc(100% - 32px);
  opacity: 0;
}

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-on {
  right: calc(100% - 34px);
  opacity: 1;
}

#stcm-modal .stcm-toggle input:disabled + .stcm-toggle-track {
  opacity: 0.6;
  filter: grayscale(100%);
  cursor: not-allowed;
}

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

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

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

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

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

/* Cookie Icon */
#stcm-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: stcm-fade-in 0.3s ease-in-out forwards;
}

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

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

/* --------------------------------
Backdrop
-------------------------------- */
#stcm-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 stcm-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

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

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

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

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

/* --------------------------------
  Kapture
  Everything above is Silktide's stylesheet as downloaded. What follows
  restyles it for the website: Kapture's violet, white ground and dark
  words, the site's 4px buttons, a smaller card, and the buttons on the
  right. The floating cookie icon is hidden; the footer's "Cookies" link
  opens the preferences instead.
-------------------------------- */
#stcm-wrapper {
  --boxShadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  --fontFamily: inherit;
  --primaryColor: #6c4cf1;
  --backgroundColor: #ffffff;
  --textColor: #17131f;
  --backdropBackgroundColor: #17131f55;
  --iconColor: #6c4cf1;
  --iconBackgroundColor: #ffffff;
  font-family: inherit;
}

#stcm-wrapper #stcm-icon {
  display: none !important;
}

#stcm-wrapper .stcm-button {
  border-width: 1px;
  border-radius: 4px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

#stcm-wrapper .stcm-button-secondary {
  color: var(--textColor);
  border-color: rgba(23, 19, 31, 0.18);
}

#stcm-wrapper .stcm-button-secondary:hover {
  background-color: var(--backgroundColor);
  color: var(--textColor);
  border-color: var(--textColor);
}

#stcm-wrapper .stcm-button-primary:hover {
  background-color: #5a3ddb;
  border-color: #5a3ddb;
  color: #ffffff;
}

#stcm-wrapper a:focus,
#stcm-wrapper #stcm-banner button:focus,
#stcm-wrapper #stcm-modal button:focus {
  border-radius: 4px;
}

#stcm-banner {
  width: 440px;
  padding: 20px;
  border: 1px solid rgba(23, 19, 31, 0.1);
  box-shadow: var(--boxShadow);
}

#stcm-banner p {
  font-size: 14px;
  line-height: 22px;
  margin: 0;
}

#stcm-banner a {
  color: var(--textColor);
  font-weight: 600;
  text-underline-offset: 4px;
}

#stcm-banner .stcm-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

#stcm-banner .stcm-preferences-button {
  margin-right: auto;
  padding: 8px 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--textColor);
  text-decoration: underline;
  text-underline-offset: 4px;
}

#stcm-banner .stcm-preferences-button span:hover {
  color: var(--primaryColor);
}

#stcm-modal {
  width: 560px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  padding: 24px;
  box-shadow: var(--boxShadow);
}

#stcm-modal header {
  margin-bottom: 12px;
}

#stcm-modal h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#stcm-modal .stcm-modal-close {
  padding: 8px;
}

#stcm-modal .stcm-modal-close svg {
  fill: var(--textColor);
  width: 14px;
  height: 14px;
}

#stcm-modal p {
  font-size: 14px;
  line-height: 22px;
}

#stcm-modal section {
  margin-top: 24px;
}

#stcm-modal fieldset {
  margin: 0 0 20px;
}

#stcm-modal legend {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

#stcm-modal .stcm-toggle,
#stcm-modal .stcm-toggle-track {
  height: 28px;
  width: 60px;
}

#stcm-modal .stcm-toggle-track {
  background: rgba(23, 19, 31, 0.35);
}

#stcm-modal .stcm-toggle-thumb {
  height: 24px;
  width: 24px;
}

#stcm-modal .stcm-toggle-off,
#stcm-modal .stcm-toggle-on {
  font-size: 12px;
  font-weight: 600;
  top: 6px;
  color: #ffffff;
}

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

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-off {
  right: calc(100% - 26px);
}

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-on {
  right: calc(100% - 28px);
}

#stcm-modal footer {
  flex-direction: row;
  justify-content: flex-end;
  gap: 8px;
}

/* Kapture's mark, beside the words. */
#stcm-wrapper .stcm-brand {
  flex-shrink: 0;
  width: 28px;
  height: auto;
  fill: var(--primaryColor);
}

/* Centred on the block of words, however many lines they run to. */
#stcm-banner .stcm-intro {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Preferences beside Decline, on the right with the other two. */
#stcm-banner .stcm-preferences-button {
  margin-right: 4px;
  padding: 8px 8px;
}

/* The preferences open where the prompt was, as the same box: same place,
   same width, no slide of their own. */
#stcm-modal {
  position: fixed;
  bottom: 16px;
  left: 50%;
  width: 440px;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 32px);
  padding: 20px;
  border: 1px solid rgba(23, 19, 31, 0.1);
  transform: translateX(-50%);
  opacity: 1;
  animation: none;
}

#stcm-modal header {
  justify-content: flex-start;
  gap: 14px;
}

#stcm-modal h2 {
  font-size: 16px;
  margin-right: auto;
}

#stcm-modal section {
  margin-top: 16px;
}

#stcm-modal fieldset {
  margin: 0 0 16px;
}

#stcm-modal footer {
  margin-top: 16px;
}

/* Wide enough for the three buttons on one row. The preferences keep the
   same width, being the same box. */
#stcm-banner,
#stcm-modal {
  width: 460px;
  padding: 16px;
}

/* A smaller card: smaller words, smaller buttons, a smaller mark. */
#stcm-banner p,
#stcm-modal p {
  font-size: 13px;
  line-height: 20px;
}

#stcm-wrapper .stcm-button {
  padding: 6px 12px;
  font-size: 13px;
  line-height: 18px;
}

#stcm-banner .stcm-preferences-button {
  padding: 6px 6px;
  font-size: 13px;
}

#stcm-banner .stcm-actions {
  margin-top: 12px;
}

#stcm-wrapper .stcm-brand {
  width: 24px;
}

#stcm-banner .stcm-intro,
#stcm-modal header {
  gap: 12px;
}

#stcm-modal h2 {
  font-size: 15px;
}

#stcm-modal legend {
  font-size: 13px;
}

/* The preferences, tighter: five rows have to fit a phone without filling
   it. Smaller words, less air between the rows, and a small switch that
   shows its state by position and colour in place of the words On and Off. */
#stcm-modal header {
  margin-bottom: 8px;
}

#stcm-modal p {
  font-size: 12px;
  line-height: 17px;
}

#stcm-modal section {
  margin-top: 12px;
}

#stcm-modal fieldset {
  margin: 0 0 10px;
}

#stcm-modal legend {
  margin: 0 0 2px;
}

#stcm-modal .stcm-consent-row {
  align-items: center;
  gap: 16px;
}

#stcm-modal .stcm-toggle,
#stcm-modal .stcm-toggle-track {
  height: 20px;
  width: 36px;
}

#stcm-modal .stcm-toggle-thumb {
  height: 16px;
  width: 16px;
}

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

#stcm-modal .stcm-toggle-off,
#stcm-modal .stcm-toggle-on {
  display: none;
}

#stcm-modal footer {
  margin-top: 12px;
}

/* Essential is locked on. Pale violet, so it reads as on and not as an off
   switch that happens to sit on the right. */
#stcm-modal .stcm-toggle input:disabled + .stcm-toggle-track {
  background: var(--primaryColor);
  filter: none;
  opacity: 0.45;
}

/* The narrowest phones, under 360px. At 320px the card stood 218px tall,
   close to 40% of a small screen. Here it runs nearly edge to edge, drops the
   mark so the words take fewer lines, and sets the two buttons side by side
   with Manage Preferences under them. Nothing changes at 360px and up. */
@media (max-width: 359px) {
  #stcm-banner,
  #stcm-modal {
    bottom: 8px;
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    padding: 12px 14px;
  }

  #stcm-banner .stcm-brand {
    display: none;
  }

  #stcm-banner p {
    font-size: 12px;
    line-height: 17px;
  }

  #stcm-banner .stcm-actions {
    margin-top: 10px;
    gap: 6px;
  }

  #stcm-wrapper #stcm-banner .stcm-button {
    flex: 1 1 0;
    padding: 6px 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  #stcm-banner .stcm-preferences-button {
    order: 1;
    margin: 0 auto;
    padding: 4px 8px;
    font-size: 12px;
  }
}
