/* ============================================================
   Gerador de Avatares — Arthur 22
   HTML/CSS/JS puro (+ Bootstrap só para a grade)
   ============================================================ */

:root {
  --navy: #111532;
  --yellow: #fcba1d;
  --green: #22aa00;
  --white: #ffffff;
  --radius: 8px;
}

/* Basier Circle — usado no header e footer (igual ao site oficial) */
@font-face {
  font-family: "Basier Circle";
  src: url("fonts/Basier%20Circle%20Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Basier Circle";
  src: url("fonts/Basier%20Circle%20Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Basier Circle";
  src: url("fonts/Basier%20Circle%20SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Basier Circle";
  src: url("fonts/Basier%20Circle%20Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  background-color: var(--navy);
  color: var(--white);
  overflow-x: hidden;
}

/* ---------- Hero ---------- */
.hero {
  width: 100%;
  line-height: 0;
}
.hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Faixa de texto (amarela) ---------- */
.faixa-texto {
  background-color: var(--yellow);
  color: var(--navy);
  text-align: center;
  padding: 26px 16px;
}
.faixa-texto p {
  max-width: 880px;
  margin: 0 auto;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

/* ---------- Grade de modelos ---------- */
.modelos {
  background-color: var(--navy);
  padding: 56px 0;
}
.modelos a {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  transition:
    transform 250ms ease,
    box-shadow 250ms ease;
}
.modelos a:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.modelos img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Divisor amarelo ---------- */
.divisor {
  background-color: var(--yellow);
  height: 80px;
  width: 100%;
}

/* ---------- Seções de editor ---------- */
.editor {
  width: 100%;
  padding: 56px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  scroll-margin-top: 16px;
}
.editor--navy {
  background-color: var(--navy);
}
.editor--verde {
  background-color: var(--green);
}
.editor--amarelo {
  background-color: var(--yellow);
}

/* Preview (canvas visível) — responsivo, mantém proporção 4:5 */
.frame {
  line-height: 0;
}
canvas.preview {
  width: 320px;
  max-width: min(82vw, 360px);
  height: auto;
  display: block;
}
/* Placeholder atrás do molde antes do upload (decorativo, combina com o design) */
.editor--navy canvas.preview,
.editor--verde canvas.preview {
  background-color: var(--yellow);
}
.editor--amarelo canvas.preview {
  background-color: var(--navy);
}

/* Canvas de alta resolução fica oculto (usado só no download) */
canvas.highres {
  display: none;
}

/* Input de arquivo escondido — acionado pelo label */
.editor input[type="file"] {
  display: none;
}

/* Botão "Escolha uma foto" (label) — sempre branco */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: var(--radius);
  background-color: var(--white);
  color: var(--navy);
  border: 2px solid var(--white);
  transition: all 250ms ease;
}
.upload-btn:hover {
  background-color: transparent;
  color: var(--white);
}
.upload-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Controles (setas + zoom) */
.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.controls button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  background-color: var(--white);
  border: 2px solid var(--white);
  border-radius: var(--radius);
  transition: all 250ms ease;
}
.controls button svg {
  width: 24px;
  height: 24px;
  fill: var(--navy);
  transition: fill 250ms ease;
}
.controls button:hover {
  background-color: transparent;
}
.controls button:hover svg {
  fill: var(--white);
}
.editor--amarelo .controls button:hover svg {
  fill: var(--navy);
}

/* Botões "Salvar" / "Compartilhar" */
.save,
.share {
  cursor: pointer;
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 26px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: all 250ms ease;
}
/* Sobre fundo navy -> botão amarelo */
.editor--navy .save,
.editor--navy .share {
  background-color: var(--yellow);
  color: var(--navy);
  border-color: var(--yellow);
}
.editor--navy .save:hover,
.editor--navy .share:hover {
  background-color: transparent;
  color: var(--yellow);
}
/* Sobre fundo verde ou amarelo -> botão navy */
.editor--verde .save,
.editor--verde .share,
.editor--amarelo .save,
.editor--amarelo .share {
  background-color: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.editor--verde .save:hover,
.editor--verde .share:hover,
.editor--amarelo .save:hover,
.editor--amarelo .share:hover {
  background-color: transparent;
  color: var(--navy);
}

.is-hidden {
  display: none !important;
}

/* ---------- Botão "voltar ao topo" ---------- */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  background-color: var(--yellow);
  border: 2px solid var(--navy);
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  /* escondido até rolar a página */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease,
    background-color 0.2s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background-color: var(--white);
}
.back-to-top svg {
  width: 26px;
  height: 26px;
  fill: var(--navy);
}

/* ---------- Responsivo ---------- */
@media (min-width: 768px) {
  .faixa-texto p {
    font-size: 20px;
  }
  canvas.preview {
    width: 340px;
    max-width: 340px;
  }
}

/* ===========================================================
   Header — igual ao site oficial ([arth_header] do tema divi-child)
   Fixo no topo, sem background. Logo à esquerda, hambúrguer à direita.
   Menu abre como drawer lateral direito (slide-in) ao clicar no hambúrguer.
   =========================================================== */

.arth-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: transparent;
  color: #ffffff;
  padding: 22px 40px;
  box-sizing: border-box;
  pointer-events: none; /* deixa cliques passarem onde só houver "ar" */
  transition: background-color 0.3s ease;
}
/* Após rolar mais de 100px (classe injetada via JS), pinta o header. */
.arth-header.is-scrolled {
  background-color: #00a820;
  pointer-events: auto;
}
.arth-header__inner {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.arth-header__logo,
.arth-header__toggle,
.arth-header__nav {
  pointer-events: auto; /* só os elementos clicáveis recebem pointer */
}
.arth-header__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  flex-shrink: 0;
}
.arth-header__logo img {
  display: block;
  height: 70px;
  width: auto;
  transition: height 0.3s ease;
}
/* Quando rolar mais de 100px (classe injetada via JS), encolhe a logo. */
.arth-header.is-scrolled .arth-header__logo img {
  height: 44px;
}

/* Hambúrguer — sempre visível. */
.arth-header__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 10px;
  cursor: pointer;
  width: 48px;
  height: 48px;
  margin-left: auto;
  position: relative;
  z-index: 3;
}
.arth-header__toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  margin: 4px 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    background-color 0.25s ease;
}
.arth-header.is-open .arth-header__toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.arth-header.is-open .arth-header__toggle span:nth-child(2) {
  opacity: 0;
}
.arth-header.is-open .arth-header__toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Drawer lateral direito — escondido off-screen, desliza da direita pra esquerda. */
.arth-header__nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 88vw);
  background-color: rgba(15, 23, 81, 0.98);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 96px 36px 40px;
  z-index: 1;
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.35s;
  box-shadow: -10px 0 32px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
  overflow-y: auto;
}
.arth-header.is-open .arth-header__nav {
  transform: translateX(0);
  visibility: visible;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
}
.arth-header__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}
.arth-header__menu li {
  list-style: none;
  margin: 0;
}
.arth-header__menu a {
  color: #ffffff !important;
  text-decoration: none !important;
  font-family: "Basier Circle", "Roboto", Arial, sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  padding: 6px 0;
  transition: color 0.2s ease;
  display: inline-block;
}
.arth-header__menu a:hover,
.arth-header__menu a:focus-visible {
  color: #ffa526 !important;
}
.arth-header__menu .current-menu-item > a,
.arth-header__menu .current_page_item > a,
.arth-header__menu .current-menu-ancestor > a,
.arth-header__menu .current_page_ancestor > a {
  color: #00a820 !important;
}

@media (max-width: 600px) {
  .arth-header {
    padding: 16px 20px;
  }
  .arth-header__logo img,
  .arth-header.is-scrolled .arth-header__logo img {
    height: 36px;
  }
  .arth-header__nav {
    padding: 88px 28px 32px;
  }
  .arth-header__menu a {
    font-size: 20px;
  }
}

/* ===========================================================
   Footer — igual ao site oficial ([arth_footer] do tema divi-child)
   =========================================================== */

.arth-footer {
  background-color: #00a820;
  color: #111530;
  padding: 78px 20px 56px;
  box-sizing: border-box;
}
.arth-footer__inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 35px;
}
.arth-footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #111530;
  text-decoration: none !important;
}
.arth-footer__logo:hover {
  opacity: 0.85;
}
.arth-footer__logo-img {
  display: block;
  height: 150px;
  width: auto;
}
.arth-footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}
.arth-footer__social-item {
  color: #111530;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease;
}
.arth-footer__social-item:hover,
.arth-footer__social-item:focus-visible {
  opacity: 0.7;
}
.arth-footer__social-item svg {
  width: 28px;
  height: 28px;
  display: block;
}
.arth-footer__bottom {
  max-width: 1140px;
  margin: 35px auto 0;
  padding-top: 16px;
  border-top: 1px solid #111530;
  text-align: center;
}
.arth-footer__copy {
  margin: 0;
  color: #111530;
  font-family: "Basier Circle", "Roboto", Arial, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .arth-footer {
    padding: 56px 16px 40px;
  }
  .arth-footer__social {
    gap: 16px;
  }
  .arth-footer__social-item svg {
    width: 24px;
    height: 24px;
  }
  .arth-footer__logo-img {
    height: 150px;
  }
  .arth-footer__copy {
    font-size: 16px;
  }
}
