/**
 * v4.3.2 Teaching popup cleanup.
 *
 * The shared drawer action styles explicitly set display:flex on links and
 * buttons. That author rule can override the browser's native [hidden]
 * presentation, which is why Open source remained visible in v4.3.1.
 */

/* Always respect the drawer's programmatic hidden state. */
.had-detail-overlay [data-had-detail-url][hidden],
.had-detail-overlay [data-had-detail-permalink][hidden],
.had-detail-overlay [data-had-copy][hidden],
.had-detail-overlay [data-had-citation-box][hidden] {
  display: none !important;
}

/* Teaching-page popups never expose source or citation-detail controls. */
body.had-view-teaching .had-detail-overlay [data-had-detail-url],
body.had-view-teaching .had-detail-overlay [data-had-copy],
body.had-view-teaching .had-detail-overlay [data-had-citation-box],
.had-detail-overlay.is-teaching-portfolio-context [data-had-detail-url],
.had-detail-overlay.is-teaching-portfolio-context [data-had-copy],
.had-detail-overlay.is-teaching-portfolio-context [data-had-citation-box],
.had-detail-drawer.is-teaching-portfolio-context [data-had-detail-url],
.had-detail-drawer.is-teaching-portfolio-context [data-had-copy],
.had-detail-drawer.is-teaching-portfolio-context [data-had-citation-box] {
  display: none !important;
}

/* Keep the two approved Teaching popup actions visible. */
body.had-view-teaching .had-detail-overlay [data-had-detail-permalink]:not([hidden]),
body.had-view-teaching .had-detail-overlay .had-drawer-actions [data-had-close],
.had-detail-overlay.is-teaching-portfolio-context [data-had-detail-permalink]:not([hidden]),
.had-detail-overlay.is-teaching-portfolio-context .had-drawer-actions [data-had-close] {
  display: inline-flex;
}
