*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: #fff;
  color: #111;
}

/* ─── Header ─────────────────────────────────────────── */

header {
  text-align: center;
  padding: 56px 20px 36px;
  max-width: 860px;
  margin: 0 auto;
}

header h1 {
  font-size: 2.6rem;
  font-weight: 100;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  text-decoration: none;
  transition: color 0.15s;
}

.social-links a svg {
  width: 16px;
  height: 16px;
}

.social-links a:hover {
  color: #444;
}


/* ─── Filtros ─────────────────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 8px;
  padding-bottom: 4px;
}

/* Botão All */
.filter-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.78rem;
  color: #888;
  cursor: pointer;
  padding: 4px 12px;
  transition: color 0.15s, border-color 0.15s;
}

.filter-btn:hover { color: #333; border-color: #aaa; }

.filter-btn.active {
  color: #111;
  border-color: #111;
  border-bottom-width: 1px;
  font-weight: 500;
}

/* ─── Dropdowns ───────────────────────────────────────── */

.dropdown {
  position: relative;
}

.dropdown-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.78rem;
  color: #888;
  cursor: pointer;
  padding: 4px 10px 4px 12px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.dropdown-btn:hover { color: #333; border-color: #aaa; }

.dropdown-btn.has-active {
  color: #111;
  border-color: #111;
  font-weight: 500;
}

.dropdown-btn .chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.dropdown.open .chevron { transform: rotate(180deg); }

.dropdown-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFE600;
  color: #111;
  font-size: 0.68rem;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  min-width: 150px;
  z-index: 100;
  overflow: hidden;
}

.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  padding: 9px 16px;
  font-size: 0.8rem;
  color: #555;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.dropdown-item:hover { background: #f5f5f5; color: #111; }

.dropdown-item.active {
  color: #111;
  font-weight: 500;
  background: #fffde6;
}

.dropdown-item.active::before {
  content: '✓ ';
  color: #b8a800;
}

/* ─── Galeria ─────────────────────────────────────────── */

main {
  padding: 24px 52px;
}

.gallery {
  columns: 4;
  column-gap: 21px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 21px;
  cursor: pointer;
  overflow: hidden;
  display: block;
  border-radius: 8px;
  position: relative;
}

.gallery-item img {
  width: 100%;
  display: block;
  border-radius: 8px;
  transition: opacity 0.2s;
  -webkit-user-drag: none;
  user-select: none;
}

/* Escudo transparente sobre as imagens */
.img-shield {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  -webkit-user-drag: none;
}

/* Escudo no visualizador — posicionado sobre a foto */
.viewer-img-shield {
  position: absolute;
  cursor: default;
  pointer-events: all;
}

.gallery-item:hover img {
  opacity: 0.88;
}

.empty {
  text-align: center;
  color: #aaa;
  padding: 100px 20px;
  font-size: 0.85rem;
  line-height: 1.8;
  column-span: all;
}

.empty code {
  font-family: monospace;
  background: #f4f4f4;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.82rem;
}

/* ─── Visualizador ────────────────────────────────────── */

.viewer {
  position: fixed;
  inset: 0;
  background: #1c1c1c;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer[hidden] {
  display: none;
}

/* Topo */
.viewer-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  z-index: 10;
}

.viewer-counter {
  font-size: 0.75rem;
  color: #888;
  letter-spacing: 0.04em;
}

.viewer-controls {
  display: flex;
  gap: 4px;
}

.viewer-controls button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #ccc;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.viewer-controls button:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Conteúdo */
.viewer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 110px);
  padding-top: 50px;
  padding-bottom: 10px;
}

.viewer-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  display: block;
}

/* Info da foto */
.viewer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 0.73rem;
  color: #777;
  letter-spacing: 0.03em;
  text-align: center;
}

.viewer-info .info-filename {
  color: #ddd;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Setas de navegação */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ccc;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 10;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.nav-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

.nav-btn.prev { left: 18px; }
.nav-btn.next { right: 18px; }

/* ─── Responsivo ──────────────────────────────────────── */

@media (max-width: 1024px) {
  .gallery { columns: 3; }
}

@media (max-width: 680px) {
  .gallery { columns: 2; }
  main { padding: 16px 26px; }
  header h1 { font-size: 1.4rem; }
  .viewer-content { max-width: calc(100vw - 80px); }
  .nav-btn { width: 34px; height: 34px; }
  .nav-btn.prev { left: 8px; }
  .nav-btn.next { right: 8px; }
}

@media (max-width: 420px) {
  .gallery { columns: 1; }
  main { padding: 12px 18px; }
}
