:root {
  --edp-search-ink: #171513;
  --edp-search-muted: #6f675f;
  --edp-search-paper: #fffdf9;
  --edp-search-warm: #f5eee4;
  --edp-search-line: #ded4c7;
  --edp-search-accent: #c94b2c;
  --edp-search-accent-dark: #97341e;
  --edp-search-gold: #e2a83b;
  --edp-search-shadow: 0 28px 80px rgba(31, 21, 14, .22);
}

html.edp-search-open { overflow: hidden; }

.edp-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  overflow: auto;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(22, 18, 15, .76);
  backdrop-filter: blur(10px);
}

.edp-search-overlay[hidden] { display: none !important; }

.edp-search-surface {
  position: relative;
  width: min(1120px, 100%);
  min-height: min(820px, calc(100vh - 60px));
  margin: 0 auto;
  padding: clamp(26px, 5vw, 64px);
  overflow: visible;
  color: var(--edp-search-ink);
  background:
    radial-gradient(circle at 93% 2%, rgba(226, 168, 59, .18), transparent 28%),
    linear-gradient(145deg, #fffdf9 0%, #fbf7f1 100%);
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 28px;
  box-shadow: var(--edp-search-shadow);
  box-sizing: border-box;
  font-family: inherit;
}

.edp-search-standalone { padding: 42px 18px 72px; background: #f7f2eb; }
.edp-search-standalone .edp-search-surface { min-height: 680px; box-shadow: 0 18px 60px rgba(31, 21, 14, .11); }
.edp-search-page { max-width: none !important; margin: 0 !important; padding: 0 !important; }

.edp-search-preview-badge {
  width: fit-content;
  margin: -10px 0 24px;
  padding: 7px 11px;
  color: #4f3f12;
  background: #fff1b9;
  border: 1px solid #e7cc67;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
}

.edp-search-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  color: var(--edp-search-ink);
  background: rgba(255,255,255,.86);
  border: 1px solid var(--edp-search-line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 31px;
  line-height: 1;
}

.edp-search-close:hover { background: var(--edp-search-ink); color: white; }
.edp-search-close:focus-visible,
.edp-search-surface button:focus-visible,
.edp-search-surface a:focus-visible,
.edp-search-input:focus-visible { outline: 3px solid var(--edp-search-gold); outline-offset: 3px; }

.edp-search-hero { max-width: 790px; margin: 0 auto 30px; text-align: center; }
.edp-search-eyebrow { margin: 0 0 10px !important; color: var(--edp-search-accent) !important; font-size: 13px !important; font-weight: 800 !important; letter-spacing: .16em; text-transform: uppercase; }
.edp-search-hero h1 { margin: 0 0 13px !important; color: var(--edp-search-ink) !important; font-family: Georgia, 'Times New Roman', serif !important; font-size: clamp(38px, 6vw, 68px) !important; font-weight: 600 !important; line-height: .98 !important; letter-spacing: -.035em; }
.edp-search-hero > p:last-child { max-width: 620px; margin: 0 auto !important; color: var(--edp-search-muted) !important; font-size: clamp(16px, 2vw, 19px) !important; line-height: 1.55 !important; }

.edp-search-form { position: relative; z-index: 4; max-width: 830px; margin: 0 auto; }
.edp-search-input-wrap {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px 9px 18px;
  background: white;
  border: 2px solid var(--edp-search-ink);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(56, 38, 25, .12);
}
.edp-search-input-wrap:focus-within { border-color: var(--edp-search-accent); box-shadow: 0 0 0 5px rgba(201, 75, 44, .11), 0 14px 36px rgba(56, 38, 25, .14); }
.edp-search-input-wrap svg { width: 26px; height: 26px; fill: none; stroke: var(--edp-search-muted); stroke-width: 1.8; }
.edp-search-input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 !important;
  color: var(--edp-search-ink) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-family: inherit;
  font-size: 18px !important;
  line-height: 1.3;
}
.edp-search-input:focus { outline: 0 !important; }
.edp-search-input::placeholder { color: #8e857b; opacity: 1; }
.edp-search-submit {
  min-height: 50px;
  padding: 0 25px;
  color: white;
  background: var(--edp-search-accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
}
.edp-search-submit:hover { background: var(--edp-search-accent-dark); transform: translateY(-1px); }

.edp-search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: min(520px, 62vh);
  margin: 0 !important;
  padding: 8px !important;
  overflow-y: auto;
  list-style: none !important;
  background: white;
  border: 1px solid var(--edp-search-line);
  border-radius: 16px;
  box-shadow: 0 22px 56px rgba(34, 24, 17, .18);
}
.edp-search-suggestion { display: grid; grid-template-columns: 58px 1fr; gap: 13px; align-items: center; min-height: 66px; margin: 0 !important; padding: 8px; border-radius: 11px; cursor: pointer; }
.edp-search-suggestion:hover, .edp-search-suggestion[aria-selected='true'] { background: var(--edp-search-warm); }
.edp-search-suggestion-thumb { display: grid; width: 58px; height: 50px; place-items: center; overflow: hidden; color: var(--edp-search-accent); background: #f1e3d5; border-radius: 9px; font-family: Georgia, serif; font-size: 34px; }
.edp-search-suggestion-thumb img { width: 100%; height: 100%; object-fit: cover; }
.edp-search-suggestion-copy { min-width: 0; }
.edp-search-suggestion-copy strong, .edp-search-suggestion-copy small { display: block; }
.edp-search-suggestion-copy strong { overflow: hidden; color: var(--edp-search-ink); font-size: 15px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.edp-search-suggestion-copy small { margin-top: 4px; overflow: hidden; color: var(--edp-search-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.edp-search-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 16px auto 0; color: var(--edp-search-muted); font-size: 13px; }
.edp-search-quick button, .edp-search-empty-choices button { padding: 7px 11px; color: #51483f; background: transparent; border: 1px solid var(--edp-search-line); border-radius: 999px; cursor: pointer; font: inherit; }
.edp-search-quick button:hover, .edp-search-empty-choices button:hover { color: white; background: var(--edp-search-ink); border-color: var(--edp-search-ink); }

.edp-search-results-region { margin-top: 46px; }
.edp-search-toolbar { display: flex; gap: 18px; justify-content: space-between; align-items: end; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--edp-search-line); }
.edp-search-summary { margin: 0 !important; color: var(--edp-search-ink) !important; font-size: 16px !important; font-weight: 750; }
.edp-search-filters { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.edp-search-filters button { min-height: 40px; padding: 8px 13px; color: var(--edp-search-muted); background: transparent; border: 1px solid var(--edp-search-line); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700; }
.edp-search-filters button.is-active { color: white; background: var(--edp-search-ink); border-color: var(--edp-search-ink); }

.edp-search-correction { margin: 0 0 18px; padding: 12px 14px; color: #4c3e16; background: #fff2c3; border-left: 4px solid var(--edp-search-gold); border-radius: 7px; }
.edp-search-status { margin: 30px 0; padding: 26px; color: var(--edp-search-muted); text-align: center; }
.edp-search-status.is-loading::before { display: inline-block; width: 17px; height: 17px; margin-right: 10px; border: 2px solid #d1c6b9; border-top-color: var(--edp-search-accent); border-radius: 50%; content: ''; vertical-align: -3px; animation: edp-search-spin .75s linear infinite; }
.edp-search-status.is-error { color: #822d1d; background: #fff0ec; border-radius: 10px; }

.edp-search-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.edp-search-card { display: grid; grid-template-columns: 138px minmax(0, 1fr); min-width: 0; overflow: hidden; background: rgba(255,255,255,.9); border: 1px solid var(--edp-search-line); border-radius: 16px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.edp-search-card:hover { transform: translateY(-3px); border-color: #cbb9a8; box-shadow: 0 14px 32px rgba(50, 34, 22, .11); }
.edp-search-card-media { display: grid; min-height: 190px; place-items: center; overflow: hidden; color: rgba(255,255,255,.94); background: linear-gradient(145deg, var(--edp-search-accent), #8a2d1b); text-decoration: none !important; }
.edp-search-card-media img { width: 100%; height: 100%; object-fit: cover; }
.edp-search-card-media span { font-family: Georgia, serif; font-size: 72px; line-height: 1; }
.edp-search-card-body { min-width: 0; padding: 19px 18px 17px; }
.edp-search-card-meta { display: flex; gap: 7px; align-items: center; min-width: 0; margin-bottom: 9px; }
.edp-search-kind { flex: none; color: var(--edp-search-accent-dark); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.edp-search-topic { overflow: hidden; color: var(--edp-search-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.edp-search-topic::before { margin-right: 7px; content: '·'; }
.edp-search-card h2 { margin: 0 0 8px !important; font-family: Georgia, 'Times New Roman', serif !important; font-size: 21px !important; font-weight: 650 !important; line-height: 1.18 !important; letter-spacing: -.015em; }
.edp-search-card h2 a { color: var(--edp-search-ink) !important; text-decoration: none !important; }
.edp-search-card h2 a:hover { color: var(--edp-search-accent-dark) !important; }
.edp-search-excerpt { display: -webkit-box; margin: 0 0 12px !important; overflow: hidden; color: var(--edp-search-muted) !important; font-size: 13px !important; line-height: 1.48 !important; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.edp-search-read { color: var(--edp-search-accent-dark); font-size: 12px; font-weight: 800; }

.edp-search-pagination { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 30px; }
.edp-search-page-button { min-height: 44px; padding: 9px 15px; color: var(--edp-search-ink); background: white; border: 1px solid var(--edp-search-line); border-radius: 10px; cursor: pointer; font-weight: 750; }
.edp-search-page-button:hover:not(:disabled) { color: white; background: var(--edp-search-ink); }
.edp-search-page-button:disabled { cursor: not-allowed; opacity: .42; }
.edp-search-page-label { color: var(--edp-search-muted); font-size: 13px; font-weight: 700; }

.edp-search-empty { grid-column: 1 / -1; padding: 50px 20px; text-align: center; background: rgba(255,255,255,.65); border: 1px dashed #cdbdaa; border-radius: 18px; }
.edp-search-empty-mark { display: grid; width: 64px; height: 64px; margin: 0 auto 16px; place-items: center; color: white; background: var(--edp-search-accent); border-radius: 50%; font-family: Georgia, serif; font-size: 35px; }
.edp-search-empty h2 { margin: 0 0 8px !important; color: var(--edp-search-ink) !important; font-family: Georgia, serif !important; font-size: 28px !important; }
.edp-search-empty p { max-width: 560px; margin: 0 auto 20px !important; color: var(--edp-search-muted) !important; }
.edp-search-empty-choices { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

@keyframes edp-search-spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .edp-search-overlay { padding: 0; background: var(--edp-search-paper); }
  .edp-search-overlay .edp-search-surface { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .edp-search-results { grid-template-columns: 1fr; }
  .edp-search-toolbar { align-items: flex-start; flex-direction: column; }
  .edp-search-filters { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .edp-search-surface { padding: 72px 15px 34px; border-radius: 0; }
  .edp-search-standalone { padding: 0; }
  .edp-search-hero { margin-bottom: 22px; }
  .edp-search-hero h1 { font-size: 42px !important; }
  .edp-search-hero > p:last-child { font-size: 15px !important; }
  .edp-search-input-wrap { grid-template-columns: 25px minmax(0, 1fr); padding: 8px 12px; border-radius: 14px; }
  .edp-search-input { height: 45px; font-size: 16px !important; }
  .edp-search-submit { grid-column: 1 / -1; width: 100%; }
  .edp-search-suggestions { position: fixed; top: 220px; right: 12px; left: 12px; }
  .edp-search-quick { justify-content: flex-start; }
  .edp-search-results-region { margin-top: 32px; }
  .edp-search-card { grid-template-columns: 98px minmax(0, 1fr); }
  .edp-search-card-media { min-height: 172px; }
  .edp-search-card-body { padding: 15px 13px; }
  .edp-search-card h2 { font-size: 18px !important; }
  .edp-search-excerpt { -webkit-line-clamp: 2; }
  .edp-search-pagination { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .edp-search-card, .edp-search-submit { transition: none; }
  .edp-search-status.is-loading::before { animation-duration: 1.8s; }
}

