/* https://www.joshwcomeau.com/css/custom-css-reset/ */
/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}
dialog {
  margin: initial;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Increase line-height (but not as much as Josh likes) */
  line-height: 1.4; 
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/* Joe's dope styles */
main {
  position: relative;
  width: 96vw;
  max-width: 680px;
  margin-inline: auto;
  padding-block: 8px;

  background-color: white;
  padding-inline: 8px;
  border-radius: 4px;

  grid-column: 2;
}

/* a lovely lobotomized owl */
*+* {
  margin-top: 4px;
}

:root {
  --pantero: #eab308;
}

body {
  font-family: 'Merriweather', serif;
  background-color: var(--pantero);
}
header {
  width: 100%;
  padding-block: 4px;
  text-align: center;
}

#pantero {
  font-family: 'OtherHand', serif;
  font-size: 2em; /* h1 default size */
  font-weight: 800;
  color: black;
  text-decoration: none;
}

h2 {
  margin-top: 16px;
}
h3 {
  margin-top: 12px;
}

.body-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 680px) minmax(232px, 1fr);
}

.annotation-anchor sup {
  font-size: 0.7em;
  margin-left: 1px;
}

.annotation-anchor > a {
  color: var(--pantero);
  text-decoration: none;
}

.annotation {
  position: absolute;
  left: calc(100% + 16px);
  width: 200px;
  margin-top: 0;
  font-size: 0.8rem;
  line-height: 1.3;
  color: #555;
  border-left: 2px solid var(--pantero);
  padding: 6px 8px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
}

.annotation-id {
  font-weight: bold;
  text-decoration: none;
  color: inherit;
}

@media (max-width: 720px) {
  .body-container {
    grid-template-columns: 1fr minmax(0, 680px) 1fr;
  }

  .annotation {
    position: static;
    display: block;
    width: auto;
    margin-block: 8px;
    border-left: none;
  }
}
