/*
 * ========================================
 * Exposed Filters Styles (CSS-Only Layout)
 * ========================================
 */

/* Style the outer container */
.views-exposed-form {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* Target Drupal's default form wrapper and turn it into a flex container */
.views-exposed-form .form--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  /* Aligns labels and inputs nicely */
  gap: 0.5rem;
  /* Creates space between each filter */
}

/* Target each individual filter element's wrapper */
.views-exposed-form .js-form-item,
.views-exposed-form .form-actions {
  margin: 0;
  /* Remove default Drupal margins */
}

/* Style the labels */
.views-exposed-form .js-form-item label {
  display: block;
  font-size: 0.875em;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.views-exposed-form .btn {
  background-color: #067fc3;
  color: #fff;
  border: none;
  cursor: pointer;
}

.views-exposed-form .button,
.views-exposed-form select,
.views-exposed-form input {
  border-radius: 0;
}

.views-exposed-form .form-item-field-event-type-target-id input,
.views-exposed-form .form-item-field-election-type-target-id {
  max-width: 200px;
}

/* On mobile, stack the filters for better usability */
@media (max-width: 768px) {
  .views-exposed-form .form--inline {
    flex-direction: column;
    align-items: stretch;
  }
}

/*
 * Custom Styles for the Decision List Page
 */

/* Main container for the list of decisions */
.view-decision-list .view-content {
  border-top: 1px solid #e9ecef;
  /* Top border for the whole list */
}

/* Each individual decision row */
.view-decision-list .views-row {
  display: flex;
  /* This is the key to aligning the columns */
  padding: 1.5rem 0;
  border-bottom: 1px solid #e9ecef;
  gap: 1.5rem;
  /* The space between your "columns" */
}

/*
 * Styling for each "column" within the row
 */

/* Serial Number column */
.view-decision-list .views-field-view-node {
  /* Use the correct field name here */
  flex: 0 0 60px;
  /* Don't grow, don't shrink, base width of 60px */
  font-weight: bold;
  font-size: 1.1rem;
  color: #343a40;
}

/* Date column */
.view-decision-list .views-field-field-date {
  /* Use the correct date field name */
  flex: 0 0 100px;
  /* Fixed width of 100px */
  font-weight: bold;
  color: #343a40;
}

/* Main content column (title and decision text) */
.view-decision-list .views-field-title {
  /* Use the correct title field name */
  flex-grow: 1;
  /* This column will take up the remaining space */
}

.view-decision-list .views-field-title a {
  font-size: 1.2rem;
  color: #067fc3;
  text-decoration: none;
  font-weight: 500;
}

.view-decision-list .views-field-title a:hover {
  text-decoration: underline;
}

/* The sub-text/decision text */
.view-decision-list .views-field-field-decision-text {
  /* Use the correct field name */
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #6c757d;
  font-style: italic;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .view-decision-list .views-row {
    flex-direction: column;
    /* Stack columns vertically on small screens */
    gap: 0.5rem;
  }
}

.decision-list .decision-date {
  font-weight: bold;
  color: #343a40;
}

.decision-list .decision-link {
  position: relative;
}

.decision-list .decision-link a {
  font-size: 1.2rem;
  color: #067fc3;
  text-decoration: none;
  font-weight: 500;
}

.decision-list .decision-link a:hover {
  text-decoration: underline;
}

/* 2. Find the link within the card and create an invisible overlay */
/* We use the title's link as our source. */
.decision-list .decision-link a::after {
  content: '';
  /* Create an empty pseudo-element */
  position: absolute;
  /* Position it relative to the .event-card */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/*
 * Custom Styles for the Region Content Sidebar
 */
.region-sidebar-nav .nav-link {
  background-color: #f8f9fa;
  /* Light grey background */
  color: #212529;
  /* Dark text */
  margin-bottom: 0.5rem;
  /* Space between links */
  font-weight: 500;
  text-align: center;
  border: 1px solid #dee2e6;
}

/* Style for the active/hovered link */
.region-sidebar-nav .nav-link:hover,
.region-sidebar-nav .nav-link.active {
  background-color: #0d6efd;
  /* Your theme's primary blue color */
  color: #fff;
  border-color: #0d6efd;
}

/*
 * ========================================
 * Card Grid Styles
 * ========================================
 */

.cec-custom-card {
  width: 48%;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
  margin-right: 16px;
}

@media (max-width: 840px) {
  .cec-custom-card {
    width: 100%;
    margin-right: 0 !important;
  }

  .cec-custom-cards .views-row .cec-custom-card {
    margin-left: 0 !important;
  }
}

.cec-custom-cards .views-row {
  margin-bottom: 2rem;
}

.cec-custom-cards .views-row .cec-custom-card:nth-child(2n) {
  margin-left: 20px;
  margin-right: 0;
}

/* Style the card's image */
.cec-custom-card .views-field-field-image img {
  width: 100%;
  height: 200px;
  /* Give a fixed height to keep cards uniform */
  object-fit: cover;
  /* Ensures the image covers the area without distortion */
  display: block;
}

/* Style the text content wrapper we created */
.cec-custom-card .cec-custom-card-content {
  padding: 0.5rem 0;
  flex-grow: 1;
  /* Allows cards of different text length to have the same height */
  display: flex;
  flex-direction: column;
}

/* Style the title (we used an H3 in our custom text field) */
.cec-custom-card .cec-custom-card-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: #212529;
}

/* Style the introduction text */
.cec-custom-card .cec-custom-card-content p {
  font-size: 0.95rem;
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 0;
}

.cec-custom-card .cec-custom-card-content a {
  color: #067fc3;
  text-decoration: none;
  font-weight: 500;
}

.cec-custom-card .cec-custom-card-content a:hover {
  text-decoration: underline;
}

.cec-custom-card .event-type-pill,
.cec-custom-card .election-type-pill {
  margin-top: 0.25rem;
  display: inline-block;
  padding: 0.3em 0.8em;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 50px;
  color: #067fc3;
  background-color: #e7f1ff;
  width: fit-content;
}

/* Make whole event card clickable */

.cec-custom-card {
  position: relative;
}

/* 2. Find the link within the card and create an invisible overlay */
/* We use the title's link as our source. */
.cec-custom-card .cec-custom-card-content h3 a::after {
  content: '';
  /* Create an empty pseudo-element */
  position: absolute;
  /* Position it relative to the .event-card */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/*

General page field rules

*/

.field--name-field-image {
  margin-bottom: 1rem;
}

.field--name-field-date {
  color: #343a40;
  margin-bottom: 0.5rem;
}

/*

Styles related to decision list page
*/

.field--name-field-serial-no {
  font-weight: bold;
  font-size: 1.25rem;
  color: #067fc3;
  margin-bottom: 0.5rem;
}

.field--name-field-decision-text {
  color: #fff;
  padding: 25px 30px 25px 20px;
  font-size: 30px;
  background: url(../images/listhead.jpg) left bottom no-repeat #067fc3 !important;
  margin-bottom: 0.5rem;
}

/*
Styles related to event and election pages
*/

.field--name-field-event-type .field__item,
.field--name-field-election-type .field__item {
  margin-top: 0.25rem;
  display: inline-block;
  padding: 0.3em 0.8em;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 50px;
  color: #067fc3;
  background-color: #e7f1ff;
  width: fit-content;
}
#block-cec-theme-content ul li:not(:first-of-type) thead{
    display: none;
}