/* ── Pet of the Month — playful pet-park pastels ────────────────────
   Soft sky blue + sunny cream, paw-print confetti, rounded sans,
   polaroid gallery cards. Hand-coded. */

:root {
  --sky: #cfe8f7;
  --sky-deep: #7cc0e8;
  --cream: #fffaf0;
  --sun: #ffd166;
  --coral: #ff8b66;
  --coral-deep: #ef6a41;
  --mint: #7fd8b4;
  --ink: #274253;
  --ink-soft: #6c8697;
  --white: #ffffff;
  --err: #e05e5e;
  --font-display: 'Baloo 2', cursive;
  --font-body: 'Nunito Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--sky) 0%, var(--cream) 380px);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { position: relative; text-align: center; padding: 64px 0 44px; }

.paws {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  font-size: 1.1rem;
  letter-spacing: 1.4em;
  opacity: 0.5;
}

.badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--sun);
  border-radius: 999px;
  padding: 8px 22px;
  margin-bottom: 20px;
  box-shadow: 0 6px 16px rgba(255, 209, 102, 0.55);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.7rem, 9vw, 4.6rem);
  line-height: 1.02;
}

.hero h1 .wiggle {
  color: var(--coral-deep);
  display: inline-block;
  transform: rotate(-2deg);
}

.hero .sub {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--ink-soft);
  font-size: 1.06rem;
  font-weight: 600;
}

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* ── Tabs ─────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 6px 0 28px;
}

.tab {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink-soft);
  background: var(--white);
  border: 2px solid rgba(39, 66, 83, 0.12);
  border-radius: 999px;
  padding: 11px 30px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* ── Cards / form ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 24px;
  padding: 34px 30px;
  max-width: 580px;
  margin: 0 auto;
  box-shadow: 0 20px 50px rgba(39, 66, 83, 0.12);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  text-align: center;
}

.card-sub { text-align: center; color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; margin: 6px 0 24px; }

/* Drop zone */
.drop {
  position: relative;
  border: 3px dashed var(--sky-deep);
  border-radius: 18px;
  background: rgba(207, 232, 247, 0.25);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 18px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop:hover { border-color: var(--coral); background: rgba(255, 139, 102, 0.06); }

.drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.drop-inner { text-align: center; padding: 26px 16px; }

.drop-icon { font-size: 2.2rem; display: block; margin-bottom: 8px; }

.drop-text { font-weight: 700; }

.drop-hint { color: var(--ink-soft); font-size: 0.85rem; margin-top: 4px; }

.preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fields */
.field { margin-bottom: 16px; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }

@media (min-width: 540px) { .field-grid { grid-template-columns: 1fr 1fr; } }

label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; }

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid rgba(39, 66, 83, 0.14);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--sky-deep);
  box-shadow: 0 0 0 4px rgba(124, 192, 232, 0.25);
}

input::placeholder { color: var(--ink-soft); opacity: 0.6; }

input.error { border-color: var(--err); }

.form-error { color: var(--err); font-weight: 700; font-size: 0.9rem; text-align: center; margin-top: 14px; }

/* My entry */
.my-photo-wrap { text-align: center; margin-bottom: 20px; }

.my-photo {
  max-width: 260px;
  width: 100%;
  border-radius: 14px;
  border: 8px solid var(--white);
  box-shadow: 0 14px 34px rgba(39, 66, 83, 0.2);
  transform: rotate(-2deg);
}

.my-caption { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-top: 14px; }

.share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Notes */
.note {
  max-width: 580px;
  margin: 20px auto;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.2);
  border: 2px solid rgba(255, 209, 102, 0.7);
  font-weight: 600;
  text-align: center;
}

/* ── Gallery ──────────────────────────────────────────────────────── */
.gallery-head { text-align: center; margin-bottom: 24px; }

.gallery-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; }

.gallery-sub { color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
}

.pet-card {
  background: var(--white);
  border-radius: 6px;
  padding: 10px 10px 14px;
  box-shadow: 0 10px 26px rgba(39, 66, 83, 0.13);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.pet-card:nth-child(3n) { transform: rotate(0.8deg); }
.pet-card:nth-child(3n+1) { transform: rotate(-0.8deg); }

.pet-card:hover { transform: translateY(-4px) rotate(0deg); box-shadow: 0 18px 40px rgba(39, 66, 83, 0.2); }

.pet-card::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 74px;
  height: 20px;
  background: rgba(255, 209, 102, 0.65);
  border-radius: 2px;
}

.pet-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  background: var(--sky);
}

.pet-caption {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-author { color: var(--ink-soft); font-size: 0.78rem; font-weight: 600; }

.pet-votes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 8px;
}

.vote-count { font-weight: 800; font-size: 0.85rem; color: var(--coral-deep); }

.vote-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--white);
  background: var(--coral);
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.vote-btn:hover { transform: scale(1.05); filter: brightness(1.05); }

.vote-btn.is-voted {
  background: var(--mint);
  cursor: default;
  transform: none;
}

/* Empty state */
.empty { text-align: center; padding: 60px 20px; }

.empty-icon { font-size: 3rem; display: block; margin-bottom: 12px; }

.empty p { font-size: 1.1rem; font-weight: 700; }

.empty-sub { color: var(--ink-soft); font-weight: 600; font-size: 0.95rem !important; margin: 6px 0 20px; }

.load-wrap { text-align: center; margin-top: 30px; }

/* ── Lightbox ─────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(39, 66, 83, 0.9);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lb-content {
  background: var(--white);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lb-img { width: 100%; max-height: 56vh; object-fit: contain; background: var(--cream); }

.lb-meta { padding: 18px 22px 22px; }

.lb-caption { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }

.lb-author { color: var(--ink-soft); font-weight: 600; font-size: 0.85rem; margin-top: 2px; }

.lb-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }

.lb-votes { font-weight: 800; color: var(--coral-deep); }

.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  line-height: 1;
}

.lb-nav {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--white);
  font-size: 2.2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0 10px;
  transition: background 0.15s ease;
}

.lb-nav:hover { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 640px) {
  .lb-nav { position: absolute; bottom: 18px; top: auto; }
  .lb-prev { left: 22%; }
  .lb-next { right: 22%; }
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 30px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  line-height: 1.25;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(120deg, var(--coral), var(--coral-deep));
  color: var(--white);
  box-shadow: 0 12px 28px rgba(239, 106, 65, 0.4);
}

.btn-ghost {
  background: var(--white);
  color: var(--ink);
  border: 2px solid rgba(39, 66, 83, 0.16);
}

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--err);
  color: #fff;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 300;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  max-width: 92vw;
  text-align: center;
}

.toast.toast-ok { background: var(--mint); color: var(--ink); }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 20px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  border-top: 2px dashed rgba(39, 66, 83, 0.15);
}

#wbx-powered-by-slot { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
