/* gallery.css: visual da página da galeria */

:root {
  --bg: #0d0f14;
  --panel: #161a22;
  --border: #262c38;
  --text: #e8ecf3;
  --muted: #9aa3b5;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* topo */
.header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px clamp(16px, 4vw, 48px) 8px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.brand p { margin: 2px 0 0; color: var(--muted); }
.logo { width: 40px; height: 40px; display: block; }

.lang { display: flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* busca e filtros */
main { padding: 16px clamp(16px, 4vw, 48px) 40px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search input {
  width: min(320px, 100%); padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* no celular a busca ocupa a linha toda, pra o placeholder não cortar */
@media (max-width: 600px) { .search { flex: 1 1 100%; } .search input { width: 100%; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  font: inherit; padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.filters button[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: #7c5cff22; }
.count { color: var(--muted); margin: 18px 0 10px; }

/* grade de cards */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: #3a4252; }
.card iframe { width: 100%; height: 220px; border: 0; display: block; background: #0a0c10; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h2 { margin: 0; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.level { font-size: 12px; color: var(--muted); }
.cat { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  border: 1px solid var(--border); background: #1d222c; color: var(--text);
  font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 10px; cursor: pointer;
}
.btn:hover { border-color: #3a4252; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:focus-visible, .filters button:focus-visible, .lang button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* janela de detalhes */
.detail {
  width: min(1000px, 94vw); max-height: 92vh; padding: 0;
  border: 1px solid var(--border); border-radius: 20px; background: var(--panel); color: var(--text);
  overflow: auto;
}
.detail[open] { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.detail::backdrop { background: #000a; backdrop-filter: blur(4px); }
.detail-preview iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; background: #0a0c10; }
.detail-body { padding: 26px 26px 24px; min-width: 0; }
.detail h2 { margin: 4px 0 6px; }
.detail h3 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.detail ol { margin: 0; padding-left: 20px; }
.detail li { margin-bottom: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tags span { font: 12px ui-monospace, Consolas, monospace; background: #0d0f14; border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.close { position: absolute; top: 10px; right: 12px; margin: 0; z-index: 2; }
.close button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #0d0f14cc; color: var(--text); font-size: 20px; cursor: pointer; }
.source {
  margin: 16px 0 0; max-height: 320px; overflow: auto; padding: 14px;
  background: #0a0c10; border: 1px solid var(--border); border-radius: 10px;
  font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre;
}
@media (max-width: 760px) {
  .detail[open] { grid-template-columns: 1fr; }
  .detail-preview iframe { min-height: 280px; }
}

.footer { padding: 0 clamp(16px, 4vw, 48px) 32px; color: var(--muted); font-size: 13px; }
.footer a { color: var(--accent-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
