/* ============================================================
   Leanne's Groodles - shared site styles
   Loaded on every page alongside Tailwind (CDN).
   Contains: design tokens, fonts, buttons, cards, badges,
   nav/footer chrome, and the homepage paw-print animation.
   ============================================================ */

:root {
  --accent: #B5735A;
  --accent-hover: #CC8E72;
  --sage: #7A9E8A;
  --sage-hover: #5E8272;
  --heading: #2C2B28;
  --body-text: #5C4A3A;
  --muted: #635a52;
  --border: #D4B8A8;
  --border-subtle: #E8D5C4;
  --bg: #FFFDF9;
  --bg-secondary: #F5EFE6;
  --bg-alt: #EDE4D8;
  --bg-subtle: #FAF6F1;

  /* Brand cursor - a brown paw print (32×32, hotspot near its centre).
     Falls back to the normal cursor in browsers without SVG-cursor support. */
  --cursor-paw: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2064%2064'%3E%3Cg%20fill='%23B5735A'%20stroke='%23FFFDF9'%20stroke-width='2.5'%20stroke-linejoin='round'%3E%3Cpath%20d='M32%2050C32%2050%2016%2040%2016%2030C16%2025%2020%2022%2024%2022C27%2022%2030%2024%2032%2028C34%2024%2037%2022%2040%2022C44%2022%2048%2025%2048%2030C48%2040%2032%2050%2032%2050Z'/%3E%3Cellipse%20cx='14'%20cy='20'%20rx='5'%20ry='6.5'/%3E%3Cellipse%20cx='25'%20cy='13'%20rx='5'%20ry='6.5'/%3E%3Cellipse%20cx='39'%20cy='13'%20rx='5'%20ry='6.5'/%3E%3Cellipse%20cx='50'%20cy='20'%20rx='5'%20ry='6.5'/%3E%3C/g%3E%3C/svg%3E") 16 14, auto;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  color: var(--body-text);
  line-height: 1.7;
  background: var(--bg);
}

/* The paw is the default cursor everywhere; `cursor` inherits, so it flows to
   all elements. Links and buttons keep their own `cursor: pointer` (defined
   below / by the browser) for a clear clickable affordance, and text fields
   keep a normal caret so typing and selection still feel right. */
html { cursor: var(--cursor-paw); }
input, textarea, select, [contenteditable] { cursor: auto; }

h1, h2, h3, h4, .font-display {
  font-family: 'Playfair Display', serif;
  color: var(--heading);
  letter-spacing: -0.03em;
}

/* Bumps every Tailwind text-[var(--muted)] utility up to medium weight -
   !important guarantees it beats Tailwind's own injected <style>, whichever
   order the CDN script happens to inject it in relative to this file. */
.text-\[var\(--muted\)\] {
  font-weight: 500 !important;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  font-weight: 700;
  padding: 0.85rem 1.75rem;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 8px 24px -8px rgba(181, 115, 90, 0.55), 0 2px 6px -2px rgba(181, 115, 90, 0.4);
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(181, 115, 90, 0.6), 0 4px 10px -2px rgba(181, 115, 90, 0.45);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px rgba(181, 115, 90, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--sage-hover);
  border: 1.5px solid var(--sage);
  box-shadow: 0 6px 18px -10px rgba(122, 158, 138, 0.45);
}
.btn-secondary:hover {
  background: var(--sage);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(122, 158, 138, 0.55);
}
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px rgba(122, 158, 138, 0.5);
}

.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border);
  box-shadow: 0 6px 18px -10px rgba(181, 115, 90, 0.3);
}
.btn-outline-accent:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.btn-outline-accent:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px rgba(181, 115, 90, 0.4);
}

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 40px -22px rgba(92, 74, 58, 0.35), 0 4px 12px -4px rgba(92, 74, 58, 0.12);
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 220ms ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 54px -22px rgba(92, 74, 58, 0.4), 0 8px 18px -6px rgba(92, 74, 58, 0.18);
}

.surface-elevated {
  background: var(--bg);
  border-radius: 20px;
  box-shadow: 0 30px 70px -20px rgba(44, 43, 40, 0.35), 0 10px 30px -10px rgba(44, 43, 40, 0.25);
}

/* ---------- Status badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
}
.badge-available { background: rgba(122, 158, 138, 0.18); color: #4d6b5b; }
.badge-reserved { background: rgba(217, 158, 73, 0.2); color: #92691f; }
.badge-sold { background: rgba(156, 136, 120, 0.2); color: #6b5d50; }
.badge-coming-soon { background: rgba(181, 115, 90, 0.18); color: #95543b; }
.badge-confirmed { background: rgba(70, 130, 180, 0.16); color: #2f6f96; }

/* ---------- Links with animated underline ---------- */
.link-underline {
  position: relative;
  text-decoration: none;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 240ms ease;
}
.link-underline:hover::after,
.link-underline:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Site header / nav ---------- */
/* The nav partial is fetched and injected by js/include.js after the page
   loads. Until it arrives, this wrapper reserves the header's exact height
   (82px) so the page doesn't lurch downward when the nav pops in - that
   downward jump was the "top banner flash" on load and between pages.
   Once the nav is injected the wrapper is no longer :empty, so it switches to
   display:contents: that removes it from the box tree so <header>'s effective
   parent is <body>, giving the sticky header somewhere to actually stick
   (a wrapper exactly as tall as the header would leave no room for sticky). */
[data-include="nav"] {
  display: block;
  min-height: 82px;
}
[data-include="nav"]:not(:empty) {
  display: contents;
  min-height: 0;
}
.site-header {
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  position: relative;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--body-text);
  padding-bottom: 6px;
  transition: color 180ms ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}
.nav-link:hover { color: var(--accent); }
.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-link.is-active { color: var(--accent); }
.nav-link:focus-visible {
  outline: none;
  color: var(--accent);
}

#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 320ms ease;
}
#mobile-menu.is-open {
  /* Fit the visible viewport (minus the 5rem header) and scroll internally if
     the links overflow on short screens - a fixed max-height clipped the last
     item ("Enquire Now") on smaller phones. */
  max-height: calc(100vh - 5rem);
  max-height: calc(100dvh - 5rem);
  overflow-y: auto;
}

#nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--heading);
  transition: transform 240ms ease, opacity 200ms ease;
}
#nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#nav-toggle.is-open span:nth-child(2) { opacity: 0; }
#nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Paw print drift animation (homepage hero) ---------- */
.paw-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.paw {
  position: absolute;
  opacity: 0;
  color: rgba(255, 253, 249, 0.55);
  filter: drop-shadow(0 6px 14px rgba(44, 43, 40, 0.2));
  animation-name: paw-drift;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}
/* Warm-toned variant for use over light/cream backgrounds (instead of the near-white default) */
.paw-warm {
  color: rgba(181, 115, 90, 0.16);
  filter: none;
}
@keyframes paw-drift {
  0% { transform: translate(-6vw, 12px) rotate(-18deg) scale(0.85); opacity: 0; }
  12% { opacity: 0.9; }
  50% { transform: translate(46vw, -22px) rotate(8deg) scale(1); opacity: 0.7; }
  88% { opacity: 0.85; }
  100% { transform: translate(108vw, 14px) rotate(20deg) scale(0.9); opacity: 0; }
}

/* ---------- Scroll reveal ----------
   The .reveal class is added by js/include.js only to content that starts
   below the fold, so with JS off (or reduced motion on) everything stays
   visible. Elements gently fade and rise as they scroll into view. */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
  }
  /* Directional variants: text/blocks that slide in all the way from the frame
     edge to their resting spot. The exact off-screen distance is set per element
     by js/include.js via --reveal-shift. Their section must clip overflow so the
     off-screen offset never adds a scrollbar. They stay fully opaque so you can
     watch the text travel in. */
  .reveal.reveal-left,
  .reveal.reveal-right {
    opacity: 1;
    transform: translateX(var(--reveal-shift, 0px));
    transition: transform 950ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- On-load entrance ----------
   For content that's already on screen when the page opens (e.g. the hero),
   scroll-reveal can't help - so these play a self-starting CSS animation the
   moment the page loads. animation-fill-mode: both sets the start state before
   the first paint, so there's no flash, and it needs no JavaScript. Add the
   `hero-reveal` class to a wrapper and its direct children rise in with a
   gentle stagger. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes reveal-rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }
  .hero-reveal > * {
    animation: reveal-rise 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .hero-reveal > *:nth-child(1) { animation-delay: 0.06s; }
  .hero-reveal > *:nth-child(2) { animation-delay: 0.16s; }
  .hero-reveal > *:nth-child(3) { animation-delay: 0.26s; }
  .hero-reveal > *:nth-child(4) { animation-delay: 0.36s; }
  .hero-reveal > *:nth-child(5) { animation-delay: 0.46s; }
  .hero-reveal > *:nth-child(6) { animation-delay: 0.56s; }
}

/* ---------- Accordion (FAQ / Guardian Program) ---------- */
.accordion-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 360ms ease, opacity 280ms ease;
}
.accordion-item.is-open .accordion-panel {
  opacity: 1;
}
.accordion-icon {
  transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.accordion-item.is-open .accordion-icon {
  transform: rotate(135deg);
}

/* ---------- Misc ---------- */
.section-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 12px 0;
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

::selection {
  background: rgba(181, 115, 90, 0.25);
  color: var(--heading);
}

/* ---------- Nav dropdown ---------- */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  position: relative;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--body-text);
  padding-bottom: 6px;
  transition: color 180ms ease;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
}
.nav-dropdown-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}
.nav-dropdown-btn:hover { color: var(--accent); }
.nav-dropdown-btn:hover::after,
.nav-dropdown-btn.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-dropdown-btn.is-active { color: var(--accent); }
.nav-dropdown-btn:focus-visible { outline: none; color: var(--accent); }
.nav-dropdown-chevron { transition: transform 200ms ease; }
.nav-dropdown.is-open .nav-dropdown-chevron { transform: rotate(180deg); }
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 14rem;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 20px 48px -12px rgba(44, 43, 40, 0.28), 0 6px 18px -6px rgba(44, 43, 40, 0.14);
  padding: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 60;
}
.nav-dropdown.is-open .nav-dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--body-text);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}
.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible { background: var(--bg-secondary); color: var(--accent); outline: none; }
.nav-dropdown-item.is-active { color: var(--accent); background: var(--bg-secondary); }

/* Mobile Puppies subnav accordion */
.mobile-subnav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.625rem 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--body-text);
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  line-height: 1.7;
}
.mobile-subnav-toggle:hover { color: var(--accent); }
.mobile-subnav-chevron { transition: transform 200ms ease; flex-shrink: 0; }
.mobile-subnav-toggle[aria-expanded="true"] .mobile-subnav-chevron { transform: rotate(180deg); }
.mobile-subnav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 280ms ease;
  padding-left: 0.75rem;
}
.mobile-subnav.is-open { max-height: 12rem; }
.mobile-subnav a {
  display: block;
  padding: 0.45rem 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.mobile-subnav a:hover, .mobile-subnav a.is-active { color: var(--accent); }
