#site_content > main {
  display: contents;
}

/* -----------------------------------------------------------------
   Responsive overrides on top of the black_white theme.

   Theme background: the theme was written with a fixed ~900px
   desktop-era layout. Content-area children (sidebar, #content)
   have hardcoded widths, and rich content blocks (images, embeds,
   code, tables) have no max-width, so on iPad mini / phone
   viewports various bits push beyond the html max-width:70ch cap
   and cause horizontal overflow.

   These overrides do the minimum to make the site behave on
   narrow viewports without rewriting the theme.
   ----------------------------------------------------------------- */

/* Rich content (images, embeds, code blocks, tables) must never
   exceed the content column. Most of the "main content overflowing"
   symptoms trace back to one of these. */
#site_content img,
#site_content video,
#site_content iframe,
#site_content embed,
#site_content object {
  max-width: 100%;
  height: auto;
}

#site_content pre {
  overflow-x: auto;
  max-width: 100%;
}

#site_content code {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

#site_content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* Sidebar: the theme pins it to 210px with flex-shrink:0. On
   narrow viewports this forces the whole #site_content row to
   exceed its container. Let it shrink and reflow below #content
   instead. */
@media (max-width: 720px) {
  .sidebar {
    width: 100%;
    flex-shrink: 1;
    padding-left: 0;
    padding-right: 0;
  }
  #content {
    min-width: 0;
  }
  #site_content {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Override the black_white theme's fixed 898px footer so it shrinks
   on narrow viewports (tablets, phones) instead of overflowing and
   losing its centering. The theme's width:898px/height:33px was a
   2000s desktop assumption; we treat 898 as a max, not a target. */
#footer {
  width: auto;
  max-width: 898px;
  height: auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* Newsletter subscribe — footer strip above the copyright line. */
#subscribe_footer {
  max-width: 898px;
  margin-left: auto;
  margin-right: auto;
  padding: 20px 16px 12px;
  box-sizing: border-box;
  text-align: center;
  color: #FFF;
  font: normal 100% 'lucida sans unicode', arial, sans-serif;
  border-top: 1px solid #2a2a2a;
}

.newsletter-form {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

.newsletter-form__label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8em;
  color: #ccc;
}

.newsletter-form__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.newsletter-form__email {
  padding: 6px 10px;
  border: 1px solid #444;
  background: #0a0a0a;
  color: #fff;
  border-radius: 3px;
  flex: 1 1 220px;
  min-width: 0;
  max-width: 320px;
  font-family: inherit;
  font-size: inherit;
}

.newsletter-form__email::placeholder {
  color: #777;
}

.newsletter-form__submit {
  padding: 6px 14px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
}

.newsletter-form__submit:hover {
  background: #ddd;
}

/* Honeypot — hidden from humans, visible to (dumb) bots. */
.newsletter-form__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
