/*
  @file Base/element level theming.

  This file sets up default CSS for elements, such as links as
  well as font sizes, vertical rhythm, etc.
*/

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin-top: 0; /* Removing top margin, for better vertical rhythm layout */
  transition: var(--transition-time);
}

@media screen and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  ::before,
  ::after {
    animation: none;
  }
}

body {
  margin: 0;
  color: var(--zevi-default-body-foreground);
  background: var(--zevi-default-body-background);
  font-family: var(--font-family-primary);
  font-size: var(--font-size);
  line-height: var(--line-height);
}

/*
  Position the main canvas relative so anything further down the page that
  might use absolute will not cover the admin toolbar.
*/
.dialog-off-canvas-main-canvas {
  position: relative;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: var(--underline-offset);
}

a:focus-visible {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

p,
ul,
ol,
pre,
table,
blockquote {
  margin-bottom: var(--spacing);
}

ul ul,
ol ol,
ul ol,
ol ul {
  margin-bottom: 0;
}

sub,
sup {
  position: relative;
  vertical-align: baseline;
  line-height: 0;
}

sup {
  top: -0.5rem;
}

sub {
  bottom: -0.25rem;
}

table {
  width: 100%;
  text-align: left;
  border: var(--table-border);
  border-collapse: collapse;
}

thead th {
  padding: var(--table-padding);
  background-color: var(--table-bg-color);
}

tbody td {
  padding: var(--table-padding);
}

tbody tr {
  border-bottom: var(--table-border);
}

.ajax-progress.ajax-progress-fullscreen {
  background-color: var(--color-secondary);
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CTA link */
.cta-link a {
  display: inline-block;
  background: var(--zevi-cta-button-background);
  color: var(--zevi-cta-button-foreground);
  border-radius: var(--zevi-cta-button-border-radius);
  padding: var(--spacing-medium) var(--spacing-large);
  text-align: center;
}

.cta-link a:where(:hover, :focus) {
  background: var(--zevi-cta-button-background-hover);
  color: var(--zevi-cta-button-foreground-hover);
  text-decoration: none;
}

.cta-link--alternative a {
  background: var(--zevi-cta-button-background-alternative);
  color: var(--zevi-cta-button-foreground-alternative);
  border: 2px solid var(--zevi-cta-button-background-alternative);
}

.cta-link--alternative a:where(:hover, :focus) {
  background: var(--zevi-cta-button-background-alternative-hover);
  color: var(--zevi-cta-button-foreground-alternative-hover);
}
