/* ---- Basic Reset ---- */

* {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
table,
caption {
  margin: 0;
  padding: 0;
}

pre {
  font-size: 0.9em;
}

/* ---- Base CSS ---- */

/* CSS variables */
:root {
  --almost-white: #f5f5f5;
  --pale-gray: #eeeeee;
  --light-gray: #dedede;
  --medium-gray: #707070;
  --dark-gray: #404040;
  --darker-gray: #202020;
  --almost-black: #191919;
  --silver: #c0c0c0;
  --link-hover-color: #cc0000;

  --black-6pcnt: rgb(0 0 0 / 0.0625);
  --black-12pcnt: rgb(0 0 0 / 0.125);
  --black-25pcnt: rgb(0 0 0 / 0.25);
  --black-50pcnt: rgb(0 0 0 / 0.5);
  --black-75pcnt: rgb(0 0 0 / 0.75);

  --white-6pcnt: rgb(255 255 255 / 0.0625);
  --white-12pcnt: rgb(255 255 255 / 0.125);
  --white-25pcnt: rgb(255 255 255 / 0.25);
  --white-50pcnt: rgb(255 255 255 / 0.5);
  --white-75pcnt: rgb(255 255 255 / 0.75);

  --black-to-white-gradient: linear-gradient(to bottom, rgb(0 0 0 / 0.5) 0%, rgb(255 255 255 / 0.5) 100%);
  --white-to-black-gradient: linear-gradient(to bottom, rgb(255 255 255 / 0.5) 0%, rgb(0 0 0 / 0.5) 100%);
  --medium-gray-gradient-top: linear-gradient(to bottom, rgb(128 128 128 / 0.75) 0%, rgb(128 128 128 / 0.75) 12%, rgb(255 255 255 / 0) 100%);

  --monospace-font: "Source Code Pro", monospace;
}

/* General color overrides */
.mxs-card.mxs-dark-bg {
  color: var(--almost-white);
}

/* Standard tags / Some blocks */
:is(h1, h2, h3, h4, h5, h6) {
  text-shadow: var(--wp--custom--text--shadow-small);

  .mxs-card.mxs-dark-bg & {
    color: var(--light-gray);
  }

  .mxs-card.mxs-light-bg & {
    color: var(--medium-gray);
  }
}

p,
address {
  margin-bottom: 1em;
}

ul {
  padding-left: 1rem;
}

ol {
  padding-left: 2rem;
}

caption,
strong {
  font-weight: bold;
}

caption {
  background-color: var(--almost-white);
  border-top-left-radius: 1em;
  border-top-right-radius: 1em;
  color: var(--wp--preset--color--black);
  padding: 0.25em;
}

.mxs-light-theme-bg,
.mxs-light-bg {
  a:where(:not(.wp-element-button)) {
    border-bottom-color: rgb(0 0 0 / 0.125);
  }
}

pre {
  font-family: "Source Code Pro", monospace;
  overflow: auto;
}

dt {
  font-weight: bold;
}

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

form {
  margin-bottom: 1em;
}

input,
textarea {
  background: linear-gradient(to bottom, var(--wp--preset--color--complementary-semitransparent) 0%, rgb(255 255 255 / 0.5) 100%);

  .mxs-dark-theme-bg &,
  .mxs-card.mxs-darkbg & {
    &:focus-visible {
      outline: 2px solid var(--almost-white);
    }
  }

  .mxs-light-theme-bg & {
    &:focus-visible {
      outline: 2px solid var(--almost-black);
    }
  }

  .mxs-card.mxs-light-bg & {
    &:focus-visible {
      outline: 2px solid var(--wp--preset--color--primary);
    }
  }
}

input,
textarea,
select {
  background-color: var(--almost-white);
  border: 1px solid var(--wp--preset--color--primary-semitransparent);
  border-radius: 0.5em;
  font-family: inherit;
  font-size: 1rem;
  margin: 0.5em;
  padding: 0.5em;
}

input[type="file"],
input[type="submit"],
input[type="reset"] {
  background: var(--white-to-black-gradient);
  background-color: var(--almost-white);
}

input[type="file"]:hover,
input[type="file"]:focus,
input[type="submit"]:hover,
input[type="submit"]:focus,
input[type="reset"]:hover,
input[type="reset"]:focus {
  background-color: var(--light-gray);
}

input:focus,
textarea:focus {
  background-color: var(--light-gray);
}

hr,
.wp-block-separator {
  border-top: transparent;
  border-right: transparent;
  border-left: transparent;
  margin-top: 2em;
  margin-bottom: 2em;
}

figcaption,
.wp-caption-text {
  font-size: 0.8em;
  font-weight: bold;
  text-align: center;
}

::placeholder {
  color: var(--wp--preset--color--black);
}

/* ---- Content ---- */
/* General tags / styling */
.post,
.entry-content,
.wp-block-post-excerpt {
  clear: both;
}

@media (min-width: 800px) {
  .post,
  .entry-content,
  .wp-block-post-excerpt {
    clear: none;
  }

  .page .entry-content,
  .single .entry-content {
    clear: both;
  }
}

.wp-caption,
.is-layout-constrained .wp-caption {
  max-width: 100%;
}

.mxs-light-bg input:focus,
.mxs-light-bg textarea:focus {
  background-color: var(--pale-gray);
}

.mxs-light-bg kbd {
  color: var(--wp--preset--color--black);
}

:where(.has-mxs-small-font-size, .has-mxs-large-font-size, .has-mxs-extra-large-font-size) {
  line-height: 1.5;
}

/* Classic Gallery */
.wp-post-image,
.gallery-icon img {
  border-radius: 16px;
}

.gallery {
  clear: both;
  display: flex;
  flex-direction: column;
}

.gallery-item {
  margin: 0.5em auto;
}

.gallery-icon img {
  display: block;
  margin: 0 auto 0.5em;
}

.gallery-icon > a {
  border-bottom: transparent;
  padding-bottom: 0;
}

.gallery-icon a img {
  border: 1px solid var(--light-gray);
}

.gallery-icon a img:hover,
.gallery-icon a:focus img {
  border-color: var(--medium-gray);
}

.gallery-caption {
  font-size: 0.8em;
  font-weight: bold;
  max-width: 150px;
}

/* Jetpack Tiled Gallery */
.tiled-gallery__item a {
  border-bottom: transparent;
  padding-bottom: 0;
}

@media (min-width: 640px) {
  .gallery {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .gallery-item {
    width: 33.33%;
  }

  .gallery-caption {
    margin: 0 auto;
  }
}

@media (min-width: 768px) {
  .gallery-item {
    width: 25%;
  }
}

/* WordPress classes */
.sticky {
  border: 6px solid;
  border-radius: 1em;
  padding: 1em;

  .mxs-dark-theme-bg &,
  .mxs-light-theme-bg .mxs-dark-bg & {
    border-color: var(--white-25pcnt);
  }

  .mxs-light-theme-bg & {
    border-color: var(--black-25pcnt);
  }

  .mxs-card.mxs-light-bg & {
    background-color: var(--pale-gray);
    border-color: var(--wp--preset--color--base);
  }
}

@media (min-width: 1366px) {
  .sticky {
    margin-left: auto;
    margin-right: auto;
  }
}

.post-nav-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em;
  justify-content: center;
  margin: 1em;
  text-align: center;
}

.wp-block-post-content .post-page-numbers {
  border: 1px solid;
  border-radius: 0.5em;
  font-size: 1rem;
  height: 3em;
  padding: 0.75em;
  width: 3em;
}

a.more-link {
  border-bottom: transparent;
  display: block;
  text-decoration: underline;
}

.wp-smiley {
  margin: 0;
  padding: 0;
}

input.adminbar-input {
  background-image: none;
}
