

:root {
  --hover-dark: #99690F; /* Not an emplace color */
  --dark-honey: #C38513; /* Not an emplace color */
  --dark-yellow: #E9A422;
  --yellow: #FBB040;
  --light-yellow: #FDB919;
  --blue: #4F5FAB;
  --dark-blue: #2C2C6E;
  --black: #231f20
}

/* 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 {
  width: 95%;
  display: flex;
  flex-direction: column;
}

.directory-header {
  padding: 5px 10px 20px 20px;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  position: relative;
}

.header-top {
  display: flex;
  justify-content: end;
  align-items: flex-start;
  flex-wrap: wrap;
}

.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;
  align-self: flex-end;
}

.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;
  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: flex-end;
  gap: 7px;
  height: 100%;
}

.checkbox-field input {
  height: 25px !important;
}

.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;
  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;
}

#match-full-text {
  font-size: 0.875rem;
  color: #666;
  height: 1.2rem;
  min-width: 13rem;
  border: 1px solid #aaa;
}

.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;
  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: 5px 10px 20px 10px;
}

.card {
  display: flex;
  flex-direction: column;
  flex: 1 2 25%;
  margin: 10px 10px 15px 10px;
  overflow: hidden;
  max-width: 300px;
  min-width: 200px;
  width: clamp(250px, 30vw, 350px); /* min 250px, scales up to 350px */
  border: 2px solid #ddd;
  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 {
  flex: 1;
  display: flex;
  width: 100%;
  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: fill;
  object-position: center;
  display: block;
}

.card-thumbnail a {
  display: block;
  width: 100%;
  height: 100%;
}

.card-thumbnail a:focus {
  outline: none;
}

.card-thumbnail a:focus-visible {
  outline: 3px solid var(--dark-honey);
  outline-offset: -3px;
}

.card-content {
  flex: 1;
  margin: 2px 5px 5px 5px;
}

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

.card-post-title a {
  text-decoration: none;
  color: var(--dark-honey);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
}

.card-post-title a:hover {
  color: var(--hover-dark);
}

.card-post-title a:focus {
  outline: none;
}

.card-post-title a:focus-visible {
  outline: 2px solid var(--dark-honey);
  padding-right: 2px;
  padding-left: 2px;
}

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

.card-excerpt {
  margin: 7px 5px 0px 5px;
  font-size: 0.8rem;
  line-height: 1.1rem;
}


.meta-data {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  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: var(--blue);
  color:  white;

  border-radius: 4px;
  border: 1px solid #ddd;
  text-decoration: none;

  transition: all 0.2s ease;
  text-wrap: wrap;
  width: fit-content;
  font-size: 0.8em;
  font-weight: 500;
  line-height: 1.2;
  margin: 1px;
  font-size: clamp(0.65rem, 1vw, 0.75rem);
}

.meta-filter-btn:hover,
.meta-filter-btn:focus-visible {
  color:  var(--blue);
  background-color: white;
  border-color: var(--blue);
  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: var(--black);
  font-size: 0.8rem;
}

/* Current page */
.pagination .current {
  background-color: var(--blue);
  color: #fff;
  border-color:var(--dark-blue)
}

/* 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 */
}

/* Select2 custom styles */
.select2-container .select2-selection--single .select2-selection__rendered,
.select2-results__option {
  min-height: .65rem;
  font-size: 0.7em; /* option text */
}

/* override rounded corners from select2 to match our design */
.select2-container--default .select2-selection--single {
  border-radius: 0;
}

.select2-container {
    width: auto !important;
    min-width: 150px;
}

.select2-dropdown {
  width: auto !important;
}