/* BASE */

html {
  box-sizing: border-box;
  font-size: 1.2em;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #141414;
  line-height: 1.5;
  max-width: 70%;
  margin: 1em auto;
  padding: 0 1rem;
  background: #fff;
}

h1 {
  line-height: 1.25;
  margin: 0.2em 0 0.6em;
  color: #245268;
}

h2 {
  line-height: 1.25;
  margin: 2em 0em 1em 0em;
  padding: 0.2em 0.2em 0.2em 0.4em;
  background-color: #A5C1D2;
}

h1 > code, h2 > code {
  word-break: break-all;
}

h3 {
  line-height: 1.25;
  margin: 1.2em 0 0.6em;
}

li {
  line-height: 2em;
}

.beta-banner {
  background-color: #F69B70;
  color: #56260F;
  padding: 0.6em 1em;
  font-size: 1.2em;
  text-align: center;
  margin-bottom: 1rem;
}

/* CONTENT TYPE FORM */

form {
  margin-bottom: 1.5rem;
}

fieldset {
  margin-bottom: 1em;
  border: 1px solid #245268;
  border-radius: 4px;
  padding: 0.6em 1em 0.9em;
  background-color: #ebebec;
}

legend {
  font-weight: 700;
  padding: 0 0.3em;
  color: #245268;
}

#epubForm label {
  font-weight: 400;
}

input[type="checkbox"] {
  accent-color: #71CD5D;
}

.option {
  padding: 0.3em;
}

.note {
  margin: 0.2em 0.25em 0.2em 2em;
  color: #494747;
  font-size: 1em;
  font-style: italic;
}

.intro {
  margin-top: 0em;
  margin-left: 0.3em;
}

#epubForm input[type="checkbox"]:focus-visible,
#epubForm label:focus-visible,
button:focus-visible {
  outline: 2px solid #17480D;
  outline-offset: 2px;
  border-radius: 2px;
}

[aria-disabled="true"] + label {
  opacity: 0.55;
  cursor: not-allowed;
}

/* OUTPUT VALUES */

/* Preserves new lines from JS .join("\n") */
#results, #metaOutput {
  white-space: pre-wrap;
}

.value, .metaTag {
  font-family: Consolas, Monaco, "Courier New", ui-monospace, SFMono-Regular, monospace;
  display: inline-block;
  background: #E3ECF1;
  border: 1px solid #A5C1D2;
  color: #245268;
  padding: 0.2em 0.45em;
  margin: 0.2em 0.25em 0.2em 0em;
  border-radius: 4px;
  line-height: 1.3;
  word-break: break-all;
}

code {
  font-family: Consolas, Monaco, "Courier New", ui-monospace, SFMono-Regular, monospace;
  word-break: break-all;
}

.copy-btn {
  margin-top: 0.5em;
  padding: 0.4em 0.8em;
  background-color: #71CD5D;
  color: #141414;
  border: none;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
}

.copy-btn:hover {
  background-color: #17480D;
  color: #fff;
}

.hidden {
  display: none;
}

.copy-feedback {
  margin-left: 0.6em;
  font-size: 0.9em;
  color: #245268;
  font-style: italic;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* CUSTOM CHECKBOXES */

#epubForm input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

#epubForm input[type="checkbox"] + label {
  position: relative;
  padding-left: 2em;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}


#epubForm input[type="checkbox"] + label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.5em;
  height: 1.5em;
  border: 2px solid #17480D;
  border-radius: 4px;
  background: white;
  box-sizing: border-box;
}

#epubForm input[type="checkbox"]:checked + label::before {
  background: #71CD5D;
  border-color: #17480D;
}

#epubForm input[type="checkbox"]:checked + label::after {
  content: "";
  position: absolute;
  left: 0.6em;
  top: 0.46em;
  width: 0.35em;
  height: 0.7em;
  border: solid #17480D;
  border-width: 0 0.2em 0.2em 0;
  transform: rotate(45deg);
}

#epubForm input[type="checkbox"]:focus + label::before,
#epubForm input[type="checkbox"]:focus-visible + label::before {
  outline: 2px solid #17480D;
  outline-offset: 2px;
}

/* RESPONSIVITY */

@media (max-width: 768px) {
  body {
    max-width: 100%;
    margin: 0;
    padding: 0.75rem;
  }

  fieldset {
    padding: 0.5em 0.8em 0.8em;
  }

  #epubForm fieldset {
    gap: 0.35em 0.5em;
  }

  input, select, textarea, button {
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
  }

  #epubForm input[type="checkbox"] + label {
    padding-left: 2em;
  }
}


