/* Capa compartilhada: catálogo, lista administrativa e prévia de seleção. */
.material-capa {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1f3f5;
}
.material-capa .material-capa-abrir {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: zoom-in;
}
.material-capa .material-capa-imagem {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 12px;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(25, 29, 32, 0.13));
}
.material-capa-zoom {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #dce1e6;
  border-radius: 7px;
  background: #ffffff;
  color: #4b5561;
}
.material-capa-zoom svg { width: 15px; height: 15px; }
.material-capa .material-capa-acessar { cursor: pointer; }
.material-capa > button.material-capa-zoom {
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: zoom-in;
  box-shadow: none;
}
.material-capa > button.material-capa-zoom:focus-visible { outline: 3px solid #d9040a; outline-offset: -3px; }
.material-capa-abrir:focus-visible { outline: 3px solid #d9040a; outline-offset: -4px; }
.material-capa-vazia {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6b7480;
  font-size: 11px;
  font-weight: 600;
}
.material-capa-vazia svg { width: 36px; height: 36px; }
.maq-capa.material-capa { aspect-ratio: 4 / 3; }
/* No catálogo em coluna única, a imagem define a altura da capa. */
@media (max-width: 679px) {
  .maq-capa.material-capa:has(.material-capa-imagem) { aspect-ratio: auto; }
  .maq-capa.material-capa .material-capa-abrir {
    position: relative;
    inset: auto;
    height: auto;
  }
  .maq-capa.material-capa .material-capa-imagem {
    position: static;
    width: 100%;
    height: auto;
    padding: 0;
    filter: none;
  }
}
html.material-capa-modal-aberto { overflow: hidden; scroll-behavior: auto; scrollbar-gutter: stable; }
#material-capa-dialog {
  position: fixed;
  margin: auto;
  width: min(960px, calc(100% - 24px));
  max-height: 92vh;
  max-height: 92dvh;
  padding: 0;
  border: 1px solid #dce1e6;
  border-radius: 14px;
  background: #ffffff;
  color: #191d20;
  overflow: auto;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.25);
}
#material-capa-dialog::backdrop { background: rgba(16, 20, 25, 0.62); }
#material-capa-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; }
#material-capa-dialog h2 { min-width: 0; margin: 0; font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
#material-capa-dialog button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  background: #ffffff;
  color: #191d20;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}
#material-capa-dialog button:focus-visible { outline: 3px solid #d9040a; outline-offset: 2px; }
#material-capa-dialog .material-capa-dialog-imagem { display: block; width: 100%; height: 70vh; height: 70dvh; padding: 16px; object-fit: contain; background: #f1f3f5; }
#material-capa-dialog .material-capa-dialog-erro { padding: 36px 18px; }
#material-capa-dialog [hidden] { display: none !important; }
[data-theme="dark"] .material-capa { background: #252c32; }
