/* ============================================================================
   POLONI MÓVEIS — tema visual (paleta, tipografia, componentes)
   Ver README.md para a tabela de conversão OKLCH <-> hex.
   ============================================================================ */

[data-theme="poloni"] {
  color-scheme: dark;
  --p: 66.28% 0.0908 80.47;
  --pc: 19.05% 0.0089 59.08;
  --s: 49.82% 0.0458 136.15;
  --sc: 95.28% 0.0127 86.83;
  --n: 23.71% 0.0142 81.61;
  --nc: 92.66% 0.0202 84.59;
  --b1: 17.98% 0.0094 75.03;
  --b2: 21.16% 0.0130 77.93;
  --b3: 24.80% 0.0157 71.30;
  --bc: 91.15% 0.0202 84.59;

  --hex-p: #b08d4f;
  --hex-pc: #171310;
  --hex-s: #57694f;
  --hex-sc: #f3efe6;
  --hex-n: #221e17;
  --hex-nc: #ede6d8;
  --hex-b1: #14110d;
  --hex-b2: #1c1812;
  --hex-b3: #262019;
  --hex-bc: #e8e1d3;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--hex-b1);
}

.font-display { font-family: 'Playfair Display', serif; }

h1, h2, h3, .font-display { text-wrap: balance; }

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hex-p);
}

.brass-rule {
  width: 3rem;
  height: 1px;
  background: linear-gradient(90deg, var(--hex-p), transparent);
  transition: width 0.4s ease;
}
.card-precision:hover .brass-rule { width: 5rem; }

.blueprint-texture {
  background-image: radial-gradient(circle at 1px 1px, rgba(232, 225, 211, 0.06) 1px, transparent 0);
  background-size: 28px 28px;
}

.card-precision { border-radius: 2px; }

.btn-brass {
  background-color: var(--hex-p);
  color: var(--hex-pc);
  border: none;
  border-radius: 2px;
}
.btn-brass:hover { background-color: color-mix(in srgb, var(--hex-p) 85%, black); }

.btn-outline-brass {
  background-color: transparent;
  border-radius: 2px;
  border-color: rgba(232, 225, 211, 0.3);
  color: var(--hex-bc);
}
.btn-outline-brass:hover {
  background-color: rgba(232, 225, 211, 0.1);
  border-color: rgba(232, 225, 211, 0.45);
}

.nav-cta-desktop { display: none; }
@media (min-width: 640px) {
  .nav-cta-desktop { display: inline-flex; }
}

.hero-overlay {
  background: linear-gradient(180deg, rgba(20, 17, 13, 0.55) 0%, rgba(20, 17, 13, 0.75) 55%, rgba(20, 17, 13, 0.96) 100%);
}

.gallery-overlay {
  background: linear-gradient(0deg, rgba(20, 17, 13, 0.92) 0%, rgba(20, 17, 13, 0.15) 60%, transparent 100%);
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--hex-p);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ============================================================================
   LOGOMARCA REAL (arquivo em assets/img/logo.jpg)
   ============================================================================ */
.brand-logo {
  max-height: 7rem;
  max-width: 340px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.brand-logo--painel { max-height: 3rem; max-width: 260px; }

@media (max-width: 480px) {
  .brand-logo { max-height: 3rem; max-width: 230px; }
}

/* Se o .jpg tiver fundo BRANCO SÓLIDO, adicione a classe "brand-logo-blend"
   junto de "brand-logo" no HTML (nos 3 arquivos: navbar.php, painel/index.php
   e no <img> da #watermark-logo em index.php) para disfarçar o retângulo
   branco sobre o fundo escuro do site. Só funciona bem se o fundo for
   branco puro — para outra cor sólida, o certo é pedir uma versão com
   fundo transparente (PNG/WEBP) ao designer.
*/
.brand-logo-blend {
  mix-blend-mode: multiply;
}

/* Marca d'água do logotipo */
#watermark-logo {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.25;
}
#watermark-logo img {
  max-width: min(60vw, 60vh);
  max-height: min(60vw, 60vh);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Modo de Edição (CRUD visual de textos, títulos e imagens) */
body.edit-mode [data-editable="text"] {
  outline: 1px dashed rgba(176, 141, 79, 0.55);
  outline-offset: 4px;
  cursor: text;
  border-radius: 2px;
}
body.edit-mode [data-editable="text"]:hover { background: rgba(176, 141, 79, 0.06); }
body.edit-mode [data-editable="text"]:focus {
  outline: 1.5px solid var(--hex-p);
  background: rgba(176, 141, 79, 0.1);
}

.editable-item { position: relative; }

.item-delete-btn {
  display: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 25;
  width: 1.85rem;
  height: 1.85rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(20, 17, 13, 0.85);
  border: 1px solid rgba(232, 225, 211, 0.35);
  color: var(--hex-bc);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.item-delete-btn:hover { border-color: #c0392b; color: #e57368; }
body.edit-mode .item-delete-btn { display: flex; }

.image-edit-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 15;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(20, 17, 13, 0.55);
  color: var(--hex-bc);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
body.edit-mode .image-edit-overlay { display: flex; }

.add-tile {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.6rem;
  border: 1px dashed rgba(232, 225, 211, 0.3);
  color: rgba(232, 225, 211, 0.55);
  cursor: pointer;
  min-height: 220px;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  padding: 1rem;
}
body.edit-mode .add-tile { display: flex; }
.add-tile:hover { border-color: var(--hex-p); color: var(--hex-p); }

#edit-mode-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
body.edit-mode #edit-mode-toggle {
  background-color: var(--hex-s);
  color: var(--hex-sc);
}

/* Badge de "assistir no Instagram" sobre a miniatura do projeto */
.instagram-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 20;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(20, 17, 13, 0.7);
  border: 1px solid rgba(232, 225, 211, 0.35);
  color: var(--hex-bc);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.instagram-badge svg { width: 1.1rem; height: 1.1rem; margin-left: 2px; }


.instagram-badge:hover {
  background: var(--hex-p);
  color: var(--hex-pc);
  transform: scale(1.08);
}

/* Badge de "ampliar imagem" — mesmo visual do badge do Instagram, usado quando não há vídeo vinculado */
.zoom-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 20;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(20, 17, 13, 0.7);
  border: 1px solid rgba(232, 225, 211, 0.35);
  color: var(--hex-bc);
  cursor: zoom-in;
  transition: background 0.2s ease, transform 0.2s ease;
}
.zoom-badge svg { width: 1.1rem; height: 1.1rem; }
.zoom-badge:hover {
  background: var(--hex-p);
  color: var(--hex-pc);
  transform: scale(1.08);
}

#architect-dashboard {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background-color: var(--hex-b1);
}

/* Toast simples de feedback (salvo / erro) */
#poloni-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translate(-50%, 1rem);
  z-index: 200;
  background: var(--hex-n);
  color: var(--hex-bc);
  border: 1px solid rgba(232,225,211,0.15);
  padding: 0.7rem 1.2rem;
  border-radius: 2px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#poloni-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#poloni-toast.error { border-color: rgba(224, 90, 90, 0.5); color: #f2b8b8; }
