/**
 * @file
 * Directory Profile Mobile Image Centering
 * Ensures profile images, titles, and positions are centered on mobile devices
 */

/* Mobile-first: Center images on small screens */
@media (max-width: 767px) {
  /* Ensure the image wrapper column centers its content */
  .directory-profile-item .col-12.col-md-2 {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Center the image itself */
  .directory-profile-item .col-12.col-md-2 img {
    margin: 0 auto;
    display: block;
  }

  /* Ensure the field wrapper doesn't interfere */
  .directory-profile-item .field--name-field-dir-profile-photo {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* Override any img display: flex from other CSS */
  .directory-profile-item .col-12.col-md-2 img[alt] {
    display: block;
  }

  /* Center the name and position section */
  .directory-profile-item .col-12.col-md-7 {
    text-align: center;
  }

  /* Center profile title */
  .directory-profile-item .profile-title {
    text-align: center;
  }

  /* Center profile position */
  .directory-profile-item .profile-position {
    text-align: center;
  }

  /* Center primary department section */
  .directory-profile-item .profile-dept {
    justify-content: center;
  }

  /* Center primary department info */
  .directory-profile-item .primary-dept-info {
    text-align: center;
  }
}

/* Tablet and up: Left-align images, titles, and positions */
@media (min-width: 768px) {
  .directory-profile-item .col-12.col-md-2 {
    display: block;
  }

  .directory-profile-item .col-12.col-md-2 img {
    margin: 0;
  }

  .directory-profile-item .col-12.col-md-7 {
    text-align: left;
  }

  .directory-profile-item .profile-title {
    text-align: left;
  }

  .directory-profile-item .profile-position {
    text-align: left;
  }

  .directory-profile-item .profile-dept {
    justify-content: flex-start;
  }

  .directory-profile-item .primary-dept-info {
    text-align: left;
  }
}
