/* ── Signature Dish Contest — bistro chalkboard menu ────────────────
   Charcoal-green chalkboard with smudges, hand-lettered chalk
   headline, menu-entry cards with dot leaders, cafe awning strip. */

:root {
  --board: #2c3a33;
  --board-deep: #222d28;
  --chalk: #f2efe6;
  --chalk-dim: #b9c2ba;
  --butter: #f0c75e;
  --butter-deep: #d4a838;
  --tomato-red: #cf5c48;
  --card: #33443c;
  --line: rgba(242, 239, 230, 0.18);
  --err: #ff8a75;
  --font-chalk: 'Kalam', cursive;
  --font-body: 'Poppins', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(75% 45% at 25% 12%, rgba(242, 239, 230, 0.05), transparent 60%),
    radial-gradient(60% 40% at 80% 70%, rgba(242, 239, 230, 0.04), transparent 60%),
    linear-gradient(180deg, var(--board) 0%, var(--board-deep) 100%);
  background-attachment: fixed;
  color: var(--chalk);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

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

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

/* ── Awning ───────────────────────────────────────────────────────── */
.awning {
  height: 30px;
  background: repeating-linear-gradient(90deg, var(--tomato-red) 0 46px, var(--chalk) 46px 92px);
  -webkit-mask-image: radial-gradient(circle 23px at 23px 6px, #000 98%, transparent), linear-gradient(#000 0 14px, transparent 14px);
  mask-image: radial-gradient(circle 23px at 23px 6px, #000 98%, transparent), linear-gradient(#000 0 14px, transparent 14px);
  -webkit-mask-size: 46px 100%, 100% 100%;
  mask-size: 46px 100%, 100% 100%;
  -webkit-mask-position: 0 14px, 0 0;
  mask-position: 0 14px, 0 0;
  -webkit-mask-repeat: repeat-x, no-repeat;
  mask-repeat: repeat-x, no-repeat;
}

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

.hero-inner { position: relative; }

.chef-hat { font-size: 2rem; display: block; margin-bottom: 6px; }

.kicker {
  font-family: var(--font-chalk);
  font-size: 1.25rem;
  color: var(--butter);
  transform: rotate(-1.5deg);
  display: inline-block;
}

.hero h1 {
  font-family: var(--font-chalk);
  font-weight: 700;
  font-size: clamp(2.4rem, 10vw, 3.7rem);
  line-height: 1.05;
  color: var(--chalk);
  text-shadow: 0 0 14px rgba(242, 239, 230, 0.25);
}

.chalk-underline {
  display: block;
  width: 200px;
  height: 8px;
  margin: 10px auto 0;
  background:
    linear-gradient(90deg, transparent, var(--butter) 12%, var(--butter) 88%, transparent) 0 0 / 100% 3px no-repeat,
    linear-gradient(90deg, transparent, var(--chalk-dim) 20%, var(--chalk-dim) 80%, transparent) 8px 6px / 90% 2px no-repeat;
}

.hero .sub { margin-top: 14px; color: var(--chalk-dim); max-width: 440px; margin-left: auto; margin-right: auto; }

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

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

.tab {
  flex: 1;
  font-family: var(--font-chalk);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 12px 10px;
  background: transparent;
  color: var(--chalk-dim);
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.tab.is-active {
  background: rgba(242, 239, 230, 0.08);
  color: var(--butter);
  border: 1.5px solid var(--butter);
}

/* ── Cards / notes ────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 30px 26px;
  margin-bottom: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.card h2 {
  font-family: var(--font-chalk);
  font-weight: 700;
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 6px;
  color: var(--chalk);
}

.card-sub { color: var(--chalk-dim); font-size: 0.92rem; margin-bottom: 20px; text-align: center; }

.note {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--card);
  border: 1.5px dashed var(--butter);
  text-align: center;
}

/* ── Dropzone ─────────────────────────────────────────────────────── */
.drop {
  position: relative;
  border: 2px dashed var(--butter);
  border-radius: 10px;
  background: rgba(240, 199, 94, 0.06);
  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(240, 199, 94, 0.12); }

.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: 500; }

.drop-hint { color: var(--chalk-dim); font-size: 0.85rem; 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-chalk);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--butter);
}

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

input:focus { outline: none; border-color: var(--butter); }
input.error { border-color: var(--err); }
input::placeholder { color: var(--chalk-dim); 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: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s 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(--butter); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(120deg, var(--butter), var(--butter-deep));
  color: var(--board-deep);
  box-shadow: 0 8px 22px rgba(240, 199, 94, 0.35);
}

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

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

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(34, 45, 40, 0.3);
  border-top-color: var(--board-deep);
  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: 240px;
  width: 100%;
  border: 5px solid var(--chalk);
  border-radius: 4px;
  transform: rotate(-1.5deg);
  margin-bottom: 12px;
}

.my-caption { font-family: var(--font-chalk); font-size: 1.3rem; color: var(--butter); }

.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-chalk); font-weight: 700; font-size: 2rem; }

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

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

.dish-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dish-card:hover { transform: translateY(-4px); border-color: var(--butter); }

.dish-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border: 4px solid var(--chalk);
  border-radius: 4px;
  margin-bottom: 10px;
}

.dish-name {
  font-family: var(--font-chalk);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--butter);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* dot leader under the name, like a menu */
.dish-name::after {
  content: '';
  display: block;
  margin-top: 3px;
  border-bottom: 2px dotted rgba(242, 239, 230, 0.35);
}

.dish-secret {
  font-size: 0.84rem;
  color: var(--chalk-dim);
  line-height: 1.45;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-author { font-family: var(--font-chalk); color: var(--chalk-dim); font-size: 0.92rem; margin-top: 4px; }

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

.vote-count { font-weight: 600; color: var(--butter); font-size: 0.88rem; }

.vote-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 18px;
  background: var(--tomato-red);
  color: var(--chalk);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.vote-btn:hover:not(:disabled) { filter: brightness(1.12); }
.vote-btn.is-voted { background: rgba(242, 239, 230, 0.14); color: var(--chalk-dim); cursor: default; }

/* ── Empty / load more ────────────────────────────────────────────── */
.empty { text-align: center; padding: 44px 20px; border: 2px dashed var(--line); border-radius: 10px; }

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

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

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

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

.lb-content {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  max-width: 540px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}

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

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

.lb-caption { font-family: var(--font-chalk); font-weight: 700; font-size: 1.15rem; color: var(--butter); line-height: 1.4; }

.lb-author { color: var(--chalk-dim); font-size: 0.88rem; margin-top: 6px; }

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

.lb-votes { font-weight: 600; color: var(--butter); }

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

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.6rem;
  background: rgba(242, 239, 230, 0.1);
  border: none;
  color: var(--chalk);
  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(--chalk);
  color: var(--board-deep);
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 999px;
  z-index: 200;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

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

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: var(--chalk-dim);
  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; }
}
