/* templates/css/group-list.css */
/* Page type: group list pages (Sporting/Hound/etc) */

/* =========================================================
   HERO BASE
========================================================= */

.hero {
  width: 100%;
  height: 720px;
  background-size: cover;
  background-position: center;
  background-image: var(--hero-desktop);
}

/* Tablet */
@media (max-width: 1024px) {
  .hero {
    height: 600px;
    background-image: var(--hero-tablet);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .hero {
    height: 460px;
    background-image: var(--hero-mobile);
  }
}

/* ========================================
   HERO IMAGE VARIABLES — PER GROUP
======================================== */

.page-apartment{
  --hero-desktop: url("../../images/apartment-dogs-desktop.webp");
  --hero-tablet:  url("../../images/apartment-dogs-tablet.webp");
  --hero-mobile:  url("../../images/apartment-dogs-mobile.webp");
}

.page-brachycephalic{
  --hero-desktop: url("../../images/brachycephalic-desktop.webp");
  --hero-tablet:  url("../../images/brachycephalic-tablet.webp");
  --hero-mobile:  url("../../images/brachycephalic-mobile.webp");
}

.page-family{
  --hero-desktop: url("../../images/family-dogs-desktop.webp");
  --hero-tablet:  url("../../images/family-dogs-tablet.webp");
  --hero-mobile:  url("../../images/family-dogs-mobile.webp");
}

.page-first{
  --hero-desktop: url("../../images/first-time-dog-owners-desktop.webp");
  --hero-tablet:  url("../../images/first-time-dog-owners-tablet.webp");
  --hero-mobile:  url("../../images/first-time-dog-owners-mobile.webp");
}

.page-giant{
  --hero-desktop: url("../../images/giant-breeds-desktop.webp");
  --hero-tablet:  url("../../images/giant-breeds-tablet.webp");
  --hero-mobile:  url("../../images/giant-breeds-mobile.webp");
}

.page-herding{
  --hero-desktop: url("../../images/herding-group-desktop.webp");
  --hero-tablet:  url("../../images/herding-group-tablet.webp");
  --hero-mobile:  url("../../images/herding-group-mobile.webp");
}

.page-hound{
  --hero-desktop: url("../../images/hound-group-desktop.webp");
  --hero-tablet:  url("../../images/hound-group-tablet.webp");
  --hero-mobile:  url("../../images/hound-group-mobile.webp");
}

.page-hypoallergenic{
  --hero-desktop: url("../../images/hypoallergenic-desktop.webp");
  --hero-tablet:  url("../../images/hypoallergenic-tablet.webp");
  --hero-mobile:  url("../../images/hypoallergenic-mobile.webp");
}

.page-index{
  --hero-desktop: url("../../images/index-desktop.webp");
  --hero-tablet:  url("../../images/index-tablet.webp");
  --hero-mobile:  url("../../images/index-mobile.webp");
}

.page-jogging{
  --hero-desktop: url("../../images/jogging-desktop.webp");
  --hero-tablet:  url("../../images/jogging-tablet.webp");
  --hero-mobile:  url("../../images/jogging-mobile.webp");
}

.page-large{
  --hero-desktop: url("../../images/large-breed-dogs-desktop.webp");
  --hero-tablet:  url("../../images/large-breed-dogs-tablet.webp");
  --hero-mobile:  url("../../images/large-breed-dogs-mobile.webp");
}

.page-medium{
  --hero-desktop: url("../../images/medium-breeds-desktop.webp");
  --hero-tablet:  url("../../images/medium-breeds-tablet.webp");
  --hero-mobile:  url("../../images/medium-breeds-mobile.webp");
}

.page-non-sporting{
  --hero-desktop: url("../../images/non-sporting-group-desktop.webp");
  --hero-tablet:  url("../../images/non-sporting-group-tablet.webp");
  --hero-mobile:  url("../../images/non-sporting-group-mobile.webp");
}

.page-pop{
  --hero-desktop: url("../../images/pop-desktop.webp");
  --hero-tablet:  url("../../images/pop-tablet.webp");
  --hero-mobile:  url("../../images/pop-mobile.webp");
}

.page-protection{
  --hero-desktop: url("../../images/protection-desktop.webp");
  --hero-tablet:  url("../../images/protection-tablet.webp");
  --hero-mobile:  url("../../images/protection-mobile.webp");
}

.page-small{
  --hero-desktop: url("../../images/small-breeds-desktop.webp");
  --hero-tablet:  url("../../images/small-breeds-tablet.webp");
  --hero-mobile:  url("../../images/small-breeds-mobile.webp");
}

.page-sporting{
  --hero-desktop: url("../../images/sporting-group-desktop.webp");
  --hero-tablet:  url("../../images/sporting-group-tablet.webp");
  --hero-mobile:  url("../../images/sporting-group-mobile.webp");
}

.page-terrier{
  --hero-desktop: url("../../images/terrier-group-desktop.webp");
  --hero-tablet:  url("../../images/terrier-group-tablet.webp");
  --hero-mobile:  url("../../images/terrier-group-mobile.webp");
}

.page-toy{
  --hero-desktop: url("../../images/toy-group-desktop.webp");
  --hero-tablet:  url("../../images/toy-group-tablet.webp");
  --hero-mobile:  url("../../images/toy-group-mobile.webp");
}

.page-working{
  --hero-desktop: url("../../images/working-group-desktop.webp");
  --hero-tablet:  url("../../images/working-group-tablet.webp");
  --hero-mobile:  url("../../images/working-group-mobile.webp");
}

.page-x-small{
  --hero-desktop: url("../../images/x-small-breeds-desktop.webp");
  --hero-tablet:  url("../../images/x-small-breeds-tablet.webp");
  --hero-mobile:  url("../../images/x-small-breeds-mobile.webp");
}

/* =========================================================
   HERO (scoped to group list pages)
========================================================= */

.page-group-list .hero{
  position: relative;
  width: 100%;
  height: 720px;

  background-image: var(--hero-desktop);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px){
  .page-group-list .hero{
    height: 560px;
    background-image: var(--hero-tablet);
  }
}

@media (max-width: 768px){
  .page-group-list .hero{
    height: 440px;
    background-image: var(--hero-mobile);
  }
}

/* =========================================================
   MOBILE JUMP LINKS (in-content)
========================================================= */

/* Mobile jump bar (ONLY mobile) */
.mobile-jump {
  display: none;
  margin: 14px 0 8px;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile-jump .jump-link,
.mobile-bottom-nav .jump-link {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid #D4BFA8;
  background: #F5F0E6;
  color: #5C4A3A;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 768px) {
  .mobile-jump { display: flex; }
}

/* Mobile bottom link */
.mobile-bottom-nav {
  display: none;
  margin: 18px 0 30px;
  justify-content: center;
}

@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
}

/* =========================================================
   FLOATING BUTTONS (mobile)
   NOTE: .back-to-top is hidden on mobile because jump-bar replaces it.
========================================================= */

/* Floating Back-to-top button (mobile only) */
.back-to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #5C4A3A;
  color: #F5F0E6;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (min-width: 769px) {
  .back-to-top { display: none; }
}

/* Floating Next Breed button (mobile only) — sits above the fixed jump-bar */
.next-breed-btn {
  position: fixed;
  right: 14px;
  bottom: 80px; /* above jump-bar */
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #5C4A3A;
  color: #F5F0E6;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;

  /* Hidden until JS adds .is-visible */
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;

  /* Ensure it sits above the jump-bar */
  z-index: 10000;

  -webkit-tap-highlight-color: transparent;
}

.next-breed-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.next-breed-btn:active {
  transform: translateY(1px);
}

/* Desktop: never show */
@media (min-width: 769px) {
  .next-breed-btn { display: none; }
}

/* Mobile: allow it to render (JS controls visible/hidden via opacity/class) */
@media (max-width: 768px) {
  .next-breed-btn { display: grid; place-items: center; }
}

/* =========================================================
   PAGINATION / TOOLTIP (if present)
========================================================= */

.page-number.open .breed-list {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

/* Bigger tap targets on mobile */
@media (max-width: 768px) {
  .page-number a,
  .page-number span.current {
    padding: 10px 14px;
    min-width: 44px;     /* Apple recommended tap size */
    min-height: 44px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* =========================================================
   LETTER NAV + ANCHOR OFFSET
========================================================= */

.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  margin: 10px 0 20px;
  border-top: 1px solid #e0d6c8;
  border-bottom: 1px solid #e0d6c8;
}



.letter-nav a {
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid #D4BFA8;
  border-radius: 6px;
  background: #f5f0e6;
  color: #5C4A3A;
  font-weight: 600;
  font-size: 14px;
}

.letter-nav a:focus-visible {
  outline: 2px solid #5C4A3A;
  outline-offset: 2px;
}

.letter-nav a:hover{
  background:#D4BFA8;
}

.letter-divider { scroll-margin-top: 90px; }


/* Offset so anchors don't hide under sticky UI */
.letter-anchor {
  display: block;
  position: relative;
  top: -90px;     /* matches sticky bar height */
  height: 0;
  visibility: hidden;
}

/* =========================================================
   STICKY JUMP BAR (mobile only)
========================================================= */

@media (max-width: 768px) {
  .jump-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 9999;

    display: flex;
    gap: 10px;
    justify-content: space-between;

    background: rgba(245, 240, 230, 0.95);
    border: 1px solid #D4BFA8;
    border-radius: 12px;
    padding: 10px 12px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    backdrop-filter: blur(6px);
  }

  .jump-link {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 12px 10px;
    border-radius: 10px;
    background: #5C4A3A;
    color: #F5F0E6;
    font-weight: 700;
    min-height: 44px; /* tap size */
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Give space so jump-bar doesn't cover the last cards */
  main.container {
    padding-bottom: 90px;
  }

  /* Hide the floating single-arrow since jump-bar replaces it */
  .back-to-top { display: none; }
}

/* Hide jump-bar on desktop */
@media (min-width: 769px) {
  .jump-bar { display: none; }
}

/* =========================================================
   BROWSE BAR (letters left, pages right)
========================================================= */

.browse-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin: 14px 0 18px;
  padding: 10px 0;
  border-top: 1px solid #e0d6c8;
  border-bottom: 1px solid #e0d6c8;
}

.browse-bar .letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: 0;
}

.browse-bar .letter-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
}

.page-switch{
  position:relative;
}

.page-switch a,
.page-switch .current{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px;
  height:34px;
  padding:0 10px;
  border:1px solid #D4BFA8;
  border-radius:6px;
  text-decoration:none;
  font-weight:600;
}

.page-switch .current{
  background:#5C4A3A;
  color:#fff;
  border-color:#5C4A3A;
}

.page-switch a{
  background:#f5f0e6;
  color:#5C4A3A;
}

.page-switch a:hover{
  background:#D4BFA8;
}

/* Optional desktop hover preview for Page 2 */
.page-preview {
  top: calc(100% + 6px);   /* smaller gap helps */
  pointer-events: auto;    /* ensure clickable */
}

/* Keep preview open when hovering either the switch OR the preview itself */
.page-switch:hover .page-preview,
.page-preview:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-preview-title{
  font-weight:700;
  color:#5C4A3A;
  margin-bottom:8px;
}

.page-preview-items{
  display:grid;
  gap:6px;
  max-height:260px;
  overflow:auto;
}

.page-preview-items a{
  color:#5C4A3A;
  text-decoration:underline;
  font-weight:600;
  border:0;
  height:auto;
  min-width:0;
  padding:0;
  background:transparent;
}

.page-preview-items a:hover{
  text-decoration:none;
}

/* =========================================================
   LETTER DIVIDERS INSIDE GRID (no choppy gaps)
========================================================= */

.letter-divider{
  grid-column: 1 / -1;
  margin: 10px 0 6px;
  padding: 10px 0 6px;
  border-bottom: 1px solid #e0d6c8;
}

.letter-divider span{
  display:inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color:#5C4A3A;
}


/* Mobile: stack nicely */
@media (max-width:768px){
  .browse-bar{
    align-items:flex-start;
  }
  .page-preview{ display:none; } /* hover preview off on mobile */
}

/* =========================================================
   GROUP LIST NAV BUTTONS (lighter style)
========================================================= */

.page-group-list .nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.page-group-list .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 16px;
  border-radius: 8px;

  background: #F5F0E6;        /* light ivory */
  border: 1px solid #D4BFA8;  /* sandstone */
  color: #5C4A3A;             /* dark brown text */

  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

/* Hover */
.page-group-list .nav-btn:hover {
  background: #D4BFA8;        /* slightly darker */
  color: #3e3126;
  transform: translateY(-1px);
}

/* Active (current page) */
.page-group-list .nav-btn.active {
  background: #A38F7D;        /* taupe */
  border-color: #A38F7D;
  color: #ffffff;
}

/* Active hover (subtle) */
.page-group-list .nav-btn.active:hover {
  background: #8F7A68;
}


.view-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 18px;
}
