/* assets/css/05-layout.css
 *
 * Layout grid for main content and sidebar.
 */

.site-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  max-width: 120rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .site-layout {
    /* A wider fixed column for the sidebar. 16rem (256px) read as
       cramped once font-size math was fixed elsewhere in this file. */
    grid-template-columns: minmax(0, 1fr) 20rem;
  }
}

/* Ensure content doesn't overflow viewport on mobile */
main {
  max-width: 100%;
  overflow-x: hidden;
  width: 100%;
}

/* Ensure articles and content areas respect viewport */
article {
  max-width: 100%;
  overflow-x: hidden;
  width: 100%;
}

.content {
  max-width: 100%;
  overflow-x: hidden;
  width: 100%;
}

.e-content {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  width: 100%;
}

/* Responsive tables - allow horizontal scroll on mobile */
.e-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ensure code blocks don't overflow on mobile */
.e-content pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.e-content code {
  max-width: 100%;
  overflow-x: auto;
  word-wrap: break-word;
}

/* Override chota's container class for mobile responsiveness */
.container {
  max-width: 100%;
  padding: 0 1.5rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .container {
    max-width: 120rem;
    padding: 0 2rem;
  }
}

.frame {
  overflow: hidden;
  display: flex;
  align-items: center;
}

.frame img,
.frame video {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
