/* ============================================================
   Library page — quick actions + filter + items grid
   ============================================================ */


/* ============================================================
   Light intro (uses .unit-intro pattern, slightly adjusted)
   ============================================================ */

.lib-intro {
  background: var(--white);
  padding: calc(var(--topbar-h) + var(--header-h) + 32px) 0 16px;
}

@media (max-width: 1279.98px) {
  .lib-intro { padding-top: calc(var(--header-h) + 32px); }
}

@media (max-width: 767.98px) {
  .lib-intro { padding: calc(var(--header-h) + 20px) 0 12px; }
}


/* ============================================================
   Quick-action cards — static library documents
   ============================================================ */

.lib-actions {
  background: var(--white);
  padding: 24px 0 48px;
}

.lib-actions__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1023.98px) {
  .lib-actions__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 479.98px) {
  .lib-actions__grid { grid-template-columns: 1fr; }
}

.lib-action {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur) var(--ease);
}

.lib-action:hover {
  border-color: var(--ink-3);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.lib-action__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-2);
  background: var(--paper);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.lib-action:hover .lib-action__icon {
  background: var(--ink);
  color: var(--white);
}

.lib-action__icon svg { width: 18px; height: 18px; }

.lib-action__title {
  font-size: var(--fs-16);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--ink);
}

.lib-action__desc {
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: -2px;
}

.lib-action__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--red);
  margin-top: auto;
  padding-top: 8px;
  transition: color var(--dur-fast) var(--ease);
}

.lib-action__link svg {
  width: 12px;
  height: 12px;
  transition: transform var(--dur) var(--ease);
}

.lib-action:hover .lib-action__link svg { transform: translateX(2px); }


/* ============================================================
   Items archive section
   ============================================================ */

.lib-archive {
  background: var(--white);
  padding: 24px 0 96px;
}

@media (max-width: 767.98px) {
  .lib-archive { padding: 16px 0 72px; }
}

.lib-archive__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 18px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.lib-archive__count {
  font-size: var(--fs-14);
  color: var(--text-muted);
}

.lib-archive__count strong {
  color: var(--ink);
  font-weight: 600;
}


/* ============================================================
   Items grid — text-only cards (no photos)
   ============================================================ */

.lib-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 20px;
}

@media (max-width: 767.98px) {
  .lib-items { grid-template-columns: 1fr; gap: 14px; }
}


/* ============================================================
   Library item card — clean text-only library catalog row
   ============================================================ */

.lib-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.lib-item:hover {
  border-color: var(--ink-3);
  box-shadow: var(--shadow-2);
}

/* Top row — type pill + year + status */
.lib-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lib-item__type {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--paper);
  border-radius: var(--r-pill);
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.lib-item__year {
  font-size: var(--fs-12);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.lib-item__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 3px 10px;
  background: rgba(46, 125, 79, 0.12);
  color: rgb(40, 110, 70);
  border-radius: var(--r-pill);
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lib-item__status--out {
  background: var(--paper);
  color: var(--text-muted);
}

.lib-item__status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.lib-item__title {
  font-size: var(--fs-18);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--ink);
  margin: 4px 0 2px;
}

.lib-item__author {
  font-size: var(--fs-13);
  color: var(--text-muted);
  line-height: 1.4;
}

.lib-item__meta-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  font-size: var(--fs-12);
  color: var(--text-muted);
}

.lib-item__meta-bottom span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lib-item__meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}


/* ============================================================
   Action button — download / external / detail
   ============================================================ */

.lib-item__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 11px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--fs-13);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.lib-item__btn:hover {
  background: var(--ink);
  color: var(--white);
}

.lib-item__btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease);
}

.lib-item__btn--download:hover svg { transform: translateY(2px); }
.lib-item__btn--external:hover svg { transform: translate(2px, -2px); }
.lib-item__btn--detail:hover svg { transform: translateX(3px); }


/* ============================================================
   Filter behavior — JS toggles .is-hidden on items
   ============================================================ */

.lib-item.is-hidden { display: none; }


/* ============================================================
   Empty state
   ============================================================ */

.lib-empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--paper-2);
  border-radius: var(--r-4);
  display: none;
}

.lib-empty.is-visible { display: block; }

.lib-empty__title {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.lib-empty__desc {
  font-size: var(--fs-14);
  color: var(--text-muted);
}
