/* Home sidebar: Recent updates (Fluid)
   - Desktop: left side-col (>= lg)
   - Mobile: slide-out drawer (see views/fluid/layout.ejs)
*/
.recent-updates {
  padding-right: 0.5rem;
}

.recent-updates .recent-updates-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  opacity: 0.9;
}

.recent-updates .list-group-item {
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
}

html:not([data-user-color-scheme="dark"]) .recent-updates .list-group-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

html[data-user-color-scheme="dark"] .recent-updates .list-group-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.recent-updates .recent-updates-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem;
}

.recent-updates .recent-updates-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-updates .recent-updates-date {
  flex: 0 0 auto;
  font-size: 0.78rem;
  opacity: 0.7;
  white-space: nowrap;
}

.recent-updates .recent-updates-empty {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Mobile drawer */
@media (max-width: 991.98px) {
  .recent-updates-drawer-toggle {
    position: fixed;
    opacity: 0;
    pointer-events: none;
  }

  .recent-updates-drawer-handle {
    position: fixed;
    left: 0;
    top: 55%;
    transform: translateY(-50%);
    z-index: 1500;
    padding: 0.45rem 0.6rem;
    border-radius: 0 999px 999px 0;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    user-select: none;
  }

  html:not([data-user-color-scheme="dark"]) .recent-updates-drawer-handle {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  html[data-user-color-scheme="dark"] .recent-updates-drawer-handle {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.14);
  }

  .recent-updates-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1490;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .recent-updates-drawer-panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(84vw, 320px);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 1500;
    overflow: hidden;
    border-radius: 0 16px 16px 0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
  }

  html:not([data-user-color-scheme="dark"]) .recent-updates-drawer-panel {
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid rgba(0, 0, 0, 0.10);
  }

  html[data-user-color-scheme="dark"] .recent-updates-drawer-panel {
    background: rgba(14, 14, 16, 0.94);
    border-right: 1px solid rgba(255, 255, 255, 0.10);
  }

  .recent-updates-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
  }

  html:not([data-user-color-scheme="dark"]) .recent-updates-drawer-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  html[data-user-color-scheme="dark"] .recent-updates-drawer-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  }

  .recent-updates-drawer-title {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    opacity: 0.95;
  }

  .recent-updates-drawer-close {
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    line-height: 2rem;
    text-align: center;
    border-radius: 999px;
    font-size: 1.2rem;
    opacity: 0.8;
    user-select: none;
  }

  html:not([data-user-color-scheme="dark"]) .recent-updates-drawer-close:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  html[data-user-color-scheme="dark"] .recent-updates-drawer-close:hover {
    background: rgba(255, 255, 255, 0.10);
  }

  .recent-updates-drawer-body {
    /* Leave room for fixed global player / iOS safe-area. */
    padding: 0.5rem 0.75rem calc(6.5rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Slightly more compact layout on mobile */
  .recent-updates--mobile {
    padding-right: 0;
  }

  .recent-updates--mobile .recent-updates-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.55rem 0.65rem;
  }

  .recent-updates--mobile .recent-updates-date {
    opacity: 0.65;
  }

  /* Toggle states */
  .recent-updates-drawer-toggle:checked ~ .recent-updates-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .recent-updates-drawer-toggle:checked ~ .recent-updates-drawer-panel {
    transform: translateX(0);
  }

  .recent-updates-drawer-toggle:checked ~ .recent-updates-drawer-handle {
    opacity: 0;
    pointer-events: none;
  }
}
