/* ===========================================================================
   Bow Wow Pow Wow — stylesheet
   Aesthetic: sunny outdoor dog park. Warm cream paper, grass green,
   tennis-ball yellow, hydrant red accents. Rounded, friendly, confident.
   =========================================================================== */

:root {
  --cream:      #FBF3E4;
  --paper:      #FFFDF8;
  --ink:        #2B2118;
  --ink-soft:   #6B5D4F;
  --grass:      #3F7D4E;
  --grass-dk:   #2C5A38;
  --ball:       #E9C547;     /* tennis-ball yellow */
  --hydrant:    #D9542B;     /* warm red accent */
  --sky:        #8FC2D6;
  --line:       #E4D8C2;
  --shadow:     rgba(43, 33, 24, 0.12);

  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body:    'Nunito', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(233,197,71,0.18), transparent 38%),
    radial-gradient(circle at 88% 82%, rgba(143,194,214,0.20), transparent 42%);
  background-attachment: fixed;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1.6rem;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-paw { font-size: 1.7rem; transform: rotate(-12deg); }
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo-text em { color: var(--hydrant); font-style: normal; }

.nav { display: flex; gap: 1.4rem; margin-left: 1rem; }
.nav a {
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--grass-dk); border-color: var(--ball); }

.nav-auth { margin-left: auto; display: flex; gap: 0.7rem; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2.5px solid var(--ink);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  display: inline-block;
}
.btn:active { transform: translateY(2px); }
.btn-solid {
  background: var(--ball);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-solid:hover { box-shadow: 4px 4px 0 var(--ink); transform: translateY(-1px); }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-ghost:hover { background: var(--cream); }
.btn-grass { background: var(--grass); color: #fff; box-shadow: 3px 3px 0 var(--grass-dk); }
.btn-grass:hover { box-shadow: 4px 4px 0 var(--grass-dk); transform: translateY(-1px); }

/* ---------- Page wrapper ---------- */
.page { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 2rem 1.4rem; }

/* ---------- Landing / hero ---------- */
.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -1.5px;
  margin-bottom: 1rem;
}
.hero h1 .pop { color: var(--hydrant); display: inline-block; transform: rotate(-3deg); }
.hero p.lede { font-size: 1.25rem; color: var(--ink-soft); max-width: 40ch; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .btn { font-size: 1.1rem; padding: 0.75rem 1.6rem; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; margin-top: 3.5rem; }
.feature-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  padding: 1.6rem;
  box-shadow: 5px 5px 0 var(--shadow);
}
.feature-card .emoji { font-size: 2.2rem; display: block; margin-bottom: 0.6rem; }
.feature-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin-bottom: 0.4rem; }
.feature-card p { color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- Cards / feed ---------- */
.section-head {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 1.3rem;
  display: flex; align-items: center; gap: 0.5rem;
}

.feed { display: flex; flex-direction: column; gap: 1.4rem; max-width: 600px; margin: 0 auto; }
.post {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 5px 5px 0 var(--shadow);
}
.post-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.1rem; }
.post-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ball); border: 2.5px solid var(--ink);
  display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0;
}
.post-meta strong { font-family: var(--font-display); font-weight: 600; display: block; }
.post-meta span { font-size: 0.82rem; color: var(--ink-soft); }
.post-media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--sky), var(--grass));
  display: grid; place-items: center;
  color: #fff; font-size: 3rem;
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
}
.post-body { padding: 0.9rem 1.1rem; }
.post-actions { display: flex; gap: 1.2rem; margin-top: 0.6rem; font-weight: 700; color: var(--ink-soft); }
.post-actions button {
  background: none; border: none; cursor: pointer;
  font: inherit; color: inherit; display: flex; align-items: center; gap: 0.3rem;
}
.post-actions button:hover { color: var(--hydrant); }

/* ---------- Profile ---------- */
.profile-head {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  padding: 2rem;
  box-shadow: 5px 5px 0 var(--shadow);
  display: flex; gap: 1.8rem; align-items: center; flex-wrap: wrap;
}
.profile-avatar {
  width: 130px; height: 130px; border-radius: 50%;
  background: var(--ball); border: 4px solid var(--ink);
  display: grid; place-items: center; font-size: 4rem; flex-shrink: 0;
}
.profile-name { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; line-height: 1; }
.profile-breed { color: var(--ink-soft); font-size: 1.05rem; margin-top: 0.2rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.tag {
  background: var(--cream); border: 2px solid var(--ink);
  border-radius: 999px; padding: 0.25rem 0.8rem;
  font-size: 0.85rem; font-weight: 700;
}
.tag.energy-high { background: var(--hydrant); color: #fff; }
.tag.energy-low  { background: var(--sky); }

.profile-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.4rem; margin-top: 1.4rem; }
.panel {
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: 5px 5px 0 var(--shadow);
}
.panel h3 { font-family: var(--font-display); font-weight: 600; margin-bottom: 0.7rem; }
.match-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0; border-bottom: 2px dashed var(--line); }
.match-item:last-child { border-bottom: none; }
.match-item .mini-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--sky); border: 2.5px solid var(--ink); display: grid; place-items: center; }

/* ---------- Meetups ---------- */
.meetup-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1.4rem; }
.meetup-list { display: flex; flex-direction: column; gap: 1rem; }
.meetup-card {
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: var(--r-md); padding: 1.2rem; box-shadow: 4px 4px 0 var(--shadow);
}
.meetup-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.meetup-card .when { color: var(--hydrant); font-weight: 800; }
.meetup-card .meta { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.3rem; }
#map { width: 100%; height: 520px; border: 3px solid var(--ink); border-radius: var(--r-md); box-shadow: 4px 4px 0 var(--shadow); }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 420px; margin: 2rem auto; }
.auth-card { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r-lg); padding: 2.2rem; box-shadow: 6px 6px 0 var(--shadow); }
.auth-card h1 { font-family: var(--font-display); font-weight: 700; font-size: 2rem; text-align: center; margin-bottom: 0.3rem; }
.auth-card .sub { text-align: center; color: var(--ink-soft); margin-bottom: 1.6rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.3rem; font-size: 0.92rem; }
.field input,
.field select,
.field textarea {
  width: 100%; padding: 0.7rem 0.9rem; font: inherit;
  border: 2.5px solid var(--ink); border-radius: var(--r-sm); background: var(--cream);
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 3px solid var(--ball); }
.field .hint { color: var(--ink-soft); font-weight: 600; }
.field input[type="file"] { padding: 0.5rem; background: var(--paper); }
.auth-card .btn { width: 100%; text-align: center; margin-top: 0.4rem; }
.auth-switch { text-align: center; margin-top: 1.2rem; color: var(--ink-soft); }
.auth-switch a { color: var(--hydrant); font-weight: 700; }
.pledge { background: var(--cream); border: 2px dashed var(--ink); border-radius: var(--r-sm); padding: 0.8rem; font-size: 0.85rem; margin-top: 1.2rem; }

/* ---------- Dog form + My Dogs ---------- */
/* Uploaded photos fill the round avatar slots; emoji shows when there's none. */
.profile-avatar img,
.post-avatar img,
.mini-avatar img,
.dog-card-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}
.auth-wrap.form-wide { max-width: 560px; }
.field-row { display: flex; gap: 0.8rem; }
.field-row .field { flex: 1; }
.photo-preview { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; }
.photo-preview img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 2.5px solid var(--ink); flex-shrink: 0;
}
.photo-preview span { font-size: 0.82rem; color: var(--ink-soft); }
.profile-head-main { flex: 1; }
.profile-edit { align-self: flex-start; }

.mydogs-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 1.2rem; }
.dog-card {
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r-lg);
  padding: 1.2rem; box-shadow: 5px 5px 0 var(--shadow);
  display: flex; align-items: center; gap: 0.9rem;
}
.dog-card-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--ball); border: 2.5px solid var(--ink);
  display: grid; place-items: center; font-size: 1.9rem; flex-shrink: 0;
  text-decoration: none;
}
.dog-card-body { flex: 1; min-width: 0; }
.dog-card-body strong { font-family: var(--font-display); font-weight: 600; display: block; }
.dog-card-body span { font-size: 0.82rem; color: var(--ink-soft); }
.empty-state { text-align: center; margin-top: 1.2rem; }

/* Feed posting */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.post-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.posting-as { color: var(--ink-soft); margin-bottom: 1.1rem; }
.post-action-link { color: var(--ink-soft); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
.post-action-link:hover { color: var(--hydrant); }

/* Match strength badge */
.match-pct { font-size: 0.72rem; font-weight: 800; color: #fff; background: var(--grass); border: 2px solid var(--ink); border-radius: 999px; padding: 0.05rem 0.45rem; }

/* RSVP */
.rsvp-form { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.7rem; flex-wrap: wrap; }
.rsvp-form select { padding: 0.5rem 0.6rem; border: 2.5px solid var(--ink); border-radius: var(--r-sm); background: var(--cream); font: inherit; }
.rsvp-going { border-color: var(--grass-dk); color: var(--grass-dk); font-weight: 800; }

/* Post detail + comments */
.back-link { margin-bottom: 1rem; }
.back-link a { color: var(--hydrant); font-weight: 700; }
.post-single { max-width: 600px; margin: 0 auto; }
.comments { max-width: 600px; margin: 1.4rem auto 0; }
.comment { padding: 0.8rem 0; border-bottom: 2px dashed var(--line); }
.comment:last-of-type { border-bottom: none; }
.comment-head { display: flex; align-items: center; gap: 0.6rem; }
.comment-head strong { font-family: var(--font-display); font-weight: 600; }
.comment-time { font-size: 0.78rem; color: var(--ink-soft); }
.comment-body { margin-top: 0.25rem; }
.comment-form { margin-top: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.comment-form textarea { width: 100%; padding: 0.7rem 0.9rem; font: inherit; border: 2.5px solid var(--ink); border-radius: var(--r-sm); background: var(--cream); resize: vertical; }
.comment-form textarea:focus { outline: 3px solid var(--ball); }
.comment-form .btn { align-self: flex-start; }
.comment-login { margin-top: 1rem; color: var(--ink-soft); }
.comment-login a { color: var(--hydrant); font-weight: 700; }
.inline-del { margin-left: auto; }
.del-btn { background: none; border: none; cursor: pointer; font: inherit; color: var(--ink-soft); font-weight: 700; padding: 0.2rem 0.4rem; border-radius: var(--r-sm); }
.del-btn:hover { color: var(--hydrant); background: var(--cream); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 2rem 1rem; border-top: 3px solid var(--ink); background: var(--paper); margin-top: 3rem; }
.footer p { font-family: var(--font-display); font-weight: 500; }
.footer-fine { font-family: var(--font-body); font-weight: 400; color: var(--ink-soft); font-size: 0.88rem; margin-top: 0.3rem; }

/* ---------- Auth-aware nav + flash messages ---------- */
.nav-user {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--grass-dk);
  margin-right: 0.5rem;
  align-self: center;
}
.flashes { max-width: 760px; margin: 0 auto 1.4rem; }
.flash {
  background: var(--paper);
  border: 2.5px solid var(--hydrant);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 0.7rem 1rem;
  box-shadow: 3px 3px 0 var(--hydrant);
  font-weight: 600;
}
.auth-card form { display: block; }
.auth-card form .btn { width: 100%; margin-top: 0.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .profile-grid, .meetup-layout { grid-template-columns: 1fr; }
  .nav { display: none; }
}
