.insights-page .dropdown-group {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  gap: 1rem;
}

@media (min-width: 648px) {
  .insights-page .dropdown-group {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.insights-page .dropdown-group .row-1,
.insights-page .dropdown-group .row-2 {
  display: flex;
  width: 100%;
  gap: 1rem;
  flex-direction: column;
}

@media (min-width: 648px) {
  .insights-page .dropdown-group .row-1,
  .insights-page .dropdown-group .row-2 {
    flex-direction: row;
  }

  /* When on partner page (partner dropdown is hidden), put all visible dropdowns on one line */
  .insights-page[data-is-partner-category='true'] .dropdown-group .row-2 {
    flex-direction: row;
    width: 100%;
  }
}

@media (min-width: 1331px) {
  /* Regular layout (2 rows) for non-partner pages */
  .insights-page[data-is-partner-category='false'] .dropdown-group .row-1 .custom-dropdown,
  .insights-page[data-is-partner-category='false'] .dropdown-group .row-2 .custom-dropdown,
  .insights-page[data-is-partner-category='false'] .dropdown-group .row-2 .search-container {
    width: calc(33.333% - 0.667rem);
  }

  /* Single row layout for partner pages - Resource Type auto width, others divide remaining space */
  .insights-page[data-is-partner-category='true'] .dropdown-group .row-1 .resource-type-dropdown {
    width: auto;
    flex: 0 0 auto;
  }

  .insights-page[data-is-partner-category='true']
    .dropdown-group
    .row-1
    .resource-type-dropdown
    .dropdown-header {
    padding-right: 45px;
    white-space: nowrap;
  }

  .insights-page[data-is-partner-category='true'] .dropdown-group .row-2 .custom-dropdown,
  .insights-page[data-is-partner-category='true'] .dropdown-group .row-2 .search-container {
    flex: 1;
    min-width: 0;
  }
}

.insights-page .custom-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 0;
}

@media (min-width: 648px) {
  .insights-page .custom-dropdown {
    width: calc(50% - 0.5rem);
  }
}

@media (min-width: 1331px) {
  .insights-page .dropdown-group .row-1 .custom-dropdown,
  .insights-page .dropdown-group .row-2 .custom-dropdown,
  .insights-page .dropdown-group .row-2 .search-container {
    width: calc(33.333% - 0.667rem);
  }
}

.insights-page .dropdown-header {
  /* Button reset styles */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin: 0;
  display: block;
  width: 100%;
  text-align: left;

  /* Original dropdown-header styles */
  padding: 13px 20px 12px 20px;
  background: #fff;
  border: 1px solid #e4e6f2;
  cursor: pointer;
  position: relative;
  font-size: 16px;
  line-height: 1.45em;
  font-weight: 600;
  border-radius: 5px;
}

/* Focus styles for accessibility */
.insights-page .dropdown-header:focus {
  outline: 2px solid #0833dc;
  outline-offset: 2px;
}

.insights-page .dropdown-header:focus:not(:focus-visible) {
  outline: none;
}

.insights-page .dropdown-header:after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

.insights-page .dropdown-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e4e6f2;
  border-top: none;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Ensure the dropdown container stays above other elements */
.insights-page .custom-dropdown.active {
  position: relative;
  z-index: 1001;
}

/* Ensure dropdown options stay visible */
.insights-page .custom-dropdown.active .dropdown-options {
  display: block;
  pointer-events: auto;
}

/* Add custom scrollbar styling for WebKit browsers */
.insights-page .dropdown-options::-webkit-scrollbar {
  width: 8px;
}

.insights-page .dropdown-options::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 0 4px 4px 0;
}

.insights-page .dropdown-options::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.insights-page .dropdown-options::-webkit-scrollbar-thumb:hover {
  background: #0ec9ff;
}

.insights-page .dropdown-options label {
  display: block;
  font-size: 16px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color 300ms ease 0ms;
}

.insights-page .dropdown-options label:hover {
  background-color: #1784e8;
  color: #fff;
}

/* Empty state message for dropdowns */
.insights-page .dropdown-options .no-options {
  display: block;
  padding: 12px 20px;
  margin: 0;
  color: #666;
  font-size: 14px;
  font-style: italic;
  text-align: center;
}

.insights-page .custom-dropdown.active .dropdown-options {
  display: block;
}

.insights-page .filter-container {
  margin-block: 2rem;
}

.insights-page .selected-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
  gap: 10px;
}

.insights-page .visually-hidden {
  display: none;
}

/* Migration page - selected categories styles */
.migration-page .selected-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
  gap: 10px;
}

.migration-page .category-tag {
  display: inline-flex;
  align-items: center;
  background: #f0f0f0;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    color 300ms ease 0ms,
    background-color 300ms ease 0ms;
}

.migration-page .category-tag:hover {
  background: rgb(246, 246, 246);
}

.migration-page .category-tag:hover .remove-category {
  color: #ff0000 !important;
}

.migration-page .remove-category {
  margin-right: 0.5rem;
  cursor: pointer;
  font-weight: bold;
  color: #666;
}

.migration-page .clear-all {
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.9rem;
  color: #0044ff;
  transition: color 300ms ease 0ms;
}

.migration-page .clear-all:hover {
  color: #0ec9ff;
}

/* Migration badges on resource cards */
.migration-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1.25rem 0;
  flex-wrap: wrap;
}

.migration-badge {
  display: inline-block;
  padding: 4px 0.625rem;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  line-height: 100%;
}

.migration-badge.migration-from {
  background-color: #768d98;
  color: #fff;
}

.migration-badge.migration-to {
  &.microsoft {
    background-color: #0097dc;
    color: #fff;
  }

  &.sage {
    background-color: #33de61;
    color: #fff;
  }

  &.oracle-netsuite {
    background-color: #92c0cf;
    color: #000;
  }
}

.migration-arrow {
  color: #666;
  font-size: 1rem;
  font-weight: bold;
}

/* Migration page specific card styling - match resources page */
.migration-page {
  .posts-container {
    .post-thumbnail a {
      aspect-ratio: 494 / 250;
      overflow: hidden;

      img {
        height: 100%;
        object-fit: cover;
      }
    }

    .post-type-label,
    .featured-badge {
      display: inline-block;
      font-size: 14px;
      text-transform: uppercase;
      color: #585858;
      margin: 20px 0 0 0;
    }

    .post-header {
      margin-top: -10px;
    }
  }
}

/* Highlight the selected item in the dropdown */
.insights-page .custom-dropdown .dropdown-options label.selected {
  background-color: #1784e8;
  color: #fff;
  font-weight: bold;
}

.insights-page .custom-dropdown .dropdown-header {
  font-weight: bold;
  color: #333;
}

.insights-page .no-partner-message,
.insights-page .no-topics-message,
.insights-page .no-industries-message {
  padding: 12px 20px;
  margin: 0;
}

/* Ensure all dropdowns are initially hidden */
.insights-page .custom-dropdown {
  display: none;
}

/* Show dropdowns dynamically when JavaScript sets display to block */
.insights-page .custom-dropdown.show {
  display: block;
}

/* Override for topic checkboxes to make them visible */
.insights-page .topic-dropdown .dropdown-options input[type='checkbox'].topic-checkbox {
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  width: 16px;
  height: 16px;
}

/* Add styling for topic dropdown labels to accommodate visible checkboxes */
.insights-page .topic-dropdown .dropdown-options label {
  display: flex;
  align-items: center;
}

/* Make topic dropdown behave like other dropdowns */
.insights-page .topic-dropdown .dropdown-options label:hover {
  background-color: #1784e8;
  color: #fff;
}

/* Style for selected checkboxes to match other dropdowns */
.insights-page .topic-dropdown .dropdown-options label:has(input:checked) {
  background-color: #1784e8;
  color: #fff;
  font-weight: bold;
}

/* Remove the different hover state */
.insights-page .topic-dropdown .dropdown-options label:hover:not(:has(input:checked)) {
  background-color: #1784e8;
  color: #fff;
}

/* Partner page layout modifications - updated for single line layout - exclude case studies (uses grid) */
.insights-page[data-is-partner-category='true']:not(.case-studies-page) .dropdown-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

/* Hide the partner dropdown but keep application visible */
.insights-page[data-is-partner-category='true'] .partner-dropdown {
  display: none !important;
}

/* Force all elements to be in one row when on partner page - exclude case studies (uses grid) */
.insights-page[data-is-partner-category='true']:not(.case-studies-page) .application-dropdown,
.insights-page[data-is-partner-category='true']:not(.case-studies-page) .industry-dropdown,
.insights-page[data-is-partner-category='true']:not(.case-studies-page) .topic-dropdown,
.insights-page[data-is-partner-category='true']:not(.case-studies-page) .search-container {
  display: block !important;
  width: 100%;
}

/* Create a new flex container specifically for the partner page - exclude case studies (uses grid) */
.insights-page[data-is-partner-category='true']:not(.case-studies-page) .dropdown-group {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1rem;
}

/* Set both rows to display their contents directly in the parent - exclude case studies (uses grid) */
.insights-page[data-is-partner-category='true']:not(.case-studies-page) .row-1,
.insights-page[data-is-partner-category='true']:not(.case-studies-page) .row-2 {
  display: contents;
}

/* On partner pages, force all elements to equal width - exclude case studies (uses grid) */
@media (min-width: 648px) {
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .application-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .industry-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .topic-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .search-container {
    width: calc(25% - 0.75rem);
    flex: 1;
  }

  /* Fix search container's display property for partner pages */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .search-container.show {
    display: block !important;
  }
}

/* Responsive layout for tablets and mobile */
@media (max-width: 767px) {
  /* Stack all dropdowns vertically on smaller screens */
  .insights-page .dropdown-group,
  .insights-page .dropdown-group .row-1,
  .insights-page .dropdown-group .row-2 {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Make all dropdowns and search full width */
  .insights-page .custom-dropdown,
  .insights-page .search-container,
  .insights-page[data-is-partner-category='true'] .application-dropdown,
  .insights-page[data-is-partner-category='true'] .industry-dropdown,
  .insights-page[data-is-partner-category='true'] .topic-dropdown,
  .insights-page[data-is-partner-category='true'] .search-container {
    width: 100%;
    flex: none;
  }

  /* Ensure proper content flow for partner pages */
  .insights-page[data-is-partner-category='true'] .row-1,
  .insights-page[data-is-partner-category='true'] .row-2 {
    display: flex;
    width: 100%;
  }

  /* Fix margin between stacked elements */
  .insights-page .custom-dropdown {
    margin-bottom: 0.75rem;
  }

  /* Stack selected categories vertically with more spacing */
  .insights-page .selected-categories {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Make category tags full width */
  .insights-page .category-tag {
    width: 100%;
    justify-content: space-between;
  }

  /* Put the clear all link at the bottom with some spacing */
  .insights-page .clear-all {
    margin-top: 0.5rem;
    align-self: flex-end;
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box;
  }

  /* New rules to ensure all dropdowns and search have the same width on mobile */
  .insights-page .custom-dropdown,
  .insights-page .search-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box;
  }

  .insights-page .dropdown-header,
  .insights-page #search-input {
    width: 100%;
    box-sizing: border-box;
  }

  /* Ensure dropdown options container extends to full width */
  .insights-page .dropdown-options {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Custom breakpoint for medium tablets */
@media (min-width: 768px) and (max-width: 1330px) {
  /* Adjust the flex layout to handle 2 dropdowns per row */
  .insights-page .dropdown-group .row-1,
  .insights-page .dropdown-group .row-2 {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  /* Make dropdowns take up ~50% width (2 per row) - exclude case studies (uses grid) */
  .insights-page .custom-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .application-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .industry-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .topic-dropdown {
    width: calc(50% - 0.5rem) !important;
    margin-bottom: 1rem !important;
  }

  /* Make search container take full width and appear at the bottom */
  .insights-page .search-container,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .search-container {
    width: 100% !important;
    margin-top: 0.5rem !important;
    order: 10;
    /* Push to the end using flexbox order */
  }

  /* Force proper content flow for partner pages - exclude case studies (uses grid) */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .row-1,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .row-2 {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  /* Override any other rules to ensure two columns for dropdowns */
  .insights-page .dropdown-group.two-row-layout .custom-dropdown {
    width: calc(50% - 0.5rem) !important;
  }

  /* Ensure search field is always properly displayed */
  .insights-page .search-container.show {
    display: block !important;
  }

  /* Fix for specific partner pages layout - exclude case studies (uses grid) */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .dropdown-group {
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }
}

/* COMPLETE REPLACEMENT FOR PARTNER PAGE LAYOUT CSS */
.insights-page[data-is-partner-category='true'] .dropdown-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Hide partner dropdown completely */
.insights-page[data-is-partner-category='true'] .partner-dropdown {
  display: none !important;
}

/* Create a flex container for partner page filters */
.insights-page[data-is-partner-category='true'] .filter-container {
  position: relative;
}

/* Force a single-line layout for partner pages on desktop */
@media (min-width: 1331px) {
  /* Create a single line by killing the row containers */
  .insights-page[data-is-partner-category='true'] .row-1,
  .insights-page[data-is-partner-category='true'] .row-2 {
    display: contents;
  }

  /* Turn all elements into direct flex children */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .dropdown-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap !important;
  }

  /* Each filter takes equal width - exclude case studies (uses grid) */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .application-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .industry-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .topic-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .search-container {
    width: 25% !important;
    flex: 1 !important;
    display: block !important;
    margin-right: 10px;
  }

  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .search-container {
    margin-right: 0;
  }
}

/* Modified tablet layout for partner pages - specific override - exclude case studies (uses grid) */
@media (min-width: 768px) and (max-width: 1330px) {
  /* Make the rows display as rows with wrap */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .dropdown-group,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .row-1,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .row-2 {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  /* Put dropdowns in pairs */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .application-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .industry-dropdown,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .topic-dropdown {
    width: calc(50% - 0.5rem) !important;
    flex: 0 0 calc(50% - 0.5rem) !important;
    margin-bottom: 1rem !important;
    display: block !important;
  }

  /* Search field at full width at the bottom */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .search-container {
    width: 100% !important;
    flex: 0 0 100% !important;
    margin-top: 0.5rem !important;
    order: 10;
    display: block !important;
  }

  /* Set display:contents for the rows so the items flow correctly */
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .row-1,
  .insights-page[data-is-partner-category='true']:not(.case-studies-page) .row-2 {
    display: contents !important;
  }
}

/* Mobile responsive fixes for uniform width across all devices */
@media (max-width: 767px) {
  /* Force all elements to be the same width regardless of content */
  .insights-page .dropdown-group .row-1,
  .insights-page .dropdown-group .row-2 {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .insights-page .custom-dropdown,
  .insights-page .search-container,
  .insights-page #search-input {
    width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    flex: 1 1 auto !important;
  }

  /* Make the search input match dropdown height */
  .insights-page #search-input {
    height: 45px;
    box-sizing: border-box;
  }

  /* Apply consistent margins between stacked elements */
  .insights-page .custom-dropdown:not(:last-child),
  .insights-page .search-container:not(:last-child) {
    margin-bottom: 10px !important;
  }

  /* Ensure the search container is the same size as dropdowns */
  .insights-page .search-container {
    display: block !important;
  }
}

/* Ensure grandchild categories display correctly on all screen sizes */
.application-dropdown .dropdown-options label.grandchild-category {
  padding-left: 55px;
  margin-bottom: 0;
  position: relative;
}

/* Ensure proper indentation for application hierarchy levels */
.application-dropdown .dropdown-options label.child-category {
  padding-left: 38px;
  margin-bottom: 0;
  position: relative;
}

/* Special override for tip-of-the-month page - force partner dropdown visible */
body.category-tip-of-the-month .partner-dropdown,
.partner-dropdown.tip-of-month-override {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Override for partner dropdown in tip-of-month category */
.insights-page[data-is-partner-category='true'] .partner-dropdown.tip-of-month-override {
  display: block !important;
}

/* When on tip-of-month page, ensure layout is fixed for partner visibility */
body.category-tip-of-the-month .insights-page .dropdown-group {
  display: flex !important;
  flex-direction: column !important;
}

body.category-tip-of-the-month .insights-page .dropdown-group .row-1,
body.category-tip-of-the-month .insights-page .dropdown-group .row-2 {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

@media (min-width: 768px) {
  body.category-tip-of-the-month .insights-page .dropdown-group .custom-dropdown,
  body.category-tip-of-the-month .insights-page .dropdown-group .search-container {
    width: calc(50% - 0.5rem) !important;
  }
}

@media (min-width: 1331px) {
  body.category-tip-of-the-month .insights-page .dropdown-group .custom-dropdown,
  body.category-tip-of-the-month .insights-page .dropdown-group .search-container {
    width: calc(33.333% - 0.667rem) !important;
  }
}

/* Special handling for tip-of-the-month page - REVISED to maintain default layout */
body.category-tip-of-the-month .insights-page .dropdown-group,
.insights-page[data-is-partner-category='true'] .dropdown-group.two-row-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Reset the custom styling for tip-of-month so it matches default /insights page */
body.category-tip-of-the-month .insights-page .row-1,
body.category-tip-of-the-month .insights-page .row-2 {
  display: flex;
  width: 100%;
  gap: 1rem;
  flex-direction: column;
}

@media (min-width: 648px) {
  body.category-tip-of-the-month .insights-page .row-1,
  body.category-tip-of-the-month .insights-page .row-2 {
    flex-direction: row;
  }
}

@media (min-width: 1331px) {
  /* Match the default /insights layout */
  body.category-tip-of-the-month .insights-page .partner-dropdown,
  body.category-tip-of-the-month .insights-page .application-dropdown,
  body.category-tip-of-the-month .insights-page .industry-dropdown,
  body.category-tip-of-the-month .insights-page .topic-dropdown,
  body.category-tip-of-the-month .insights-page .search-container {
    width: calc(33.333% - 0.667rem) !important;
    flex: 0 0 calc(33.333% - 0.667rem) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Remove any forced layouts that were causing alignment issues */
  body.category-tip-of-the-month .insights-page .search-container {
    width: calc(33.333% - 0.667rem) !important;
    margin-top: 0 !important;
  }
}

/* For tablet, use the same layout as default /insights page */
@media (min-width: 768px) and (max-width: 1330px) {
  body.category-tip-of-the-month .insights-page .partner-dropdown,
  body.category-tip-of-the-month .insights-page .application-dropdown,
  body.category-tip-of-the-month .insights-page .industry-dropdown,
  body.category-tip-of-the-month .insights-page .topic-dropdown {
    width: calc(50% - 0.5rem) !important;
    flex: 0 0 calc(50% - 0.5rem) !important;
  }

  body.category-tip-of-the-month .insights-page .search-container {
    width: 100% !important;
    margin-top: 0.75rem !important;
  }
}

/* Remove forced custom layouts that were causing right alignment */
body.category-tip-of-the-month .insights-page .dropdown-group .row-1,
body.category-tip-of-the-month .insights-page .dropdown-group .row-2 {
  justify-content: flex-start !important;
}

.insights-page-wrapper {
  width: 100%;
  border-bottom: 1px solid #dadbde !important;
}

.insights-page.page-container {
  width: 85%;
  margin: 0 auto;
  padding-block-start: 2rem;
  padding-block-end: 3rem;

  &.migration-page {
    padding-block-start: 0;
  }
}

.insights-page .no-results-container {
  display: none;
  width: 100%;
}

.insights-page .no-results-container .no-results {
  text-align: left;
  font-size: 1.2rem;
  color: #666;
  margin-top: 2rem;
}

.resources-page .no-results-container {
  display: none;
  width: 100%;
}

.resources-page .no-results-container .no-results {
  text-align: left;
  font-size: 1.2rem;
  color: #666;
  margin-top: 2rem;
}

/* Migration page - no results styling */
.migration-page .no-results-container {
  display: none;
  width: 100%;
  /* padding: 3rem 0; */
}

.migration-page .no-results-container.show {
  display: block !important;
}

.migration-page #posts-container.hide {
  display: none !important;
}

.migration-page .no-results {
  grid-column-start: 1;
  grid-column-end: 4;
  text-align: left;
  font-size: 1.25rem;
  color: #666;
  font-weight: 500;
  margin: 0;
}

.insights-page .section-title {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.25em !important;
  color: #134f8a;
  margin: 0 auto 40px auto;
}

.insights-page .posts-container {
  margin: 0 auto;
}

@media (min-width: 648px) {
  .insights-page .posts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 45px;
  }
}

@media (min-width: 760px) {
  .insights-page .posts-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1331px) {
  .insights-page .posts-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

.insights-page .posts-container .post {
  position: relative;
  padding-bottom: 30px;
}

.insights-page .posts-container .post:hover .post-title a {
  color: #0ec9ff !important;
}

.insights-page .posts-container .post:hover .more-link {
  color: #0ec9ff !important;
}

.insights-page .posts-container .post:hover .more-link:after {
  margin-left: 12px !important;
}

.insights-page .posts-container .post-info {
  padding-block: 0rem;
}

.insights-page .posts-container .post-title,
.insights-page .post-title {
  font-weight: 700 !important;
  font-size: 21px !important;
  line-height: 1.25em !important;
  margin-top: 10px;
  margin-bottom: 15px;
}

.insights-page .posts-container .post-title a {
  font-size: 21px !important;
  color: #333;
  text-decoration: none;
  transition: color 300ms ease 0ms;
}

.insights-page .posts-container .post-title a:hover {
  color: #0ec9ff;
}

.insights-page .posts-container .more-link {
  position: absolute;
  bottom: 10px;
  font-family: 'Figtree', Helvetica, Arial, Lucida, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.25em !important;
  color: #0044ff !important;
  transition: color 300ms ease 0ms;
}

.insights-page .posts-container .more-link:hover {
  color: #0ec9ff !important;
}

.insights-page .posts-container .more-link:after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
  margin-left: 5px;
  transition: margin-left 300ms ease 0ms;
  vertical-align: middle;
  margin-top: -3px;
}

.insights-page .posts-container .more-link:hover:after {
  margin-left: 12px !important;
}

.insights-page .posts-container .post-thumbnail a {
  display: block;
  width: 100%;
  height: auto;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
}

.insights-page .posts-container .post-thumbnail a img {
  width: 100%;
  max-width: 100%;
  border-radius: 15px;
}

/* Resources page specific card styling */
.resources-page {
  .posts-container {
    .post-thumbnail a {
      aspect-ratio: 494 / 250;
      overflow: hidden;

      img {
        height: 100%;
        object-fit: cover;
      }
    }

    .post-type-label,
    .featured-badge {
      display: inline-block;
      font-size: 14px;
      text-transform: uppercase;
      color: #585858;
      margin: 20px 0 0 0;
    }

    .post-header {
      margin-top: -10px;
    }
  }
}

.insights-page .category-tag {
  display: inline-flex;
  align-items: center;
  background: #f0f0f0;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    color 300ms ease 0ms,
    background-color 300ms ease 0ms;
}

.insights-page .category-tag:hover {
  background: rgb(246, 246, 246);
}

.insights-page .category-tag:hover .remove-category {
  color: #ff0000 !important;
}

.insights-page .remove-category {
  margin-right: 0.5rem;
  cursor: pointer;
  font-weight: bold;
  color: #666;
}

.insights-page .clear-all {
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.9rem;
  color: #0044ff;
  transition: color 300ms ease 0ms;
}

.insights-page .clear-all:hover {
  color: #0ec9ff;
}

.pagination-container {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 3rem;
}

.pagination-btn,
.insights-page .pagination-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: #0044ff !important;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 300ms ease 0ms;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin: 0;
  font-size: 14px;
  line-height: 1;
}

.pagination-btn:first-child,
.pagination-btn:last-child,
.insights-page .pagination-btn:first-child,
.insights-page .pagination-btn:last-child {
  width: auto;
  padding: 0.7rem 1.2rem;
  border-radius: 100px;
}

.pagination-btn:hover,
.insights-page .pagination-btn:hover {
  background-color: #0ec9ff !important;
}

.pagination-btn:disabled,
.insights-page .pagination-btn:disabled {
  background-color: #e3e9f0 !important;
  color: #999;
  cursor: not-allowed;
}

.pagination-btn.active,
.insights-page .pagination-btn.active {
  background-color: #134f8a !important;
  color: #fff;
  cursor: default;
}

.pagination-ellipsis,
.insights-page .pagination-ellipsis,
.resources-page .pagination-ellipsis,
.migration-page .pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #134f8a;
  font-weight: 500;
  user-select: none;
  flex-shrink: 0;
}

.pagination-dots {
  padding: 0.5rem;
  color: #666;
  font-size: 1rem;
}

/* WordPress default pagination (.page-numbers) - for server-side rendered pagination */
.pagination-container .page-numbers {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background-color: #0044ff !important;
  color: #fff !important;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 300ms ease 0ms;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
}

.pagination-container .page-numbers:hover {
  background-color: #0ec9ff !important;
  color: #fff !important;
}

.pagination-container .page-numbers.current {
  background-color: #0044ff !important;
  color: #fff !important;
  cursor: default;
  pointer-events: none;
}

.pagination-container .page-numbers.dots {
  background-color: transparent !important;
  color: #666 !important;
  cursor: default;
  width: auto;
  padding: 0 0.5rem;
}

.pagination-container .page-numbers.prev,
.pagination-container .page-numbers.next {
  width: auto;
  padding: 0.7rem 1.2rem;
  border-radius: 100px;
}

.pagination-container .page-numbers.prev:hover,
.pagination-container .page-numbers.next:hover {
  background-color: #0ec9ff !important;
}

.insights-page .search-container {
  width: 100%;
  position: relative;
  flex: 1;
  display: none;
}

@media (min-width: 648px) {
  .insights-page .search-container {
    width: 48%;
  }
}

@media (min-width: 1331px) {
  .insights-page .search-container {
    width: calc(33.333% - 0.667rem);
  }
}

.insights-page .search-container.show {
  display: block;
}

.insights-page #search-input {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid #e4e6f2;
  color: #666;
  border-radius: 5px;
  font-size: 16px;
  outline: none;
  margin-top: -7px;

  @media (min-width: 1331px) {
    margin-top: 0;
  }
}

.insights-page .no-results {
  text-align: center;
  font-size: 1.2rem;
  color: #666;
  margin-top: 2rem;
}

.insights-page .loader-spinner {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.insights-page .loader-spinner span {
  font-size: 14px;
  color: #666;
}

.insights-page .loader-spinner img {
  width: 26px;
  margin-right: 8px;
}

.insights-page .pagination-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20px;
  margin-top: 20px;
}

.insights-page .pagination-spinner img {
  visibility: hidden;
  width: 20px;
}

.insights-page .posts-container .post-date {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6em;
  color: #585858;
  margin-bottom: 10px !important;
  display: none !important;

  @media (min-width: 648px) {
    display: block !important;
  }
}

.insights-page.case-studies .posts-container {
  margin: 0 auto;

  @media (min-width: 648px) {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-gap: 45px;
  }

  @media (min-width: 760px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media (min-width: 1331px) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.insights-page.case-studies .posts-container .post-excerpt {
  line-height: 1.65em;
  color: #666;
  margin-bottom: 30px;
}

.insights-page.case-studies .custom-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 0;

  @media (min-width: 648px) {
    width: calc(50% - 0.5rem);
  }

  @media (min-width: 1331px) {
    width: 25%;
    margin-bottom: 1rem;
  }
}

/* ============================================
   Case Studies Grid Layout
   ============================================ */

/* Override flexbox with CSS Grid for case studies filters.
   !important is required here because this selector ties in specificity
   with the base `.insights-page .dropdown-group { display: flex }` rule
   above - without it, whichever rule happens to load last wins the
   cascade tie. In practice, third-party CSS optimization/caching (e.g.
   "Remove Unused CSS" plugins) can inject a stale/duplicate copy of the
   base flex rule *after* this one on a fresh page load, silently
   reverting the layout back to a single flex column. !important makes
   this override deterministic regardless of rule order. */
.case-studies-page .dropdown-group {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Tablet: 2 columns */
@media (min-width: 648px) {
  .case-studies-page .dropdown-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 4 columns */
@media (min-width: 1331px) {
  .case-studies-page .dropdown-group {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Force grid children to occupy 100% of column width */
.case-studies-page .custom-dropdown,
.case-studies-page .search-container {
  width: 100% !important;
}

/* Ensure grid children display correctly */
.case-studies-page .custom-dropdown.show,
.case-studies-page .search-container.show {
  display: block;
}

/* Override partner-specific flexbox rules for case studies */
.case-studies-page[data-is-partner-category='true'] .dropdown-group {
  display: grid !important;
}

/* Grid children should occupy full column width on all breakpoints */
@media (min-width: 648px) {
  .case-studies-page .custom-dropdown,
  .case-studies-page .search-container {
    width: 100% !important;
    flex: none;
  }
}

@media (min-width: 1331px) {
  .case-studies-page .custom-dropdown,
  .case-studies-page .search-container {
    width: 100% !important;
    flex: none;
  }
}

.insights-page.apps .posts-container,
.insights-page.search-results-page .posts-container {
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 0;
}

@media (min-width: 1331px) {
  .insights-page.search-results-page .posts-container {
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 45px;
  }
}

.insights-page.apps .posts-container .et-boc {
  margin: 0 auto;

  @media (min-width: 648px) {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-gap: 45px;
  }

  @media (min-width: 760px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media (min-width: 1331px) {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1331px) {
  .insights-page.search-results-page .posts-container:has(.et-boc) {
    grid-template-columns: 1fr;
    grid-gap: 45px;
  }
}

.insights-page.apps .posts-container .post-excerpt {
  line-height: 1.65em;
  color: #666;
  margin-bottom: 30px;
}

/* Apps Archive Pagination - Match Insights Style */
.post-type-archive-apps .navigation.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-block: 3rem;
  gap: 0.5rem;
}

.post-type-archive-apps .page-numbers {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 36.34px;
  height: 34.38px;
  background-color: #0044ff !important;
  color: #fff !important;
  border: none;
  cursor: pointer;
  border-radius: 100px;
  transition: background-color 300ms ease 0ms;
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  margin-inline: 0.1rem;
}

.post-type-archive-apps .page-numbers:hover {
  background-color: #0ec9ff !important;
  color: #fff !important;
}

.post-type-archive-apps .page-numbers.current {
  background-color: #134f8a !important;
  color: #fff !important;
  cursor: default;
}

/* Remove dots styling since we're not using them */
.post-type-archive-apps .page-numbers.dots {
  display: none !important;
}

.post-type-archive-apps .page-numbers.prev,
.post-type-archive-apps .page-numbers.next {
  display: inline !important;
  padding: 0.55rem 0.9rem;
  background-color: #0044ff !important;
  min-width: auto;
}

.post-type-archive-apps .page-numbers.prev:hover,
.post-type-archive-apps .page-numbers.next:hover {
  background-color: #0ec9ff !important;
}

/* Disabled state for prev/next buttons */
.post-type-archive-apps .page-numbers.prev.disabled,
.post-type-archive-apps .page-numbers.next.disabled {
  background-color: #e3e9f0 !important;
  color: #999 !important;
  cursor: not-allowed !important;
}

.post-type-archive-apps .page-numbers.prev.disabled:hover,
.post-type-archive-apps .page-numbers.next.disabled:hover {
  background-color: #e3e9f0 !important;
  color: #999 !important;
}

.insights-page.search-results-page .posts-container .entry-footer {
  margin-bottom: 40px;

  a {
    /* font-weight: 600 !important; */
    /* color: #333; */

    &:hover {
      color: #0ec9ff;
    }
  }
}

.navigation.posts-navigation .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
}

.navigation.posts-navigation .nav-links .nav-previous,
.navigation.posts-navigation .nav-links .nav-next {
  display: inline-block !important;
  width: fit-content !important;
  padding: 0.8rem 0.9rem 0.8rem 0.9rem;
  background-color: #04f !important;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 100px;
  transition: background-color 0.3s ease 0s;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 7px;

  a {
    font-size: 1rem;
    font-weight: 500;
    line-height: 12px !important;
    color: #fff;
    text-decoration: none;
  }

  &:hover {
    background-color: #0ec9ff !important;
  }
}

.navigation.posts-navigation .nav-links .nav-previous {
  &:before {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
    content: '\2190';
    font-size: 20px !important;
    margin-top: -3px;
    line-height: 13px;
  }
}

.navigation.posts-navigation .nav-links .nav-next {
  &:after {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
    content: '\2192' !important;
    font-size: 20px !important;
    font-weight: bold !important;
    margin-top: -3px;
    line-height: 13px;
  }
}

/* Migration Page Specific Styles */
/* Ensure proper grid layout for Migration page filters */
@media (min-width: 1331px) {
  /* On desktop, make dropdown-group a single-row flex container */
  .migration-page .dropdown-group {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
  }

  /* Row containers display inline and take only the space needed */
  .migration-page .dropdown-group .row-1,
  .migration-page .dropdown-group .row-2 {
    display: contents;
  }

  /* All dropdowns have equal width - each takes 25% of total space */
  .migration-page .dropdown-group .row-1 .custom-dropdown,
  .migration-page .dropdown-group .row-2 .custom-dropdown {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
}

@media (min-width: 648px) and (max-width: 1330px) {
  /* On medium screens, allow 2 per row */
  .migration-page .dropdown-group .row-1 .custom-dropdown,
  .migration-page .dropdown-group .row-2 .custom-dropdown {
    width: calc(50% - 0.5rem);
  }
}

@media (max-width: 647px) {
  /* On small screens, stack vertically */
  .migration-page .dropdown-group .row-1 .custom-dropdown,
  .migration-page .dropdown-group .row-2 .custom-dropdown {
    width: 100%;
  }
}

/* Migration From/To dropdown radio button hiding and selected state styling */
.migration-page .migration-from-dropdown .dropdown-options input[type='radio'],
.migration-page .migration-to-dropdown .dropdown-options input[type='radio'] {
  display: none;
}

.migration-page .migration-from-dropdown .dropdown-options label:has(input:checked),
.migration-page .migration-to-dropdown .dropdown-options label:has(input:checked) {
  background-color: #1784e8;
  color: #fff;
  font-weight: bold;
}
