/* Sandsprite Kennels — shared stylesheet
   Mobile-first. Breakpoints: 600px (tablet), 900px (small desktop), 1200px (wide desktop). */

:root {
  --color-bg: #faf6f0;
  --color-surface: #ffffff;
  --color-text: #2b241d;
  --color-text-muted: #6b5f52;
  --color-primary: #6b3f2a;
  --color-primary-dark: #4a2b1c;
  --color-accent: #b5651d;
  --color-accent-light: #f1e2d0;
  --color-border: #e6dccb;
  --radius: 10px;
  --radius-lg: 16px;
  --max-width: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --shadow-sm: 0 1px 3px rgba(43, 36, 29, 0.08);
  --shadow-md: 0 6px 20px rgba(43, 36, 29, 0.12);

  /* Footer sits on --color-primary-dark, which flips light/dark below —
     these pair with whichever shade that resolves to, so footer text
     always contrasts against its own background. */
  --color-footer-text: #f1e9df;
  --color-footer-text-muted: #cbb9a4;
  --color-footer-border: rgba(241, 233, 223, 0.2);
  --footer-logo-filter: brightness(0) invert(1);
  --color-hero-logo: #2b1f16;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #201a15;
    --color-surface: #2a231c;
    --color-text: #f1e9df;
    --color-text-muted: #c7b9a8;
    --color-primary: #e0a978;
    --color-primary-dark: #f1c9a1;
    --color-accent: #d98a44;
    --color-accent-light: #3a2c1f;
    --color-border: #453a2f;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);

    /* --color-primary-dark is now light, so footer text/border/logo flip to dark */
    --color-footer-text: #4a2b1c;
    --color-footer-text-muted: #6b3f2a;
    --color-footer-border: rgba(43, 27, 16, 0.25);
    --footer-logo-filter: none;
    --color-hero-logo: var(--color-primary); /* same as the Book now button */
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--color-primary-dark);
}

h1 { font-size: clamp(1.8rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
.unavailable-note { font-size: 1.1rem; }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: bold;
  color: var(--color-primary-dark);
}
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--color-primary-dark); }

.nav-links {
  list-style: none;
  margin: 0;
  padding: 1rem 0 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-links.is-open { display: flex; flex-basis: 100%; width: 100%; }

.nav-links a {
  display: block;
  padding: 0.6rem 0.25rem;
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-accent);
  text-decoration: none;
}

@media (min-width: 700px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex !important;
    flex-direction: row;
    padding: 0;
    gap: 1.75rem;
  }
  .nav-links a {
    border-bottom: none;
    padding: 0.25rem 0;
  }
  .nav-links a[aria-current="page"] {
    border-bottom: 2px solid var(--color-accent);
  }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-accent-light), var(--color-bg));
  border-bottom: 1px solid var(--color-border);
  padding: 2.5rem 0 3rem;
}
.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}
.hero-copy .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
}
.hero-art {
  display: flex;
  justify-content: center;
}
.hero-art svg { width: 100%; max-width: 320px; }
/* Homepage sign logo, drawn as a mask so its colour follows the theme */
.hero-logo {
  display: block;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 480 / 291.1;
  background-color: var(--color-hero-logo);
  -webkit-mask: url("../assets/logo-sign.svg") center / contain no-repeat;
  mask: url("../assets/logo-sign.svg") center / contain no-repeat;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 3fr 2fr;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}
.btn:hover { text-decoration: none; background: var(--color-primary); color: #fff; }
.btn:disabled,
.btn[disabled] {
  border-color: var(--color-border);
  color: var(--color-text-muted);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.65;
  font-family: inherit;
  font-size: inherit;
}
.btn:disabled:hover,
.btn[disabled]:hover {
  background: transparent;
  color: var(--color-text-muted);
}
.btn-solid {
  background: var(--color-primary);
  color: #fff;
}
.btn-solid:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* ---------- Sections ---------- */
.section {
  padding: 3rem 0;
}
.section-alt {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.section-head {
  max-width: 640px;
  margin: 0 auto 2rem;
  text-align: center;
}

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }

.stat-card {
  text-align: center;
  padding: 1.25rem 1rem;
}
.stat-card .stat-num {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--color-accent);
  font-weight: bold;
  display: block;
}
.stat-card .stat-label {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (min-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}
.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item svg { width: 45%; opacity: 0.55; }
.gallery-item > a,
.gallery-item-trigger {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  cursor: pointer;
}
.gallery-item img.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.4rem 0.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-item figcaption.has-description {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.35;
}
.gallery-item figcaption .desc {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 0.15rem;
}

/* ---------- Kelpie titleholder tiles (overlay caption explains the title/award) ---------- */
.kelpie-item figcaption {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.35;
  padding: 0.6rem 0.75rem;
}
.kelpie-item figcaption strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.kelpie-item figcaption span {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.9;
}

/* ---------- Lightbox (facilities category galleries) ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-image {
  max-width: 90vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: #000;
}
.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 999px;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
}
.lightbox-prev { left: -0.5rem; }
.lightbox-next { right: -0.5rem; }
@media (min-width: 700px) {
  .lightbox-prev { left: -3.5rem; }
  .lightbox-next { right: -3.5rem; }
}
.lightbox-info {
  color: #fff;
  text-align: center;
  margin-top: 1rem;
  max-width: 90vw;
}
.lightbox-caption {
  display: block;
  font-size: 0.95rem;
}
.lightbox-counter {
  display: block;
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 0.25rem;
}
.lightbox-original {
  display: inline-block;
  margin-top: 0.5rem;
  color: #fff;
  text-decoration: underline;
  font-size: 0.85rem;
}

/* ---------- Tables (litters / pedigree-ish info) ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}
th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
th {
  background: var(--color-accent-light);
  color: var(--color-primary-dark);
}
tr:last-child td { border-bottom: none; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  max-width: 640px;
}
@media (min-width: 600px) {
  .form-grid.two-col { grid-template-columns: 1fr 1fr; }
  .form-grid.two-col .full { grid-column: 1 / -1; }
}
label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}
input, textarea, select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  color: var(--color-text);
  background: var(--color-surface);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin: 0 0.35rem 0.35rem 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: var(--color-footer-text);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}
.site-footer a { color: var(--color-footer-text); }
.footer-logo {
  width: 140px;
  height: auto;
  margin-bottom: 0.75rem;
  filter: var(--footer-logo-filter);
}
.footer-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.5rem;
}
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
.footer-grid h4 {
  color: var(--color-footer-text);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-bottom {
  border-top: 1px solid var(--color-footer-border);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-footer-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* ---------- Utility ---------- */
.muted { color: var(--color-text-muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.notice {
  background: var(--color-accent-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
