/* Header search toggle + fade-down panel.
   Self-contained (not part of the Gulp bundle) so it can ship without a build. */

/* Screen-reader-only helper (Tailwind's sr-only may be tree-shaken out of the build). */
.gwotmf-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;
}

/* Anchor the absolutely-positioned panel to the header block. */
.wp-block-acf-header {
  position: relative;
}

/* Magnifying-glass toggle button. */
.header-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #00205b;
  line-height: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.2s ease;
}
.header-search-toggle:hover {
  opacity: 0.65;
}
.header-search-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}

/* Desktop: breathing room between the nav menu and the Donate button.
   (Only the desktop toggle lives inside the nav; the mobile one is spaced
   by the header cluster's own utility classes.) */
.header-nav-container .header-search-toggle {
  margin-left: 12px;
  margin-right: 20px;
}

/* Fade-down panel (closed state). */
.header-search-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  background: #ffffff;
  border-top: 1px solid #ececec;
  box-shadow: 0 12px 24px rgba(16, 24, 32, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.32s ease, transform 0.32s ease, visibility 0s linear 0.32s;
}

/* Open state. */
.wp-block-acf-header.search-open .header-search-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.header-search-panel .container {
  padding-top: 20px;
  padding-bottom: 20px;
}

.header-search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-search-form__icon {
  position: absolute;
  left: 18px;
  display: flex;
  color: #00205b;
  pointer-events: none;
}
.header-search-form__icon svg {
  display: block;
  width: 20px;
  height: 20px;
}
.header-search-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 20px 0 52px;
  border: 1px solid #ececec;
  border-radius: 8px;
  background: #ffffff;
  color: #101820;
  font-size: 16px;
  line-height: 1.2;
  outline: none;
  box-shadow: 0 1px 2px rgba(16, 24, 32, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.header-search-form input[type="search"]::placeholder {
  color: #a7a8a9;
}
.header-search-form input[type="search"]:focus {
  border-color: #65b2e7;
  box-shadow: 0 0 0 3px rgba(101, 178, 231, 0.25);
}
/* Drop the native WebKit search "x" so the field keeps its custom look. */
.header-search-form input[type="search"]::-webkit-search-decoration,
.header-search-form input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Close button (dismisses the panel). */
.header-search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #101820;
  line-height: 0;
  cursor: pointer;
  border-radius: 6px;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}
.header-search-close:hover {
  opacity: 0.7;
  background-color: #f5f5f6;
}
.header-search-close svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* Honor users who prefer reduced motion: no slide, instant reveal. */
@media (prefers-reduced-motion: reduce) {
  .header-search-panel,
  .wp-block-acf-header.search-open .header-search-panel {
    transition: none;
    transform: none;
  }
}

@media (max-width: 767px) {
  .header-search-panel .container {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .header-search-form input[type="search"] {
    height: 50px;
    padding-left: 48px;
  }
}

/* ---------------------------------------------------------------------------
   Search results page (templates/search.html → gwotmf/search-results block)
--------------------------------------------------------------------------- */
.gwotmf-search__hero {
  position: relative;
  overflow: hidden;
  background: #f5f5f6;
  padding-top: 48px;
  padding-bottom: 48px;
}
/* Keep hero text above the watermark. */
.gwotmf-search__hero .container {
  position: relative;
  z-index: 1;
}
/* GWOTMF brand seal watermark, right side, subtle. */
.gwotmf-search__watermark {
  position: absolute;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  /* Scale to the hero height so the whole seal stays inside the area. */
  height: 78%;
  max-height: 220px;
  aspect-ratio: 1 / 1;
  background: url("../images/timeline-year-background.svg") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}
@media (max-width: 1023px) {
  .gwotmf-search__watermark {
    display: none;
  }
}
.gwotmf-search__eyebrow {
  margin: 0 0 12px;
  color: #00205b;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.gwotmf-search__title {
  margin: 0 0 28px;
  color: #00205b;
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 48px);
  line-height: 1.05;
}

/* Hero search field. */
.gwotmf-search__form {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 760px;
}
.gwotmf-search__icon {
  position: absolute;
  left: 20px;
  display: flex;
  color: #00205b;
  pointer-events: none;
}
.gwotmf-search__icon svg {
  display: block;
  width: 22px;
  height: 22px;
}
.gwotmf-search__form input[type="search"] {
  width: 100%;
  height: 64px;
  padding: 0 24px 0 56px;
  border: 1px solid #ececec;
  border-radius: 8px;
  background: #ffffff;
  color: #101820;
  font-size: 17px;
  line-height: 1.2;
  outline: none;
  box-shadow: 0 1px 2px rgba(16, 24, 32, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gwotmf-search__form input[type="search"]::placeholder {
  color: #a7a8a9;
}
.gwotmf-search__form input[type="search"]:focus {
  border-color: #65b2e7;
  box-shadow: 0 0 0 3px rgba(101, 178, 231, 0.25);
}
.gwotmf-search__form input[type="search"]::-webkit-search-decoration,
.gwotmf-search__form input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Results region. */
.gwotmf-search__results {
  padding-top: 64px;
  padding-bottom: 80px;
}
.gwotmf-search__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 40px;
}
.gwotmf-search__count {
  margin: 0;
  color: #101820;
  font-size: 18px;
}
.gwotmf-search__term {
  font-weight: 700;
}
.gwotmf-search__sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #a7a8a9;
  font-size: 16px;
  white-space: nowrap;
}
.gwotmf-search__sort label {
  color: #a7a8a9;
}
.gwotmf-search__select {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.gwotmf-search__sort-select {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0 22px 0 0;
  border: 0;
  background: transparent;
  color: #101820;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.gwotmf-search__sort-select:focus-visible {
  outline: 2px solid #65b2e7;
  outline-offset: 2px;
}
/* Custom chevron. */
.gwotmf-search__select::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #101820;
  transform: translateY(-50%);
  pointer-events: none;
}

/* No-results state. */
.gwotmf-search__empty {
  padding: 8px 0 24px;
}
.gwotmf-search__empty-title {
  margin: 0 0 12px;
  color: #00205b;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  font-style: italic;
}
.gwotmf-search__empty-copy {
  margin: 0;
  color: #101820;
  font-size: 17px;
}
.gwotmf-search__empty-copy a {
  color: #00205b;
  font-weight: 700;
  text-decoration: underline;
}

@media (max-width: 767px) {
  .gwotmf-search__hero {
    padding-top: 28px;
    padding-bottom: 28px;
  }
  .gwotmf-search__title {
    margin-bottom: 20px;
  }
  .gwotmf-search__form input[type="search"] {
    height: 56px;
    padding-left: 52px;
    font-size: 16px;
  }
  .gwotmf-search__results {
    padding-top: 40px;
    padding-bottom: 56px;
  }
  .gwotmf-search__bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 28px;
  }
}
