.cfg-wrap { width: 100%; }

.cfg-filters {
  display: block;
  margin: 0 0 18px 0;
}

.cfg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.cfg-tab {
  appearance: none;
  border: 1px solid rgba(0,0,0,0.18);
  background: transparent;
  color: inherit;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: 0;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}
.cfg-tab:hover { transform: translateY(-1px); border-color: rgba(0,0,0,0.35); }
.cfg-tab.is-active { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.35); }

.cfg-select-wrap {
  display: none;
  gap: 8px;
  align-items: center;
}

.cfg-select-label { font-size: 13px; opacity: 0.75; }

.cfg-select {
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(0,0,0,0.18);
  background: transparent;
  color: inherit;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 0;
  appearance: none;
}

.cfg-sorticons {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.cfg-sortbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.18);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  user-select: none;
}

.cfg-sortbtn .cfg-sorticon { display: inline-flex; }
.cfg-sortbtn .cfg-sorttext { font-size: 12px; letter-spacing: 0.02em; }
.cfg-sortbtn.is-active { border-color: rgba(0,0,0,0.35); background: rgba(0,0,0,0.06); }
.cfg-sortbtn:focus { outline: 2px solid rgba(0,0,0,0.35); outline-offset: 2px; }

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

.cfg-item { min-width: 0; }
.cfg-item.is-hidden { display: none; }

.cfg-card { display: block; }
.cfg-link { color: inherit; text-decoration: none; }

.cfg-media {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 0;
}

.cfg-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4.8 / 3;
  object-fit: cover;
  transform: scale(1);
  transition: transform 260ms ease;
}
.cfg-link--media:hover .cfg-img,
.cfg-link--media:focus .cfg-img { transform: scale(1.02); }

.cfg-img--placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: rgba(0,0,0,0.06);
}

.cfg-body { padding-top: 12px; }
.cfg-title-row { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.cfg-title { margin: 0; font-size: 18px; line-height: 1.25; }
.cfg-title a:hover { text-decoration: underline; }

.cfg-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cfg-cat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid rgba(0,0,0,0.14);
  text-decoration: none;
}

.cfg-pagination {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.cfg-item.is-anim-in {
  animation: cfgFadeUp 520ms ease both;
  animation-delay: var(--cfg-delay, 0ms);
}

@keyframes cfgFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.cfg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  background: rgba(0,0,0,0.8);
}
.cfg-lightbox.is-open { display: block; }

.cfg-lightbox__panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cfg-lightbox__topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  pointer-events: none;
}

.cfg-lightbox__topactions,
.cfg-lightbox__close {
  pointer-events: auto;
}

.cfg-lightbox__topactions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cfg-lightbox__content {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 18px 40px;
  box-sizing: border-box;
}

.cfg-lightbox__imgstage {
  width: 100%;
  display: flex;
  justify-content: center;
}

.cfg-lightbox__imgwrap {
  width: min(1400px, calc(100vw - 36px));
  max-width: 100%;
}

.cfg-lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

.cfg-lightbox__video {
  width: min(1200px, calc(100vw - 36px));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
  margin-top: 36px;
}

.cfg-lightbox__video iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.cfg-lightbox__btn,
.cfg-lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.45);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  border-radius: 0;
  backdrop-filter: blur(4px);
}

.cfg-lightbox__btn:hover,
.cfg-lightbox__close:hover {
  background: rgba(0,0,0,0.62);
  border-color: rgba(255,255,255,0.58);
}

@media (max-width: 1024px) {
  .cfg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .cfg-tabs { display: none; }
  .cfg-select-wrap { display: flex; justify-content: center; margin-top: 4px; }
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-title-row { flex-direction: column; align-items: flex-start; }
  .cfg-lightbox__topbar { padding: 10px 12px; gap: 8px; }
  .cfg-lightbox__content { padding: 6px 12px 24px; }
  .cfg-lightbox__imgwrap,
  .cfg-lightbox__video { width: calc(100vw - 24px); }
  .cfg-lightbox__btn,
  .cfg-lightbox__close { min-height: 38px; padding: 9px 10px; font-size: 12px; }
}
