/* Cookie consent banner (templates/includes/consent.html), and the footers'
 * "Sīkdatņu iestatījumi" button that reopens it.
 *
 * Self-contained on purpose. The legacy base templates link only tokens.css
 * and this file, next to Bootstrap's reset and styles.css, which are
 * unlayered there. So every property the banner depends on is set here,
 * link states included: Bootstrap's `a:hover` outranks a single class.
 * No <b> or <strong> inside: styles.css forces them to 700 with !important.
 *
 * Fixed to the bottom, below Bootstrap's modal backdrop; a bar, not a wall.
 * The two buttons look the same on purpose: agreeing may not be easier than
 * declining.
 */

.ui-consent {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--ui-z-consent);
  box-sizing: border-box;
  margin: 0;
  padding: var(--ui-space-4) var(--ui-gutter);
  border-top: 1px solid var(--ui-color-line-strong);
  background: var(--ui-color-surface);
  box-shadow: var(--ui-shadow-bar);
  color: var(--ui-color-ink);
  font-family: var(--ui-font-body);
  font-size: var(--ui-text-sm);
  font-weight: var(--ui-weight-regular);
  line-height: var(--ui-leading-normal);
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
}

.ui-consent[hidden] {
  display: none;
}

.ui-consent__inner {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-3);
  max-width: var(--ui-container);
  margin: 0 auto;
}

.ui-consent__text {
  max-width: 70ch;
  margin: 0;
  padding: 0;
  color: inherit;
  font: inherit;
}

.ui-consent__link,
.ui-consent__link:visited {
  color: var(--ui-color-brand);
  font-weight: var(--ui-weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ui-consent__link:hover {
  color: var(--ui-color-ink-strong);
  text-decoration: underline;
}

.ui-consent__link:focus-visible,
.ui-consent__button:focus-visible {
  outline: 2px solid var(--ui-color-focus);
  outline-offset: 2px;
}

/* Two equal columns, as wide as the longer answer: neither button may look
   smaller than the other, in any language. */
.ui-consent__actions {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: var(--ui-space-3);
  margin: 0;
}

.ui-consent__button {
  box-sizing: border-box;
  min-width: 8rem;
  min-height: var(--ui-touch);
  margin: 0;
  padding: var(--ui-space-2) var(--ui-space-5);
  border: 1px solid var(--ui-color-brand);
  border-radius: var(--ui-radius-pill);
  background: var(--ui-color-brand);
  color: var(--ui-color-on-band);
  font-family: inherit;
  font-size: var(--ui-text-md);
  font-weight: var(--ui-weight-semibold);
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  transition: background-color var(--ui-duration);
}

.ui-consent__button:hover {
  background: var(--ui-color-brand-hover);
  color: var(--ui-color-on-band);
}

/* The footers' "Sīkdatņu iestatījumi": a button that reads as the text links
   around it. It has no colour of its own; the footer's link class gives it
   one (.brandcolor in includes/footer.html, .ui-site-footer__link in the new
   footer). The ring follows the text colour, so it shows on white and on the
   dark band alike. */
.ui-consent__open {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
  cursor: pointer;
  appearance: none;
}

.ui-consent__open:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ui-consent__open:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .ui-consent__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--ui-space-7);
  }
}

@media print {
  .ui-consent {
    display: none;
  }
}
