/* Wide header banner on the home page */
.cas-banner {
  width: 100%;
  border-radius: 0.4rem;
  margin-bottom: 1rem;
}

.md-typeset video {
  width: 100%;
  max-width: 720px;
  border-radius: 0.4rem;
}

/* Image galleries converted from WordPress */
.cas-gallery ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cas-gallery li { margin: 0 !important; }
.cas-gallery img { width: 100%; border-radius: 0.3rem; }

/* Embedded PDFs */
.cas-pdf {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
}

/* Team cards */
.cas-team .cas-avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
}

/* Team grid variant: keep every card on a single line, whatever the count
   (the professors on the home page). Wraps to two columns on small screens. */
.md-typeset .cas-team--row {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

@media screen and (max-width: 59.9375em) {
  .md-typeset .cas-team--row {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cas-date { color: var(--md-default-fg-color--light); }

/* Two-column demo layout (image + video) on the home page */
.cas-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  align-items: start;
}
.cas-demo img,
.cas-demo video { width: 100%; border-radius: 0.4rem; }
.cas-demo figure { margin: 0; }

/* Clickable site title with home icon (see home-link.js) */
.cas-home { color: inherit; }
.cas-home:hover { opacity: 0.8; }
.cas-home svg {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  margin-right: 0.4rem;
  vertical-align: -0.2rem;
  fill: currentColor;
}

/* Section trail after the site name in the header */
.cas-crumb-sep { margin: 0 0.5rem; opacity: 0.7; }
.cas-crumb { color: inherit; font-weight: 400; }
a.cas-crumb:hover { opacity: 0.8; }

/* Full-assignment viewer (see assignment-viewer.js) */
.cas-dialog-open { overflow: hidden; }
.cas-dialog {
  width: min(900px, 96vw);
  height: 92vh;
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  box-shadow: var(--md-shadow-z3);
}
.cas-dialog[open] { display: flex; flex-direction: column; }
.cas-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.cas-dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 700;
}
.cas-dialog__close {
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.cas-dialog__pages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--md-default-fg-color--lightest);
}
.cas-dialog__pages img {
  display: block;
  width: 100%;
  margin: 0 auto 1rem;
  background: #fff;
  box-shadow: var(--md-shadow-z1);
}
.cas-dialog__title { font-size: 0.9rem; }

/* ASE Studio tab on the home page */
.cas-ase {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  gap: 1.2rem;
  align-items: center;
}
@media screen and (max-width: 44.9375em) {
  .cas-ase { grid-template-columns: 1fr; }
}
/* The logo has white lettering: always show it on a dark tile */
.cas-ase__logo {
  background: #0f1b2d;
  border-radius: 0.6rem;
  padding: 0.8rem;
}
.cas-ase__logo img { display: block; width: 100%; }
.cas-ase__shot { margin: 1rem 0 0; }
.cas-ase__shot img { width: 100%; border-radius: 0.4rem; }

/* ASE Studio logo (white lettering): always on a dark tile */
.md-typeset img.cas-ase-logo {
  width: 13rem;
  margin: 0 1.2rem 0.8rem 0;
  padding: 0.7rem;
  background: #0f1b2d;
  border-radius: 0.6rem;
}
.cas-ase__shot { clear: both; }

/* "Source code" block at the bottom of the left sidebar (sidebar-links.js) */
.md-nav--primary .md-nav__item.cas-source {
  display: block !important;
  margin-top: 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}
.cas-source__title {
  display: block;
  margin: 0 0.6rem 0.2rem;
  font-weight: 700;
  color: var(--md-default-fg-color--light);
}
.md-nav__link.cas-source__link { display: flex; align-items: center; gap: 0.4rem; }
.cas-source__link svg { width: 1rem; height: 1rem; fill: currentColor; flex: none; }

/* Static diagrams (white background, readable in both themes) */
.md-typeset img.cas-diagram { border-radius: 0.4rem; background: #fff; padding: 0.4rem; }
