/* =========================================================
   PaperHub — Search Article page
   Pure HTML + CSS. No frameworks, no JS dependencies.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --ph-primary:        #1f5ad6;
  --ph-primary-dark:   #1944a8;
  --ph-primary-soft:   #eaf0ff;
  --ph-primary-tint:   #f3f6ff;

  --ph-text:           #1c2330;
  --ph-text-muted:     #5a6473;
  --ph-text-subtle:    #8590a3;
  --ph-text-link:      #1f5ad6;

  --ph-border:         #e4e7ec;
  --ph-border-strong:  #cfd4dc;
  --ph-border-soft:    #eef1f5;

  --ph-surface:        #ffffff;
  --ph-surface-alt:    #fafbfd;
  --ph-page:           #f5f7fa;

  --ph-success:        #1f7a4c;
  --ph-success-soft:   #e6f4ed;
  --ph-amber:          #9a5b00;
  --ph-amber-soft:     #fbeed1;
  --ph-slate:          #334155;
  --ph-slate-soft:     #eef1f5;

  --ph-radius-sm: 4px;
  --ph-radius:    8px;
  --ph-radius-lg: 12px;
  --ph-radius-pill: 999px;

  --ph-shadow-xs: 0 1px 2px rgba(18, 30, 60, 0.04);
  --ph-shadow-sm: 0 1px 3px rgba(18, 30, 60, 0.06);
  --ph-shadow:    0 2px 8px rgba(18, 30, 60, 0.06);
  --ph-shadow-md: 0 6px 18px rgba(18, 30, 60, 0.08);
  --ph-shadow-lg: 0 14px 32px rgba(18, 30, 60, 0.10);

  --ph-header-height: 240px;  /* site navbar + sticky search card */
  --ph-sticky-offset: 120px;

  --ph-font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ph-font-serif: "Source Serif 4", "Georgia", "Times New Roman", serif;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--ph-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ph-text);
  background: var(--ph-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ph-text-link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.005em;
  color: var(--ph-text);
}

p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.ph-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Page shell ---------- */
.ph-search-page {
  /* clear the site's floating rounded navbar (.header-style-six) */
  padding-top: 130px;
  background: var(--ph-page);
}

/* =========================================================
   HEADER (page-level search toolbar — STICKY card below
   the site's floating rounded navbar)
   ========================================================= */
.ph-search-header {
  position: sticky;
  top: 120px;              /* clear the floating .header-style-six navbar */
  z-index: 30;
  margin: 0 auto 20px;
  /* full-width bleed behind the card so nothing shows through when sticky */
  padding: 10px max(32px, calc((100vw - 1360px) / 2)) 10px;
  background: var(--ph-page);
}

.ph-search-header__inner {
  max-width: 1296px;
  margin: 0 auto;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(18, 30, 60, 0.08);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* hide the browser's native search clear button (we render our own) */
.ph-search-form__input::-webkit-search-cancel-button,
.ph-search-form__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- Compact sticky toolbar card (inside content column) ---------- */
.ph-search-toolbar-card {
  position: relative;
  top: auto;
  z-index: 1;
  background: #0f2f6d;
  border: 1px solid #0f2f6d;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(8, 28, 68, 0.24);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ph-search-toolbar-card .ph-search-toolbar__meta {
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 10px;
}
.ph-search-toolbar-card .ph-search-toolbar__count { color: rgba(236, 243, 255, 0.88); }
.ph-search-toolbar-card .ph-search-toolbar__count strong,
.ph-search-toolbar-card .ph-search-toolbar__query { color: #ffffff; }
.ph-search-toolbar-card .ph-search-toolbar__scope { display: inline; margin-top: 0; font-size: 12.5px; color: rgba(210, 223, 246, 0.9); }
.ph-search-toolbar-card .ph-search-toolbar__sort-label { color: rgba(210, 223, 246, 0.82); }
.ph-search-toolbar__sep { color: rgba(210, 223, 246, 0.64); margin: 0 4px; }

/* Slim active filters bar */
.ph-search-active-filters--slim {
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: none;
  gap: 10px;
}
.ph-search-active-filters--slim .ph-search-active-filters__label { font-size: 11px; }
.ph-search-active-filters--slim .ph-chip--filter { padding: 3px 8px; font-size: 12px; }

/* =========================================================
   INTERACTIVE YEAR RANGE (dual-handle overlay)
   ========================================================= */
.ph-range__slider {
  position: relative;
  height: 28px;
  margin: 4px 10px;
}
.ph-range__slider .ph-range__track {
  position: absolute;
  left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: var(--ph-border-soft);
  border-radius: 4px;
  margin: 0;
}
.ph-range__slider .ph-range__fill {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--ph-primary);
  border-radius: 4px;
  left: 0; right: 0;
}
.ph-range__input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: 0; right: 0;
  top: 0;
  width: 100%;
  height: 28px;
  background: transparent;
  pointer-events: none;   /* track is visual; only thumbs interact */
  margin: 0;
}
.ph-range__input:focus { outline: none; }
.ph-range__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ph-primary);
  box-shadow: var(--ph-shadow-sm);
  cursor: grab;
  pointer-events: auto;
  margin-top: 0;
}
.ph-range__input:active::-webkit-slider-thumb { cursor: grabbing; }
.ph-range__input::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ph-primary);
  box-shadow: var(--ph-shadow-sm);
  cursor: grab;
  pointer-events: auto;
}
.ph-range__input::-webkit-slider-runnable-track { background: transparent; border: 0; }
.ph-range__input::-moz-range-track { background: transparent; border: 0; }

/* =========================================================
   MODAL (All Journals / All Authors)
   ========================================================= */
.ph-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ph-modal.is-open { display: flex; }
.ph-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 30, 60, 0.55);
  backdrop-filter: blur(2px);
}
.ph-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: var(--ph-surface);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(18, 30, 60, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ph-modal-in .18s ease-out both;
}
@keyframes ph-modal-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
.ph-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ph-border);
}
.ph-modal__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ph-modal__close {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--ph-text-muted);
  font-size: 20px;
  line-height: 1;
  transition: background .12s ease, color .12s ease;
}
.ph-modal__close:hover { background: var(--ph-border-soft); color: var(--ph-text); }

.ph-modal__body {
  padding: 14px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ph-modal__search { width: 100%; }
.ph-modal__search .ph-input { width: 100%; padding-left: 30px; }

.ph-modal__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
}
.ph-modal__item {
  padding: 7px 8px;
  border-radius: 6px;
  transition: background .12s ease;
}
.ph-modal__item:hover { background: var(--ph-primary-tint); }
.ph-modal__item .ph-check { width: 100%; }

.ph-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--ph-border);
  background: var(--ph-surface-alt);
}

/* Empty-state behavior when JS flips it */
.ph-search-empty-state.is-active .ph-search-empty-state__divider { display: none; }
.ph-search-empty-state:not(.is-active) .ph-search-empty-state__inner { opacity: 0.55; }

@media (max-width: 640px) {
  .ph-modal__list { grid-template-columns: 1fr; }
  .ph-modal { padding: 12px; }
  .ph-modal__dialog { max-height: 92vh; }
}

/* Brand */
.ph-search-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 6px;
}
.ph-search-brand__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ph-text);
  text-decoration: none;
}
.ph-search-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--ph-primary), var(--ph-primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow: var(--ph-shadow-sm);
}
.ph-search-brand__wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.ph-search-brand__name { font-weight: 700; font-size: 16px; }
.ph-search-brand__tagline { font-size: 11.5px; color: var(--ph-text-subtle); letter-spacing: 0.01em; }

.ph-search-brand__divider {
  width: 1px; height: 22px;
  background: var(--ph-border);
}
.ph-search-brand__section {
  font-size: 13px;
  font-weight: 600;
  color: var(--ph-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Toolbar */
.ph-search-toolbar { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Search form */
.ph-search-form {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  column-gap: 10px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border-strong);
  border-radius: var(--ph-radius-lg);
  min-height: 46px;
  padding: 3px 7px 3px 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ph-search-form:focus-within {
  border-color: var(--ph-primary);
  box-shadow: 0 0 0 4px rgba(31, 90, 214, 0.12);
}
.ph-search-form__icon {
  display: inline-flex;
  align-items: center;
  color: var(--ph-text-subtle);
}
.ph-search-form__input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13.5px;
  padding: 7px 2px;
  color: var(--ph-text);
}
.ph-search-form__input::placeholder { color: var(--ph-text-subtle); }
.ph-search-form__clear {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  color: var(--ph-text-subtle);
  background: var(--ph-border-soft);
  transition: background .15s ease, color .15s ease;
}
.ph-search-form__clear:hover { background: var(--ph-border); color: var(--ph-text); }
.ph-search-form__submit {
  flex: 0 0 auto;
  min-width: 68px;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
}
.ph-search-form__advanced {
  margin-left: 4px;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
}

/* Toolbar meta */
.ph-search-toolbar__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.ph-search-toolbar__count {
  color: var(--ph-text-muted);
  font-size: 14px;
  line-height: 1.5;
}
.ph-search-toolbar__count strong { color: var(--ph-text); font-weight: 700; }
.ph-search-toolbar__query {
  color: var(--ph-text);
  font-weight: 600;
  font-style: italic;
}
.ph-search-toolbar__scope {
  display: block;
  color: var(--ph-text-subtle);
  font-size: 12px;
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.ph-search-toolbar__sort {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
  padding-top: 2px;
}
.ph-search-toolbar__sort-label {
  font-size: 11px;
  line-height: 1;
  margin-top: 8px;
  color: var(--ph-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Select (custom chevron) */
.ph-select {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.ph-select::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ph-text-subtle);
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}
.ph-select__control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid var(--ph-border-strong);
  background: var(--ph-surface);
  border-radius: 10px;
  min-width: 142px;
  min-height: 40px;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 500;
  color: var(--ph-text);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ph-select__control:hover { border-color: var(--ph-border-strong); }
.ph-select__control:focus {
  outline: 0;
  border-color: var(--ph-primary);
  box-shadow: 0 0 0 3px rgba(31, 90, 214, 0.15);
}
.ph-select__chevron {
  display: none;
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
.ph-search-main { flex: 1 0 auto; }

.ph-search-main__container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 8px 32px 60px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: flex-start;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.ph-search-sidebar {
  position: sticky;
  top: var(--ph-sticky-offset);
  align-self: start;
  margin-top: 0;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius-lg);
  box-shadow: var(--ph-shadow-xs);
  overflow: hidden;
  max-height: calc(100vh - var(--ph-sticky-offset) - 24px);
  display: flex;
  flex-direction: column;
}
.ph-search-sidebar__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--ph-border-soft);
}
.ph-search-sidebar__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ph-search-sidebar__hint {
  font-size: 11.5px;
  color: var(--ph-text-subtle);
  font-weight: 500;
}

.ph-search-sidebar > .section-filter {
  border-bottom: 1px solid var(--ph-border-soft);
}
.ph-search-sidebar > .section-filter:last-of-type {
  border-bottom: 0;
}

/* Scrollable groups area */
.ph-search-sidebar {
  scrollbar-width: thin;
}
.ph-search-sidebar > .section-filter:first-of-type { padding-top: 4px; }

/* keep all filter content inside the card */
.ph-search-sidebar {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Footer actions */
.ph-search-sidebar__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--ph-border-soft);
  background: var(--ph-surface-alt);
}

/* Filter groups (section-filter) */
.section-filter {
  padding: 14px 16px 16px;
}
.section-filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-filter__title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ph-text);
}
.section-filter__toggle {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--ph-text-muted);
  font-size: 14px;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}
.section-filter__toggle:hover { background: var(--ph-border-soft); color: var(--ph-text); }

.section-filter__body { display: flex; flex-direction: column; gap: 10px; }

.ph-filter-group__list { display: flex; flex-direction: column; gap: 2px; }
.ph-filter-group__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 6px;
  transition: background .12s ease;
}
.ph-filter-group__item:hover { background: var(--ph-primary-tint); }
.ph-filter-group__count {
  font-size: 11.5px;
  color: var(--ph-text-subtle);
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ph-border-soft);
}
.ph-filter-group__more {
  align-self: flex-start;
  font-size: 12px;
  color: var(--ph-text-link);
  font-weight: 500;
  padding: 4px 0;
}
.ph-filter-group__more:hover { text-decoration: underline; }

/* inline search within a filter */
.ph-filter-group__search {
  position: relative;
  display: flex; align-items: center;
}
.ph-filter-group__search-icon {
  position: absolute;
  left: 10px;
  color: var(--ph-text-subtle);
  display: inline-flex;
}
.ph-filter-group__search .ph-input {
  width: 100%;
  padding-left: 30px;
}

/* Tags row inside filter */
.ph-filter-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ph-filter-group__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* ---------- Inputs ---------- */
.ph-input {
  width: 100%;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface);
  border-radius: var(--ph-radius);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ph-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ph-input::placeholder { color: var(--ph-text-subtle); }
.ph-input:focus {
  outline: 0;
  border-color: var(--ph-primary);
  box-shadow: 0 0 0 3px rgba(31, 90, 214, 0.15);
}
.ph-input--sm { padding: 7px 10px; font-size: 12.5px; }

/* ---------- Custom check / radio ---------- */
.ph-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--ph-text);
  line-height: 1.3;
  flex: 1 1 auto;
}
.ph-check input { position: absolute; opacity: 0; pointer-events: none; }
.ph-check__box {
  width: 15px; height: 15px;
  border-radius: 3px;
  border: 1.5px solid var(--ph-border-strong);
  background: var(--ph-surface);
  display: inline-flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color .12s ease, background .12s ease;
}
.ph-check__label { flex: 1 1 auto; }
.ph-check:hover .ph-check__box { border-color: var(--ph-primary); }
.ph-check input:checked + .ph-check__box {
  background: var(--ph-primary);
  border-color: var(--ph-primary);
}
.ph-check input:checked + .ph-check__box::after {
  content: "";
  width: 8px; height: 4px;
  border-left: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.ph-check input:focus-visible + .ph-check__box {
  box-shadow: 0 0 0 3px rgba(31, 90, 214, 0.2);
}

/* Radio variant */
.ph-check--radio .ph-check__box { border-radius: 50%; }
.ph-check--radio input:checked + .ph-check__box { background: #fff; border-color: var(--ph-primary); border-width: 5px; }
.ph-check--radio input:checked + .ph-check__box::after { content: none; }

/* ---------- Range (visual only) ---------- */
.ph-range { display: flex; flex-direction: column; gap: 12px; }
.ph-range__track {
  position: relative;
  height: 4px;
  background: var(--ph-border-soft);
  border-radius: 4px;
  margin: 12px 10px 4px;
}
.ph-range__fill {
  position: absolute;
  left: 15%;
  right: 10%;
  top: 0; bottom: 0;
  background: var(--ph-primary);
  border-radius: 4px;
}
.ph-range__handle {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ph-primary);
  transform: translate(-50%, -50%);
  box-shadow: var(--ph-shadow-xs);
}
.ph-range__handle--start { left: 15%; }
.ph-range__handle--end   { left: 90%; }
.ph-range__inputs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.ph-range__field { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ph-range__label { font-size: 10.5px; color: var(--ph-text-subtle); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.ph-range__dash { color: var(--ph-text-subtle); padding-bottom: 7px; }

/* =========================================================
   CONTENT — Right side
   ========================================================= */
.ph-search-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Summary */
.ph-search-summary {
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius-lg);
  padding: 20px 24px;
  box-shadow: var(--ph-shadow-xs);
}
.ph-search-summary__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.ph-search-summary__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ph-search-summary__lead {
  color: var(--ph-text-muted);
  font-size: 13.5px;
}
.ph-search-summary__lead strong { color: var(--ph-text); }
.ph-search-summary__query {
  color: var(--ph-text);
  font-weight: 600;
  font-style: italic;
}
.ph-search-summary__hint {
  color: var(--ph-text-subtle);
  font-size: 12.5px;
  margin-top: 4px;
}

/* Active filter chips */
.ph-search-active-filters {
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ph-search-active-filters__label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ph-text-subtle);
}
.ph-search-active-filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}
.ph-search-active-filters__clear {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ph-text-link);
  padding: 4px 6px;
}
.ph-search-active-filters__clear:hover { text-decoration: underline; }

/* Chip */
.ph-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: var(--ph-radius-pill);
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  color: var(--ph-text);
  line-height: 1.2;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.ph-chip:hover { border-color: var(--ph-border-strong); }

.ph-chip--filter {
  background: var(--ph-primary-soft);
  border-color: transparent;
  color: var(--ph-primary-dark);
  font-weight: 500;
}
.ph-chip--filter:hover { background: #dde7ff; }
.ph-chip__key {
  color: var(--ph-text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ph-chip__value { font-weight: 600; }
.ph-chip__x {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: var(--ph-primary-dark);
  margin-left: 2px;
  transition: background .12s ease;
}
.ph-chip--filter:hover .ph-chip__x {
  background: rgba(25, 68, 168, 0.14);
}

/* Chip toggle (year quick links etc.) */
.ph-chip--toggle {
  padding: 4px 10px;
  background: var(--ph-surface);
  color: var(--ph-text-muted);
  font-weight: 500;
  border-color: var(--ph-border);
}
.ph-chip--toggle:hover {
  background: var(--ph-primary-tint);
  color: var(--ph-primary-dark);
  border-color: var(--ph-primary-soft);
}
.ph-chip--toggle.is-active {
  background: var(--ph-primary);
  color: #fff;
  border-color: var(--ph-primary);
}

/* Tag (subject-area / keyword) */
.ph-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--ph-radius-pill);
  background: var(--ph-slate-soft);
  color: var(--ph-text-muted);
  border: 1px solid transparent;
  line-height: 1.3;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.ph-tag:hover {
  background: var(--ph-primary-tint);
  color: var(--ph-primary-dark);
}
.ph-tag.is-active {
  background: var(--ph-primary-soft);
  color: var(--ph-primary-dark);
  border-color: #d6e1ff;
  font-weight: 600;
}
.ph-tag--keyword {
  background: var(--ph-surface);
  border-color: var(--ph-border);
  color: var(--ph-text-muted);
  font-size: 11.5px;
  padding: 3px 9px;
}
.ph-tag--keyword:hover {
  background: var(--ph-primary-tint);
  color: var(--ph-primary-dark);
  border-color: #d6e1ff;
}

/* Hint panel */
.ph-search-hint {
  display: flex;
  gap: 12px;
  background: var(--ph-primary-tint);
  border: 1px solid #dbe5ff;
  color: var(--ph-text-muted);
  border-radius: var(--ph-radius);
  padding: 12px 16px;
}
.ph-search-hint__icon {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--ph-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}
.ph-search-hint__body { font-size: 12.5px; line-height: 1.55; }
.ph-search-hint__body strong { color: var(--ph-text); }
.ph-search-hint__body code {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 11.5px;
  background: #fff;
  border: 1px solid #dbe5ff;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ph-primary-dark);
}

/* =========================================================
   ARTICLE RESULT LIST
   ========================================================= */
.ph-search-result-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: ph-result;
}
.ph-search-result-list__item { counter-increment: ph-result; }

.ph-article-card {
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--ph-shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ph-article-card:hover {
  border-color: var(--ph-border-strong);
  box-shadow: var(--ph-shadow-md);
  transform: translateY(-1px);
}

/* Topbar */
.ph-article-card__topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.ph-article-card__doi-pill {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ph-primary-dark);
  background: var(--ph-primary-soft);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.06em;
}

/* Badges */
.ph-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.01em;
  background: var(--ph-slate-soft);
  color: var(--ph-slate);
  border: 1px solid transparent;
}
.ph-badge--journal {
  background: #1c2330;
  color: #fff;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.ph-badge--year {
  background: var(--ph-primary-soft);
  color: var(--ph-primary-dark);
  font-variant-numeric: tabular-nums;
}
.ph-badge--type {
  background: var(--ph-surface);
  color: var(--ph-text-muted);
  border-color: var(--ph-border);
}
.ph-badge--access {
  background: var(--ph-success-soft);
  color: var(--ph-success);
}
.ph-badge--access-sub {
  background: var(--ph-amber-soft);
  color: var(--ph-amber);
}
.ph-badge--soft {
  background: var(--ph-primary-soft);
  color: var(--ph-primary-dark);
}

/* Body */
.ph-article-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ph-article-card__title {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 650;
  color: var(--ph-text);
}
.ph-article-card__title a {
  color: inherit;
  text-decoration: none;
}
.ph-article-card__title a:hover {
  color: var(--ph-primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.ph-article-card__authors {
  font-size: 13px;
  color: var(--ph-text-muted);
  line-height: 1.45;
}
.ph-article-card__authors em {
  font-style: italic;
  color: var(--ph-text-subtle);
}
.ph-article-card__meta {
  font-size: 12.5px;
  color: var(--ph-text-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.ph-article-card__sep { color: var(--ph-border-strong); }
.ph-article-card__doi {
  font-size: 12.5px;
  color: var(--ph-text-muted);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
}
.ph-article-card__doi-label {
  font-family: var(--ph-font);
  color: var(--ph-text-subtle);
  font-weight: 600;
  margin-right: 4px;
}
.ph-article-card__doi a { color: var(--ph-primary-dark); }

.ph-article-card__abstract {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ph-text);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.ph-article-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

/* Footer */
.ph-article-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ph-border-soft);
  flex-wrap: wrap;
}

.ph-article-card__stats {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.ph-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ph-text-muted);
}
.ph-stat__icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ph-primary-tint);
  color: var(--ph-primary-dark);
}
.ph-stat__num {
  font-weight: 700;
  color: var(--ph-text);
  font-variant-numeric: tabular-nums;
}
.ph-stat__label { color: var(--ph-text-subtle); }

.ph-article-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.ph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--ph-radius);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.ph-btn:hover { text-decoration: none; }
.ph-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(31, 90, 214, 0.22);
}

.ph-btn--primary {
  background: var(--ph-primary);
  color: #fff;
  border-color: var(--ph-primary);
}
.ph-btn--primary:hover {
  background: var(--ph-primary-dark);
  border-color: var(--ph-primary-dark);
}

.ph-btn--secondary {
  background: var(--ph-surface);
  color: var(--ph-text);
  border-color: var(--ph-border-strong);
}
.ph-btn--secondary:hover {
  background: var(--ph-primary-tint);
  color: var(--ph-primary-dark);
  border-color: #d6e1ff;
}

.ph-btn--ghost {
  background: transparent;
  color: var(--ph-text-muted);
  border-color: transparent;
}
.ph-btn--ghost:hover {
  background: var(--ph-border-soft);
  color: var(--ph-text);
}

.ph-btn--sm { padding: 7px 12px; font-size: 12.5px; }
.ph-btn--block { width: 100%; }

/* =========================================================
   PAGINATION
   ========================================================= */
.ph-search-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
  padding: 10px;
}
.ph-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--ph-text-muted);
  font-weight: 500;
  border-radius: var(--ph-radius);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.ph-page:hover {
  background: var(--ph-primary-tint);
  color: var(--ph-primary-dark);
  text-decoration: none;
}
.ph-page.is-current {
  background: var(--ph-primary);
  color: #fff;
  border-color: var(--ph-primary);
  font-weight: 700;
}
.ph-page.is-current:hover { background: var(--ph-primary-dark); color: #fff; }
.ph-page--nav { padding: 0 14px; font-weight: 600; color: var(--ph-text); }
.ph-page--nav.is-disabled {
  color: var(--ph-text-subtle);
  pointer-events: none;
  opacity: 0.6;
}
.ph-page--ellipsis {
  color: var(--ph-text-subtle);
  cursor: default;
  background: transparent;
}
.ph-page--ellipsis:hover { background: transparent; color: var(--ph-text-subtle); }

/* =========================================================
   EMPTY STATE
   ========================================================= */
.ph-search-empty-state {
  margin-top: 16px;
  background: var(--ph-surface);
  border: 1px dashed var(--ph-border-strong);
  border-radius: var(--ph-radius-lg);
  padding: 0;
  overflow: hidden;
}
.ph-search-empty-state__divider {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--ph-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  background: var(--ph-surface-alt);
  border-bottom: 1px dashed var(--ph-border);
}
.ph-search-empty-state__inner {
  padding: 40px 32px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
}
.ph-search-empty-state__illustration {
  color: var(--ph-primary);
  margin-bottom: 4px;
}
.ph-search-empty-state__title {
  font-size: 20px;
  font-weight: 700;
}
.ph-search-empty-state__lead {
  color: var(--ph-text-muted);
  font-size: 13.5px;
  max-width: 480px;
}
.ph-search-empty-state__tips {
  text-align: left;
  font-size: 13px;
  color: var(--ph-text-muted);
  background: var(--ph-surface-alt);
  border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 480px;
  margin-top: 6px;
}
.ph-search-empty-state__tips li {
  position: relative;
  padding-left: 18px;
}
.ph-search-empty-state__tips li::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ph-primary);
  opacity: 0.5;
}
.ph-search-empty-state__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1160px) {
  .ph-search-header__inner {
    padding: 14px 24px;
  }
  .ph-search-main__container {
    grid-template-columns: 240px 1fr;
    padding: 24px 24px 48px;
    gap: 20px;
  }
  .ph-search-sidebar { top: 12px; max-height: none; position: static; }
}

@media (max-width: 900px) {
  .ph-search-main__container {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .ph-search-sidebar {
    position: static;
    max-height: none;
  }
  .ph-search-form__advanced { display: none; }
}

@media (max-width: 991px) {
  .ph-search-page { padding-top: 110px; }
}

@media (max-width: 680px) {
  .ph-search-page { padding-top: 96px; }
  .ph-search-header__inner {
    padding: 12px 16px;
  }
  .ph-search-main__container {
    padding: 18px 16px 36px;
  }
  .ph-search-form {
    padding: 4px 4px 4px 10px;
    border-radius: var(--ph-radius);
  }
  .ph-search-form__input { font-size: 14px; padding: 9px 4px; }
  .ph-search-form__clear { display: none; }

  .ph-search-toolbar__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .ph-search-summary { padding: 16px 18px; }
  .ph-search-summary__title { font-size: 18px; }

  .ph-search-active-filters {
    padding: 10px 12px;
  }

  .ph-article-card { padding: 16px 18px; }
  .ph-article-card__title { font-size: 15.5px; }

  .ph-article-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .ph-article-card__stats { gap: 14px; }
  .ph-article-card__actions { width: 100%; }
  .ph-article-card__actions .ph-btn { flex: 1 1 0; }

  .ph-search-pagination { flex-wrap: wrap; gap: 2px; }
  .ph-page { min-width: 32px; height: 32px; padding: 0 8px; font-size: 12.5px; }

  .ph-search-empty-state__inner { padding: 28px 20px 32px; }
}

@media (max-width: 420px) {
  .ph-search-brand__tagline { display: none; }
  .ph-search-brand__divider { display: none; }
  .ph-article-card__meta { font-size: 12px; }
  .ph-search-toolbar__sort-label { display: none; }
}
