/* Con-quack-ulations Gallery - visual redesign, 2026-08-02.
   Matched to the actual printed kit insert card (warm sand-to-gold
   gradient, the same navy ink as its "CON-QUACK-ULATIONS" headline),
   not an invented palette - see project memory for the reference photo.
   Applies across every page (gallery, upload, admin) for consistency. */

@font-face { font-family: 'Fredoka'; src: url('/fonts/Fredoka-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/fonts/WorkSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/fonts/WorkSans-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --sand-1: #FBF1D9;
  --sand-2: #EFCE8E;
  --wave: #A9C4CB;
  --navy: #27455C;
  --navy-soft: #3C5C74;
  --sun: #F2A93B;
  --sun-dark: #D6901F;
  --muted: #6F7F8B;
  --card: #FFFFFF;
  --line: #E4CFA0;
  --danger-bg: #FBE7E4;
  --danger-text: #8A3B2E;
  --success-bg: #E4F2E1;
  --success-text: #2E5C2A;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(180deg, var(--sand-1) 0%, var(--sand-2) 100%);
  background-attachment: fixed;
  color: var(--navy);
  font-family: 'Work Sans', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px 72px; }
.wrap-narrow { max-width: 440px; margin: 0 auto; padding: 60px 20px 72px; }

a { color: var(--navy); }

/* ---------- header / masthead ---------- */
header.site-header { text-align: center; padding: 52px 20px 40px; }
header.site-header .mark { width: 64px; height: 64px; margin: 0 auto 18px; }
header.site-header .mark svg { width: 100%; height: 100%; }
header.site-header h1 {
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  font-size: clamp(30px, 5.5vw, 46px); color: var(--navy);
  margin: 0; text-wrap: balance; letter-spacing: -0.01em;
}
header.site-header p {
  font-size: 16px; color: var(--navy-soft); max-width: 460px;
  margin: 14px auto 0; line-height: 1.6;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px;
  font-family: 'Work Sans', sans-serif; font-weight: 600; font-size: 15px;
  border-radius: 999px; text-decoration: none; border: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--sun); color: #4a2f04;
  box-shadow: 0 8px 20px -6px rgba(242,169,59,0.55);
}
.btn-primary:hover { box-shadow: 0 10px 24px -6px rgba(242,169,59,0.65); }
.btn-secondary {
  background: #fff; color: var(--navy); border: 1.5px solid var(--line);
}
.btn-danger { background: #E15C4A; color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---------- section label ---------- */
.wave-divider { display: block; width: 100%; height: 34px; margin-bottom: 6px; }
.section-label {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--navy-soft); text-align: center; margin: 0 0 22px;
  display: flex; align-items: center; gap: 12px;
}
.section-label::before, .section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- gallery grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}
.duck-card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px -14px rgba(39,69,92,0.22);
  border: 1px solid rgba(39,69,92,0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.duck-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -14px rgba(39,69,92,0.3); }
.duck-card .photo-wrap { position: relative; aspect-ratio: 1; background: #f2ead6; }
.duck-card .photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.duck-card .ship-tag {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(255,255,255,0.94); color: var(--navy);
  font-size: 11px; font-weight: 600; padding: 5px 11px;
  border-radius: 999px; letter-spacing: 0.01em;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.duck-card .body { padding: 16px 17px 18px; }
.duck-card h3 {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 20px;
  color: var(--navy); margin: 0 0 6px; text-wrap: balance;
}
.duck-card .meta { font-size: 13px; color: var(--muted); line-height: 1.5; }
.duck-card .meta b { color: var(--navy-soft); font-weight: 600; }
.empty-note { text-align: center; color: var(--navy-soft); padding: 20px; }

/* ---------- click-to-enlarge lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(39,69,92,0.7); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }

/* ---------- forms (upload + admin login) ---------- */
.form-card {
  background: var(--card); border-radius: 18px; padding: 30px 28px;
  box-shadow: 0 14px 34px -18px rgba(39,69,92,0.28);
  border: 1px solid rgba(39,69,92,0.06);
}
.form-card h1 {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 28px;
  color: var(--navy); margin: 0 0 8px; text-align: center;
}
.form-card .sub { text-align: center; color: var(--navy-soft); font-size: 14px; margin: 0 0 26px; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 600; color: var(--navy);
  margin-bottom: 7px;
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
input[type="text"], input[type="password"], input[type="file"], input[type="number"] {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fffdf8;
  font-family: 'Work Sans', sans-serif; font-size: 15px; color: var(--navy);
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus {
  outline: none; border-color: var(--sun-dark);
  box-shadow: 0 0 0 3px rgba(242,169,59,0.18);
}
.alert { padding: 13px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-warning { background: #FBF0DA; color: #7A5417; }
.d-none { display: none; }

/* ---------- admin panel ---------- */
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 26px; color: var(--navy); margin: 0; }
.admin-row {
  display: grid; grid-template-columns: 88px 1fr 1fr 1fr auto;
  gap: 14px; align-items: center;
  background: var(--card); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 8px 20px -14px rgba(39,69,92,0.22);
}
.admin-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.admin-row input[type="text"] { padding: 9px 11px; font-size: 13.5px; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 760px) {
  /* Real bug found 2026-08-02: the previous 2-column (64px/1fr) track
     still had 5 auto-placed items (img, 3 inputs, actions), so
     person_name landed in the narrow 64px image column and rendered
     squeezed. Stack everything full-width instead - no column count
     to accidentally overflow. */
  .admin-row { grid-template-columns: 1fr; }
  .admin-row img { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .duck-card, .btn { transition: none; }
}
