/* Public Database page: genre filters and set-image grid. */
.ccc-database-page{
  width:min(1220px, calc(100% - 32px));
  margin:0 auto 52px;
  padding:8px 0 28px;
}
.ccc-database-heading{
  text-align:center;
  margin:0 0 16px;
}
.ccc-database-heading h1{
  margin:0;
  font-size:clamp(24px, 3vw, 34px);
  line-height:1.15;
}
.ccc-database-heading p{
  margin:7px 0 0;
  color:var(--muted);
  font-size:14px;
}
.ccc-database-genres{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px;
  margin:0 0 20px;
}
.ccc-database-genre-btn{
  min-height:36px;
  padding:7px 13px;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(255,255,255,.025);
  color:var(--text);
  font:inherit;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  transition:border-color .16s ease, background .16s ease, transform .16s ease;
}
.ccc-database-genre-btn:hover,
.ccc-database-genre-btn:focus-visible,
.ccc-database-genre-btn.is-active{
  border-color:rgba(255,255,255,.62);
  background:rgba(255,255,255,.11);
}
.ccc-database-genre-btn:active{
  transform:translateY(1px);
}
.ccc-database-grid{
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:18px 14px;
  align-items:start;
}
a.ccc-database-set{
  display:block;
  min-width:0;
  color:inherit;
  text-decoration:none;
  border-radius:14px;
  outline:none;
}
.ccc-database-set-image{
  position:relative;
  width:100%;
  aspect-ratio:4 / 3;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:13px;
  background:rgba(255,255,255,.025);
  transition:border-color .16s ease, transform .16s ease, background .16s ease;
}
.ccc-database-set:hover .ccc-database-set-image,
.ccc-database-set:focus-visible .ccc-database-set-image{
  border-color:rgba(255,255,255,.58);
  background:rgba(255,255,255,.06);
  transform:translateY(-1px);
}
.ccc-database-set-image img{
  position:absolute;
  inset:0;
  z-index:2;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.ccc-database-set-placeholder{
  position:absolute;
  inset:0;
  z-index:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:10px;
  text-align:center;
  color:var(--muted);
}
.ccc-database-set-placeholder .material-symbols-outlined{
  font-size:30px;
  opacity:.82;
}
.ccc-database-placeholder-label{
  color:var(--text);
  font-size:12px;
  font-weight:600;
}
.ccc-database-placeholder-file{
  max-width:100%;
  font-size:10px;
  line-height:1.25;
  overflow-wrap:anywhere;
  opacity:.72;
}
.ccc-database-set-image.has-image .ccc-database-set-placeholder{
  display:none;
}
.ccc-database-set-name{
  margin-top:8px;
  min-height:2.6em;
  padding:0 2px;
  color:var(--text);
  font-size:13px;
  font-weight:600;
  line-height:1.3;
  text-align:center;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
@media (max-width:780px){
  .ccc-database-page{
    width:calc(100% - 20px);
    margin-bottom:40px;
    padding-top:2px;
  }
  .ccc-database-heading{
    margin-bottom:13px;
  }
  .ccc-database-heading h1{
    font-size:24px;
  }
  .ccc-database-heading p{
    font-size:13px;
  }
  .ccc-database-genres{
    justify-content:flex-start;
    flex-wrap:nowrap;
    gap:7px;
    overflow-x:auto;
    margin:0 -2px 16px;
    padding:0 2px 5px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }
  .ccc-database-genres::-webkit-scrollbar{
    display:none;
  }
  .ccc-database-genre-btn{
    flex:0 0 auto;
    min-height:34px;
    padding:6px 11px;
    font-size:12px;
  }
  .ccc-database-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:15px 8px;
  }
  .ccc-database-set-image{
    border-radius:10px;
  }
  .ccc-database-set-placeholder{
    gap:3px;
    padding:6px;
  }
  .ccc-database-set-placeholder .material-symbols-outlined{
    font-size:24px;
  }
  .ccc-database-placeholder-label{
    font-size:10px;
  }
  .ccc-database-placeholder-file{
    font-size:8px;
  }
  .ccc-database-set-name{
    margin-top:6px;
    min-height:2.7em;
    font-size:11px;
    line-height:1.35;
  }
}


/* Database loading state. This is displayed while the real collection-data
   promise resolves, so Browse Sets never remains in a half-open Browse List state. */
.ccc-database-loading{
  min-height:clamp(260px, 46vh, 520px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:28px 16px;
  box-sizing:border-box;
  color:var(--muted);
  text-align:center;
}
.ccc-database-loading strong{
  color:var(--text);
  font-size:15px;
  font-weight:900;
}
.ccc-database-loading > span:last-child{
  font-size:12px;
  line-height:1.35;
}
.ccc-database-loading-icon{
  color:var(--text);
  font-size:30px;
  animation:ccc-database-loading-spin .9s linear infinite;
}
@keyframes ccc-database-loading-spin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){
  .ccc-database-loading-icon{ animation:none; }
}
