/* ============================================
   MIS MASCOTAS — Hoja de estilos base
   Variables, reset, navegación, pie de página
   y utilidades compartidas por todo el sitio.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@400;600;700&display=swap');

:root {
  /* --- Paleta cálida tipo scrapbook --- */
  --paper: #faf3e6;
  --paper-alt: #f3ead6;
  --ink: #3d2c22;
  --ink-soft: #6b5646;
  --coral: #d67c56;
  --coral-dark: #b3603e;
  --teal: #2b6777;
  --mustard: #c79b42;
  --cream-card: #fffaf0;
  --border-soft: rgba(61, 44, 34, 0.14);
  --shadow-soft: 0 10px 24px rgba(61, 44, 34, 0.14);
  --shadow-hover: 0 16px 32px rgba(61, 44, 34, 0.22);

  --font-display: 'Baloo 2', 'Segoe UI', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;

  --radius-lg: 22px;
  --radius-md: 14px;
  --nav-height: 72px;

  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #241c17;
  --paper-alt: #2c231c;
  --ink: #f4e9db;
  --ink-soft: #cdb9a6;
  --cream-card: #2f261f;
  --border-soft: rgba(244, 233, 219, 0.14);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); margin: 0 0 0.4em; line-height: 1.15; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  width: min(1140px, 92%);
  margin-inline: auto;
}

/* Textura sutil de "papel" de fondo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--border-soft) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.35;
  z-index: 0;
}

/* ---------- NAVEGACIÓN ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 2px solid var(--border-soft);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--coral-dark);
}

.brand .paw { font-size: 1.4rem; }

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--paper-alt);
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  background: var(--coral);
  color: #fff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  border: 2px solid var(--border-soft);
  background: var(--cream-card);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--cream-card);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- BOTONES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: var(--shadow-hover);
}

/* ---------- PIE DE PÁGINA ---------- */
.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0 2rem;
  border-top: 2px solid var(--border-soft);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-stats {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.8rem;
}

.footer-date { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- VOLVER ARRIBA ---------- */
.back-to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 90;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ---------- ANIMACIONES DE APARICIÓN (scroll) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Decoración flotante sutil */
.floaty {
  animation: floaty 4s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- RESPETO A prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- MENÚ MÓVIL ---------- */
@media (max-width: 780px) {
  .hamburger { display: flex; }

  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 2px solid var(--border-soft);
    padding: 0.6rem 1rem 1.2rem;
    gap: 0.3rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a { display: block; }
}
