/* Modern design for the main legal library page */
.library-modern-shell {
  position: relative;
}

.library-modern-hero {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: clamp(28px, 5vw, 64px);
  margin: 18px 0 26px;
  background:
    radial-gradient(circle at 12% 16%, rgba(250, 204, 21, .24), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(59, 130, 246, .22), transparent 34%),
    linear-gradient(135deg, #071827 0%, #12324a 46%, #183d5b 100%);
  color: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.library-modern-hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -170px auto;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: rgba(201, 162, 77, .18);
  filter: blur(2px);
}

.library-modern-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: clamp(22px, 4vw, 46px);
  align-items: center;
}

.library-modern-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 14px;
  border: 1px solid rgba(250, 204, 21, .45);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #fde68a;
  font-weight: 900;
  letter-spacing: .01em;
}

.library-modern-hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.25;
  color: #fff;
}

.library-modern-hero p {
  margin: 0;
  max-width: 860px;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 2;
}

.library-modern-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.library-modern-stat {
  padding: 14px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
}

.library-modern-stat strong {
  display: block;
  font-size: 1.35rem;
  color: #fde68a;
}

.library-modern-stat span {
  display: block;
  color: rgba(255, 255, 255, .82);
  font-size: .92rem;
  margin-top: 4px;
}

.library-search-panel {
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .55);
}

.library-search-panel h2 {
  margin: 0 0 8px;
  color: #12324a;
  font-size: 1.35rem;
}

.library-search-panel p {
  margin: 0 0 15px;
  color: #475569;
  font-size: .98rem;
  line-height: 1.8;
}

.library-search-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 8px;
}

.library-search-form input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 1rem;
  padding: 12px 10px;
  outline: none;
  min-width: 0;
}

.library-search-form button {
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  background: linear-gradient(135deg, #c9a24d, #facc15);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.library-search-status {
  margin-top: 12px;
  color: #64748b;
  font-size: .9rem;
  line-height: 1.8;
}

.library-modern-results {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.library-modern-results .ai-result {
  background: #fff;
  color: #0f172a;
  border-radius: 18px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.library-modern-results .ai-result h2 {
  margin: 0;
  font-size: 1.02rem;
  color: #12324a;
}

.library-modern-results .ai-result a {
  color: inherit;
}

.library-section-modern {
  margin-top: 24px;
}

.library-section-modern .section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  flex-wrap: wrap;
}

.library-section-modern .section-head p {
  max-width: 720px;
}

.library-modern-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.library-modern-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  border-radius: 26px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf7ee 100%);
  border: 1px solid rgba(201, 162, 77, .28);
  box-shadow: 0 16px 42px rgba(15, 23, 42, .08);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  cursor: pointer;
}

.library-modern-card:focus-visible {
  outline: 3px solid rgba(201, 162, 77, .75);
  outline-offset: 5px;
}

.library-modern-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, #12324a, #c9a24d);
}

.library-modern-card:hover,
.library-modern-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 55px rgba(15, 23, 42, .13);
  border-color: rgba(201, 162, 77, .6);
}

.library-modern-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: #12324a;
  color: #facc15;
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.library-modern-card h2 {
  margin: 0 0 10px;
  color: #12324a;
  font-size: 1.22rem;
  line-height: 1.55;
}

.library-modern-card p {
  color: #475569;
  line-height: 1.9;
  margin: 0 0 14px;
}

.library-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.library-card-tags span {
  border-radius: 999px;
  padding: 5px 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: .82rem;
  font-weight: 800;
}

.library-modern-card .action-btn {
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.library-modern-card a {
  position: relative;
  z-index: 2;
}

.library-quick-paths {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.library-quick-paths a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border-radius: 18px;
  text-align: center;
  text-decoration: none;
  color: #12324a;
  background: #fff;
  border: 1px solid #e9d8aa;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.library-quick-paths a:hover,
.library-quick-paths a:focus-visible {
  background: #12324a;
  color: #fff;
}

@media (max-width: 1100px) {
  .library-modern-hero__inner {
    grid-template-columns: 1fr;
  }

  .library-modern-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-quick-paths {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .library-modern-hero {
    border-radius: 22px;
    padding: 22px;
  }

  .library-modern-stats,
  .library-modern-grid,
  .library-quick-paths {
    grid-template-columns: 1fr;
  }

  .library-search-form {
    flex-direction: column;
  }

  .library-search-form button {
    padding: 13px 16px;
  }
}

@media print {
  .library-search-panel,
  .library-quick-paths {
    display: none !important;
  }

  .library-modern-hero,
  .library-modern-card {
    box-shadow: none;
  }
}
