/* ===== ARQ+ prototype — shared styles ===== */

/* Variable font, fixed to its narrow width axis (wdth 80) -- wght varies 400-700
   via font-weight, so the 700 cut is a true variable-axis instance, not browser
   synthesis (see `font-synthesis: none` below). */
@font-face {
  font-family: "UnicaVarNarrow";
  src: url("fonts/Unica77VarBeta-[wdth80,wght400-700,ital0-1].ttf") format("truetype-variations"),
       url("fonts/Unica77VarBeta-[wdth80,wght400-700,ital0-1].ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 80%;
  font-style: normal;
  font-display: swap;
}

/* No variable "UnicaVarMono" file was provided (only static Regular/Italic OTFs) --
   declared as two static weights under one family name; flag if a variable mono
   file shows up later. */
@font-face {
  font-family: "UnicaVarMono";
  src: url("fonts/Unica77MonoLLEdu-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "UnicaVarMono";
  src: url("fonts/Unica77MonoLLEdu-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --font-sans: "UnicaVarNarrow", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "UnicaVarNarrow", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  /* "mono" role: labels/links/tags/secondary info */
  --font-mono: "UnicaVarMono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* general text, buttons, fichas */
  --text-size: 1.3rem;
  --text-line: 1.5;
  --text-weight: 400;

  /* book / page titles */
  --title-size: 2.2rem;
  --title-line: 1.2;
  --title-weight: 700;

  /* links, tags, secondary info */
  --mono-size: 1rem;
  --mono-line: 1.3;
  --mono-tracking: .01em;

  --black: #0a0a0a;
  --white: #ffffff;
  --gray-card: #e1e1e1;
  --gray-card-line: #d1d1d1;
  --gray-text: #939393;
  --gray-hover: #d1d1d1;
  --gray-border: #cccccc;
  --margin: 36px;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* opt this document into the browser's native cross-document view transition,
   giving a soft cross-fade when navigating between prototype pages (Chromium) */
@view-transition {
  navigation: auto;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  /* CAT-11: reserve the scrollbar's width permanently, so a filter that
     changes the result count (and thus whether a scrollbar is needed)
     doesn't shift the header/search/filters row horizontally */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-size);
  line-height: var(--text-line);
  font-weight: var(--text-weight);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  animation: fade-in .35s var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

a { color: inherit; transition: color .15s var(--ease); }
a:hover { color: var(--gray-hover); }

button { font-family: inherit; cursor: pointer; }

svg.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  line-height: var(--mono-line);
  letter-spacing: var(--mono-tracking);
}

.title-type {
  font-family: var(--font-sans);
  font-size: var(--title-size);
  line-height: var(--title-line);
  font-weight: var(--title-weight);
}

p, .prose {
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 400;
}

/* ---------- shared transitions ---------- */

.fade-enter-active, .fade-leave-active {
  transition: opacity .2s var(--ease);
}
.fade-enter-from, .fade-leave-to { opacity: 0; }

.nav-overlay-enter-active, .nav-overlay-leave-active {
  transition: opacity .25s var(--ease);
}
.nav-overlay-enter-from, .nav-overlay-leave-to { opacity: 0; }

.nav-slide-enter-active, .nav-slide-leave-active {
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-slide-enter-from, .nav-slide-leave-to {
  transform: translateX(-16px);
  opacity: 0;
}

.expand-enter-active, .expand-leave-active {
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.expand-enter-from, .expand-leave-to {
  opacity: 0;
  transform: translateY(-6px);
}

.list-enter-active, .list-leave-active {
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.list-move {
  transition: transform .3s var(--ease);
}
.list-enter-from {
  opacity: 0;
  transform: translateY(8px);
}
.list-leave-to {
  opacity: 0;
  transform: translateY(-8px);
}
.list-leave-active {
  position: absolute;
}

/* ---------- header ---------- */

.site-header {
  padding: 16px var(--margin) 0;
  position: relative;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hamburger-btn {
  background: none;
  border: none;
  padding: 6px;
  display: flex;
  color: var(--black);
}
.hamburger-btn svg.icon {
  width: 26px;
  height: 26px;
  stroke-width: 1.6;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  height: 32px;
  line-height: 31px;
  padding: 0 20px;
  border-radius: 20px;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: var(--gray-card); }
.btn:active { transform: scale(.97); }

.btn-dark {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.btn-dark:hover { background: #2b2b2b; }

.lang-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--black);
  border-radius: 20px;
  overflow: hidden;
}
.lang-toggle button {
  font-family: var(--font-sans);
  font-size: 13px;
  border: none;
  background: var(--white);
  color: var(--black);
  padding: 0 12px;
  height: 30px;
}
.lang-toggle button.active {
  background: var(--black);
  color: var(--white);
}

.user-greeting {
  font-size: 15px;
}

.fav-btn {
  background: none;
  border: none;
  font-size: 20px;
  padding: 4px 6px;
}

.logo-wrap {
  text-align: center;
  margin: 14px 0 10px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 80px;
  letter-spacing: -3px;
  line-height: 1;
  margin: 0;
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.search-wrap {
  max-width: 870px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--black);
  border-radius: 30px;
  padding: 11px 22px;
}

.search-bar input {
  border: none;
  outline: none;
  font-size: 16px;
  font-family: var(--font-sans);
  flex: 1;
  background: transparent;
}

.search-icon { font-size: 18px; opacity: .8; }

.search-links {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  line-height: var(--mono-line);
}

.search-links a, .search-links button.link-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  text-decoration: none;
  padding: 0;
}

.search-links a:hover, .search-links button.link-btn:hover,
.search-links .active { text-decoration: underline; }

/* ---------- inline advanced search panel ---------- */

.advanced-panel {
  max-width: 700px;
  margin: 20px auto 0;
  padding: 26px 32px 30px;
  border: 1px solid var(--black);
  border-radius: 20px;
  background: var(--white);
  text-align: left;
}

/* BUSQ-04: maqueta's literal sizes (58px title / 30px labels) -- see
   LIBRO-02's comment above on why this waited for TOKEN-01. */
.advanced-panel-title {
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1.2;
  font-weight: var(--title-weight);
  margin: 0 0 20px;
}

.advanced-panel h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 22px 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-card-line);
}

.advanced-panel .field-row:first-child { margin-top: 2px; }
.advanced-panel .checkbox-columns { max-width: none; margin-bottom: 20px; }
.advanced-panel .date-range { margin-bottom: 0; }
.advanced-panel .buscar-btn { margin-bottom: 0; margin-top: 6px; }

/* compact header state (catalog page) */
.site-header.compact { padding-top: 16px; }
.site-header.compact .logo { font-size: 44px; }
.site-header.compact .logo-wrap { margin: 0 0 12px; }
.site-header.compact .search-bar { padding: 8px 18px; }
.site-header.compact .search-bar input { font-size: 15px; }
.site-header.compact .search-links { font-size: 13px; }
.site-header.compact .search-wrap { max-width: 700px; }

/* ---------- side nav ---------- */

.side-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.15);
  z-index: 40;
}

.side-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 320px;
  background: var(--black);
  color: var(--white);
  z-index: 50;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  overflow-y: auto;
}

.side-nav-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 22px;
  padding: 0 0 20px;
  align-self: flex-start;
  transition: transform .15s var(--ease), color .15s var(--ease);
}
.side-nav-close:hover { transform: rotate(90deg); color: var(--gray-hover); }

.side-nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}

.side-nav-links a {
  text-decoration: none;
  color: var(--white);
}
.side-nav-links a:hover { text-decoration: underline; }

.side-nav-footer {
  font-size: 12px;
  line-height: 1.5;
  opacity: .95;
}
.side-nav-footer .brand-logo {
  display: block;
  height: 28px;
  width: auto;
  margin-bottom: 12px;
  /* the source PNG is a dark mark on transparent -- invert to read on the dark panel */
  filter: invert(1) brightness(2);
}
.side-nav-footer h4 { margin: 10px 0 4px; font-size: 12px; }
.side-nav-footer p { margin: 0 0 8px; }
.side-nav-footer .links { margin-top: 8px; }
.side-nav-footer .links a { display: block; text-decoration: underline; margin-bottom: 4px; }

/* ---------- carousel ---------- */

.section-title {
  font-weight: 500;
  font-size: 17px;
  margin: 0 0 10px;
}

.carousel-section { padding: 16px var(--margin) 0; }

/* HOME-05: bounded to the search bar's own width (see .search-wrap) and
   centered with it, instead of spanning margin-to-margin */
.carousel-inner {
  max-width: 870px;
  margin: 0 auto;
}

.carousel {
  display: flex;
  align-items: center;
  gap: 14px;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow: hidden;
  flex: 1;
}

.carousel-arrow {
  background: none;
  border: none;
  font-size: 22px;
  padding: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  transition: background .15s var(--ease);
}
.carousel-arrow:hover { background: var(--gray-card); }

.placeholder-cover {
  background: var(--black);
  flex-shrink: 0;
  width: 120px;
  height: 165px;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.placeholder-cover:hover { transform: translateY(-4px); opacity: .85; }

/* ---------- catalog toggle ---------- */

.catalog-toggle {
  text-align: center;
  padding: 22px var(--margin) 12px;
  border-bottom: 1px solid var(--black);
}
.catalog-toggle a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  transition: transform .2s var(--ease);
}
.catalog-toggle a:hover { transform: translateY(-3px); }
.catalog-toggle .chevrons {
  font-size: 20px;
  display: block;
  margin-bottom: 4px;
}
.catalog-toggle .label {
  font-weight: 700;
  font-size: 14px;
}

/* HOME-04: the footer is pinned to the bottom of the viewport and any
   leftover vertical space is distributed among the sections above it
   (space-between), instead of leaving a blank strip under the footer. */
.home-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
}

/* ---------- institutional footer ---------- */

.footer-institutional {
  background: var(--black);
  color: var(--white);
  margin-top: 16px;
  padding: 14px var(--margin) 12px;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.footer-logo-box {
  border: 1px solid var(--white);
  background: var(--black);
  height: 38px;
}
.footer-logo-box.wide { width: 150px; }
.footer-logo-box.narrow { width: 60px; }
.footer-logo-box.circle { width: 56px; border-radius: 50%; }

.footer-institutional .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.footer-institutional .row a { text-decoration: underline; }

/* ---------- catalog grid + filters ---------- */

.catalog-filters {
  padding: 12px var(--margin) 0;
}

.filter-dropdown-row {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 20px;
}

/* CAT-02: each dimension title is a real expand/collapse control -- the
   chevron rotates with the open state instead of swapping icons. */
.dim-toggle {
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: inherit;
  color: var(--black);
}
.dim-toggle:hover, .dim-toggle.open { text-decoration: underline; }
.dim-toggle .dim-chevron {
  display: inline-flex;
  transition: transform .2s var(--ease);
}
.dim-toggle .dim-chevron svg.icon { width: .8em; height: .8em; }
.dim-toggle.open .dim-chevron { transform: rotate(180deg); }

.clear-all {
  margin-left: auto;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--gray-text);
  text-decoration: underline;
  padding: 0;
}

.dim-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--black);
}
.dim-options .link-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  color: var(--gray-text);
  text-decoration: underline;
  padding: 0;
}

.pill {
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  border-radius: 3px;
  padding: 8px 14px;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.pill:hover { background: var(--gray-card); }
.pill.active {
  background: var(--black);
  color: var(--white);
}
.pill.active:hover { background: #2b2b2b; }
.pill:active { transform: scale(.96); }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 0 var(--margin);
}

/* CAT-01: maqueta reference is a 561x561 card, 524x524 interior with an
   18px inner margin and a 418x301 cover area -- kept as proportion (interior
   ~93% of card, cover ~80% width / ~57% height of interior), not literal px. */
.book-card {
  background: var(--gray-card);
  border: 1px solid var(--white);
  aspect-ratio: 1 / 1;
  position: relative;
  padding: 3.2%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  /* the subtitle/authors reveal on :hover adds height inside a fixed
     (aspect-ratio) box -- without clipping, that overflow bled into the
     grid row below and looked like duplicated/illegible text */
  overflow: hidden;
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.book-card:hover {
  background: var(--white);
  /* CAT-12: override the global `a:hover { color: var(--gray-hover) }` --
     without this, the title (which has no color of its own) inherited the
     link's hover gray and lost contrast on white */
  color: var(--black);
  box-shadow: 0 2px 14px rgba(0,0,0,.08);
  z-index: 1;
}
.book-card .cover-box { transition: transform .25s var(--ease); }
.book-card:hover .cover-box { transform: translateY(-2px); }

/* CAT-09: hover must not resize the (fixed, aspect-ratio) card -- long
   titles/subtitles are clamped to a fixed number of lines instead of
   growing the box or shifting the rest of the grid. */
.book-card .card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-card .card-subtitle {
  font-size: 12px;
  color: var(--gray-text);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  visibility: hidden;
}
.book-card:hover .card-subtitle { visibility: visible; }

.book-card .cover-box {
  flex: 1;
  /* flex items default to min-height: auto (their content's intrinsic
     size), which stopped this from shrinking when the hover-revealed
     subtitle/authors needed the space -- that's what overflowed. */
  min-height: 0;
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-card-line);
}
.book-card .cover-box .cover-img {
  background: var(--black);
  width: 80%;
  height: 100%;
  object-fit: cover;
}

.book-card .card-authors {
  font-family: var(--font-mono);
  font-size: 11px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  visibility: hidden;
}
.book-card:hover .card-authors { visibility: visible; }

.catalog-empty {
  padding: 60px var(--margin);
  color: var(--gray-text);
  text-align: center;
}
.catalog-empty p { margin: 0 0 10px; }
.catalog-empty .link-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  color: var(--black);
  text-decoration: underline;
}

/* ---------- detail overlay (LIBRO-01 opción A) ---------- */

/* Slides up from the bottom over the catalog grid, which stays mounted and
   scrolled where it was -- the real grid rows above the overlay's top edge
   are what read as "the leftover strip" from the maqueta, not a decorative
   graphic (that's what the old .detail-thumbs gray boxes faked). */
.detail-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 110px;
  background: var(--white);
  overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  z-index: 30;
}

.detail-overlay-enter-active, .detail-overlay-leave-active {
  transition: transform .35s var(--ease), opacity .2s var(--ease);
}
.detail-overlay-enter-from, .detail-overlay-leave-to {
  transform: translateY(100%);
  opacity: .6;
}

.detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: var(--margin) var(--margin) 60px;
  position: relative;
}

.detail-cover-panel {
  background: var(--gray-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  min-height: 640px;
  position: relative;
}
.detail-cover-panel .cover-box {
  background: var(--black);
  width: 60%;
  aspect-ratio: 3/4.2;
}

.detail-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 22px;
  width: 1.9em;
  height: 1.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.detail-nav-arrow:hover { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.detail-nav-arrow.prev { left: 12px; transform: translateY(-50%); }
.detail-nav-arrow.prev:hover { transform: translateY(-50%) translateX(-2px); }
.detail-nav-arrow.next { right: 12px; }
.detail-nav-arrow.next:hover { transform: translateY(-50%) translateX(2px); }

.detail-info {
  padding: 0 0 0 60px;
  position: relative;
}

.detail-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 22px;
  transition: transform .15s var(--ease), color .15s var(--ease);
}
.detail-close:hover { transform: rotate(90deg); color: var(--gray-hover); }

/* LIBRO-02: the maqueta's own literal sizes for this view (58/20/30px),
   now that TOKEN-01 fixed line-height to a unitless multiplier -- these
   were held back specifically to avoid redoing them on top of the bug. */
.detail-title {
  font-family: var(--font-sans);
  font-size: 32px;
  line-height: 1.2;
  font-weight: var(--title-weight);
  margin: 0 0 6px;
  padding-right: 40px;
}

.detail-authors {
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1.3;
  color: var(--gray-text);
  margin-bottom: 22px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}

.detail-actions .btn-dark { border-radius: 3px; padding: 10px 18px; font-size: 14px;}
.detail-actions a { text-decoration: underline; font-size: 14px; }

.detail-description p {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  font-weight: var(--text-weight);
  margin: 0 0 16px;
  max-width: 640px;
}

.detail-prologue {
  font-size: 18px;
  margin-top: 20px;
}

/* ---------- advanced search form ---------- */

.search-page {
  padding: 26px var(--margin) 80px;
  max-width: 1100px;
}

.search-page h1 {
  font-family: var(--font-sans);
  font-size: 2.6rem;
  line-height: 1.15;
  font-weight: var(--title-weight);
  margin: 0 0 20px;
  border-bottom: 1px solid var(--black);
  padding-bottom: 18px;
}

.field-label {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 22px;
}

.field input[type=text], .field input[type=date], .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--black);
  border-radius: 3px;
  font-size: 15px;
  font-family: var(--font-sans);
  background: var(--white);
}

.boolean-row {
  display: grid;
  grid-template-columns: 140px 1fr 200px 30px;
  gap: 16px;
  margin-bottom: 12px;
  align-items: end;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-text);
  transition: color .15s var(--ease);
}
.icon-btn:hover { color: #c0392b; }

.add-row-btn {
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 3px;
  padding: 8px 14px;
  font-size: 14px;
  margin-bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.add-row-btn:hover { background: var(--black); color: var(--white); }
.add-row-btn svg.icon { width: .9em; height: .9em; }

.buscar-btn {
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 3px;
  padding: 12px 26px;
  font-size: 15px;
  margin-bottom: 40px;
}

.filtrar-resultados h2 {
  font-size: 22px;
  margin-bottom: 20px;
}

.checkbox-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 26px;
  max-width: 760px;
}

.checkbox-columns h3 {
  font-size: 15px;
  margin: 0 0 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin-bottom: 8px;
}

.date-range {
  display: flex;
  gap: 24px;
  margin-bottom: 22px;
}
.date-range .field { max-width: 220px; }

.text-field { margin-bottom: 22px; max-width: 500px; }

/* ---------- search results ---------- */

/* BUSQ-02: active-criteria summary, above the sidebar accordions */
.criteria-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px var(--margin) 0;
}
.criteria-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--black);
  background: var(--white);
  border-radius: 20px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
}
.criteria-chip:hover { background: var(--gray-card); }
.criteria-chip svg.icon { width: .8em; height: .8em; }
.criteria-clear-all {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  color: var(--gray-text);
  text-decoration: underline;
  padding: 6px 4px;
}

/* BUSQ-04: 36px results container margin, 72px sidebar gutter */
.results-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  padding: 10px var(--margin) 60px 72px;
}

.results-sidebar {
  background: var(--gray-card);
  padding: 20px;
  align-self: start;
}

/* BUSQ-04: sidebar heading + item labels at the maqueta's literal 30px */
.results-sidebar h3 {
  font-family: var(--font-sans);
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 14px;
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--black);
  border-radius: 20px;
  padding: 6px 12px;
  margin-bottom: 20px;
  background: var(--white);
}
.sidebar-search input {
  border: none;
  outline: none;
  font-size: 13px;
  flex: 1;
  background: transparent;
}

.filter-group {
  border-top: 1px solid var(--gray-card-line);
  padding: 12px 0;
}
.filter-group:last-child { border-bottom: 1px solid var(--gray-card-line); }

.filter-group-toggle {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  padding: 0;
  color: var(--black);
}
.filter-group-toggle svg.icon { width: .9em; height: .9em; }

.sidebar-search svg.icon { width: .85em; height: .85em; }

.filter-group-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.result-list {
  padding: 20px 0 0 40px;
}

.result-card {
  display: grid;
  grid-template-columns: 130px 1fr 120px;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--gray-card-line);
}

.result-cover {
  background: var(--black);
  width: 130px;
  height: 160px;
}

/* BUSQ-04: literal maqueta sizes -- 30px doc-type, 40px result title,
   20px mono authors/source, 30px preview (3 lines, unchanged) */
.result-type {
  font-family: var(--font-sans);
  font-size: 30px;
  line-height: 1.2;
  color: var(--gray-text);
  margin-bottom: 4px;
}

.result-title {
  font-family: var(--font-sans);
  font-size: 40px;
  line-height: 1.2;
  font-weight: var(--title-weight);
  margin: 0 0 8px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.result-title:hover { text-decoration: underline; color: var(--gray-hover); }

.result-authors {
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 2px;
}
.result-authors a { text-decoration: underline; }
.result-authors a:hover { color: var(--gray-hover); }

.result-source {
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1.3;
  color: var(--gray-text);
  margin-bottom: 10px;
}
.result-source a { text-decoration: underline; }
.result-source a:hover { color: var(--gray-hover); }

.result-excerpt {
  font-family: var(--font-sans);
  font-size: 30px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  max-width: 640px;
}
/* BUSQ-06: the highlighted term reads as bold, not a UA-default yellow
   background -- there was never a deliberate style for <mark> (the
   server's snippet() just emits the tag), so the yellow was only ever the
   browser default leaking through, not an intentional later decision. */
.result-excerpt mark {
  background: none;
  color: inherit;
  font-weight: 700;
}

.result-tags {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  line-height: var(--mono-line);
  display: flex;
  gap: 12px;
}
.result-tags span { text-decoration: underline; }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.result-actions .btn-dark {
  border-radius: 3px;
  padding: 8px 16px;
  font-size: 13px;
}
.result-actions button.link-btn {
  background: none;
  border: none;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
}

.results-count {
  padding: 20px 40px 0;
  font-size: 13px;
  color: var(--gray-text);
}

/* ---------- responsive ---------- */

@media (max-width: 1300px) {
  .catalog-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1000px) {
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-body { grid-template-columns: 1fr; }
  .detail-info { padding-left: 0; margin-top: 30px; }
  .results-layout { grid-template-columns: 1fr; }
  .result-list { padding-left: 0; }
  .result-card { grid-template-columns: 100px 1fr; }
  .result-actions { grid-column: 1 / -1; flex-direction: row; }
}

@media (max-width: 640px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row, .checkbox-columns, .boolean-row { grid-template-columns: 1fr; }
  .logo { font-size: 60px; }
}

/* ---------- real cover images (fill the prototype's placeholder boxes) ---------- */
.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--black);
}
.detail-thumb .cover-img { object-fit: cover; }

/* ---------- document detail: meta line + multi-article contents list ---------- */
.detail-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gray-text);
  margin: -14px 0 22px;
  letter-spacing: -0.03rem;
  line-height: 1.5;
}

.detail-chapters { margin-top: 8px; max-width: 640px; }
.detail-chapters h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-text);
  margin-bottom: 10px;
}
.detail-chapter {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 12px 0;
  border-top: 1px solid var(--gray-card-line);
  text-decoration: none;
  color: inherit;
}
.detail-chapter:hover .chapter-title { text-decoration: underline; }
.detail-chapter .chapter-title { font-weight: 600; }
.detail-chapter .chapter-authors { font-family: var(--font-mono); font-size: 13px; color: var(--gray-text); }
.detail-chapter .chapter-pages { font-family: var(--font-mono); font-size: 12px; color: var(--gray-text); margin-left: auto; }
