/* =============================================================
   PokéxCraft — Consulta de crafts de profissões
   Estética: "Guia de campo" — claro, amigável, arredondado
   (Inspirada em jogos de coleta de criaturas, sem usar marcas
   registradas. Mobile-first, sem deps externas além de fontes.)
   ============================================================= */

/* -------------------------------------------------------------
   1. Tokens (variáveis CSS)
   ------------------------------------------------------------- */
:root {
  /* Fundo / superfícies — creme quente + azul-céu pálido */
  --bg:            oklch(0.97 0.012 90);   /* fundo da página (creme) */
  --bg-2:          #ffffff;                /* superfícies (cards) */
  --bg-3:          oklch(0.95 0.025 230);  /* hover / inputs (céu pálido) */
  --line:          oklch(0.90 0.015 230);  /* bordas finas */
  --line-strong:   oklch(0.82 0.025 230);  /* bordas destacadas */

  /* Tinta — azul-marinho profundo, não preto */
  --ink:           oklch(0.26 0.04 255);   /* texto principal */
  --ink-muted:     oklch(0.48 0.03 255);   /* texto secundário */
  --ink-faint:     oklch(0.65 0.02 255);   /* texto auxiliar */

  /* Acentos */
  --red:           oklch(0.62 0.19 28);    /* ação primária (coral/cinabre) */
  --red-deep:      oklch(0.52 0.19 28);
  --red-soft:      oklch(0.95 0.04 28);    /* fundo soft */
  --sky:           oklch(0.65 0.15 235);   /* azul-céu (link, tag) */
  --sky-deep:      oklch(0.52 0.15 235);
  --sky-soft:      oklch(0.94 0.04 235);
  --leaf:          oklch(0.68 0.16 150);   /* verde-pradaria (progresso/sucesso) */
  --leaf-deep:     oklch(0.52 0.16 150);
  --leaf-soft:     oklch(0.94 0.05 150);
  --gold:          oklch(0.82 0.16 90);    /* amarelo destaque */
  --gold-soft:     oklch(0.96 0.06 90);

  /* Tipografia */
  --font-display: "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;

  /* Escala de espaçamento */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* Raio + sombra (mais generosos, mais "friendly") */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Sombra chunky com offset — dá uma vibe de cartão de jogo */
  --shadow-1:  0 2px 0 oklch(0.78 0.025 230), 0 4px 12px oklch(0.50 0.05 255 / 0.08);
  --shadow-2:  0 3px 0 oklch(0.78 0.025 230), 0 14px 28px -10px oklch(0.50 0.05 255 / 0.18);
}

/* -------------------------------------------------------------
   2. Reset + base
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  /* Pattern sutil de pontos — feeling "rota de exploração", quase invisível */
  background-image:
    radial-gradient(oklch(0.65 0.15 235 / 0.06) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: 0; }
a { color: var(--sky-deep); text-decoration: none; }
a:hover { color: var(--red); }

/* Tipografia display — Fredoka, rounded */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.05; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; }
h3 { font-size: 1.25rem; line-height: 1.25; }

/* Eyebrow / kicker */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

/* -------------------------------------------------------------
   3. Layout — container, header, footer
   ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s-4);
}

/* Header global */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(0.97 0.012 90 / 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand__mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 0 var(--red-deep);
  flex: 0 0 auto;
}
.brand__x {
  color: var(--red);
  font-weight: 700;
}

.site-header__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.site-footer {
  margin-top: var(--s-8);
  padding: var(--s-6) 0;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer p { margin: 0; }

/* -------------------------------------------------------------
   4. Botões — chunky, com offset shadow
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--line-strong);
}
.btn:hover {
  background: var(--bg-3);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--line-strong);
}
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--line-strong); }

.btn--primary {
  background: var(--red);
  border-color: var(--red-deep);
  color: #fff;
  box-shadow: 0 2px 0 var(--red-deep);
}
.btn--primary:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
  box-shadow: 0 3px 0 var(--red-deep);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  box-shadow: 0 2px 0 var(--line);
}
.btn--ghost:hover { background: var(--bg-2); }

.btn--danger {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-muted);
  box-shadow: 0 2px 0 var(--line);
}
.btn--danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 2px 0 var(--red);
}

.btn--sm { padding: 6px 12px; font-size: 0.8rem; }
.btn--icon { padding: 8px; width: 40px; height: 40px; }

/* -------------------------------------------------------------
   5. Campo de busca
   ------------------------------------------------------------- */
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search__icon {
  position: absolute;
  left: 16px;
  color: var(--ink-faint);
  pointer-events: none;
}
.search__input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  font: inherit;
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 2px 0 var(--line);
}
.search__input::placeholder { color: var(--ink-faint); font-weight: 500; }
.search__input:focus {
  border-color: var(--sky);
  background: #fff;
  box-shadow: 0 2px 0 var(--sky-deep);
}
.search--hero .search__input {
  padding: 18px 22px 18px 54px;
  font-size: 1.05rem;
}
.search--hero .search__icon { left: 20px; }

/* Filtro inline (página de profissão) */
.search--inline { max-width: 360px; }
.search--inline .search__input { padding: 10px 16px 10px 42px; font-size: 0.92rem; }
.search--inline .search__icon { left: 14px; }

/* -------------------------------------------------------------
   6. Wishlist trigger (header)
   ------------------------------------------------------------- */
.wishlist-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 14px 8px 12px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 0 var(--line-strong);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.wishlist-trigger:hover {
  border-color: var(--sky-deep);
  color: var(--sky-deep);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--sky-deep);
}
.wishlist-trigger__label { display: none; }
@media (min-width: 640px) {
  .wishlist-trigger__label { display: inline; }
}
.wishlist-trigger__badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 0 var(--red-deep);
}

/* -------------------------------------------------------------
   6b. Drawer da wishlist (sidebar lateral direita)
       Abre via JS adicionando .is-open na .drawer
   ------------------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.22 0.05 255 / 0.45);
  opacity: 0;
  transition: opacity 220ms ease;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 100vw);
  background: var(--bg);
  border-left: 2px solid var(--line);
  box-shadow: -10px 0 32px oklch(0.30 0.06 255 / 0.18);
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: translateX(0); }

/* Header do drawer */
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-bottom: 2px solid var(--line);
  flex: 0 0 auto;
}
.drawer__title { min-width: 0; flex: 1 1 auto; }
.drawer__title h2 { font-size: 1.4rem; margin: 0; white-space: nowrap; }
.drawer__title .eyebrow { display: block; margin-bottom: 4px; }
.drawer__close {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--line-strong);
  transition: transform 180ms ease, border-color 120ms ease, color 120ms ease;
  flex: 0 0 auto;
}
.drawer__close:hover {
  border-color: var(--red);
  color: var(--red);
  transform: rotate(90deg);
}

/* Overview compacto */
.drawer__overview {
  padding: var(--s-4) var(--s-5);
  background: var(--sky-soft);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.drawer__overview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-2);
}
.drawer__overview-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 800;
}
.drawer__overview-head strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--leaf-deep);
}
.drawer__overview-stat {
  margin: var(--s-2) 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 500;
}

/* Lista de itens (compacta) */
.drawer__list {
  list-style: none;
  margin: 0;
  padding: var(--s-3);
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.drawer-item {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 var(--line);
}
.drawer-item__thumb {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--sky-soft), var(--gold-soft));
  border: 2px solid var(--line);
}
.drawer-item__body { flex: 1 1 auto; min-width: 0; }
.drawer-item__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  line-height: 1.2;
  color: var(--ink);
}
.drawer-item__sub {
  margin: 2px 0 var(--s-2);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
}
.drawer-item__sub .prof-tag { color: var(--red); }
.drawer-item__progress-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.drawer-item__progress-row .progress { flex: 1 1 auto; }
.drawer-item__progress-row .pct {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  min-width: 36px;
  text-align: right;
}
.drawer-item__progress-row .pct--done { color: var(--leaf-deep); }
.drawer-item__remove {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.drawer-item__remove:hover {
  color: var(--red);
  border-color: var(--red);
}

/* Estado vazio do drawer */
.drawer__empty {
  padding: var(--s-7) var(--s-5);
  text-align: center;
  color: var(--ink-muted);
}
.drawer__empty .empty__icon { margin-bottom: var(--s-3); }
.drawer__empty h3 { margin-bottom: 6px; font-size: 1.15rem; }
.drawer__empty p { font-size: 0.9rem; margin: 0 auto; max-width: 28ch; }

/* Footer do drawer com botão "ver lista completa" */
.drawer__foot {
  padding: var(--s-4) var(--s-5);
  border-top: 2px solid var(--line);
  flex: 0 0 auto;
  background: var(--bg);
}
.drawer__foot .btn { width: 100%; }

/* -------------------------------------------------------------
   7. Home — hero + grid de profissões
   ------------------------------------------------------------- */
.hero {
  position: relative;
  padding: var(--s-8) 0 var(--s-7);
  text-align: center;
  /* Faixa de "horizonte" suave: cima céu-pálido, baixo creme */
  background:
    linear-gradient(to bottom, var(--sky-soft) 0%, transparent 60%);
  overflow: hidden;
}
.hero::before, .hero::after {
  /* "Nuvens" decorativas — círculos macios atrás do título */
  content: "";
  position: absolute;
  border-radius: 50%;
  background: oklch(1 0 0 / 0.5);
  pointer-events: none;
}
.hero::before {
  width: 220px; height: 220px;
  top: -80px; left: -60px;
  filter: blur(2px);
}
.hero::after {
  width: 300px; height: 300px;
  top: 20px; right: -120px;
  filter: blur(3px);
}
.hero > .container { position: relative; z-index: 1; }

.hero__eyebrow { display: inline-block; margin-bottom: var(--s-3); }
.hero h1 {
  max-width: 16ch;
  margin: 0 auto var(--s-3);
}
.hero h1 em {
  color: var(--red);
  font-style: normal;
  font-weight: 700;
}
.hero__lede {
  max-width: 52ch;
  margin: 0 auto var(--s-5);
  color: var(--ink-muted);
  font-size: 1.05rem;
}
.hero__search {
  max-width: 560px;
  margin: 0 auto;
}
.hero__hint {
  margin-top: var(--s-4);
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.hero__hint kbd {
  display: inline-block;
  padding: 2px 10px;
  margin: 0 3px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--ink-muted);
  box-shadow: 0 1px 0 var(--line-strong);
}

/* Seção genérica */
.section { padding: var(--s-7) 0; }
.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.section__head p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  max-width: 60ch;
}

/* Grid de profissões */
.profession-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 720px) {
  .profession-grid { grid-template-columns: repeat(2, 1fr); }
}

.profession-card {
  position: relative;
  display: block;
  padding: var(--s-5);
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  overflow: hidden;
  min-height: 220px;
}
.profession-card:hover {
  border-color: var(--sky);
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}
/* Cada card tem uma cor de "tipo" — barra colorida no topo */
.profession-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--card-accent, var(--sky));
}
.profession-card--estilista { --card-accent: oklch(0.72 0.18 340); } /* rosa */
.profession-card--engenheiro { --card-accent: oklch(0.72 0.17 60); } /* laranja */
.profession-card--professor  { --card-accent: var(--sky); }
.profession-card--aventureiro { --card-accent: var(--leaf); }

.profession-card__seal {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card-accent, var(--sky));
  color: #fff;
  margin-bottom: var(--s-4);
  box-shadow: 0 3px 0 oklch(from var(--card-accent, var(--sky)) calc(l - 0.15) c h);
}
.profession-card__name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 var(--s-1);
}
.profession-card__desc {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}
.profession-card__meta {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1.5px dashed var(--line);
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
}
.profession-card__meta strong {
  color: var(--ink-muted);
  font-weight: 800;
  font-family: var(--font-body);
}
.profession-card--placeholder {
  background:
    repeating-linear-gradient(
      135deg,
      var(--bg-2),
      var(--bg-2) 10px,
      oklch(0.96 0.012 90) 10px,
      oklch(0.96 0.012 90) 20px
    );
  border-style: dashed;
}
.profession-card--placeholder .profession-card__desc { color: var(--ink-faint); }
/* Seal mantém a cor da profissão mesmo no placeholder — só fica levemente dessaturado */
.profession-card--placeholder .profession-card__seal {
  filter: saturate(0.55);
}

/* -------------------------------------------------------------
   8. Página de Profissão — header + lista de crafts
   ------------------------------------------------------------- */
.page-header {
  padding: var(--s-7) 0 var(--s-5);
  background: var(--sky-soft);
  border-bottom: 2px solid var(--line);
}
.page-header__top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.page-header__title-block { min-width: 0; }
.page-header__title-block h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
}
.page-header__title-block .eyebrow {
  display: block;
  margin-bottom: var(--s-2);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: var(--s-4);
  font-weight: 600;
}
.crumbs a { color: var(--ink-muted); }
.crumbs a:hover { color: var(--red); }

/* Lista de crafts */
.craft-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  padding: var(--s-6) 0;
}
@media (min-width: 720px) {
  .craft-list { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .craft-list { grid-template-columns: repeat(3, 1fr); }
}

.craft {
  display: flex;
  flex-direction: column;
  padding: var(--s-4);
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.craft:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--sky);
}
.craft__head {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin-bottom: var(--s-3);
}
.craft__thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, var(--sky-soft), var(--gold-soft));
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.craft__title-block { flex: 1 1 auto; min-width: 0; }
.craft__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  color: var(--ink);
}
.craft__tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-deep);
  background: var(--red-soft);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 800;
}

.craft__ingredients-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 800;
  margin: var(--s-2) 0 var(--s-2);
  padding-top: var(--s-3);
  border-top: 1.5px dashed var(--line);
}
.craft__ingredients {
  list-style: none;
  margin: 0 0 var(--s-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}
.craft__ingredients li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.92rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.craft__ingredients li .ing-name { flex: 1 1 auto; }
.craft__ingredients li .ing-qty {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--sky-deep);
  background: var(--sky-soft);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}
.craft__actions {
  margin-top: auto;
  display: flex;
  gap: var(--s-2);
}

/* -------------------------------------------------------------
   8a. Layout da página de profissão — sidebar + lista
   ------------------------------------------------------------- */
.profession-layout {
  display: grid;
  gap: var(--s-5);
  padding: var(--s-6) 0;
}
@media (min-width: 900px) {
  .profession-layout {
    grid-template-columns: 240px 1fr;
    gap: var(--s-6);
    align-items: start;
  }
}

.profession-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
@media (min-width: 900px) {
  .profession-sidebar {
    position: sticky;
    top: 84px;
    padding: var(--s-5);
  }
}

.profession-sidebar__title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 800;
  margin: 0;
}

.rank-filters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
@media (min-width: 900px) {
  .rank-filters {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
  }
}

.rank-chip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}
@media (min-width: 900px) {
  .rank-chip { display: flex; width: 100%; }
}
.rank-chip__input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rank-chip__inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-muted);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  box-shadow: 0 2px 0 var(--line);
}
.rank-chip__box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 2px solid var(--line-strong);
  background: var(--bg-2);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background 120ms ease, border-color 120ms ease;
}
.rank-chip__check {
  opacity: 0;
  color: #fff;
  transition: opacity 120ms ease;
}
.rank-chip__label { flex: 0 1 auto; }
.rank-chip__count {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.72rem;
  padding: 1px 8px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-faint);
  margin-left: auto;
}

.rank-chip__input:checked ~ .rank-chip__inner { color: var(--ink); }
.rank-chip__input:checked ~ .rank-chip__inner .rank-chip__box {
  background: var(--red);
  border-color: var(--red-deep);
}
.rank-chip__input:checked ~ .rank-chip__inner .rank-chip__check { opacity: 1; }

.rank-chip__input:focus-visible ~ .rank-chip__inner {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

.rank-chip:hover .rank-chip__inner { border-color: var(--line-strong); }

@media (min-width: 900px) {
  .rank-chip__inner {
    width: 100%;
    border-radius: var(--radius-sm);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    padding: 6px 10px;
  }
  .rank-chip__label { flex: 1 1 auto; }
  .rank-chip:hover .rank-chip__inner {
    background: var(--bg-3);
    border-color: transparent;
  }
}

.rank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-2);
}
@media (min-width: 900px) {
  .rank-actions {
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1.5px dashed var(--line);
  }
}
.rank-action {
  padding: 5px 12px;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.rank-action:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--bg);
}

.profession-sidebar__stat {
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-weight: 500;
}
@media (min-width: 900px) {
  .profession-sidebar__stat {
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1.5px dashed var(--line);
  }
}
.profession-sidebar__stat strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ink);
  display: inline-block;
  line-height: 1;
  margin-right: 4px;
}

.profession-main .craft-list {
  padding: 0;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .profession-main .craft-list { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1180px) {
  .profession-main .craft-list { grid-template-columns: repeat(3, 1fr); }
}

/* -------------------------------------------------------------
   8b. Página de detalhe de craft (craft.html)
   ------------------------------------------------------------- */
/* Hero — bloco grande, imagem + título + meta + CTA */
.craft-detail {
  margin: var(--s-6) 0 var(--s-5);
  padding: var(--s-6);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  align-items: center;
}
@media (min-width: 720px) {
  .craft-detail {
    grid-template-columns: auto 1fr;
    gap: var(--s-6);
    padding: var(--s-7);
  }
}

/* Imagem grande do item resultante — moldura decorada */
.craft-detail__hero-img {
  width: 160px;
  height: 160px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--sky-soft), var(--gold-soft));
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow:
    inset 0 0 0 4px var(--bg-2),
    inset 0 0 0 6px var(--line),
    0 3px 0 var(--line-strong);
  flex: 0 0 auto;
  justify-self: center;
}
@media (min-width: 720px) {
  .craft-detail__hero-img { width: 180px; height: 180px; justify-self: start; }
}

.craft-detail__body { min-width: 0; text-align: center; }
@media (min-width: 720px) {
  .craft-detail__body { text-align: left; }
}

.craft-detail__eyebrow { display: inline-block; margin-bottom: var(--s-2); }
.craft-detail__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  line-height: 1.05;
  margin: 0 0 var(--s-3);
}

/* Badges lado a lado (profissão, rank, skill, tempo) */
.craft-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: center;
  margin-bottom: var(--s-5);
}
@media (min-width: 720px) {
  .craft-detail__meta { justify-content: flex-start; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-body);
}
.badge svg { color: var(--ink-faint); }
.badge--profession {
  background: var(--red-soft);
  border-color: oklch(0.85 0.10 28);
  color: var(--red-deep);
}
.badge--profession svg { color: var(--red); }
.badge--rank {
  background: var(--gold-soft);
  border-color: oklch(0.85 0.12 90);
  color: oklch(0.45 0.12 80);
}
.badge--rank svg { color: oklch(0.65 0.15 85); }
.badge--skill {
  background: var(--sky-soft);
  border-color: oklch(0.85 0.08 235);
  color: var(--sky-deep);
}
.badge--skill svg { color: var(--sky); }
.badge--time {
  background: var(--leaf-soft);
  border-color: oklch(0.85 0.10 150);
  color: var(--leaf-deep);
}
.badge--time svg { color: var(--leaf); }

.craft-detail__cta .btn {
  padding: 12px 22px;
  font-size: 0.95rem;
}

/* Bloco "Receita" — grade de ingredientes em cards bonitos */
.recipe {
  padding: var(--s-5) 0;
}
.recipe__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.recipe__head h2 { font-size: 1.5rem; }
.recipe__head p { margin: 4px 0 0; color: var(--ink-muted); font-size: 0.9rem; }

.ingredient-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (min-width: 520px) {
  .ingredient-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .ingredient-grid { grid-template-columns: repeat(3, 1fr); }
}

.ingredient-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 2px 0 var(--line);
}
.ingredient-card:hover {
  transform: translateY(-2px);
  border-color: var(--sky);
  box-shadow: 0 3px 0 var(--sky-deep);
  color: var(--ink);
}
.ingredient-card__img {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, var(--sky-soft), var(--gold-soft));
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ingredient-card__body { flex: 1 1 auto; min-width: 0; }
.ingredient-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.2;
}
.ingredient-card__qty {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--red);
  letter-spacing: 0;
}

/* Bloco "Usado em" — reaproveita .result-list, mas tem um possível estado vazio menor */
.also-used__empty {
  padding: var(--s-5);
  background: var(--bg-2);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-muted);
  text-align: center;
  font-weight: 500;
}

/* -------------------------------------------------------------
   9. Resultados de busca (busca global)
   ------------------------------------------------------------- */
.search-results-head {
  padding: var(--s-6) 0 var(--s-4);
}
.search-results-head p {
  color: var(--ink-muted);
  margin: var(--s-2) 0 0;
}
.search-results-head .needle {
  color: var(--red);
  font-family: var(--font-display);
  font-weight: 700;
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.result {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 2px 0 var(--line);
}
.result:hover {
  border-color: var(--sky);
  transform: translateX(2px);
  box-shadow: 0 2px 0 var(--sky-deep);
}
.result__icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--sky-soft);
  color: var(--sky-deep);
  flex: 0 0 auto;
}
.result__body { flex: 1 1 auto; min-width: 0; }
.result__name {
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-display);
}
.result__meta {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin: 2px 0 0;
  font-weight: 500;
}
.result__meta .prof-tag {
  color: var(--red);
  font-weight: 800;
}
.result__chevron { color: var(--ink-faint); flex: 0 0 auto; }
.result:hover .result__chevron { color: var(--red); }

/* -------------------------------------------------------------
   10. Wishlist — progresso geral + items
   ------------------------------------------------------------- */
.wishlist-overview {
  margin: var(--s-6) 0 var(--s-5);
  padding: var(--s-5);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-1);
}
.wishlist-overview__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
}
.wishlist-overview__head h2 { font-size: 1.5rem; }
.wishlist-overview__stat {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink-muted);
}
.wishlist-overview__stat strong {
  color: var(--leaf-deep);
  font-size: 1.2rem;
  font-family: var(--font-display);
  font-weight: 700;
}

/* Barra de progresso — verde pradaria */
.progress {
  position: relative;
  width: 100%;
  height: 14px;
  background: var(--bg-3);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    var(--leaf) 0%,
    var(--leaf) 60%,
    var(--gold) 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 6s linear infinite;
  transition: width 320ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes progress-shimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}
.progress--lg { height: 20px; }
.progress--sm { height: 10px; }

/* Items da wishlist */
.wishlist {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding-bottom: var(--s-6);
}
.wishlist-item {
  padding: var(--s-5);
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-1);
}
.wishlist-item__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.wishlist-item__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, var(--sky-soft), var(--gold-soft));
  border: 2px solid var(--line);
}
.wishlist-item__title { flex: 1 1 auto; min-width: 0; }
.wishlist-item__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}
.wishlist-item__sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}
.wishlist-item__sub .prof-tag { color: var(--red); }

.wishlist-item__progress-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.wishlist-item__progress-row .progress { flex: 1 1 auto; }
.wishlist-item__pct {
  flex: 0 0 auto;
  min-width: 54px;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}
.wishlist-item__pct--done { color: var(--leaf-deep); }

/* Tabela de ingredientes (input "tenho" vs "preciso") */
.ing-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--s-4);
  font-size: 0.92rem;
}
.ing-table th {
  text-align: left;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 var(--s-2) var(--s-2);
  border-bottom: 1.5px dashed var(--line);
}
.ing-table th.num { text-align: right; }
.ing-table td {
  padding: var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-weight: 500;
}
.ing-table tr:last-child td { border-bottom: 0; }
.ing-table td.num { text-align: right; font-family: var(--font-body); font-weight: 700; }
.ing-table tr.done td { color: var(--ink-faint); }
.ing-table tr.done td:first-child {
  color: var(--leaf-deep);
  font-weight: 700;
}

.qty-input {
  width: 72px;
  padding: 6px 12px;
  font: inherit;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: right;
  color: var(--ink);
  background: var(--bg-2);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.qty-input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-soft);
}
.qty-needed {
  display: inline-block;
  min-width: 32px;
  text-align: right;
  color: var(--ink-muted);
  font-weight: 700;
}

.wishlist-item__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1.5px dashed var(--line);
}

/* Estado vazio */
.empty {
  padding: var(--s-8) var(--s-4);
  text-align: center;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
}
.empty__icon {
  width: 64px; height: 64px;
  margin: 0 auto var(--s-3);
  display: grid; place-items: center;
  color: var(--ink-faint);
  background: var(--sky-soft);
  border-radius: 50%;
}
.empty h3 { margin-bottom: 6px; }
.empty p { margin: 0 auto; max-width: 40ch; color: var(--ink-muted); }
.empty__actions { margin-top: var(--s-4); }

/* -------------------------------------------------------------
   11. Acessibilidade & utilitários
   ------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------------------------------------
   Imagens dos itens (populadas dinamicamente pelo app.js)
   ------------------------------------------------------------- */

.craft__thumb img,
.wishlist-item__thumb img,
.craft-detail__hero-img img,
.ingredient-card__img img,
.result__icon img,
.drawer-item__thumb img,
.ing-img {
  image-rendering: pixelated;
}

.craft__thumb img,
.wishlist-item__thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
.craft__thumb,
.wishlist-item__thumb {
  padding: 4px;
  overflow: hidden;
}

.drawer-item__thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
.drawer-item__thumb {
  overflow: hidden;
  padding: 4px;
  display: grid;
  place-items: center;
}

.craft-detail__hero-img img,
.ingredient-card__img img {
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  display: block;
}
.craft-detail__hero-img,
.ingredient-card__img {
  overflow: hidden;
}
.ingredient-card__img { padding: 4px; }

.result__icon img {
  max-width: 28px;
  max-height: 28px;
}

.ing-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.ing-table .ing-img {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 8px;
}

/* -------------------------------------------------------------
   Áreas clicáveis no card de craft (lista de profissão)
   ------------------------------------------------------------- */

.craft__head--link {
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin: -4px;
  transition: background 120ms ease;
}
.craft__head--link:hover {
  background: var(--bg-3);
  color: inherit;
}
.craft__head--link:hover .craft__name { color: var(--red); }

.craft__ingredients li {
  display: block;
  padding: 0;
}
.craft__ingredients .ing-link {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink-muted);
  text-decoration: none;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  transition: background 120ms ease, color 120ms ease;
}
.craft__ingredients .ing-link:hover {
  background: var(--sky-soft);
  color: var(--ink);
}
.craft__ingredients .ing-link .ing-name { flex: 1 1 auto; }

