/* style.css */

/* Importação de fontes */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');

/* Estilo geral */
html, body {
  background: linear-gradient(to bottom, #b8f6ff 0%, #7ddaff 70%, #57aeff 100%);
  font-family: 'Press Start 2P', cursive;
  margin: 0;
  padding: 0;
  color: #333;
  font-size: 14px;
  overflow-x: hidden; /* evita rolagem lateral */
  width: 100%;
}

/* Header (Topo) */
header {
  position: relative;
  height: 200px;
  background: linear-gradient(to bottom, #faffc8 0%, #dfffff 70%, #baf6ff 100%);
  overflow: hidden;
  text-align: center;
  font-family: 'Press Start 2P', cursive;
  padding-top: 40px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.356);
}

/* Título com borda preta */
header h1 {
  margin: 0;
  font-size: 2.2em;
  position: relative;
  z-index: 2;
  color: rgb(250, 253, 47);
  text-shadow:
    -3px -3px 0 #000,
     3px -3px 0 #000,
    -3px  3px 0 #000,
     3px  3px 0 #000,
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

/* Parágrafo também com borda preta */
header p {
  margin: 5px 0 0 0;
  font-size: 1.1em;
  position: relative;
  z-index: 2;
  color: rgb(250, 253, 47);
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

/* Céu animado */
#sky {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden; /* corrigido para não vazar */
  z-index: 0;
}
#sky img { position: absolute; z-index: 1; }
.pombo { width: 100px; height: 100px; image-rendering: pixelated; user-select: none; }
.coracao { width: 50px; height: 30px; image-rendering: pixelated; user-select: none; }

/* Navegação simples */
nav {
  text-align: center;
  background-color: #ffd966;
  padding: 10px;
  font-weight: bold;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
}
nav a {
  margin: 0 15px;
  color: #333;
  text-decoration: none;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
}
nav a:hover { color: #ff4d4d; text-decoration: underline; }

/* Seções */
section {
  padding: 20px;
  max-width: 900px;
  margin: auto;
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  line-height: 1.4;
}

/* Caixa fofa para "Nossa História" */
.story-card {
  background: #ffd966;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 10px;
}
.story-card p {
  margin: 10px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #333;
}
@media (max-width: 520px) {
  .story-card { padding: 14px; }
  .story-card p { font-size: 11px; }
}

/* Contador */
.contador {
  font-size: 2em;
  color: #ff4d4d;
  text-align: center;
  font-family: 'Press Start 2P', cursive;
}
@media (max-width: 520px) {
  .contador {
    font-size: 1.3em;
  }
}

/* Galeria */
.galeria {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.galeria img,
.galeria video {
  width: 80%;
  max-width: 500px;
  height: auto; /* corrigido para Safari */
  object-fit: contain;
}

/* Presentes */
#presentes h2 {
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
  font-size: 1.8em;
  text-align: center;
  margin-bottom: 15px;
  color: #333;
}
#presentes p {
  font-family: 'Press Start 2P', cursive;
  font-size: 11px;
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 20px auto;
}
.gift-item {
  background-color: #fff;
  border: 3px solid #000;
  padding: 10px;
  text-align: center;
  box-shadow: 4px 4px 0 #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 320px;
}
.gift-item img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border: 2px solid #000;
  margin-bottom: 8px;
  display: block;
}
.gift-item p {
  margin: 5px 0;
  font-size: 10px;
  color: #333;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.buy-button {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 12px;
  background-color: #ff0033;
  color: white;
  text-decoration: none;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  text-transform: uppercase;
  cursor: pointer;
}
.buy-button:hover { background-color: #cc0029; box-shadow: 1px 1px 0 #000; }

/* PIX card compacto */
.pix-area {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}
.qr-card {
  max-width: 320px;
  width: 100%;
  background: #fff;
  border: 2px solid #222;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 6px 6px 0 #222;
  text-align: center;
}
.qr-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.qr-card p { margin: 0 0 10px; }

.qr-block {
  display: grid;
  place-items: center;
  gap: 8px;
  margin: 6px 0 10px;
}
#qrPixImg {
  width: 180px;
  height: auto;
  border-radius: 12px;
  cursor: zoom-in;
  border: 1px solid #ddd;
  background: #fff;
}
.qr-caption { font-size: 0.7rem; color: #555; }

.pix-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  background: #f9f9ff;
  border: 1px dashed #bbb;
  padding: 6px 8px;
  border-radius: 10px;
}
.pix-key strong { font-size: 0.75rem; }

.copy-btn {
  padding: 4px 8px;
  font-size: 0.7rem;
  border-radius: 6px;
  border: 1px solid #222;
  background: #ffe6f2;
  cursor: pointer;
}
.copy-btn:hover { filter: brightness(0.98); }

/* Lightbox QR */
.qr-lightbox { position: fixed; inset: 0; display: none; z-index: 9999; }
.qr-lightbox.is-open { display: block; }
.qr-lightbox__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.qr-lightbox__dialog {
  position: relative;
  max-width: min(90vw, 520px);
  margin: 6vh auto;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  border: 2px solid #222;
}
.qr-lightbox__dialog img { width: 100%; height: auto; display: block; border-radius: 12px; }
.qr-lightbox__close {
  position: absolute; top: 8px; right: 10px;
  background: #fff; border: 2px solid #222; border-radius: 50%;
  width: 34px; height: 34px; font-size: 20px; line-height: 28px; cursor: pointer;
}
.qr-lightbox__hint { text-align: center; font-size: 0.9rem; color: #666; margin-top: 8px; }

/* Dicas de vestuário */
.dicas-gifs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 14px;
}
.dicas-gifs img {
  width: 180px;
  border: 3px solid #000;
  border-radius: 12px;
  box-shadow: 4px 4px 0 #000;
}

/* Rodapé */
footer {
  text-align: center;
  background-color: #ffd966;
  padding: 10px;
  margin-top: 20px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
}

/* Modal de Mensagem */
.modal { display: none; }
.modal.is-open { display: block; }
.modal[aria-hidden="true"] { display: none; }
.modal[aria-hidden="false"] { display: block; }

.modal {
  position: fixed;
  z-index: 999;
  padding-top: 100px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  font-family: 'Press Start 2P', cursive;
}
.modal-content {
  background-color: #fff;
  margin: auto;
  padding: 20px;
  border: 3px solid #000;
  width: 90%;
  max-width: 500px;
  box-shadow: 4px 4px 0 #000;
  text-align: center;
}
.modal-content h3 { font-size: 12px; text-transform: uppercase; margin-bottom: 10px; }
.modal input, .modal textarea, .modal button {
  width: 90%;
  padding: 8px;
  margin-top: 8px;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
  border: 2px solid #000;
}
.modal button {
  background-color: #ff0033; color: #fff; cursor: pointer; text-transform: uppercase; box-shadow: 3px 3px 0 #000;
}
.modal button:hover { background-color: #cc0029; box-shadow: 1px 1px 0 #000; }
.close { color: #000; float: right; font-size: 20px; font-weight: bold; cursor: pointer; }
.close:hover { color: #f00; }

/* Mural */
.mural {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.msg-card {
  background: #fff;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 12px;
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
}
.msg-top { margin-bottom: 8px; border-bottom: 2px dashed #000; padding-bottom: 6px; }
.msg-nome { font-weight: bold; }
.msg-texto { margin-top: 6px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }

/* ===== Mobile-first melhorias ===== */

/* Imagens responsivas em TODO o site (fallback geral) */
img, video {
  max-width: 100%;
  height: auto;
}

/* Inputs amigáveis ao toque */
input, select, textarea, button {
  font-size: 16px;              /* evita zoom automático no iOS */
  line-height: 1.3;
}

/* Mantém "Comprar" pequeno */
.buy-button {
  padding: 8px 12px;
  min-height: auto;
  font-size: 9px;
}

/* Outros botões mais confortáveis no mobile */
.copy-btn,
.modal button,
#rsvpForm button {
  min-height: 44px;
  padding: 10px 14px;
}


/* Telas pequenas */
@media (max-width: 520px) {
  header {
    height: 160px;              /* reduz o header no mobile */
    padding-top: 28px;
  }
  header h1 { font-size: 1.7em; }
  header p  { font-size: 1em; }

  /* Conteúdo com respiro melhor */
  section {
    padding: 16px 14px;
  }

  /* Contador um pouco menor */
  .contador { font-size: 1.2em; }

  /* Grade de presentes mais fluida e cartões mais baixos */
  .gift-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px auto;
  }
  .gift-item {
    min-height: 280px;
    padding: 10px 8px;
  }
  .gift-item img {
    width: 140px;
    height: 140px;
  }
  .gift-item p { font-size: 11px; } /* ligeiro aumento p/ leitura */

  /* PIX card: compacto */
  .qr-card { max-width: 300px; padding: 12px; }
  #qrPixImg { width: 160px; }
  .qr-caption,
  .pix-key,
  .pix-key strong { font-size: 0.8rem; }

  /* Dicas (GIFs) menores lado a lado */
  .dicas-gifs img { width: 150px; }
}

/* Telas muito pequenas */
@media (max-width: 360px) {
  .gift-item { min-height: 260px; }
  .gift-item img { width: 128px; height: 128px; }
}

/* Nav fixa no topo (opcional – remova se não quiser “grudar”) */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Menos animação para quem prefere/precisa */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
