/* The Flamingo Files — pink, white, flamingos. */

:root {
  --bg: #fff5f8;
  --bg-card: #ffffff;
  --bg-inset: #fff0f5;
  --pink: #e5487f;
  --pink-hot: #c81e5b;
  --pink-soft: #ffd3e2;
  --text: #2a1620;
  --text-dim: #8a6b78;
  --border: rgba(229, 72, 127, 0.24);
  --shadow: 0 2px 10px rgba(200, 30, 91, 0.08);
  --radius: 14px;
  --hero-image: url("/img/hero-flamingo.svg");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--pink-hot); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.hidden { display: none !important; }

/* --- Banner --- */

.hero {
  /* Three layers: the flamingo art at its natural aspect (height-fit, centered),
     then a bench band and the same sky gradient the SVG uses, both stretching
     to any width. On screens wider than the art, the scene extends seamlessly
     instead of `cover` scaling up and cropping the flamingo's head off —
     max-height caps the band, so cover could never respect the aspect ratio. */
  background-image:
    var(--hero-image),
    linear-gradient(to bottom, rgba(122, 59, 82, 0) 78.5%, rgba(122, 59, 82, 0.18) 78.5%),
    linear-gradient(to bottom, #fff0f6 0%, #ffdcea 60%, #ffc9de 100%);
  background-size: auto 100%, 100% 100%, 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  /* NOT aspect-ratio + max-height: when the max-height clamps, CSS transfers
     it back through the ratio and shrinks the element's WIDTH, leaving the
     banner 971px wide and left-aligned on wide screens. A viewport-based
     height keeps the art's 1200:420 shape up to the cap instead. */
  width: 100%;
  height: min(35vw, 340px);
  border-bottom: 4px solid var(--pink);
  /* The hero is an <a> back to the home page — logo behavior. */
  display: block;
}
.hero:focus-visible { outline: 3px solid var(--pink-hot); outline-offset: -3px; }
/* An uploaded banner photo replaces all three layers and crops like a photo. */
.hero.hero-photo {
  background-size: cover;
}

.masthead {
  text-align: center;
  padding: 22px 20px 8px;
}
.masthead h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 52px);
  letter-spacing: -0.02em;
  color: var(--pink-hot);
}
.masthead p {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 15px;
}

/* --- Judge grid --- */

.judge-grid {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  /* Fixed 3x2 (2x3 on phones): auto-fit would wrap six judges 5+1 on wide
     screens, and an orphan row reads as a mistake. */
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 20px;
}
@media (max-width: 700px) {
  .judge-grid { grid-template-columns: repeat(2, 1fr); }
}
.judge-grid a {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  padding: 8px;
}
.judge-grid a:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.judge-grid img {
  width: 100%;
  max-width: 190px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow);
  background: var(--pink-soft);
  transition: transform 0.15s ease;
}
.judge-grid a:hover img { transform: translateY(-3px) scale(1.02); }
.judge-grid .name {
  display: block;
  margin-top: 12px;
  font-size: 21px;
  font-weight: 700;
  color: var(--pink-hot);
}
.judge-grid .role {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
}

/* --- Cards --- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 22px 0;
}
.card h2 { margin: 0 0 14px; font-size: 22px; color: var(--pink-hot); }
.card h3 { margin: 22px 0 8px; font-size: 17px; }

.section-note { color: var(--text-dim); font-size: 14px; margin: 0 0 14px; }

/* --- Judge detail header --- */

.judge-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 26px 0 6px;
}
.judge-head img {
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow);
  background: var(--pink-soft);
}
.judge-head h1 { margin: 0; font-size: clamp(26px, 6vw, 40px); color: var(--pink-hot); }
.judge-head p { margin: 2px 0 0; color: var(--text-dim); }

/* --- Gallery strip --- */

.gallery-wrap { position: relative; }
.gallery {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.gallery figure {
  margin: 0;
  flex: 0 0 auto; /* never shrink — this is what keeps it a single row */
  scroll-snap-align: start;
}
.gallery img {
  height: 220px;
  width: auto;
  max-width: 340px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  border: 2px solid var(--pink-soft);
  background: var(--bg-inset);
  cursor: zoom-in;
}
.gallery figcaption {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 340px;
  margin-top: 5px;
}
.scroll-btn {
  position: absolute;
  top: 96px;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  color: var(--pink-hot);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.scroll-btn.prev { left: -6px; }
.scroll-btn.next { right: -6px; }
@media (hover: none) { .scroll-btn { display: none; } }

/* --- Bribe menu --- */

.bribe-menu { margin: 0; }
.bribe-menu div {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.bribe-menu div:last-child { border-bottom: 0; }
.bribe-menu dt {
  flex: 0 0 38%;
  font-weight: 700;
  color: var(--pink-hot);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bribe-menu dd { margin: 0; flex: 1; }

.bio { white-space: pre-wrap; margin: 0; }

/* --- Q&A --- */

.qa { list-style: none; padding: 0; margin: 0; }
.qa li {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.qa li:first-child { border-top: 0; }
.qa .q { margin: 0; font-weight: 600; }
.qa .q::before { content: "Q: "; color: var(--pink); }
.qa .a { margin: 8px 0 0; white-space: pre-wrap; }
.qa .a::before { content: "A: "; color: var(--pink); font-weight: 600; }
.qa .who { display: block; margin-top: 8px; font-size: 13px; color: var(--text-dim); }

/* --- Forms --- */

label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 5px; }
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--pink);
  outline-offset: 0;
  background: #fff;
}
textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 13px; color: var(--text-dim); margin: 5px 0 0; font-weight: 400; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }

.btn {
  display: inline-block;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--pink);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover { background: var(--pink-hot); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-secondary { background: var(--bg-inset); color: var(--pink-hot); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--pink-soft); }
.btn-danger { background: #b3244c; }
.btn-small { padding: 7px 14px; font-size: 14px; }

/* Honeypot: parked far off-screen rather than display:none — the slightly
   smarter bots skip fields that are display:none. */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.msg { margin: 14px 0 0; padding: 11px 14px; border-radius: 10px; font-size: 15px; }
.msg.ok { background: #e6f6ec; color: #1d6b3a; }
.msg.err { background: #fdeaef; color: #a01639; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--pink-hot);
  font-size: 12px;
  font-weight: 700;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.tabs button {
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--pink); color: #fff; border-color: var(--pink); }

/* --- Lightbox --- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(42, 22, 32, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.lightbox img {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.lightbox .lb-caption {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 14px;
  padding: 0 20px;
}
.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 12px; }
.lightbox .lb-next { right: 12px; }

/* --- Footer / misc --- */

footer {
  text-align: center;
  padding: 26px 20px 40px;
  color: var(--text-dim);
  font-size: 13px;
}
footer a { color: var(--text-dim); }

.back-link { display: inline-block; margin-top: 22px; font-size: 14px; text-decoration: none; }

.manage-photo {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.manage-photo img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.manage-photo .grow { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
