/**
 * @file
 * Research listing and research article pages.
 */

/*********RESEARCH****************/
/* 1. The Row: Set up Flex and Gap */
.research-page .views-view-grid.row {
  display: flex;
  flex-wrap: wrap; 
  gap: 10px;
  /* display: grid;
  grid-template-columns: repeat(3, 1fr); */
  /* gap: 30px; */
  margin-left: 0;
  margin-right: 0;
}

/* 2. The Columns: Dynamic Width Calculation */
.research-page .views-view-grid.row > div {
  padding:0;
  flex: 1 1 calc(33% - 20px);
  max-width: calc(33% - 20px);

  /* Your existing styling */
  background-color: #ffffff;
  border: 1px solid rgba(var(--mt-color-base-value), 0.1);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 3. Handle Responsive Changes */
/* If you use 2 columns on mobile (50%), update the calc */
@media (max-width: 991px) {
  .research-page .views-view-grid.row > div {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
}

/* If you use 1 column on mobile (100%) */
@media (max-width: 576px) {
  .research-page .views-view-grid.row > div {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* 4. Image Handling */
.research-page .views-field-field-research-image img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid rgba(var(--mt-color-base-value), 0.05);
}

/* 5. Title and Content Padding */
.research-page .views-field-title,
.views-field-field-research-caption {
  padding: 15px 20px;
}

.research-page .views-field-title h5 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.research-page .views-field-title a {
  color: var(--mt-color-base-dark);
  text-decoration: none;
}

.research-page .views-field-title a:hover {
  color: var(--mt-color-primary);
}

/* 6. The Footer (Awards/Tags) */
/* This pushes the award info to the very bottom of the card */
.research-page .views-field-field-award {
  margin-top: auto;
  background-color: rgba(var(--mt-color-base-value), 0.03); /* Matching your tab/sidebar grey */
  border-top: 1px solid rgba(var(--mt-color-base-value), 0.05);
}

.research-page .card-footer {
  padding: 12px 20px;
  font-size: 0.85rem;
}

.research-page .card-footer p {
  margin-bottom: 5px;
  color: var(--mt-color-base-light);
}

.research-page .award a {
  font-weight: 600;
  color: var(--mt-color-primary) !important;
  text-decoration: none;
}

/* 7. Hover Effect */

.research-page .views-view-grid .row > div:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(var(--mt-color-base-value), 0.15);
  border-color: var(--mt-color-primary-light);
}

/* 1. Article Container & Spacing */
/* 2. The Main Image (Left Column) */
.node--type-reasearch-articles .field--name-field-research-image {
  float: left; /* Wraps text around image for a journalistic look */
  margin: 0 25px 20px 0;
  max-width: 300px;
}

.node--type-reasearch-articles .field--name-field-research-image img {
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(var(--mt-color-base-value), 0.1);
  border: 1px solid rgba(var(--mt-color-base-value), 0.1);
}

/* 3. Date & Meta Info */
.node--type-reasearch-articles .field--name-created {
  display: block;
  font-weight: 700;
  color: var(--mt-color-base-light);
  font-size: 0.85rem;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

/* 4. Body Content Typography */
.node--type-reasearch-articles .field--name-body {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--mt-color-base-dark);
}

.node--type-reasearch-articles .field--name-body p {
  margin-bottom: 1.5em;
}

/* 5. The Metadata Sidebar (Right Column) */
.node--type-reasearch-articles .layout__region--second-above,
.node--type-pms-cs-news .layout__region--second,
.node--type-pms-eng-news .layout__region--second,
.node--type-news .layout__region--second{
  background-color: rgba(var(--mt-color-base-value), 0.04);
  padding: 25px !important;
  border-radius: 12px;
  border-top: 4px solid var(--mt-color-primary); /* Teal Accent */
}

/* Sidebar Headings (Tags, Awards) */
.node--type-reasearch-articles .layout__region--second-above h2.title,
.node--type-reasearch-articles .layout__region--second-above .block > h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--mt-color-base-dark);
  margin-bottom: 15px;
  border-bottom: 2px solid rgba(var(--mt-color-base-value), 0.1);
  padding-bottom: 8px;
}

/* 6. Pill Styling for Tags/Research Themes */
.node--type-reasearch-articles .field--name-field-research-theme{ gap: 20px;}
.node--type-reasearch-articles .field--name-field-research-theme .field__item,
.node--type-reasearch-articles .field--name-field-award.field__item {
  margin-bottom: 20px;
}

.node--type-reasearch-articles .field--name-field-research-theme a,
.node--type-reasearch-articles .field--name-field-award a {
  display: inline-block;
  padding: 8px 15px;
  background-color: #ffffff;
  color: var(--mt-color-primary);
  border: 1px solid var(--mt-color-primary);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.node--type-reasearch-articles .field--name-field-research-theme a:hover,
.node--type-reasearch-articles .field--name-field-award a:hover {
  background-color: var(--mt-color-primary);
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(var(--mt-color-primary-value), 0.2);
}
