*,
*::before,
*::after {
  box-sizing: border-box;
}

/* html is set to 62.5% so that all the REM measurements are 1rem = 10px */
html {
  font-size: 62.5%;
}

body,
input,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'IBM Plex Mono', monospace;
}

body {
  padding: 2rem 4rem;
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--header-color);
}

p {
  margin-bottom: 1.2rem;
}

.table-container {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
}

table td,
table th {
  padding: 4px 8px;
  overflow-wrap: break-word;
  text-align: left;
}

table.data {
  border: 1px solid black;
  min-width: 640px;
}

table.data th {
  border-bottom: 1px solid black;
}

table.data td,
table.data th {
  padding: 10px 20px;
  border-right: 1px dotted black;
}


table.data tr td.right,
table.data tr th.right {
  text-align: right;
}

caption {
  padding: 10px;
}

.hero {
  display: block;
  width: 100%;
  max-width: 910px;
  margin: auto;
}

nav,
.content,
.frame {
  max-width: 78rem;
  margin: auto;
}

article {
  border: 1px solid black;
  margin: 2rem -3rem;
  padding: 2rem 3rem;
}

article img {
  max-width: 100%;
}

nav {
  text-align: right;
}

nav ul {
  padding-inline-start: 0;
}

nav ul li {
  list-style: none;
}

.content {
  font-size: 1.8rem;
}

.content.centered {
  text-align: center;
}

.content pre[class*="language-"] {
  background-color: black;
}

.frame {
  margin: 2rem auto;
  border: 1px solid #292929;
  border-radius: 6px;
  background: #171717;
  overflow: hidden;
}

.frameHeader {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #292929;
  background: black;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  gap: 12px;
}

.frameHeaderTitle {
  position: relative;
  display: grid;
  height: 40px;
  align-items: center;
  color: #fafafa;
  font-size: 14px;
  line-height: 40px;
  vertical-align: top;
  border-bottom: 1px solid white;
}

.frameHeaderSubtitle {
  height: 40px;
  color: #898989;
  font-size: 14px;
  line-height: 40px;
}

.frameContent {
  width: 100%;
  margin: 0;
  overflow-x: auto;
  background: #1d1f21;
}

.frameContent code {
  font-family: inherit;
  font-size: 1.5rem;
  letter-spacing: 0.1px;
  line-height: 22.5px;
}

.frameContentMobile {
  display: none;
}

.frameResult {
  width: 100%;
  outline: 1px solid #292929;
  display: block;
}

#newsletter {
  margin-top: 4rem;
}

#newsletter form > * {
  margin: 1rem 0;
}

.content input {
  font-size: inherit;
}

/* Latest popup styles */
#latest-popup {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 300px;
  z-index: 1000;
}

#latest-popup .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

#latest-popup .popup-type {
  font-weight: bold;
  color: #666;
}

#latest-popup .popup-close {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
}

#latest-popup .popup-title {
  font-weight: 500;
  text-decoration: none;
  color: inherit;
}

#latest-popup .popup-date {
  color: #666;
  font-size: 0.8em;
  margin-top: 0.25rem;
}

.responsive-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

@media screen and (max-width: 1000px) {
  body {
    padding: 2rem 1rem;
  }

  .frame {
    margin: 4rem auto;
  }

  .frameContentDesktop + .frameContentMobile {
    display: none;
  }

  .frameContentMobile {
    display: block;
  }

  .frameHeaderTitle {
    display: none;
  }
  
  /* Allow header to grow to fit wrapped subtitle */
  .frameHeader {
    height: auto;
    min-height: 40px;
    align-items: center;
    padding: 8px 16px;
  }
  
  .frameHeaderSubtitle {
    height: auto;
    line-height: 1.3;
    white-space: normal;
  }
}
