/* Portfolio Grid/List - Mobile First */
.mpl-container {
  width: 100%;
  position: relative;
}

/* Reset h4 inside plugin to prevent theme bleed */
.mpl-container h4.mpl-item-title {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  font-size: 24px;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}

/* Controls Bar */
.mpl-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 30px;
}

.mpl-category-trigger {
  padding: 0;
  font-family: 'DMSans-SemiBold', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0px;
  color: black;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.mpl-clear {
  margin-left: auto;
  padding: 0;
  font-family: 'DMSans-SemiBold', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0px;
  color: black;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.mpl-category-trigger.active {
  color: #1b2742;
  text-decoration: underline;
  text-underline-offset: 4px;
	color: #5f7fc7;
}

.mpl-category-trigger:hover,
.mpl-clear:hover {
  color: #5f7fc7;
}

.mpl-clear:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Filter Panel */
.mpl-filter-panel {
  display: none;
  overflow: hidden;
}

.mpl-filter-panel.active {
  display: block;
}

.mpl-filter-group:last-child {
  margin-bottom: 0;
}

.mpl-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-bottom: 60px;
}

.mpl-filter-option {
  font-family: 'DMSans-Regular', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0px;
  color: black;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1.2;
}

.mpl-filter-option:hover {
  color: #5f7fc7;
}

.mpl-filter-option.active {
  color: #5f7fc7;
  font-family: 'DMSans-SemiBold', sans-serif;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Portfolio Grid (Mobile) */
.mpl-portfolio {
  display: grid;
  gap: 15px;
}

/* Grid card base styles (applies to all grid views) */
.mpl-portfolio[data-view^='grid'] .mpl-item {
  position: relative;
  overflow: hidden;
  display: block;
}

.mpl-portfolio[data-view^='grid'] .mpl-item-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 0;
}

.mpl-portfolio[data-view^='grid'] .mpl-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.mpl-portfolio[data-view^='grid'] .mpl-item:hover .mpl-item-image img {
  transform: scale(1.05);
}

.mpl-portfolio[data-view^='grid'] .mpl-item-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  z-index: 2;
}

.mpl-portfolio[data-view^='grid'] .mpl-item-title {
  font-family: 'DMSans-SemiBold', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  text-transform: none;
  letter-spacing: 0px;
  color: #ffffff;
  margin: 0 !important;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.mpl-portfolio[data-view^='grid'] .mpl-item-meta {
  display: none;
}

/* Bottom gradient for title readability (default state) */
.mpl-portfolio[data-view^='grid'] .mpl-item::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80%;
  background: linear-gradient(to top, rgba(27, 39, 66, 0.9), transparent);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mpl-portfolio[data-view^='grid'] .mpl-item:hover::before {
  opacity: 0;
}

/* Hover overlay */
.mpl-portfolio[data-view^='grid'] .mpl-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(27, 39, 66, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.mpl-portfolio[data-view^='grid'] .mpl-item:hover::after {
  opacity: 1;
}

/* Mobile Grid Sizes */
.mpl-portfolio[data-view='grid-medium'] {
  grid-template-columns: 1fr;
  gap: 15px;
}

.mpl-item {
  display: block;
  text-decoration: none;
  color: #000000;
  transition: opacity 0.3s ease;
}

.mpl-item:active {
  opacity: 0.7;
}

.mpl-item-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 0;
}

.mpl-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.mpl-item-title {
  font-family: 'DMSans-SemiBold', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0px;
  line-height: 1.3;
  margin-bottom: 8px !important;
}

.mpl-item-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: 'DMSans-SemiBold', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0px;
  color: black;
}

.mpl-no-results {
  padding: 60px 0;
  text-align: center;
  font-family: 'DMSans-SemiBold', sans-serif;
  font-size: 16px;
  color: rgba(0, 0, 0, 0.4);
  grid-column: 1 / -1;
}

/* Tablet & Desktop */
@media (min-width: 768px) {
  .mpl-filter-options {
    gap: 10px 25px;
  }

  /* Grid View - Medium (default 3-column) */
  .mpl-portfolio[data-view='grid-medium'] {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}
