/*
Theme Name: Moldura Delegada Sato
Theme URI: https://borabueno.com.br
Author: Rafael
Description: Tema de página única para gerar moldura de campanha na foto de perfil (Delegada Sato, 15515). O visitante envia a própria foto, ajusta enquadramento e zoom, e baixa a imagem final já quadrada com a moldura fixa da campanha.
Version: 1.2
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: moldura-sato
*/

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body.moldura-sato-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #1E6FD9 0%, #0B4FA8 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.moldura-wrap {
  width: 100%;
  max-width: 420px;
}

.moldura-header {
  text-align: center;
  margin-bottom: 24px;
}

.moldura-eyebrow {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  margin: 0 0 6px;
}

.moldura-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin: 0;
}

.moldura-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin: 8px 0 0;
  line-height: 1.5;
}

.moldura-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.moldura-stage {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: #EDE8E0;
  user-select: none;
  touch-action: none;
  cursor: pointer;
  margin: 0 auto;
}

.moldura-stage.has-photo {
  cursor: grab;
}

.moldura-stage.dragging {
  cursor: grabbing;
}

.moldura-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 0 32px;
  color: #8A6E5A;
  font-size: 13px;
}

.moldura-placeholder svg {
  width: 26px;
  height: 26px;
}

.moldura-placeholder small {
  color: #A69B8C;
  font-size: 11px;
}

.moldura-photo {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  transform-origin: center center;
  pointer-events: none;
}

.moldura-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.moldura-controls {
  width: 100%;
  max-width: 320px;
  margin-top: 18px;
  display: none;
}

.moldura-controls.active {
  display: block;
}

.moldura-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.moldura-zoom-row svg {
  width: 18px;
  height: 18px;
  color: #0B4FA8;
  flex-shrink: 0;
}

.moldura-zoom-row input[type="range"] {
  width: 100%;
  accent-color: #0B4FA8;
}

.moldura-hint {
  font-size: 11px;
  color: #A69B8C;
  text-align: center;
  margin: 10px 0 0;
}

.moldura-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
}

.moldura-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.moldura-link-btn.primary {
  color: #0B4FA8;
  font-weight: 700;
}

.moldura-link-btn.secondary {
  color: #8A6E5A;
}

.moldura-link-btn svg {
  width: 13px;
  height: 13px;
}

.moldura-download {
  width: 100%;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0B4FA8;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(11, 79, 168, 0.35);
  transition: background 0.15s ease, transform 0.1s ease;
}

.moldura-download:hover:not(:disabled) {
  background: #0A4694;
}

.moldura-download:active:not(:disabled) {
  transform: scale(0.98);
}

.moldura-download:disabled {
  background: rgba(11, 79, 168, 0.25);
  cursor: not-allowed;
  box-shadow: none;
}

.moldura-download svg {
  width: 18px;
  height: 18px;
}

.moldura-ios-hint {
  max-width: 320px;
  margin: 14px auto 0;
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  line-height: 1.5;
}

.moldura-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.moldura-footer a {
  color: #fff;
  text-decoration: underline;
}

#moldura-file-input {
  display: none;
}

@media (max-width: 380px) {
  .moldura-title {
    font-size: 22px;
  }
  .moldura-card {
    padding: 16px;
  }
}
