
/* needed so we can center our content from inside parent theme container */
.directory-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100% !important;
  margin-top: 20px;
  margin-bottom: 20px;
}

.directory-container {
  margin-top: 15px auto;
  width: 95%;
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.directory-header {
  padding: 20px;
  padding-right: 10px;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-wrap: wrap;
  position: relative;
}

.header-text {
  flex: 0 1 auto;
  padding-right: 15px;
  margin-right: auto; /* Push everything else to the right */
  margin-bottom: 1rem;
  align-items: left;
}
.header-right {
  display: block;
}

.header-right-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-right: 15px;
}

.filter-container {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.search-button {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #6a6a6a;
  padding: 0;
  cursor: pointer;
  transition: all 0.4s ease;
}

.search-button:not(:disabled):hover {
  background: #e0e0e0;
  color: #6a6a6a;
}

#match-any-input-box {
  width: 100%;
  box-sizing: border-box;
}

.header-right-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: right;
  margin-right: 15px;
  margin-top: 10px;
}

#advanced-filter-button {
  padding: 4px 10px;
  font-size: 0.875rem;
}

#metadata-filter-panel {
  display: none;
  position: relative;
  top: 100%;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
  padding: 10px;
  z-index: 1000;
  margin: 2rem auto; /* Center the panel horizontally */
  max-width: fit-content;
}

#metadata-filter-panel.active {
  display: inline-block;
}

.metafields-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 15px;
}

.metafields-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#metadata-filter-form {
  display: inline-block;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  max-width: fit-content;
  margin-right: 5px;
  margin-left: 5px;
}

.metadata-field {
  margin-bottom: 5px;
}

.metadata-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
}

.checkbox-field input[type="checkbox"] {
  margin: 0;
}

.checkbox-field label {
  margin: 0;
  cursor: pointer; /* Make the label clickable */
}

.metadata-field select,
.metadata-field input {
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.875rem;
  height: 35px;
}

.apply-filters-button {
  padding: 7px;
  height: 40px;
  font-size: 0.875rem;
  font-weight: 650;
  margin-top: auto;
}

.apply-filters-button:hover {
  background: #e0e0e0;
  color: #6a6a6a;
}

.sort-select {
  width: auto;
  display: inline-block;
  font-size: 0.875rem;
}

select {
  background-color: white;
  color: #666;
}

.any-text-filter,
.metadata-sort {
  display: flex;
  align-items: center;
  font-size-adjust: 0.8rem;
}

.any-text-filter input,
.metadata-sort select {
  font-size: 0.875rem; /* 14px if base is 16px */
  padding: 4px 8px; /* Adjust padding to match smaller text */
  height: 30px; /* Make input/select height consistent */
}

.any-text-filter input::placeholder {
  font-size: 0.875rem;
  color: #666;
}

.search-any-button {
  height: 30px;
  width: 40px;
}

.search-any-button .dashicons {
  font-family: "dashicons";
  font-size: 1.2em;
  color: #333;
  vertical-align: middle;
}

select option[disabled] {
  color: #999;
  font-style: italic;
}

.reset-button {
  padding: 4px 10px;
  font-size: 0.875rem;
}

.reset-button:disabled {
  opacity: 0.5;
  cursor: default;
  background: #eee;
  color: #6a6a6a;
  border-color: #eee;
}

.reset-button:not(:disabled):hover {
  background: #e0e0e0;
  color: #6a6a6a;
}

.subheader {
  display: flex;
  justify-content: space-between;
  align-items: center; /* vertical */
}

.subheader #filter-results {
  font-size: 0.875rem;
  color: #666;
  display: block;
  text-align: left;
  margin-top: 5px;
  margin-left: 20px;
}

.filter-result-item {
  display: inline-block;
  white-space: nowrap;
  border: 1px solid #dbcdcd;
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 2px 4px;
  margin: 2px;
}

.subheader .pagination {
  display: flex;
  justify-content: right;
}

.grid-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;

  padding: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  flex: 1 1 25%;
  margin: 15px;
  padding: 5px;
  overflow: hidden;
  max-width: 300px;
  width: clamp(250px, 30vw, 350px); /* min 250px, scales up to 350px */

  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);

  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px); /* Slight upward movement */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Larger shadow */
}

.card-thumbnail {
  display: flex;
  aspect-ratio: 4 / 3;
  width: 100%;
  padding: 5px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;

  font-size: 12px;
  color: #888;  /* for placeholder alt text */
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.card-post-title {
  margin: 2px 5px 0px 5px;
}

.card-post-title a {
  text-decoration: none;
  color: #0274be;
  font-size: 1.4rem;
  cursor: pointer;
}

.card-author-date {
  margin: 2px 5px 0px 5px;
  font-size: 0.75rem;
}

.card-excerpt {
  margin: 7px 5px 0px 5px;
  font-size: 0.75rem;
  font-style:italic;
}


.meta-data {
  display: flex;
  flex-direction: row;
  margin-top: 5px;
  min-width: 0; /* Prevent overflow of content so it doesn't squeeze the thumbnail image */
}

.meta-filter-btn {
  display: inline-flex;
  padding: 1px 6px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
  text-wrap: wrap;
  width: fit-content;
  font-size: 0.8em;
  line-height: 1.2;
  margin: 1px;
  font-size: clamp(0.65rem, 1vw, 0.75rem);
}

.meta-filter-btn:hover {
  color: black;
  background-color: #e0e0e0;
  border-color: #046bd2;
  cursor: pointer;
}

.meta-data-date {
  font-size: 0.8em;
  color: #666;
  margin: 4px 2px;
  margin-top: auto; /* Calculate top margin to display date at bottom of the card */
}

/* Pagination container */
.pagination {
  display: flex;
  justify-content: right;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 20px;
  margin-right: 20px;
}

/* Individual page links */
.pagination a,
.pagination span {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 4px;
  margin: 0 4px;
  border: 1px solid #cccccc70;
  text-decoration: none;
  color: #333;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Current page */
.pagination .current {
  background-color: #0274be;
  color: #fff;
  border-color: #0274be;
}

/* Hover state */
.pagination a:hover {
  background-color: #f0f0f0;
}

/* Previous/Next links */
.pagination .prev,
.pagination .next {
  font-family: "dashicons";
  font-size: 0;
  width: 30px;
  height: 30px;
}

.pagination .next {
  margin-right: 0px; /* let container handle the margin */
}

.pagination .dots {
  border: none;
  margin: 0 2px;
  padding: 0px;
  position: relative;
  top: 0.4px; /* Make the dots lower to align with bottom of other buttons, not bottom of other text */
}

/* Icon styling (example using Font Awesome) */
.pagination .prev::before,
.pagination .next::before {
  font-family: "dashicons";
  font-weight: 400;
  font-size: 16px;
  color: #333;
}

.pagination .prev::before {
  content: "\f341"; /* Left arrow */
}

.pagination .next::before {
  content: "\f345"; /* Right arrow */
}
