.acs-section {
  padding: 56px 0;
  background: #FFF;
  color: #333333;
}

.acs-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.acs-header {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 32px auto;
}

.acs-header h2 {
  margin: 0 0 12px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  font-weight: 500;
  color: #333333;
}

.acs-header p {
  margin: 0;
  color: #6c5a4d;
  line-height: 1.7;
  font-size: 1rem;
}

.acs-form {
  background: #ffffff;
  border: 1px solid rgba(74, 54, 39, 0.16);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(49, 36, 29, 0.08);
  padding: 28px;
  max-width: 960px;
  margin: auto;
  margin-bottom: 3rem;
  margin-top: 3rem;
}

.acs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.acs-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.acs-field-wide {
  grid-column: span 2;
}

.acs-field label,
.acs-per-page label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #49372b;
}

.acs-field input,
.acs-field select,
.acs-per-page select {
  width: auto;
  border: 1px solid rgba(74, 54, 39, 0.22);
  border-radius: 6px;
  padding: 11px 15px;
  font-size: 0.95rem;
  color: #333333;
  outline: none;
}

.acs-field input:focus,
.acs-field select:focus,
.acs-per-page select:focus {
  border-color: #FFF;
  box-shadow: 0 0 0 3px rgba(123, 74, 43, 0.12);
}

.acs-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.acs-button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.acs-button-primary {
  background: #3A3C51;
  color: #ffffff;
  border-color: #3A3C51;
}

.acs-button-primary:hover,
.acs-button-primary:focus {
  background: #333333;
  border-color: #333333;
}

.acs-button-secondary {
  background: transparent;
  color: #3A3C51;
  border-color: rgba(116, 77, 43, 0.35);
}

.acs-button-secondary:hover,
.acs-button-secondary:focus {
  background: #3A3C51;
  color: #ffffff;
  border-color: #3A3C51;
}

.acs-status-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}

.acs-summary {
  color: #6c5a4d;
  font-size: 0.98rem;
}

.acs-per-page {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 160px;
}

.acs-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.acs-card {
  background: #ffffff;
  border: 1px solid rgba(74, 54, 39, 0.16);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(49, 36, 29, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.acs-card-image-link {
  display: block;
  background: #eadfd2;
}

.acs-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.acs-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.acs-card-title {
  margin: 0 0 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 500;
  color: #333333;
}

.acs-card-meta {
  margin: 0 0 12px 0;
  color: #8a7667;
  font-size: 0.88rem;
  line-height: 1.5;
}

.acs-card-text {
  margin: 0 0 18px 0;
  color: #6c5a4d;
  font-size: 0.96rem;
  line-height: 1.6;
  flex: 1;
}

.acs-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.acs-keyword {
  display: inline-flex;
  align-items: center;
  background: #f0e3d5;
  color: #5a3b25;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.78rem;
  line-height: 1;
}

.acs-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  text-decoration: none;
  border: 1px solid rgba(116, 77, 43, 0.35);
  border-radius: 6px;
  padding: 9px 16px;
  color: #3A3C51;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.acs-card-link:hover,
.acs-card-link:focus {
  background: #3A3C51;
  color: #ffffff;
  border-color: #3A3C51;
}

.acs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.acs-page-button {
  border: 1px solid rgba(116, 77, 43, 0.35);
  background: #ffffff;
  color: #3A3C51;
  border-radius: 6px;
  padding: 8px 13px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.acs-page-button:hover,
.acs-page-button:focus,
.acs-page-button.is-active {
  background: #3A3C51;
  color: #ffffff;
  border-color: #3A3C51;
}

.acs-page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.acs-loading,
.acs-empty,
.acs-error {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px solid rgba(74, 54, 39, 0.16);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  color: #6c5a4d;
}

@media (max-width: 1200px) {
  .acs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .acs-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .acs-field-wide {
    grid-column: span 3;
  }
}

@media (max-width: 900px) {
  .acs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .acs-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .acs-field-wide {
    grid-column: span 2;
  }

  .acs-status-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .acs-section {
    padding: 42px 0;
  }

  .acs-container {
    padding: 0 18px;
  }

  .acs-form {
    padding: 20px;
  }

  .acs-grid {
    grid-template-columns: 1fr;
  }

  .acs-field-wide {
    grid-column: span 1;
  }

  .acs-results {
    grid-template-columns: 1fr;
  }

  .acs-actions {
    flex-direction: column;
  }

  .acs-button {
    width: 100%;
  }
}

/* extra */

#acs-boolean-help, #acs-date-help {
    font-size: 0.85rem;
    margin-bottom: 0;
    padding: 0 10px 0;
	margin-top: -5px;
}

.searchresultstitle {
  display: block;
  position: absolute;
}

#acs-summary {
	margin: -5px 3px;
}

#acs-results-start:focus {
    outline: 2px solid #FFFFFF;
    outline-offset: 6px;
}

/* Discovery form groups */
.acs-group { border: 0; padding: 0; margin: 24px 0; min-width: 0; }
.acs-group + .acs-group { border-top: 1px solid #e2dcd6; padding-top: 24px; }
.acs-group legend { font-family: Georgia, serif; font-size: 1.35rem; color: #3a3c51; padding: 0 0 14px; }
.acs-help, .acs-field small { font-size: .85rem; color: #65574c; line-height: 1.6; }
.acs-help { margin: 10px 0 18px; }
.acs-subheading { font-size: 1.05rem; margin: 20px 0 4px; }
.acs-field-full { grid-column: 1 / -1; }
.acs-field input, .acs-field select { box-sizing: border-box; width: 100%; min-width: 0; }
#acs-results-start { scroll-margin-top: 120px; }
#acs-results-start:focus { outline: 2px solid #FFF; outline-offset: 6px; }
.acs-summary { flex: 1; }

/* Keep the result heading and controls hidden until matching records are shown. */
#acs-results-start[hidden] { display: none !important; }
#acs-results { scroll-margin-top: 120px; }

#acs-advanced-fields[hidden] { display: none !important; }
#acs-general:disabled {
  background: #CCC !important;
  border-color: #b9b3ad;
  color: #59534e;
  opacity: 1;
  cursor: not-allowed;
}
#acs-general:disabled::placeholder { color: #59534e; opacity: 1; }


/* Default to hidden before JavaScript initializes, including inside Elementor. */
#acs-results-start:not([data-results-visible="true"]) { display: none !important; }
#advanced-character-search-form { scroll-margin-top: 120px; }
#acs-advanced-fields { display: flow-root; }
