/* Open Library Publications — Clean Red UI — 2026-08-28 v7
 * Final cleanup layer: removes technical/diagonal line motifs from all major
 * red surfaces and rebuilds Advanced Filters as a clean, consistent panel.
 */
:root{
  --olv7-red-950:#851019;
  --olv7-red-900:#98151f;
  --olv7-red-800:#ad1924;
  --olv7-red-700:#c51f2a;
  --olv7-red-600:#dc2c36;
  --olv7-red-500:#e83c46;
  --olv7-red-soft:#fff5f6;
  --olv7-line:#ead8db;
  --olv7-line-strong:#dfa8ae;
  --olv7-ink:#1b2432;
  --olv7-muted:#667085;
  --olv7-surface:#fff;
  --olv7-red-gradient:linear-gradient(105deg,#8c111a 0%,#bc1d28 52%,#df3742 100%);
}

/* --------------------------------------------------------------------------
   1. REMOVE DIAGONAL / TECHNICAL MOTIFS ACROSS THE FRONTEND
   -------------------------------------------------------------------------- */
html body .openlib_site_header__utility,
html body .openlib_journal_header__utility,
html[data-openlib-color-mode="dark"] body .openlib_site_header__utility,
html[data-openlib-color-mode="dark"] body .openlib_journal_header__utility,
html body .pkp_structure_footer_wrapper.openlib_site_footer,
html body .pkp_structure_footer_wrapper.openlib_journal_footer_global,
html[data-openlib-color-mode="dark"] body .pkp_structure_footer_wrapper.openlib_site_footer,
html[data-openlib-color-mode="dark"] body .pkp_structure_footer_wrapper.openlib_journal_footer_global{
  background-image:none!important;
  background:var(--olv7-red-gradient)!important;
}

html body.openlib-site-index .openlib_search_panel--primary,
html body.openlib-site-index.openlib-search-is-fixed .openlib_search_panel--primary,
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_search_panel--primary,
html[data-openlib-color-mode="dark"] body.openlib-site-index.openlib-search-is-fixed .openlib_search_panel--primary,
html body .openlib_search_form,
html[data-openlib-color-mode="dark"] body .openlib_search_form{
  background-image:none!important;
  background:var(--olv7-red-gradient)!important;
}

/* Old futuristic overlays/corner rails must never show. */
html body.openlib-site-index .openlib_search_panel--primary:before,
html body.openlib-site-index .openlib_search_panel--primary:after,
html body.openlib-site-index.openlib-search-is-fixed .openlib_search_panel--primary:before,
html body.openlib-site-index.openlib-search-is-fixed .openlib_search_panel--primary:after,
html body .openlib_search_form:before,
html body .openlib_search_form:after{
  display:none!important;
  content:none!important;
  background:none!important;
  border:0!important;
  box-shadow:none!important;
}

/* Remove segmented/repeating card rail; keep one calm accent. */
html body.openlib-site-index .openlib_journal_card:before{
  height:3px!important;
  background-image:none!important;
  background:linear-gradient(90deg,#9a151f 0%,#d52a35 72%,#ef6d75 100%)!important;
}

/* Dashed is reserved only for the journal content/action separator. */
html body.openlib-site-index .openlib_journal_tools,
html body.openlib-journal-page .openlib_journal_header__navrow,
html body .pkp_structure_footer_wrapper.openlib_site_footer,
html body .pkp_structure_footer_wrapper.openlib_journal_footer_global{
  border-style:solid!important;
}
html body.openlib-site-index .openlib_journal_tools{border-bottom:1px solid var(--olv7-line)!important;}
html body.openlib-journal-page .openlib_journal_header__navrow{border-bottom:1px solid var(--olv7-line)!important;}
html body.openlib-site-index .openlib_journal_footer{border-top:1px dashed #ddaeb3!important;}

/* --------------------------------------------------------------------------
   2. SEARCH PAGE — CLEAN PRIMARY PANEL
   -------------------------------------------------------------------------- */
html body .openlib_search_form{
  padding:13px!important;
  border:1px solid #b9212c!important;
  border-radius:18px!important;
  box-shadow:0 16px 36px rgba(104,14,21,.16)!important;
  overflow:hidden!important;
}
html body .openlib_search_form__primary,
html body .openlib_search_form__primary.has_journal_filter{
  position:relative!important;
  z-index:2!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 220px 150px!important;
  gap:10px!important;
  align-items:center!important;
}
html body .openlib_search_form__query,
html body .openlib_search_form__journal,
html body .openlib_search_form__submit{
  min-height:50px!important;
  border-radius:13px!important;
}
html body .openlib_search_form__query,
html body .openlib_search_form__journal{
  border:1px solid rgba(255,255,255,.74)!important;
  background:#fff!important;
  box-shadow:none!important;
}
html body .openlib_search_form__submit{
  border:1px solid rgba(255,255,255,.74)!important;
  background:#fff!important;
  color:#a81924!important;
  box-shadow:none!important;
}
html body .openlib_search_form__submit:hover,
html body .openlib_search_form__submit:focus{
  background:#fff6f7!important;
  color:#82121a!important;
}

/* --------------------------------------------------------------------------
   3. ADVANCED FILTERS — REBUILT, NOT A RED BOX INSIDE A RED BOX
   -------------------------------------------------------------------------- */
html body .openlib_search_advanced{
  position:relative!important;
  z-index:2!important;
  margin:10px 0 0!important;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid rgba(255,255,255,.34)!important;
  border-radius:13px!important;
  background:rgba(255,255,255,.10)!important;
  color:#fff!important;
  box-shadow:none!important;
}
html body .openlib_search_advanced summary{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-height:48px!important;
  box-sizing:border-box!important;
  padding:0 15px!important;
  cursor:pointer!important;
  list-style:none!important;
  border:0!important;
  border-radius:12px!important;
  background:transparent!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:850!important;
  line-height:1.2!important;
  outline:0!important;
}
html body .openlib_search_advanced summary::-webkit-details-marker{display:none!important;}
html body .openlib_search_advanced summary::marker{display:none!important;content:""!important;}
html body .openlib_search_advanced summary:after{
  position:absolute!important;
  right:15px!important;
  top:50%!important;
  width:8px!important;
  height:8px!important;
  content:""!important;
  border-right:2px solid currentColor!important;
  border-bottom:2px solid currentColor!important;
  transform:translateY(-65%) rotate(45deg)!important;
  transition:transform .18s ease!important;
  opacity:.85!important;
}
html body .openlib_search_advanced[open] summary:after{
  transform:translateY(-35%) rotate(225deg)!important;
}
html body .openlib_search_advanced summary .fa,
html body .openlib_search_advanced summary .openlib_advanced_icon{
  position:static!important;
  flex:0 0 16px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:16px!important;
  height:16px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  color:inherit!important;
  line-height:1!important;
}
html body .openlib_search_advanced summary .openlib_advanced_icon svg{
  display:block!important;
  width:16px!important;
  height:16px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

/* Expanded state becomes one clean white content panel. */
html body .openlib_search_advanced[open]{
  border-color:#f3d8db!important;
  background:#fff!important;
  color:var(--olv7-ink)!important;
}
html body .openlib_search_advanced[open] summary{
  min-height:48px!important;
  border-radius:12px 12px 0 0!important;
  border-bottom:1px solid #efdcdf!important;
  background:#fff8f9!important;
  color:#a71823!important;
}
html body .openlib_search_advanced__grid{
  display:grid!important;
  grid-template-columns:minmax(250px,.8fr) minmax(0,1.6fr)!important;
  gap:18px!important;
  align-items:start!important;
  margin:0!important;
  padding:18px!important;
  background:#fff!important;
}
html body .openlib_search_advanced__field,
html body .openlib_search_advanced__dates{
  min-width:0!important;
}
html body .openlib_search_advanced__field label,
html body .openlib_search_advanced__dates legend{
  display:block!important;
  margin:0 0 7px!important;
  padding:0!important;
  color:#4b5565!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.3!important;
}
html body .openlib_search_advanced__field input{
  box-sizing:border-box!important;
  width:100%!important;
  height:44px!important;
  margin:0!important;
  padding:0 13px!important;
  border:1px solid #d9dfe7!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#273244!important;
  box-shadow:none!important;
  outline:0!important;
}
html body .openlib_search_advanced__field input:focus,
html body .openlib_search_advanced__dates select:focus{
  border-color:#dc4a54!important;
  box-shadow:0 0 0 3px rgba(220,40,51,.08)!important;
}

html body .openlib_search_advanced__dates{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:12px!important;
}
html body .openlib_search_advanced__dates .from,
html body .openlib_search_advanced__dates .to{
  min-width:0!important;
  box-sizing:border-box!important;
  padding:12px!important;
  border:1px solid #e8e1e3!important;
  border-radius:11px!important;
  background:#fcfbfc!important;
}
html body .openlib_search_advanced__dates fieldset{
  display:grid!important;
  grid-template-columns:auto minmax(70px,1fr) auto minmax(62px,.8fr) auto minmax(62px,.8fr)!important;
  gap:6px!important;
  align-items:center!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}
html body .openlib_search_advanced__dates fieldset legend{
  grid-column:1 / -1!important;
  width:100%!important;
}
html body .openlib_search_advanced__dates fieldset label{
  margin:0!important;
  color:#697386!important;
  font-size:11px!important;
  font-weight:700!important;
  white-space:nowrap!important;
}
html body .openlib_search_advanced__dates select{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  height:38px!important;
  margin:0!important;
  padding:0 28px 0 8px!important;
  border:1px solid #d9dfe7!important;
  border-radius:9px!important;
  background-color:#fff!important;
  color:#344054!important;
  font-size:12px!important;
  box-shadow:none!important;
  outline:0!important;
}

/* Additional hook filters, when present, should match the clean panel. */
html body .openlib_search_advanced__grid > :not(.openlib_search_advanced__field):not(.openlib_search_advanced__dates){
  min-width:0!important;
}

/* --------------------------------------------------------------------------
   4. GLOBAL CLEANUP FOR HEADER/NAV/FOOTER RED AREAS
   -------------------------------------------------------------------------- */
html body .openlib_site_header__utility,
html body .openlib_journal_header__utility{
  border-bottom:0!important;
}
html body .openlib_journal_header__navrow,
html body .openlib_site_header__main{
  box-shadow:0 5px 18px rgba(55,21,24,.045)!important;
}
html body .openlib_site_footer__bottom{
  border-top:1px solid rgba(255,255,255,.18)!important;
}

/* --------------------------------------------------------------------------
   5. DARK MODE
   -------------------------------------------------------------------------- */
html[data-openlib-color-mode="dark"] body .openlib_search_advanced[open]{
  border-color:#5f3a40!important;
  background:#1b2029!important;
  color:#e8ebf1!important;
}
html[data-openlib-color-mode="dark"] body .openlib_search_advanced[open] summary{
  border-bottom-color:#50353a!important;
  background:#261c21!important;
  color:#ffb2b9!important;
}
html[data-openlib-color-mode="dark"] body .openlib_search_advanced__grid{
  background:#1b2029!important;
}
html[data-openlib-color-mode="dark"] body .openlib_search_advanced__field label,
html[data-openlib-color-mode="dark"] body .openlib_search_advanced__dates legend{
  color:#d8dde6!important;
}
html[data-openlib-color-mode="dark"] body .openlib_search_advanced__dates .from,
html[data-openlib-color-mode="dark"] body .openlib_search_advanced__dates .to{
  border-color:#3d424d!important;
  background:#171b22!important;
}
html[data-openlib-color-mode="dark"] body .openlib_search_advanced__field input,
html[data-openlib-color-mode="dark"] body .openlib_search_advanced__dates select{
  border-color:#454b57!important;
  background:#20252e!important;
  color:#f4f6fa!important;
}
html[data-openlib-color-mode="dark"] body .openlib_search_advanced__dates fieldset label{color:#b9c1ce!important;}

/* --------------------------------------------------------------------------
   6. RESPONSIVE
   -------------------------------------------------------------------------- */
@media(max-width:980px){
  html body .openlib_search_advanced__grid{grid-template-columns:1fr!important;}
  html body .openlib_search_advanced__dates{grid-template-columns:1fr 1fr!important;}
}
@media(max-width:767px){
  html body .openlib_search_form__primary,
  html body .openlib_search_form__primary.has_journal_filter{grid-template-columns:1fr!important;}
  html body .openlib_search_advanced__grid{padding:14px!important;}
  html body .openlib_search_advanced__dates{grid-template-columns:1fr!important;}
  html body .openlib_search_advanced__dates fieldset{
    grid-template-columns:auto minmax(70px,1fr)!important;
  }
  html body .openlib_search_advanced__dates fieldset legend{grid-column:1 / -1!important;}
}
