/* Best Dog In The World — warm & playful styling */

:root {
  --bg: #fdf6ec;
  --bg-soft: #fef9f1;
  --card: #ffffff;
  --ink: #3d2817;
  --ink-soft: #7a5a3f;
  --line: #ecdcbf;
  --accent: #d97706;
  --accent-dark: #b45309;
  --accent-soft: #fde7c8;
  --memorial: #be185d;
  --memorial-soft: #fce7f3;
  --shadow: 0 8px 24px rgba(61, 40, 23, 0.08);
  --shadow-lg: 0 18px 40px rgba(61, 40, 23, 0.14);
  --radius: 18px;
  --radius-sm: 10px;
  --radius-lg: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, #fff8eb 0%, var(--bg-soft) 100%);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(6px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .paw {
  font-size: 28px;
  background: var(--accent-soft);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  color: var(--ink-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--ink); }
.site-nav a.active { background: var(--accent-soft); color: var(--accent-dark); }
.site-nav a.nav-pill {
  background: var(--accent);
  color: white;
}
.site-nav a.nav-pill:hover { background: var(--accent-dark); }

/* ---------- Hero ---------- */
.home-hero {
  text-align: center;
  padding: 60px 0 40px;
}
.home-hero h1 {
  font-size: clamp(36px, 6vw, 60px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.home-hero .accent {
  font-family: 'Caveat', cursive;
  color: var(--accent);
  font-weight: 600;
}
.home-hero p {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- Dog cards (homepage) ---------- */
.dog-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 24px 0 80px;
}
.dog-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.dog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: inherit;
}
.dog-card-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--accent-soft);
}
.dog-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.dog-card:hover .dog-card-photo img { transform: scale(1.04); }
.dog-card-body {
  padding: 22px 24px 26px;
}
.dog-card-name {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.dog-card-sub {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0;
}
.dog-card .memorial-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--memorial-soft);
  color: var(--memorial);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---------- Dog page ---------- */
.dog-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
  padding: 50px 0 30px;
}
.dog-hero-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--accent-soft);
  box-shadow: var(--shadow-lg);
}
.dog-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dog-hero-text h1 {
  font-size: clamp(40px, 5vw, 56px);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.dog-hero-text .subtitle {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  color: var(--accent);
  margin: 0 0 20px;
}
.dog-hero-text .bio {
  font-size: 18px;
  line-height: 1.7;
}
.dog-hero-text .bio p { margin: 0 0 14px; }
.facts {
  margin-top: 22px;
  padding: 18px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.facts dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0;
}
.facts dt {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: center;
}
.facts dd { margin: 0; font-size: 16px; }

.memorial-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--memorial-soft);
  color: var(--memorial);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ---------- Gallery ---------- */
.gallery-section {
  padding: 50px 0 80px;
  border-top: 1px dashed var(--line);
  margin-top: 40px;
}
.gallery-section h2 {
  font-size: 32px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.gallery-section .gallery-intro {
  color: var(--ink-soft);
  margin: 0 0 26px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.gallery-item {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--accent-soft);
  box-shadow: 0 4px 10px rgba(61, 40, 23, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
}

/* ---------- Forms / buttons ---------- */
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover, button.btn:hover {
  background: var(--accent-dark);
  text-decoration: none;
  color: white;
}
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 2px solid var(--accent-soft);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }

.card-form {
  max-width: 460px;
  margin: 60px auto;
  background: var(--card);
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-form h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.card-form .lead {
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
}
.field input[type=text],
.field input[type=password],
.field input[type=file],
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 15px;
}
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-info { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Upload page ---------- */
.upload-wrap {
  max-width: 640px;
  margin: 50px auto;
  background: var(--card);
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.upload-wrap h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -0.01em;
}
.upload-wrap .lead { color: var(--ink-soft); margin: 0 0 24px; }
.upload-wrap details {
  margin-top: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink-soft);
}
.upload-wrap summary { cursor: pointer; font-weight: 700; color: var(--ink); }

.dog-thumbs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.dog-thumbs-row label {
  background: var(--bg-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
}
.dog-thumbs-row input[type=radio] { display: none; }
.dog-thumbs-row input[type=radio]:checked + span {
  /* span inside label */
}
.dog-thumbs-row label.selected,
.dog-thumbs-row label:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ---------- Footer ---------- */
.site-footer {
  background: #f7eeda;
  border-top: 1px solid var(--line);
  padding: 30px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-credit, .footer-tag {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.footer-tag { font-family: 'Caveat', cursive; font-size: 18px; color: var(--ink); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-btn {
  position: absolute;
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-btn:hover { background: rgba(255,255,255,0.25); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .dog-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 30px;
  }
  .dog-hero-photo { max-width: 420px; margin: 0 auto; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav { width: 100%; justify-content: flex-start; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .dog-thumbs-row { grid-template-columns: 1fr; }
}
