/* 30-components.css - reusable components (site-wide) */

/* ===== HERO (global) ===== */
.hero {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  /* default desktop height */
  height: 720px;

  /* desktop image (set per-page via CSS variables) */
  background-image: var(--hero-desktop);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(92, 74, 58, 0.4);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  width: 100%;
  padding: 0 20px;
  text-align: center;
  color: #F5F0E6;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Tablet */
@media (max-width: 1024px) {
  .hero {
    height: 600px;
    background-image: var(--hero-tablet, var(--hero-desktop));
  }
}

/* Mobile */
@media (max-width: 768px) {
  .hero {
    height: 500px;
    background-image: var(--hero-mobile, var(--hero-tablet, var(--hero-desktop)));
  }
}


/* Canva Credit */
.canva-credit {
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  padding: 30px;
  max-width: 800px;
  margin: 40px auto;
  border-top: 5px solid #00C4CC;
  position: relative;
}

.canva-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.canva-logo {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #00C4CC, #00B2A9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  flex-shrink: 0;
}

.canva-title h2 {
  color: #00C4CC;
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.canva-title p {
  color: #8B7355;
  font-size: 1rem;
  line-height: 1.5;
}

.credit-content {
  margin-bottom: 25px;
  line-height: 1.8;
  color: #333;
}

.canva-link {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #00C4CC, #00B2A9);
  color: white;
  padding: 14px 28px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: transform var(--ease);
  box-shadow: 0 4px 15px rgba(0, 196, 204, 0.3);
}

.canva-link:hover { transform: translateY(-3px); }

.canva-link:focus-visible {
  outline: 2px solid #00C4CC;
  outline-offset: 2px;
}

/* Mobile Canva */
@media (max-width: 768px) {
  .canva-credit { margin: 30px auto; padding: 20px; }
  .canva-header { justify-content: center; text-align: center; }
  .canva-logo { margin-right: 0; margin-bottom: 15px; }
  .canva-link { width: 100%; justify-content: center; padding: 12px 24px; }
}

/* =========================================================
   GROUP LISTING COMPONENTS (reusable site-wide)
   - Grid cards (breed tiles)
   - Nav buttons (By Popularity / Alphabetical / By Height)
   - Top pagination (small page pills)
   - Bottom pagination with hover tooltip (desktop) + tap-open (mobile via .open)
   - Lazy image fade-in
   ========================================================= */


/* -------------------------
   Breed Grid Cards
   ------------------------- */

.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 1.5rem 0 3rem;
}

@media (max-width: 1024px) {
  .grid-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .grid-container { grid-template-columns: 1fr; }
}

.grid-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 3px 15px rgba(0,0,0,0.08);
  transition: transform var(--ease), box-shadow var(--ease);
}

.grid-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

.grid-img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 3px solid var(--clay, #B8A99A);
}

/* Mobile image handling (less “cropping” on narrow screens) */
@media (max-width: 768px) {
  .grid-img {
    height: auto;
    max-height: 210px;
    object-fit: contain;
    background: rgba(212,191,168,0.35);
    padding: 10px;
  }
}

.grid-content { padding: 1.25rem; }

.grid-content h3 {
  margin: 0 0 0.6rem;
  color: #5C4A3A;
}

.grid-content p {
  margin: 0 0 0.35rem;
  color: #8B7355;
}

.btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: #B8A99A;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: transform var(--ease), background var(--ease);
}

.btn:hover {
  background: #5C4A3A;
  transform: translateY(-1px);
}


/* -------------------------
   Group page Nav Buttons
   ------------------------- */

/* =========================================================
   Make .nav-buttons .nav-btn match .letter-nav a (group-list.css)
   Put this AFTER your existing .nav-btn rules so it overrides them.
========================================================= */

.nav-buttons {
  gap: 8px;            /* match .letter-nav gap */
  margin: 10px 0 20px; /* optional: match .letter-nav spacing */
}

.nav-buttons .nav-btn {
  /* match .letter-nav a */
  padding: 6px 10px;
  border: 1px solid #D4BFA8;
  border-radius: 6px;
  background: #f5f0e6;
  color: #5C4A3A;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;

  /* remove the "big button" behavior */
  min-width: 0;
  text-align: left;      /* optional: feels more like pills */
  transition: background var(--ease);
}

.nav-buttons .nav-btn:hover {
  background: #D4BFA8;
  transform: none;       /* remove lift so it matches letter-nav */
}

/* keyboard focus like letter-nav */
.nav-buttons .nav-btn:focus-visible {
  outline: 2px solid #5C4A3A;
  outline-offset: 2px;
}

/* keep your active state, but style it like a selected pill */
.nav-buttons .nav-btn.active {
  background: #5C4A3A;
  color: #F5F0E6;
  border-color: #5C4A3A;
}

/* Prevent hover from changing current button */
.nav-btn.active:hover,
.page-switch .current:hover {
    background: #5C4A3A;
    color: #F5F0E6;
}



/* -------------------------
   Top Pagination (small pills)
   ------------------------- */

.h3-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
}

.h3-pagination a,
.h3-pagination .current {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #D4BFA8;
  background: #F5F0E6;
  color: #5C4A3A;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  position: relative;
}

.h3-pagination a:hover {
  background: #D4BFA8;
}

.h3-pagination .current {
  background: #5C4A3A;
  color: #fff;
  border-color: #5C4A3A;
}


/* =========================================================
   BOTTOM PAGINATION + BREED LIST TOOLTIP (final)
   - Desktop hover works
   - Mobile tap works via .page-number.open (JS adds it)
   ========================================================= */

.pagination-center {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 30px 0;
  padding: 18px 0;
  position: relative;
  overflow: visible; /* tooltip must escape */
}

.pagination {
  display: flex;
  gap: 8px;
  position: relative;
  padding: 14px 18px;
  background: rgba(245, 240, 230, 0.35);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(92,74,58,0.08);
  overflow: visible; /* tooltip must escape */
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}

.page-number {
  position: relative;
  display: inline-block;
}

.page-number a,
.page-number span.current {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #D4BFA8;
  background: #F5F0E6;
  color: #5C4A3A;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  min-width: 42px;
  text-align: center;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: transform var(--ease), background var(--ease);
}

.page-number a:hover {
  background: #D4BFA8;
  transform: translateY(-1px);
}

.page-number span.current {
  background: #5C4A3A;
  color: #fff;
  border-color: #5C4A3A;
  cursor: default;
}

/* Tooltip panel */
.breed-list {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #D4BFA8;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  z-index: 9999;
  min-width: 280px;
  max-width: 340px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

/* Tooltip arrow */
.breed-list::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

/* Desktop: show tooltip on hover */
@media (hover: hover) and (pointer: fine) {
  .page-number:hover .breed-list {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(-2px);
  }
}

/* Mobile: show tooltip when JS adds .open */
.page-number.open .breed-list {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-2px);
}

/* Tooltip contents */
.breed-items {
  max-height: 280px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.45;
}

.breed-items div {
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.breed-items div:last-child { border-bottom: none; }

.breed-items a {
  display: block;
  padding: 3px 6px;
  border-radius: 8px;
  color: #5C4A3A;
  text-decoration: none;
  transition: background var(--ease), transform var(--ease);
}

.breed-items a:hover {
  background: #F5F0E6;
  transform: translateX(2px);
}

/* Mobile sizing */
@media (max-width: 768px) {
  .breed-list { min-width: 240px; max-width: 290px; }
  .breed-items { max-height: 250px; font-size: 12px; }
}


/* -------------------------
   Lazy image fade-in
   ------------------------- */

img.lazy {
  opacity: 0;
  transition: opacity 0.25s ease;
}

img.lazy.loaded { opacity: 1; }

img.lazy.error {
  opacity: 1;
  outline: 2px solid #d00;
}

/* =========================================================
   MOBILE QUICK NAV (Top / Bottom) + Back-to-top button
   - Mobile only
   - Uses #top and #bottom anchors
   ========================================================= */

.jump-bar,
.back-to-top {
  display: none;
}

/* Mobile-only */
@media (max-width: 768px) {
  .jump-bar {
    display: flex;
    position: sticky;     /* stays visible without covering content */
    bottom: 0;
    left: 0;
    right: 0;
    gap: 10px;
    justify-content: center;
    padding: 10px 12px;
    margin-top: 18px;

    background: rgba(245, 240, 230, 0.92);
    border-top: 1px solid rgba(0,0,0,0.08);
    backdrop-filter: blur(6px);
    z-index: 999;
  }

  .jump-link {
    flex: 1;
    max-width: 220px;
    text-align: center;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    color: #5C4A3A;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 6px 18px rgba(92,74,58,0.10);
  }

  .jump-link:active {
    transform: translateY(1px);
  }

  /* Floating back-to-top button (shows only after scroll; JS toggles .visible) */
  .back-to-top {
    display: inline-flex;
    position: fixed;
    right: 14px;
    bottom: 74px; /* sits above jump-bar */
    width: 46px;
    height: 46px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;

    text-decoration: none;
    font-weight: 900;
    color: #fff;
    background: #5C4A3A;
    box-shadow: 0 10px 26px rgba(0,0,0,0.22);
    z-index: 1000;

    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  }

  .back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* Smooth scrolling (respect reduced motion) */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}



@media (max-width: 768px){
  .next-breed-btn{ display: grid; place-items: center; }
}

/* Footer links */
.footer-section a,
.footer-bottom a {
  color: white;
  text-decoration: underline;
}

