/**
 * Header search modal styles for pages that skip the legacy Tailwind bundle
 * (build/index.css) — v1.5 pages and pillar pages. The modal markup in
 * header.php + template-parts/CA-New/search-form.php uses legacy utility and
 * component classes; this file recreates just enough of them, scoped entirely
 * under #ca-search-modal-overlay so nothing leaks into the page.
 *
 * Hand-authored (like search-print.css), not a build output.
 * Colors from tailwind.config.js: primaryBlue #009999, textColor rgb(71 85 105).
 */

/* --- Overlay (.ca-modal-contain) --- */
#ca-search-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  height: 100vh;
  width: 100%;
  align-items: flex-start;
  justify-content: center;
  overflow-y: hidden;
  background: rgba(0, 0, 0, 0.3);
  padding-top: 2.5rem;
}
@media (min-width: 768px) {
  #ca-search-modal-overlay {
    align-items: center;
    padding-top: 0;
  }
}
#ca-search-modal-overlay.hidden {
  display: none;
}
/* Elements the JS shows/hides inside the modal (dropdown, result panes) */
#ca-search-modal-overlay .hidden {
  display: none;
}

/* --- Modal card (.ca-modal-body) --- */
#ca-modal-body-content {
  position: relative;
  z-index: 50;
  align-self: center;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  width: 83.333%;
  height: auto;
  transition: opacity 0.3s, transform 0.3s;
}
@media (min-width: 768px) {
  #ca-modal-body-content {
    width: 50%;
    max-width: 768px;
  }
}
#ca-modal-body-content.opacity-0 {
  opacity: 0;
}
#ca-modal-body-content.-translate-y-full {
  transform: translateY(-100%);
}

/* --- Close button --- */
#ca-search-modal-overlay .ca-close-modal {
  position: absolute;
  top: 0.75rem;
  right: 0.625rem;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  padding: 0.375rem;
  color: #9ca3af;
  cursor: pointer;
}
#ca-search-modal-overlay .ca-close-modal:hover {
  background: #e5e7eb;
  color: #111827;
}
#ca-search-modal-overlay .ca-close-modal svg {
  width: 1.25rem;
  height: 1.25rem;
}
#ca-search-modal-overlay .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Logo + title row --- */
#ca-modal-body-content > div.flex {
  display: flex;
  align-items: center;
  width: 100%;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}
#ca-modal-body-content > div.flex img {
  height: 2rem;
  width: 2rem;
  margin-right: 0.5rem;
}
#ca-modal-body-content h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: left;
  color: rgb(71 85 105);
}

/* --- Form inputs (.ca-input-icon-wrapper / .input-option) --- */
#ca-search-modal-overlay .ca-input-icon-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
}
#ca-search-modal-overlay .ca-input-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  z-index: 10;
  fill: rgba(0, 153, 153, 0.7);
}
#ca-search-modal-overlay .input-option {
  display: block;
  width: 100%;
  height: 3rem;
  border-radius: 0.75rem;
  border: 1px solid #009999;
  background: #fff;
  padding: 0.5rem 0.75rem 0.5rem 40px;
  font-size: 1.125rem;
  color: rgb(71 85 105);
}
#ca-search-modal-overlay .input-option::placeholder {
  color: rgb(71 85 105);
}
#ca-search-modal-overlay .input-option:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 1px #14b8a6;
}
#ca-search-modal-overlay .input-option.border-red-500 {
  border-color: #ef4444;
}
#ca-search-modal-overlay .input-option.placeholder-red-500::placeholder {
  color: #ef4444;
}
#ca-search-modal-overlay .input-option.placeholder-primaryBlue::placeholder {
  color: #009999;
}
#ca-search-modal-overlay .input-option.font-bold {
  font-weight: 700;
}

/* --- Service dropdown (#ca_dropdown) --- */
#ca-search-modal-overlay #ca_dropdown {
  position: absolute;
  top: 0.25rem;
  left: 0;
  z-index: 20;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #009999;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
#ca-search-modal-overlay #ca_dropdown.hidden {
  display: none;
}
#ca-search-modal-overlay #ca-service-results {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.75rem;
}
@media (min-width: 1024px) {
  #ca-search-modal-overlay #ca-service-results {
    flex-direction: row;
  }
  #ca-search-modal-overlay #ca-service-results > div {
    width: 50%;
  }
}
#ca-search-modal-overlay #ca-service-results h2 {
  margin: 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: rgb(71 85 105);
}
#ca-search-modal-overlay .search-service {
  display: flex;
  align-items: center;
  margin: 0.25rem;
  border-radius: 0.75rem;
  cursor: pointer;
  color: #009999;
}
#ca-search-modal-overlay .search-service:hover {
  background: #e2e8f0;
}
#ca-search-modal-overlay .search-service .service-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  width: 2.5rem;
  font-size: 1.25rem;
}
#ca-search-modal-overlay .search-service .text-primaryBlue {
  color: #009999;
}

/* --- Submit button --- */
#ca-search-modal-overlay #searchForm button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12rem;
  height: 3rem;
  margin: 0 auto;
  padding: 0 2rem;
  border: 1px solid #166534;
  border-radius: 0.5rem;
  background: #009999;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}
#ca-search-modal-overlay #searchForm button:hover {
  transform: scale(1.05);
}
#ca-search-modal-overlay #searchForm button svg {
  margin-right: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
}
