/* Shared styles used across all public pages.
   Keep reusable rules here and scope component rules to their own classes. */

/* Teacher images: the same dimensions on index.html and teachers.html.
   Upload all teacher photos at 1000 x 1000px (1:1), including photos in R2.
   At the standard size the image is 300 x 300px, plus a 1px card border.
   On narrow screens both pages shrink to the same size and keep the ratio.
   Change the two numbers below together to update both pages. */
:root{
  --teacher-image-width:300;
  --teacher-image-height:300;
}

.teacher-grid{
  --teacher-card-width:min(calc((var(--teacher-image-width) + 2) * 1px), calc(100vw - 48px));
  /* Cancel each page's existing desktop zoom for consistent displayed sizes. */
  zoom:calc(1 / var(--teacher-page-zoom, 1));
}

.teacher-grid .teacher-card{
  box-sizing:border-box;
  flex:0 0 var(--teacher-card-width);
  width:var(--teacher-card-width);
  max-width:100%;
  min-width:0;
  border-width:1px;
}

.teacher-grid .teacher-photo-wrap,
.teacher-grid > .teacher-card > .teacher-photo{
  width:100%;
  height:auto;
  aspect-ratio:var(--teacher-image-width) / var(--teacher-image-height);
  flex-shrink:0;
}

.teacher-grid .teacher-photo{
  display:block;
  object-fit:cover;
  object-position:top center;
}

.teacher-grid .teacher-photo-wrap > .teacher-photo{
  width:100%;
  height:100%;
}
