:root {
  font-family: 'Times New Roman', Times, serif;
  font-size: 11px;
  line-height: 1.3;
}

/** TOGGLE PAPER SIZE **/
#paper-settings {
  position: fixed;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1000;
  background-color: #fff;
  padding: 0.5rem;
  border-radius: 0.25rem;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
  font-size: 2rem;
}

#paper-settings ul {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  align-items: center;
}

#paper-settings li {
  list-style: none;
}

#paper-settings label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#paper-settings button {
  background-color: #ddd;
  border: 1px solid black;
  padding: 1rem;
  border-radius: 0.25rem;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
  font-weight: bold;
}

@media print {
  #paper-settings {
    display: none !important;
    float: left;
  }
}
/** **/

body {
  margin: auto;
  gap: 2rem;
}

main {
  background-color: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: auto;
  padding: /* 1.25cm */ 1.5cm;
  outline: 1px black solid;
}

body.a4 main {
  /* aspect-ratio: 1/1.4142; */
  width: 21cm;
  height: 29.7cm;
}

body.letter main {
  /* aspect-ratio: 1/1.4142; */
  width: 21.6cm;
  height: 27.9cm;
}

@media print {
  main {
    outline: none !important;
  }
}

h1, h2, h3, h4 {
  font-weight: bold;
}

:is(h3, h4) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

:is(h3, h4) :nth-child(2) { flex-grow: 1; font-weight: normal; }
:is(h3, h4) :nth-child(2)::before { content: ', '; }
:is(h3, h4) :last-child { flex-grow: 0; font-weight: bold; font-size: 0.925rem; color: #222; }
:is(h3, h4) :last-child::before { content: ''; }
h4 :last-child { color: #777; }
hr { display: none; }

hr + h2 {
  border-bottom: 1.5px #bbb solid;
  text-transform: uppercase;
}

h1, h2 { line-height: 1.5; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.325rem; }
h3 { font-size: 1.125rem; }
h4 { line-height: 1.75; font-style: italic; }
:not(div) > p { text-align: justify; }
hr { margin: 0.15rem 0; }
li { margin-left: 1rem; list-style: disc outside; }
li:not(:last-child) { margin-bottom: 0.125rem; }
a { color: #000091; text-underline-offset: 2px; text-decoration-thickness: 0.5px; }
