/* ==========================================================================
   MAXDEV — site de projetos
   tema escuro · preto + vermelho
   ========================================================================== */

:root {
  --bg: #07070a;
  --bg-2: #0c0c10;
  --surface: #101014;
  --surface-2: #141419;
  --line: #20202a;
  --line-soft: #181820;
  --text: #ececf1;
  --muted: #8b8b98;
  --red: #e10600;
  --red-2: #ff3b2f;
  --red-dim: rgba(225, 6, 0, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Rajdhani", "Inter", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* textura de fundo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(225, 6, 0, 0.10), transparent 60%),
    radial-gradient(700px 400px at 0% 0%, rgba(225, 6, 0, 0.06), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.wrap {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

::selection { background: var(--red); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #23232d; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ==========================================================================
   HEADER
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 7, 10, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.header__inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(225, 6, 0, 0.55);
  box-shadow: 0 0 18px rgba(225, 6, 0, 0.35);
}

.brand b { color: var(--red); font-weight: 700; }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: 0.18s;
}

.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--red-dim); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: 0.18s;
  background: var(--surface-2);
  color: var(--text);
}

.btn--primary {
  background: linear-gradient(135deg, var(--red) 0%, #a10400 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(225, 6, 0, 0.28);
}

.btn--primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn--danger {
  background: rgba(225, 6, 0, 0.12);
  color: #ff6b6b;
  border: 1px solid rgba(225, 6, 0, 0.35);
}
.btn--danger:hover { background: rgba(225, 6, 0, 0.22); color: #ff8a8a; }
.btn--ghost { border-color: var(--line); color: var(--muted); }
.btn--ghost:hover { color: var(--text); border-color: #34343f; }

.burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  padding: 92px 0 64px;
  position: relative;
}

.hero__glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(225, 6, 0, 0.16), transparent 62%);
  filter: blur(20px);
  pointer-events: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  margin-bottom: 22px;
}

.hero__badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 8vw, 82px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero h1 span { color: var(--red); }

.hero p {
  margin-top: 18px;
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
}

.hero__actions {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__stats {
  margin-top: 48px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 26px;
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.stat span {
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   SECÇÕES
   ========================================================================== */

.section { padding: 30px 0 70px; }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.section__title em {
  font-style: normal;
  color: var(--red);
}

.section__sub { color: var(--muted); font-size: 14px; }

/* filtros */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.chip {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: 0.16s;
}

.chip:hover { color: var(--text); border-color: #34343f; }

.chip.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 20px rgba(225, 6, 0, 0.3);
}

/* ==========================================================================
   GRELHA / CARDS
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: 0.22s ease;
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(225, 6, 0, 0);
  transition: 0.22s;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(225, 6, 0, 0.10);
}

.card:hover::after { box-shadow: inset 0 0 0 1px rgba(225, 6, 0, 0.25); }

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0d0d12;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card__media img { transform: scale(1.06); }

.card__cat {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(7, 7, 10, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(225, 6, 0, 0.4);
  color: var(--red-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.card__body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.card__title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.15;
}

.card__desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}

.card__meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #6f6f7c;
  padding-top: 2px;
}

.card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.card__meta:empty { display: none; }

.card__foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
}

.card__link {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  transition: 0.16s;
}

.card__link:hover { color: var(--red-2); }

.dl-count { font-size: 12px; color: #6f6f7c; }

/* ==========================================================================
   PÁGINA DE PROJETO
   ========================================================================== */

.crumb {
  padding: 26px 0 18px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.crumb a:hover { color: var(--red-2); }
.crumb span { color: #4d4d58; }

.proj__hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 21 / 9;
  max-height: 420px;
  background: #0d0d12;
}

.proj__hero img { width: 100%; height: 100%; object-fit: cover; }

.proj__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 10, 0) 40%, rgba(7, 7, 10, 0.85) 100%);
}

.proj__head { margin: 26px 0 30px; }

.proj__head h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.05;
}

.proj__tagline { color: var(--muted); margin-top: 8px; font-size: 17px; }

.proj__badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--red-dim);
  border: 1px solid rgba(225, 6, 0, 0.35);
  color: var(--red-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.badge--grey {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}

.proj__cols {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 32px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
}

.panel h3 {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel h3::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--red);
  border-radius: 4px;
}

.panel p { color: #b4b4c0; font-size: 15px; margin-bottom: 14px; white-space: pre-line; }
.panel p:last-child { margin-bottom: 0; }

.feats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.feat {
  padding: 6px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: #c4c4d0;
}

.side { position: sticky; top: 96px; display: grid; gap: 16px; }

.dl-big {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--red) 0%, #a10400 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.6px;
  box-shadow: 0 10px 30px rgba(225, 6, 0, 0.3);
  transition: 0.18s;
}

.dl-big:hover { filter: brightness(1.12); transform: translateY(-2px); }

.meta-list { display: grid; gap: 12px; }

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px;
}

.meta-row:last-child { border-bottom: none; padding-bottom: 0; }
.meta-row span { color: var(--muted); }
.meta-row b { font-weight: 600; }

.gallery {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.gallery img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: 0.2s;
}

.gallery img:hover { transform: scale(1.02); border-color: rgba(225, 6, 0, 0.5); }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, 0.94);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ==========================================================================
   SOBRE / FOOTER
   ========================================================================== */

.about {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(225, 6, 0, 0.08), transparent 55%),
    var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 38px;
}

.about h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.about p { color: var(--muted); }

.about__logo {
  width: 190px;
  margin-inline: auto;
  filter: drop-shadow(0 0 40px rgba(225, 6, 0, 0.45));
}

.footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 40px;
  padding: 34px 0;
  background: var(--bg-2);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.footer__links { display: flex; gap: 18px; }
.footer__links a:hover { color: var(--red-2); }

.footer__quiet {
  font-size: 12px;
  color: #4d4d58;
  transition: 0.16s;
}

.footer__quiet:hover {
  color: var(--red);
  text-decoration: underline;
}

/* ==========================================================================
   ESTADO VAZIO
   ========================================================================== */

.empty {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.delete-banner {
  background: rgba(225, 6, 0, 0.15);
  border: 1px solid rgba(225, 6, 0, 0.4);
  color: #ff8a8a;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}
#loader.delete-mode {
  border: 1px solid rgba(225, 6, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px;
}

/* ==========================================================================
   ADMIN — cadeado
   ========================================================================== */

.gate {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
  border-color: rgba(225, 6, 0, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.gate__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-dim);
  border: 1px solid rgba(225, 6, 0, 0.4);
  font-size: 22px;
  box-shadow: 0 0 24px rgba(225, 6, 0, 0.25);
}

.gate h3 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 1.4px;
  margin-bottom: 6px;
}

.gate p { color: var(--muted); font-size: 14px; }
.gate-form { display: grid; gap: 14px; margin-top: 22px; text-align: left; }
.gate-form input { text-align: center; }
.gate-form input[type="email"] { letter-spacing: 0.3px; font-size: 14px; }
.gate-form input[type="password"] { letter-spacing: 4px; }
.gate-form label { text-align: center; }
.gate-form .btn { width: 100%; padding: 12px; }

.gate-msg {
  margin-top: 14px;
  color: var(--red-2);
  font-size: 13px;
  font-weight: 600;
}

.shake { animation: shake 0.3s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* ==========================================================================
   ADMIN
   ========================================================================== */

.admin__head {
  padding: 34px 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.admin__head h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin__head p { color: var(--muted); font-size: 14px; max-width: 520px; }

.admin__cols {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
  padding-bottom: 60px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field--full { grid-column: 1 / -1; }

.field label {
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.field .hint { font-size: 12px; color: #61616d; }

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: 0.16s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.15);
}

textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: 0.16s;
  background: var(--bg-2);
}

.drop:hover, .drop.drag {
  border-color: var(--red);
  background: rgba(225, 6, 0, 0.06);
  color: var(--text);
}

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }

.thumb {
  position: relative;
  width: 92px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(7, 7, 10, 0.85);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.thumb button:hover { background: var(--red); }

.side-preview { position: sticky; top: 96px; display: grid; gap: 16px; }

.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.note {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.6;
}

.note code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--red-2);
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 140%);
  background: var(--surface-2);
  border: 1px solid rgba(225, 6, 0, 0.45);
  color: var(--text);
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 300;
}

.toast.show { transform: translate(-50%, 0); }

.hidden { display: none !important; }

@media (max-width: 980px) {
  .proj__cols { grid-template-columns: 1fr; }
  .side { position: static; }
  .admin__cols { grid-template-columns: 1fr; }
  .side-preview { position: static; }
  .about { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 760px) {
  .burger { display: grid; place-items: center; }

  .nav {
    position: absolute;
    top: 72px;
    right: 20px;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px;
    min-width: 200px;
    box-shadow: var(--shadow);
    display: none;
  }

  .nav.open { display: flex; }
  .nav a { padding: 11px 14px; }

  .header .btn--primary { display: none; }
  .nav .btn--primary { display: inline-flex; margin-top: 4px; }

  .hero { padding: 60px 0 40px; }
  .hero__stats { gap: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .proj__hero { aspect-ratio: 16 / 10; max-height: 260px; }

  /* filtros numa faixa horizontal em vez de quatro linhas de chips */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin-inline: -20px;
    padding: 2px 20px 8px;
    margin-bottom: 20px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip { flex: 0 0 auto; scroll-snap-align: start; }

  /* um card por ecrã é aceitável; um card e meio não */
  .card__media { aspect-ratio: 16 / 9; }

  /* botão de voltar como migalha compacta, não como faixa própria */
  .section__head { gap: 10px; margin-bottom: 20px; align-items: flex-start; }
  .section__head .btn--ghost {
    order: -1;
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 999px;
    color: var(--muted);
  }
}

@media (min-width: 761px) {
  .nav .btn--primary { display: none; }
}

.delete-confirm { margin-top: 10px; padding: 12px; border: 1px solid rgba(225, 6, 0, 0.4); border-radius: var(--radius-sm); background: rgba(225, 6, 0, 0.08); }
.delete-confirm p { color: #ff8a8a; font-size: 14px; font-weight: 600; text-align: center; margin-bottom: 10px; }
.delete-confirm__btns { display: flex; gap: 8px; justify-content: center; }
.delete-confirm__btns .btn { padding: 8px 16px; font-size: 13px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cat-card { display: block; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: 0.18s; text-decoration: none; color: var(--text); }
.cat-card:hover { border-color: var(--red); transform: translateY(-3px); }
.cat-card__media { aspect-ratio: 16 / 10; background: var(--bg-3); overflow: hidden; }
.cat-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cat-card__placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #1a1a22, #0d0d11); }
.cat-card__placeholder span { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: 3px; color: #3c3c49; }
.cat-card__body { padding: 14px 16px; }
.cat-card__title { font-family: Rajdhani, sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.cat-card__count { color: var(--muted); font-size: 13px; }
.cat-card--all .cat-card__media { background: linear-gradient(135deg, #1a1a22, #0d0d11); }

.upload-progress { width: 100%; height: 6px; background: var(--bg-3); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.upload-bar { height: 100%; width: 0%; background: var(--red); transition: width 0.2s; }
.thumb { position: relative; }
.thumb__info { position: absolute; bottom: 2px; left: 2px; font-size: 9px; color: #fff; background: rgba(0,0,0,0.6); padding: 1px 4px; border-radius: 3px; display: flex; gap: 4px; }
.thumb--capa { outline: 2px solid var(--red); }
.thumb__capa-btn { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 3px; font-size: 12px; padding: 2px 6px; cursor: pointer; }
.thumb__capa-tag { position: absolute; top: 2px; left: 2px; font-size: 9px; color: #fff; background: var(--red); padding: 1px 4px; border-radius: 3px; }

.card { position: relative; }
.card__overlay { position: absolute; inset: 0; z-index: 1; }
.card__foot { position: relative; z-index: 2; }
.card__title { font-size: 20px; }
.card__foot { border-top: none; padding-top: 0; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--red-2); outline-offset: 3px; }
