/* ── Before & After Contest — dramatic split-screen duotone ─────────
   Slate-grain BEFORE half, coral-energy AFTER half, headline
   straddling the divide thin/ultra-black, split bars on cards. */

:root {
  --slate: #4c525c;
  --slate-deep: #363b44;
  --coral: #ff5a3c;
  --coral-dark: #d83f24;
  --paper: #f7f5f2;
  --white: #ffffff;
  --ink: #23262c;
  --ink-soft: #7d828c;
  --line: #e5e2dc;
  --err: #d8402a;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Work Sans', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  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: 680px; margin: 0 auto; padding: 0 24px; }

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

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 60px 0 54px; color: var(--white); }

.hero-split {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, var(--slate-deep) 0%, var(--slate) 49.7%, var(--coral) 50.3%, var(--coral-dark) 100%);
}

/* grain on the before half */
.hero-split::after {
  content: '';
  position: absolute;
  inset: 0;
  right: 50%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1.2px);
  background-size: 5px 5px;
}

.hero-inner { position: relative; text-align: center; z-index: 1; }

.badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 7px 18px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 11vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0.02em;
}

.hero h1 .thin { font-weight: 200; opacity: 0.9; }
.hero h1 .slash { font-weight: 200; opacity: 0.55; }
.hero h1 .black { font-weight: 700; }

.hero .sub { margin-top: 16px; max-width: 480px; margin-left: auto; margin-right: auto; opacity: 0.92; font-weight: 500; }

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

/* ── Tabs ─────────────────────────────────────────────────────────── */
.tabs { display: flex; margin: 32px 0 22px; border-bottom: 3px solid var(--ink); }

.tab {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 13px 10px;
  background: transparent;
  color: var(--ink-soft);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab:hover { color: var(--ink); }

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

/* ── Cards / notes ────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 32px 26px 30px;
  margin-bottom: 18px;
}

/* split bar on top of cards */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--slate) 0 50%, var(--coral) 50% 100%);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.card-sub { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 20px; }

.note {
  margin: 18px 0;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 6px solid var(--coral);
  text-align: center;
}

/* ── Dropzone ─────────────────────────────────────────────────────── */
.drop {
  position: relative;
  border: 2px dashed var(--slate);
  background: var(--paper);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.drop:hover { border-color: var(--coral); }

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

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

.drop-split,
.empty-split {
  display: inline-flex;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
}

.drop-split span,
.empty-split span {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-split span:first-child, .empty-split span:first-child { background: var(--slate); }
.drop-split span:last-child, .empty-split span:last-child { background: var(--coral); }

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

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

.preview { width: 100%; max-height: 320px; object-fit: cover; display: block; }

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

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

label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--coral); }
input.error { border-color: var(--err); }
input::placeholder { color: var(--ink-soft); opacity: 0.7; }

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

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  line-height: 1.2;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.btn-primary { background: var(--coral); color: var(--white); }

.btn-primary:hover:not(:disabled) { background: var(--coral-dark); }

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1.5px solid currentColor;
  font-size: 0.82rem;
  padding: 11px 20px;
}

.btn-block { width: 100%; }

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

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

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

.my-photo {
  max-width: 300px;
  width: 100%;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.my-caption { color: var(--ink-soft); font-weight: 500; }

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

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

.gallery-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gallery-sub { color: var(--ink-soft); margin-top: 4px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.pet-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 0 0 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pet-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(35, 38, 44, 0.16); }

/* split bar */
.pet-card::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--slate) 0 50%, var(--coral) 50% 100%);
}

.pet-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
}

.pet-caption {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pet-author {
  font-family: var(--font-display);
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
  padding: 0 14px;
}

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

.vote-count { font-weight: 700; color: var(--coral); font-size: 0.9rem; }

.vote-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 18px;
  background: var(--ink);
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.vote-btn:hover:not(:disabled) { background: var(--coral); }
.vote-btn.is-voted { background: var(--line); color: var(--ink-soft); cursor: default; }

/* ── Empty / load more ────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--slate); }

.empty-sub { color: var(--ink-soft); margin: 6px 0 18px; }

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

/* ── Lightbox ─────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(35, 38, 44, 0.94);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lb-content {
  background: var(--white);
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}

.lb-img { width: 100%; max-height: 58vh; object-fit: contain; display: block; background: var(--paper); }

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

.lb-caption { font-weight: 600; line-height: 1.5; }

.lb-author {
  font-family: var(--font-display);
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}

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

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

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

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.6rem;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: var(--white);
  cursor: pointer;
  width: 52px;
  height: 52px;
  line-height: 1;
}

.lb-prev { left: 14px; }
.lb-next { right: 14px; }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  padding: 13px 24px;
  z-index: 200;
  box-shadow: 0 10px 26px rgba(35, 38, 44, 0.4);
}

.toast-ok { background: var(--coral); }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

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

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .lb-nav { display: none; }
}
