/* CAGP Homepage Views Styling */
/* Transform current Drupal structure to match legacy site exactly */

/* Homepage section container styling */
.views-element-container {
  margin-bottom: 30px;
  background: white;
  border: 1px solid #e6e6e6;
  border-radius: 5px;
  overflow: hidden;
}

/* Headers for homepage sections */
.views-element-container h2 {
  font-size: 24px;
  color: #333;
  margin: 0;
  padding: 15px 20px;
  background: #f5f5f5;
  border-left: 4px solid #2c5aa0;
  font-weight: normal;
  border-bottom: 1px solid #e6e6e6;
}

/* Content area styling */
.views-element-container .content {
  padding: 20px;
}

/* News & Events Section specific styling */
#block-cagp-news-slider .views-row {
  margin-bottom: 15px;
  padding: 15px;
  border: 1px solid #e6e6e6;
  border-radius: 3px;
  background: #fafafa;
  transition: all 0.3s ease;
}

#block-cagp-news-slider .views-row:hover {
  background: #f0f8ff;
  border-color: #2c5aa0;
}

#block-cagp-news-slider .views-field-title a {
  color: #2c5aa0;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
}

#block-cagp-news-slider .views-field-title a:hover {
  color: #1a4480;
  text-decoration: underline;
}

/* The Latest Section - Transform current blocks into three columns */

/* Create horizontal layout for the three Latest blocks */
.path-frontpage .region-content {
  display: grid;
  gap: 20px;
}

/* News slider takes full width */
.path-frontpage #block-cagp-news-slider {
  grid-column: 1 / -1;
}

/* Create three-column layout for The Latest blocks */
.path-frontpage #block-cagp-the-latest,
.path-frontpage #block-cagp-latest-resources,
.path-frontpage #block-cagp-webinar-wednesday,
.path-frontpage #block-cagp-latest-blog {
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 5px;
  min-height: 350px;
}

/* Create the three-column grid layout */
@media (min-width: 768px) {
  .path-frontpage .region-content {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .path-frontpage #block-cagp-news-slider {
    grid-column: 1 / -1;
  }

  .path-frontpage #block-cagp-the-latest {
    grid-column: 1;
  }

  .path-frontpage #block-cagp-latest-resources {
    grid-column: 2;
  }

  .path-frontpage #block-cagp-webinar-wednesday {
    grid-column: 3;
  }

  .path-frontpage #block-cagp-latest-blog {
    grid-column: 1 / -1;
    margin-top: 20px;
  }
}

/* Style each Latest block to look like legacy columns */
#block-cagp-the-latest h2,
#block-cagp-latest-resources h2,
#block-cagp-webinar-wednesday h2,
#block-cagp-latest-blog h2 {
  position: relative;
}

#block-cagp-the-latest h2:after {
  content: " Resources: View all";
  font-size: 12px;
  color: #666;
  font-weight: normal;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

#block-cagp-latest-resources h2:after {
  content: " Webinars: View all";
  font-size: 12px;
  color: #666;
  font-weight: normal;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

#block-cagp-webinar-wednesday h2:after {
  content: " Blog: View all";
  font-size: 12px;
  color: #666;
  font-weight: normal;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* Content styling for Latest blocks */
#block-cagp-the-latest .views-row,
#block-cagp-latest-resources .views-row,
#block-cagp-webinar-wednesday .views-row,
#block-cagp-latest-blog .views-row {
  margin-bottom: 15px;
  padding: 0;
  border: none;
  background: none;
}

#block-cagp-the-latest .views-field-title a,
#block-cagp-latest-resources .views-field-title a,
#block-cagp-webinar-wednesday .views-field-title a,
#block-cagp-latest-blog .views-field-title a {
  color: #333;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.3;
  text-decoration: none;
}

#block-cagp-the-latest .views-field-title a:hover,
#block-cagp-latest-resources .views-field-title a:hover,
#block-cagp-webinar-wednesday .views-field-title a:hover,
#block-cagp-latest-blog .views-field-title a:hover {
  color: #2c5aa0;
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 767px) {
  .path-frontpage .region-content {
    grid-template-columns: 1fr;
  }

  .path-frontpage #block-cagp-the-latest,
  .path-frontpage #block-cagp-latest-resources,
  .path-frontpage #block-cagp-webinar-wednesday,
  .path-frontpage #block-cagp-latest-blog {
    grid-column: 1;
    margin-bottom: 20px;
  }
}

/* Individual Content Block Styling */
#block-cagp-the-latest,
#block-cagp-latest-resources,
#block-cagp-webinar-wednesday,
#block-cagp-latest-blog {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s, transform 0.3s;
}

#block-cagp-the-latest:hover,
#block-cagp-latest-resources:hover,
#block-cagp-webinar-wednesday:hover,
#block-cagp-latest-blog:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

/* Content Block Headers */
#block-cagp-the-latest h2,
#block-cagp-latest-resources h2,
#block-cagp-webinar-wednesday h2,
#block-cagp-latest-blog h2 {
  color: #2c5aa0;
  font-size: 20px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
  text-align: center;
}

/* Different colors for different sections */
#block-cagp-the-latest h2 {
  background: linear-gradient(45deg, #2c5aa0, #3a6bb0);
  color: white;
  padding: 10px;
  border-radius: 5px;
  border-bottom: none;
}

#block-cagp-latest-resources h2 {
  color: #1a7a1a;
  border-bottom-color: #1a7a1a;
}

#block-cagp-webinar-wednesday h2 {
  color: #b85450;
  border-bottom-color: #b85450;
}

#block-cagp-latest-blog h2 {
  color: #5a2c80;
  border-bottom-color: #5a2c80;
}

/* Content Items in Blocks */
.homepage-content-sections .views-row {
  margin-bottom: 12px;
  padding: 10px 0;
  border-bottom: 1px dotted #ccc;
}

.homepage-content-sections .views-row:last-child {
  border-bottom: none;
}

.homepage-content-sections .views-field-title {
  line-height: 1.4;
}

.homepage-content-sections .views-field-title a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.homepage-content-sections .views-field-title a:hover {
  color: #2c5aa0;
  text-decoration: underline;
}

/* Special styling for The Latest block */
#block-cagp-the-latest .views-field-title a {
  font-weight: bold;
  color: #2c5aa0;
}

/* Responsive Layout */
@media (max-width: 768px) {
  .homepage-content-sections {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #block-cagp-news-slider .views-row {
    flex-direction: column;
    align-items: flex-start;
  }

  #block-cagp-news-slider h2,
  .homepage-content-sections h2 {
    font-size: 18px;
  }
}

/* Legacy-style button and "DETAILS" links */
.views-field-title a.cagp-details-link {
  display: inline-block;
  background: #2c5aa0;
  color: white !important;
  padding: 8px 15px;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: bold;
  margin-top: 8px;
  text-decoration: none !important;
}

.views-field-title a.cagp-details-link:hover {
  background: #1a4480;
  color: white !important;
}

/* Slider animation placeholder for future enhancement */
#block-cagp-news-slider .view-content {
  /* Future: Add slider/carousel functionality here */
  position: relative;
}