/* Mementiq Public Library ---------------------------------------------- */
.public-library-shell {
  --public-bg: #080b12;
  --public-surface: #0f141d;
  --public-surface-raised: #141b26;
  --public-border: rgba(255, 255, 255, 0.08);
  --public-border-strong: rgba(255, 255, 255, 0.14);
  --public-text: #f4f7fb;
  --public-muted: #8c98aa;
  --public-subtle: #657286;
  --public-blue: #5a8cff;
  --public-cyan: #8edcff;
  --public-mint: #6ed7b0;

  min-height: 100vh;
  padding: 122px 32px 92px;
  color: var(--public-text);
  background:
    radial-gradient(
      circle at 82% 2%,
      rgba(70, 128, 255, 0.09),
      transparent 30rem
    ),
    radial-gradient(
      circle at 8% 28%,
      rgba(77, 205, 255, 0.035),
      transparent 25rem
    ),
    var(--public-bg);
  font-family: "Space Mono", monospace;
}

.authenticated-content .public-library-shell {
  padding-top: 42px;
}

.public-library-container {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.public-library-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 30px;
}

.public-library-hero-copy {
  max-width: 700px;
}

.public-library-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--public-cyan);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.public-library-hero h1 {
  margin: 0;
  color: var(--public-text);
  font-size: clamp(2.35rem, 5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.public-library-hero p {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--public-muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.public-library-hero-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.public-library-primary-action,
.public-library-secondary-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 0.64rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.public-library-primary-action {
  border: 1px solid rgba(111, 174, 255, 0.34);
  color: white;
  background: linear-gradient(135deg, #3b82f6, #557cff);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.17);
}

.public-library-primary-action:hover {
  color: white;
  transform: translateY(-1px);
}

.public-library-secondary-action {
  border: 1px solid var(--public-border);
  color: #d8e0ec;
  background: rgba(255, 255, 255, 0.025);
}

.public-library-secondary-action:hover {
  border-color: var(--public-border-strong);
  color: white;
  background: rgba(255, 255, 255, 0.045);
}

.public-library-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--public-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.public-library-overview article {
  min-width: 0;
  padding: 18px 20px;
}

.public-library-overview article + article {
  border-left: 1px solid var(--public-border);
}

.public-library-overview span,
.public-library-overview small,
.public-library-overview strong {
  display: block;
}

.public-library-overview span {
  color: var(--public-subtle);
  font-size: 0.57rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.public-library-overview strong {
  margin-top: 6px;
  color: var(--public-text);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.public-library-overview small {
  margin-top: 7px;
  color: #778397;
  font-size: 0.53rem;
}

.public-library-discovery {
  position: relative;
  z-index: 4;
  margin-bottom: 34px;
  padding: 14px;
  border: 1px solid var(--public-border);
  border-radius: 12px;
  background: rgba(12, 17, 26, 0.88);
  backdrop-filter: blur(14px);
}

.public-library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px auto;
  gap: 8px;
}

.public-library-search,
.public-library-select {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  border: 1px solid var(--public-border);
  border-radius: 9px;
  background: #0d131c;
}

.public-library-search {
  gap: 9px;
  padding: 0 12px;
}

.public-library-search > i {
  flex: 0 0 auto;
  color: #718095;
  font-size: 0.72rem;
}

.public-library-search input,
.public-library-select select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #edf2f8;
  background: transparent;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
}

.public-library-search input::placeholder {
  color: #616d7f;
}

.public-library-select {
  padding: 0 10px;
}

.public-library-select select {
  height: 40px;
  padding-right: 22px;
  appearance: none;
  cursor: pointer;
}

.public-library-select > i {
  position: absolute;
  right: 10px;
  color: #69778a;
  font-size: 0.58rem;
  pointer-events: none;
}

.public-library-select option {
  color: #e9eef6;
  background: #101620;
}

.public-library-search:focus-within,
.public-library-select:focus-within {
  border-color: rgba(90, 140, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(90, 140, 255, 0.08);
}

.public-library-filter-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(90, 140, 255, 0.28);
  border-radius: 9px;
  color: #eaf2ff;
  background: rgba(90, 140, 255, 0.13);
  font-family: "Space Mono", monospace;
  font-size: 0.61rem;
  font-weight: 700;
  cursor: pointer;
}

.public-library-filter-button:hover {
  background: rgba(90, 140, 255, 0.18);
}

.public-library-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 11px;
}

.public-library-types {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.public-library-types a {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #8490a2;
  font-size: 0.54rem;
  text-decoration: none;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.public-library-types a span {
  color: #647186;
  font-size: 0.49rem;
}

.public-library-types a:hover,
.public-library-types a.active {
  border-color: rgba(90, 140, 255, 0.16);
  color: #dce8f8;
  background: rgba(90, 140, 255, 0.075);
}

.public-library-types a.active span {
  color: #8edcff;
}

.public-library-clear {
  flex: 0 0 auto;
  color: #7b8ba2;
  font-size: 0.53rem;
  text-decoration: none;
}

.public-library-clear:hover {
  color: #a8cdeb;
}

.public-library-results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.public-library-results-header span {
  display: block;
  margin-bottom: 5px;
  color: var(--public-subtle);
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.public-library-results-header h2 {
  margin: 0;
  color: #eff4fa;
  font-size: 1rem;
  font-weight: 700;
}

.public-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 26px 16px;
}

.public-media-card {
  min-width: 0;
}

.public-media-cover {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(107, 142, 188, 0.24);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(72, 129, 219, 0.2),
      transparent 42%
    ),
    #0d141f;
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.25);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.public-media-card:hover .public-media-cover {
  border-color: rgba(107, 181, 255, 0.44);
  transform: translateY(-3px);
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.33),
    0 0 26px rgba(63, 131, 214, 0.07);
}

.public-media-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-media-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(142, 220, 255, 0.55);
  font-size: 2rem;
}

.public-media-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(2, 7, 14, 0.46) 0%,
      transparent 22%,
      transparent 58%,
      rgba(2, 7, 14, 0.86) 100%
    );
}

.public-media-cover-top,
.public-media-cover-bottom {
  position: absolute;
  right: 9px;
  left: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.public-media-cover-top {
  top: 9px;
}

.public-media-cover-bottom {
  bottom: 9px;
  align-items: flex-end;
}

.public-media-type,
.public-media-own,
.public-media-status,
.public-media-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #e8eef7;
  background: rgba(6, 10, 17, 0.72);
  backdrop-filter: blur(10px);
  font-size: 0.48rem;
  line-height: 1;
}

.public-media-own {
  border-color: rgba(110, 215, 176, 0.25);
  color: #9ce1c4;
  background: rgba(29, 91, 68, 0.35);
}

.public-media-rating {
  color: #eef7ff;
}

.public-media-rating i {
  color: #9edfff;
}

.public-media-rating small {
  color: #8290a4;
  font-size: 0.42rem;
}

.public-media-status.status-completed {
  color: #9ee2ba;
}

.public-media-status.status-progress,
.public-media-status.status-rewatching {
  color: #a9c9ff;
}

.public-media-status.status-paused {
  color: #e0c38c;
}

.public-media-status.status-dropped {
  color: #e6a3aa;
}

.public-media-status.status-planned {
  color: #a9b5c7;
}

.public-media-body {
  padding: 11px 2px 0;
}

.public-media-owner {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.public-media-avatar {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border: 1px solid rgba(107, 181, 255, 0.18);
  border-radius: 50%;
  color: #bce7ff;
  background: rgba(63, 120, 181, 0.14);
  font-size: 0.49rem;
  font-weight: 700;
}

.public-media-owner > span:last-child {
  min-width: 0;
}

.public-media-owner small,
.public-media-owner strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-media-owner small {
  color: #657185;
  font-size: 0.44rem;
}

.public-media-owner strong {
  margin-top: 2px;
  color: #aeb9c8;
  font-size: 0.53rem;
  font-weight: 500;
}

.public-media-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.public-media-heading h3 {
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #f0f4f9;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.public-media-heading > span {
  flex: 0 0 auto;
  color: #68768a;
  font-size: 0.49rem;
}

.public-media-genre {
  min-height: 30px;
  margin: 5px 0 0;
  overflow: hidden;
  color: #768397;
  font-size: 0.52rem;
  line-height: 1.45;
}

.public-media-platforms,
.public-media-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.public-media-platforms {
  margin-top: 9px;
}

.public-media-platforms span {
  display: inline-flex;
  min-height: 24px;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  overflow: hidden;
  border: 1px solid rgba(104, 155, 214, 0.12);
  border-radius: 7px;
  color: #8fa9c6;
  background: rgba(53, 93, 135, 0.07);
  font-size: 0.45rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-media-platforms i {
  color: #6fbbe9;
}

.public-media-note {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: #8c97a8;
  font-size: 0.51rem;
  font-style: italic;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.public-media-tags {
  margin-top: 10px;
}

.public-media-tags span {
  color: #74849a;
  font-size: 0.46rem;
}

.public-media-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 11px;
  color: #78bde8;
  font-size: 0.49rem;
  text-decoration: none;
}

.public-media-edit:hover {
  color: #a9dcf8;
}

.public-library-empty {
  display: grid;
  min-height: 380px;
  place-items: center;
  align-content: center;
  padding: 40px 24px;
  border: 1px dashed rgba(116, 156, 205, 0.18);
  border-radius: 14px;
  text-align: center;
}

.public-library-empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(94, 174, 255, 0.15);
  border-radius: 13px;
  color: #7bc9f1;
  background: rgba(59, 130, 246, 0.06);
}

.public-library-empty h2 {
  margin: 0;
  color: #eff5fb;
  font-size: 0.94rem;
  font-weight: 700;
}

.public-library-empty p {
  max-width: 510px;
  margin: 10px auto 0;
  color: var(--public-muted);
  font-size: 0.61rem;
  line-height: 1.6;
}

.public-library-empty a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  margin-top: 15px;
  padding: 0 11px;
  border: 1px solid rgba(90, 140, 255, 0.18);
  border-radius: 8px;
  color: #a9d7f3;
  background: rgba(90, 140, 255, 0.07);
  font-size: 0.55rem;
  text-decoration: none;
}

@media (max-width: 980px) {
  .public-library-shell {
    padding-inline: 20px;
  }

  .authenticated-content .public-library-shell {
    padding-top: 30px;
  }

  .public-library-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-library-toolbar {
    grid-template-columns: minmax(220px, 1fr) 170px 170px;
  }

  .public-library-filter-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .public-library-shell,
  .authenticated-content .public-library-shell {
    padding: 92px 14px 72px;
  }

  .authenticated-content .public-library-shell {
    padding-top: 24px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .public-library-hero h1 {
    font-size: 2.35rem;
  }

  .public-library-hero-actions {
    width: 100%;
  }

  .public-library-hero-actions > a {
    flex: 1;
  }

  .public-library-overview {
    grid-template-columns: 1fr;
  }

  .public-library-overview article + article {
    border-top: 1px solid var(--public-border);
    border-left: 0;
  }

  .public-library-toolbar {
    grid-template-columns: 1fr;
  }

  .public-library-filter-button {
    grid-column: auto;
  }

  .public-library-type-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-library-types {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .public-library-types::-webkit-scrollbar {
    display: none;
  }

  .public-library-types a {
    flex: 0 0 auto;
  }

  .public-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 10px;
  }

  .public-media-cover-top,
  .public-media-cover-bottom {
    right: 7px;
    left: 7px;
  }

  .public-media-type {
    max-width: 68%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .public-media-owner {
    margin-bottom: 8px;
  }
}

@media (max-width: 420px) {
  .public-library-hero-actions {
    flex-direction: column;
  }

  .public-library-hero-actions > a {
    width: 100%;
  }

  .public-library-grid {
    gap-inline: 8px;
  }

  .public-media-type,
  .public-media-status {
    padding-inline: 6px;
    font-size: 0.43rem;
  }

  .public-media-avatar {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
}


.public-library-scope-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: #79c3eb;
  font-size: 0.53rem;
  text-decoration: none;
}

.public-library-scope-link:hover {
  color: #a9def8;
}

.public-media-owner {
  color: inherit;
  text-decoration: none;
}

.public-media-owner:hover strong {
  color: #d9e8f5;
}

.public-media-owner-arrow {
  margin-left: auto;
  color: #5f748c;
  font-size: 0.5rem;
  transition: color 140ms ease;
}

.public-media-owner:hover .public-media-owner-arrow {
  color: #8edcff;
}
