/* ── Office Pet of the Month — corporate badge-board parody ─────────
   Office white, cubicle-gray band, employee ID badge cards with
   navy headers and lanyard clips, manila folder tab, sticky-note
   votes, red APPROVED stamp. */

:root {
  --office: #f7f8fa;
  --cubicle: #d8dce2;
  --navy: #1f3a63;
  --navy-deep: #152a4a;
  --sticky: #ffe66b;
  --sticky-deep: #e8c93d;
  --badge: #ffffff;
  --manila: #f0dfb2;
  --ink: #26303c;
  --ink-soft: #7b8593;
  --line: #e2e6ec;
  --red-stamp: #c73434;
  --err: #c73434;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

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

.hidden { display: none !important; }

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

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

.mono { font-family: var(--font-mono); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.cubicle-band {
  height: 40px;
  background:
    repeating-linear-gradient(90deg, transparent 0 90px, rgba(38, 48, 60, 0.08) 90px 92px),
    var(--cubicle);
  border-bottom: 1px solid #c3c9d2;
}

.hero { text-align: center; padding-bottom: 8px; }

.hero-inner { position: relative; padding-top: 40px; }

.memo-line {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.hero h1 {
  font-weight: 700;
  font-size: clamp(2.3rem, 9vw, 3.5rem);
  line-height: 1.05;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.hero .sub { margin-top: 14px; color: var(--ink-soft); max-width: 500px; margin-left: auto; margin-right: auto; }

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

.stamp-approved {
  position: absolute;
  top: 28px;
  right: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.18em;
  color: var(--red-stamp);
  border: 3px solid var(--red-stamp);
  border-radius: 6px;
  padding: 4px 12px;
  transform: rotate(9deg);
  opacity: 0.75;
  mix-blend-mode: multiply;
}

/* ── Tabs ─────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 8px; margin: 30px 0 22px; }

.tab {
  flex: 1;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 10px;
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.tab.is-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ── Cards / notes ────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--badge);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px 26px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(31, 58, 99, 0.08);
}

.card.folder {
  background: linear-gradient(180deg, #fbf3dd, var(--manila));
  border-color: #ddc98f;
  margin-top: 24px;
}

.folder-tab {
  position: absolute;
  top: -24px;
  left: 22px;
  background: var(--manila);
  border: 1px solid #ddc98f;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 4px 16px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #8a7539;
}

.card h2 { font-weight: 700; font-size: 1.4rem; color: var(--navy); margin-bottom: 6px; }

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

.note {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy);
  text-align: center;
}

/* ── Dropzone ─────────────────────────────────────────────────────── */
.drop {
  position: relative;
  border: 2px dashed var(--navy);
  border-radius: 8px;
  background: rgba(31, 58, 99, 0.04);
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  overflow: hidden;
  transition: background 0.15s ease;
}

.drop:hover { background: rgba(31, 58, 99, 0.08); }

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

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

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

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

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

.preview { width: 100%; max-height: 300px; 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-mono);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--ink);
}

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

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

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

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 28px;
  border: none;
  border-radius: 6px;
  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(--sticky); outline-offset: 2px; }

.btn-primary { background: var(--navy); color: #fff; }

.btn-primary:hover:not(:disabled) { background: var(--navy-deep); }

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-size: 0.88rem;
  padding: 11px 20px;
}

.btn-ghost:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }

.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: #fff;
  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: 220px;
  width: 100%;
  border: 1px solid var(--line);
  border-top: 14px solid var(--navy);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 58, 99, 0.18);
  margin-bottom: 12px;
}

.my-caption { font-weight: 600; color: var(--navy); }

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

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

.gallery-head h2 { font-weight: 700; font-size: 1.6rem; color: var(--navy); }

.gallery-sub { color: var(--ink-soft); font-size: 0.78rem; margin-top: 4px; letter-spacing: 0.08em; }

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

.badge-card {
  position: relative;
  background: var(--badge);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(31, 58, 99, 0.1);
  margin-top: 12px;
}

.badge-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(31, 58, 99, 0.18); }

/* lanyard clip */
.badge-card::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 16px;
  background: #aeb6c2;
  border-radius: 4px 4px 8px 8px;
  box-shadow: inset 0 -3px 0 rgba(38, 48, 60, 0.25);
  z-index: 2;
}

.badge-head {
  background: var(--navy);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-align: center;
  padding: 8px 6px 6px;
  border-radius: 9px 9px 0 0;
}

.badge-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.badge-body { padding: 12px 14px 14px; }

.badge-name {
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-title {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge-handler {
  font-family: var(--font-mono);
  color: var(--ink-soft);
  font-size: 0.68rem;
  margin-top: 6px;
  letter-spacing: 0.05em;
}

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

.vote-count {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.8rem;
  background: var(--sticky);
  padding: 4px 10px;
  border-radius: 2px;
  box-shadow: 1px 2px 3px rgba(38, 48, 60, 0.18);
  transform: rotate(-2deg);
}

.vote-count:empty { visibility: hidden; }

.vote-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 16px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

/* ── Empty / load more ────────────────────────────────────────────── */
.empty { text-align: center; padding: 44px 20px; background: #fff; border: 1px dashed var(--cubicle); border-radius: 8px; }

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

.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(38, 48, 60, 0.9);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lb-content {
  background: #fff;
  border-radius: 10px;
  border-top: 16px solid var(--navy);
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}

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

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

.lb-caption { font-weight: 700; color: var(--navy); line-height: 1.45; }

.lb-author { color: var(--ink-soft); font-size: 0.74rem; margin-top: 6px; letter-spacing: 0.05em; }

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

.lb-votes { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }

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

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

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

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 6px;
  z-index: 200;
  box-shadow: 0 10px 26px rgba(31, 58, 99, 0.4);
}

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

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

#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; }
  .stamp-approved { position: static; display: inline-block; margin-top: 18px; }
}
