/**
 * Faculty Members Stylesheet for Drupal 11 + Bootstrap 5
 * -------------------------------------------------------
 * Modern, responsive design maintaining proven UX patterns from the previous version.
 * Optimized for accessibility, performance, and long-term maintainability.
 *
 * Design System:
 * - UH Brand Colors: #C8102E (primary), #960C22 (hover states)
 * - Typography: League Gothic (headings), Milo (body text)
 * - Spacing: Consistent rhythm for optimal readability
 * - Layout: Template-based approach for reliable content structure
 */

/* Adds extra space below the faculty page content for better visual separation and readability */
#faculty-page {
  margin-bottom: 50px;
}

/* Base body styling for improved readability and accessibility with Milo font */
body.page-node-type-faculty-members {
  font-family: 'Milo', sans-serif;
  font-size: 1.1875rem; /* 19px */
  color: #000;
  line-height: 1.6;
}

/* Main heading styling (h1) */
body.page-node-type-faculty-members h1 {
  font-family: 'League Gothic', sans-serif;
  font-size: 2.25rem; /* 36px */
  color: #000;
  text-transform: capitalize;
}

/* Custom anchor tag styles for Faculty Members pages */
body.page-node-type-faculty-members #faculty-page a {
  color: #C8102E;
}

body.page-node-type-faculty-members #faculty-page a:hover {
  color: #960C22;
}

/* Content wrapper styling */
.faculty-page-content-wrapper {
  margin-top: 25px;
}

/* Temporary spacing until breadcrumb is added */
.faculty-page-content-wrapper.row {
  margin-top: 50px;
}

/* Faculty member detail styling */
.faculty-member-detail {
  padding-right: 38px;
}

/* Faculty Photo Layout - Custom layout without Bootstrap conflicts */
.faculty-layout {
  /* Simple block container - no flexbox */
}

/* Faculty Photo - float left with exact margins from Drupal 10 */
.faculty-member-detail .faculty-photo {
  float: left;
  margin: 0 15px 15px 0;
  /* No max-width on container - let image control its own size */
}

.faculty-photo img {
  width: 100%; /* Full width of image */
  height: auto;
  display: block;
}

/* Faculty Info and Contact */
.faculty-info {
  margin-bottom: 15px;
}

.contact-info {
  margin-bottom: 15px;
}

.faculty-title {
  font-size: 1.125rem; /* 18px */
  color: #495057;
}

.affiliation .field__item {
  font-size: 1.1875rem; /* 19px - matches body */
  font-weight: 700;
  color: #000;
}

/* Contact Information Styling */
.contact-info .item {
  margin-bottom: .20rem;
  display: flex;
  align-items: center;
}

/* ORCID and Email are links - UH Red */
.contact-info .item.orcid a,
.contact-info .item.email a {
  color: #C8102E;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.contact-info .item.orcid a:hover,
.contact-info .item.email a:hover {
  color: #960C22;
  text-decoration: underline;
}

/* Phone and Office Location are plain black text */
.contact-info .item.phone,
.contact-info .item.office-location {
  color: #000;
}

.contact-info .item.phone .field__item,
.contact-info .item.office-location .field__item {
  color: #000;
}

/* Remove any link styling from phone if Drupal adds it */
.contact-info .item.phone a {
  color: #000 !important;
  text-decoration: none !important;
}

/* FontAwesome icon styling - All icons black */
.contact-info .item .small-icon {
  font-size: 1.1875rem;
  margin-right: 5px;
  width: 1.5rem;
  text-align: center;
  color: #000;
}

/* ORCID specific styling - Icon and text on same line */
.contact-info .item.orcid img {
  margin-right: 5px;
  vertical-align: middle;
}

/* Hide Drupal field labels for contact items */
.contact-info .item .field__label {
  display: none;
}

/* Ensure field content displays inline */
.contact-info .item .field__item {
  display: inline;
}

/* Faculty Bio - Hide the label like Drupal 10 */
.faculty-bio .field__label {
  display: none;
}

.faculty-bio {
  margin-top: 15px;
  margin-bottom: 15px;
  font-size: 1.1875rem; /* Match body font size exactly */
}

.faculty-bio .field__item {
  font-size: 1.1875rem; /* Ensure field item matches */
}

.faculty-bio .field__item p {
  margin-bottom: 1rem;
  font-size: 1.1875rem; /* Ensure paragraphs match exactly */
}

.faculty-bio .field__item p:last-child {
  margin-bottom: 0;
}

/* Research Topics */
.research-topics h2 {
  font-family: 'Milo', sans-serif;
  font-size: 1.5rem; /* 24px */
  font-weight: bold;
  margin-bottom: 0;
  text-transform: capitalize;
}

.research-topics a {
  text-decoration: none;
}

/* Hide the Research Topics field label since we have our own h2 */
.research-topics .field__label {
  display: none;
}

.research-topics-list .field__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.research-topics-list .field__item {
  margin-bottom: 0.5rem;
}

.research-topics-list .field__item:not(:last-child)::after {
  content: ", ";
  color: #6c757d;
}

.research-topics-list a {
  color: #C8102E;
  text-decoration: none;
  font-weight: 500;
}

.research-topics-list a:hover {
  color: #960C22;
  text-decoration: underline;
}

.research-topics ul {
  list-style-type: none;
  padding-left: 0;
}

.faculty-member-detail hr {
  border-top: 1px solid #8a8a8a;
}

/* Faculty News Section */
/* Faculty News Section */
.faculty-news-view h2 {
  font-family: 'Milo', sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0;
  text-transform: capitalize;
}

.faculty-news-view .views-field-title {
  font-size: 1.1875rem;
  font-weight: bold;
  line-height: 1em;
  margin: .7rem 0 .4rem 0;
}

.faculty-news-view .views-field-title a {
  text-decoration: none;
}

.faculty-news-view .views-field.views-field-field-news-date {
  font-size: .85rem;
  font-weight: bold;
  color: #8a8a8a;
}

/* Sidebar title styling */
.hpe-dsi-title {
  color: #C8102E;
  font-size: 1.5rem; /* 24px */
  font-weight: bold;
  margin-bottom: 15px;
  text-align: left;
}

/* Navigation Styling - Fixed for proper display and full width */
.sidebar-people-navigation {
  padding-left: 38px;
  width: 100%; /* Ensure sidebar takes full column width */
}

.sidebar-people-navigation nav {
  width: 100%; /* Nav container full width */
}

.sidebar-people-navigation .nav {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 0;
  width: 100%; /* Nav list full width */
}

.sidebar-people-navigation .nav-item {
  width: 100%; /* Nav items full width */
}

/* Parent Menu Item Styling */
.sidebar-people-navigation .nav-item.parent .nav-link.parent {
  background-color: #dfdcdc;
  color: #C8102E;
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  border-radius: 0; /* Remove Bootstrap border-radius */
}

/* Child Menu Items Styling - Fix the display */
.sidebar-people-navigation .nav .nav {
  margin-left: 15px;
  display: block;
  width: calc(100% - 15px); /* Account for left margin */
}

.sidebar-people-navigation .nav .nav .nav-item {
  display: block !important;
  width: 100%;
  clear: both;
}

.sidebar-people-navigation .nav .nav .nav-link {
  background-color: #f4f4f4;
  color: #C8102E;
  display: block;
  padding: 3px 30px;
  text-decoration: none;
  margin-bottom: 1px;
  width: 100%;
  box-sizing: border-box;
  float: none;
  border-radius: 0; /* Remove Bootstrap border-radius */
}

/* Hover Effects for Links */
.sidebar-people-navigation .nav-link:hover,
.sidebar-people-navigation .nav-link:focus {
  background-color: #d6d6d6;
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 991px) {
  .sidebar-people-navigation {
    display: none;
  }
  .faculty-photo {
    float: none;
  }
  .faculty-member-detail {
    padding-left: 0;
  }
  .faculty-info-wrapper {
    padding-left: 15px;
  }
  .faculty-member h1 {
    font-size: 3rem;
    text-transform: capitalize;
  }
  .affiliation {
    font-weight: bold;
  }
  .research-topics {
    margin-bottom: 0;
  }
  .contact-info .item {
    margin-bottom: 0;
  }
  .faculty-page-content-wrapper {
    padding-left: 30px;
    padding-right: 30px;
  }
}

@media (max-width: 575.98px) {
  body.page-node-type-faculty-members {
    font-size: 1rem;
  }

  .faculty-title {
    font-size: 1rem;
  }

  .affiliation .field__item {
    font-size: 1rem;
  }

  .contact-item {
    font-size: 0.9375rem;
  }
}

/* Print Styles */
@media print {
  .sidebar-people-navigation {
    display: none;
  }

  .faculty-news-section {
    page-break-inside: avoid;
  }

  .contact-info .item a {
    color: #000 !important;
    text-decoration: none !important;
  }

  .contact-info .item a:after {
    content: " (" attr(href) ")";
    font-size: 0.8rem;
    color: #666;
  }
}

/* Focus and Accessibility */
.contact-info .item a:focus,
.research-topics-list a:focus,
.sidebar-people-navigation .nav-link:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .sidebar-people-navigation {
    border: 2px solid #000;
  }

  .faculty-member-detail hr {
    border-top-color: #000;
  }

  .sidebar-people-navigation .nav-link {
    border: 1px solid #000;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
