:root {
  --ink: #17252f;
  --muted: #55656e;
  --paper: #ffffff;
  --wash: #f2f7f5;
  --line: #d7e2de;
  --green: #075b4c;
  --green-dark: #05463b;
  --mint: #dcefe8;
  --gold: #e7b93f;
  --focus: #186db6;
  --shadow: 0 16px 40px rgba(18, 48, 43, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  background: var(--wash);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
  margin: 0;
  min-height: 100vh;
}

a {
  color: var(--green);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.shell,
.search-page {
  margin-inline: auto;
  max-width: 1120px;
  width: calc(100% - 2rem);
}

.skip-link {
  background: var(--paper);
  left: 1rem;
  padding: 0.7rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 78px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  display: inline-block;
  height: 66px;
  object-fit: contain;
  padding: 0.2rem 0.4rem;
  width: auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.brand small,
.header-note {
  color: var(--muted);
}

.search-page {
  flex: 1;
  padding-block: 3.5rem 5rem;
}

.search-hero {
  background: var(--green);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  color: white;
  overflow: hidden;
  padding: clamp(1.75rem, 4vw, 3rem);
  position: relative;
  transition: padding 0.15s ease;
}

/* Applied once a search is showing results, so the marketing-style header
   does not cost the same vertical space on every single search as it does
   on the first, empty landing view. */
.search-hero.is-compact {
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
}

.search-hero.is-compact .eyebrow {
  margin-bottom: 0.4rem;
}

.search-hero.is-compact h1 {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  margin-bottom: 0.85rem;
}

.search-hero::after {
  background: var(--gold);
  border-radius: 50%;
  content: "";
  height: 170px;
  opacity: 0.15;
  position: absolute;
  right: -45px;
  top: -70px;
  width: 170px;
}

.eyebrow {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 0.55rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin-bottom: 0.85rem;
  max-width: 760px;
  transition: font-size 0.15s ease;
}

.intro {
  color: #deeee9;
  font-size: 1.12rem;
  max-width: 680px;
}

.search-form {
  margin-top: 2rem;
  max-width: 820px;
  position: relative;
  z-index: 1;
}

.search-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.search-controls {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.search-controls input {
  border: 2px solid transparent;
  border-radius: 0.55rem;
  font-size: 1.05rem;
  min-height: 56px;
  padding: 0.8rem 1rem;
  width: 100%;
}

.search-controls button {
  background: var(--gold);
  border: 0;
  border-radius: 0.55rem;
  color: #2e270f;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  min-height: 56px;
  padding-inline: 1.8rem;
}

.search-controls button:hover {
  background: #f2c952;
}

.search-help {
  color: #d5e8e2;
  font-size: 0.9rem;
  margin: 0.65rem 0 0;
}

.validation-message {
  color: #ffe7a8;
  display: block;
  font-weight: 700;
  margin-top: 0.4rem;
}

.filter-panel {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.65rem;
  margin-top: 1.25rem;
  padding: 0.7rem 1rem;
}

.filter-panel[open] {
  padding-bottom: 1rem;
}

.filter-panel summary {
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  padding-block: 0.3rem;
}

.filter-panel[open] summary {
  margin-bottom: 0.4rem;
}

.filter-panel summary span {
  color: #d5e8e2;
  font-size: 0.85rem;
  font-weight: 500;
}

.filter-intro {
  color: #d5e8e2;
  font-size: 0.88rem;
  margin: 0 0 0.9rem;
}

.filter-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-field label {
  font-size: 0.9rem;
}

.filter-field select {
  background: white;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  display: block;
  font-size: 1rem;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

.filter-actions {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.filter-actions button {
  background: var(--gold);
  border: 0;
  border-radius: 0.5rem;
  color: #2e270f;
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  padding: 0.65rem 1rem;
}

.filter-actions a {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
}

.search-tips {
  margin-top: 1.75rem;
}

.results-section {
  margin-top: 3rem;
}

.search-tips h2 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.results-heading-row h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.025em;
}

.search-tips p {
  color: var(--muted);
}

.results-heading-row {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.results-heading-row .eyebrow {
  color: var(--green);
}

.results-heading-row h2,
.page-count {
  margin-bottom: 0;
}

.page-count {
  color: var(--muted);
}

.result-list {
  display: grid;
  gap: 1rem;
}

.result-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
}

.result-card h3 {
  font-size: 1.28rem;
  line-height: 1.3;
  margin: 0.85rem 0 0.55rem;
}

.result-meta-top {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.type-badge {
  background: var(--mint);
  border-radius: 999px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
}

.library-id,
.byline,
.source,
.classification {
  color: var(--muted);
  font-size: 0.93rem;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.source,
.classification {
  margin-bottom: 0.45rem;
}

.result-action {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.25rem;
  justify-content: space-between;
  margin-top: 1.1rem;
  padding-top: 1rem;
}

.result-action a {
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

.result-action span {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-action .report-link {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.report-page {
  flex: 1;
  margin-inline: auto;
  max-width: 780px;
  padding: 3.5rem 1rem 5rem;
  width: 100%;
}

.report-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 5vw, 3rem);
}

.report-panel .eyebrow {
  color: var(--green);
}

.report-panel h1 {
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3rem);
}

.report-intro,
.report-form p {
  color: var(--muted);
}

.reported-item {
  background: var(--wash);
  border-left: 4px solid var(--gold);
  border-radius: 0.5rem;
  display: grid;
  gap: 0.3rem;
  margin: 1.5rem 0;
  padding: 1rem;
}

.reported-item span {
  color: var(--muted);
  font-size: 0.85rem;
}

.reported-item a {
  overflow-wrap: anywhere;
}

.report-form {
  display: grid;
  gap: 1.25rem;
}

.report-form label {
  display: block;
  font-weight: 750;
  margin-bottom: 0.4rem;
}

.report-form label span {
  color: var(--muted);
  font-weight: 400;
}

.report-form select,
.report-form input,
.report-form textarea {
  border: 1px solid #aebdb8;
  border-radius: 0.45rem;
  font: inherit;
  padding: 0.7rem 0.8rem;
  width: 100%;
}

.report-form p {
  font-size: 0.83rem;
  margin: 0.35rem 0 0;
}

.field-error {
  color: #a51f1f;
  display: block;
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.report-buttons {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.report-buttons button {
  background: var(--green);
  border: 0;
  border-radius: 0.5rem;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0.75rem 1.1rem;
}

.report-success {
  background: var(--mint);
  border-left: 5px solid var(--green);
  border-radius: 0.6rem;
  margin: 1.5rem 0;
  padding: 1.2rem;
}

.report-success p {
  margin: 0.35rem 0;
}

.back-link {
  font-weight: 750;
}

.status-message {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 0.7rem;
  display: grid;
  gap: 0.25rem;
  margin-top: 2rem;
  padding: 1.2rem;
}

.status-error {
  border-left-color: #b73a3a;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.75rem;
}

.pagination a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  font-weight: 700;
  padding: 0.6rem 0.9rem;
  text-decoration: none;
}

.site-footer {
  background: var(--ink);
  color: #d5dfdf;
  margin-top: auto;
  padding-block: 1.6rem;
}

.footer-inner {
  display: flex;
  font-size: 0.88rem;
  gap: 1rem;
  justify-content: space-between;
}

@media (max-width: 700px) {
  .header-note {
    display: none;
  }

  .search-page {
    padding-block: 1rem 3rem;
    width: calc(100% - 1rem);
  }

  .search-hero {
    border-radius: 0.75rem;
    padding: 1.5rem;
  }

  .search-controls,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .results-heading-row,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    flex-wrap: wrap;
  }
}
