section {
  margin-block: 2rem;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

iframe {
  width: min(100%, 480px);
  border: 2px dashed #888;
  border-radius: 6px;
}

/*
 * Responsive iframe:
 * frame-sizing: content-height sizes the iframe's block size to the embedded
 * document's layout intrinsic size. Keeping height auto lets it follow the
 * content height so no scrollbar appears. The embedded document must also opt
 * in with <meta name="responsive-embedded-sizing"> (see frame.html).
 */
iframe.responsive {
  frame-sizing: content-height;
  height: auto;
  border-color: #2e7d32;
}

/* The traditional comparison iframe keeps a fixed height */
iframe.fixed {
  height: 150px;
  border-color: #c62828;
}

.notice {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: bold;
}

.notice.supported {
  background: #e8f5e9;
  color: #1b5e20;
}

.notice.unsupported {
  background: #fdecea;
  color: #b71c1c;
}

code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

pre {
  background: #1e1e2e;
  color: #e4e4ef;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  line-height: 1.5;
}

/* --- for the legacy hack demos --- */
.log {
  font-family: ui-monospace, monospace;
  color: #555;
}

/* Fixed aspect-ratio padding hack (16:9) */
.aspect-wrapper {
  position: relative;
  width: min(100%, 480px);
  padding-top: 56.25%;
  border: 2px dashed #6a1b9a;
  border-radius: 6px;
  box-sizing: border-box;
}

.aspect-wrapper .aspect-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
