/* /new/gallery/ — community gallery */

.gl-hero { text-align: center; padding: var(--s-7); }
.gl-hero .pp-card__title { justify-content: center; }
.gl-hero .pp-card__sub { text-align: center; max-width: 540px; margin: 0 auto; font-size: var(--t-h4); color: var(--ink-2); }

/* Filters */
.gl-filters {
  background: var(--surface-0);
  border: 1px solid var(--stroke);
  border-radius: var(--r-4);
  padding: var(--s-4);
  margin-bottom: var(--s-5);
  position: sticky;
  top: 64px;
  z-index: 10;
  backdrop-filter: blur(8px);
  box-shadow: var(--sh-1);
}
.gl-filters__row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.8fr;
  gap: var(--s-3);
}
.gl-filters__search { position: relative; }
.gl-filters__search svg {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--ink-4);
  pointer-events: none;
}
.gl-filters__search input { padding-inline-end: 38px; }
.gl-meta {
  margin-top: var(--s-3);
  font-size: var(--t-small);
  color: var(--ink-3);
}

/* Grid */
.gl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-4);
}
.gl-card {
  background: var(--surface-0);
  border: 1px solid var(--stroke);
  border-radius: var(--r-4);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t-base);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.gl-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-3);
  border-color: var(--accent);
}
.gl-card__thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  position: relative;
  overflow: hidden;
}
.gl-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.gl-card__thumb-fallback {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  font-size: 58.56px;
}
.gl-card__body { padding: var(--s-3) var(--s-4) var(--s-4); flex: 1; display: flex; flex-direction: column; }
.gl-card__title {
  font-size: var(--t-h4);
  font-weight: 600;
  color: var(--ink-1);
  margin: 0 0 var(--s-1);
}
.gl-card__author {
  font-size: var(--t-small);
  color: var(--ink-3);
}
.gl-card__tags {
  display: flex;
  gap: 4px;
  margin-top: auto;
  padding-top: var(--s-2);
  flex-wrap: wrap;
}
.gl-card__stats {
  display: flex;
  gap: var(--s-3);
  font-size: var(--t-small);
  color: var(--ink-3);
  margin-top: var(--s-2);
}

/* Pagination */
.gl-pagination {
  display: flex;
  justify-content: center;
  gap: var(--s-2);
  margin: var(--s-7) 0;
  flex-wrap: wrap;
}
.gl-pagination button {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-0);
  border-radius: var(--r-2);
  color: var(--ink-2);
  cursor: pointer;
  font-size: var(--t-body);
  font-family: var(--font-ui);
}
.gl-pagination button:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--accent);
}
.gl-pagination button.is-active {
  background: var(--accent);
  color: var(--surface-0);
  border-color: var(--accent);
  font-weight: 600;
}
.gl-pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Modal */
.gl-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}
.gl-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 13, 0.6);
  backdrop-filter: blur(4px);
}
.gl-modal__content {
  position: relative;
  background: var(--surface-0);
  border-radius: var(--r-5);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--sh-4);
}
.gl-modal__close {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3); /* RTL: top-left */
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--surface-0);
  color: var(--ink-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gl-modal__body { padding: var(--s-6); }
.gl-modal__hero {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border-radius: var(--r-4);
  overflow: hidden;
  margin-bottom: var(--s-5);
}
.gl-modal__hero img { width: 100%; height: 100%; object-fit: cover; }
.gl-modal__title { font-size: var(--t-h2); margin: 0 0 var(--s-2); color: var(--ink-1); }
.gl-modal__desc { color: var(--ink-2); line-height: 1.6; margin-bottom: var(--s-5); }
.gl-modal__cta { display: flex; gap: var(--s-2); flex-wrap: wrap; }

@media (max-width: 720px) {
  .gl-filters__row { grid-template-columns: 1fr; }
  .gl-filters { position: static; }
  .gl-modal__body { padding: var(--s-4); }
}
