/* ── Profile Photo Lightbox Trigger ── */
.profile-photo-lb-trigger {
  display: block;
  cursor: pointer;
  line-height: 0;
}
.profile-photo-lb-trigger::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.2s;
  border-radius: inherit;
}
.profile-photo-lb-trigger:hover::after { background: rgba(0,0,0,0.12); }
.profile-photo-lb-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1;
  pointer-events: none;
}
.profile-photo-lb-trigger:hover .profile-photo-lb-icon { opacity: 1; }
/* Clickable badge variant on directory cards */
.profile-photo-badge.dog-card-lb-badge {
  pointer-events: all !important;
  text-decoration: none;
  cursor: pointer;
  display: flex !important;
  height: auto !important;
  width: auto !important;
}
.profile-photo-badge.dog-card-lb-badge:hover { background: rgba(0,0,0,0.8); }

.profile-photo-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.62);
  color: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
  letter-spacing: 0.2px;
}

/* ── Photo Thumbnail Strip ── */
.dog-lb-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: -24px 0 24px;
}
.dog-lb-strip-thumb {
  width: 60px;
  height: 60px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  background: #ede7df;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.dog-lb-strip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dog-lb-strip-thumb.is-active,
.dog-lb-strip-thumb:hover { border-color: var(--color-burgundy); }

/* ── Lightbox counter ── */
.lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* ── Profile Header ── */
.profile-header {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 32px;
  margin-bottom: 40px;
  align-items: start;
}
.profile-photo {
  border-radius: 8px;
  overflow: hidden;
  background: #ede7df;
  aspect-ratio: 4 / 3;
  position: relative;
}
.profile-main-photo,
.profile-photo-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-photo-placeholder { background: #e8ddd5; }

.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.badge {
  background: var(--color-gold);
  color: var(--color-burgundy);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 3px;
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-burgundy);
  margin-bottom: 4px;
}
.profile-callname { font-size: 0.94rem; color: var(--color-text-muted); font-style: italic; margin-bottom: 16px; }
.profile-divider  { width: 40px; height: 3px; background: var(--color-gold); margin-bottom: 20px; }

/* 2-column card grid — label and value sit on the same line */
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.profile-detail-card { display: flex; flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.profile-detail-card--full { grid-column: 1 / -1; }
.profile-details dt { font-size: 0.7rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; white-space: nowrap; }
.profile-details dd { font-size: 0.9rem; color: var(--color-text); margin: 0; }
.profile-details dd a { color: var(--color-burgundy); }
.profile-detail-empty { color: var(--color-border); font-size: 0.9rem; }

.profile-body { margin: 32px 0; line-height: 1.7; font-size: 0.9375rem; color: var(--color-text); }

/* ── Photo Strip (legacy) ── */
.photo-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 40px; }
.photo-strip-item { aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: #ede7df; }
.photo-strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.photo-strip-item img:hover { opacity: 0.85; }

/* ── Dog Photo Gallery ── */
.dog-photo-gallery { margin: 28px 0 36px; }
.dog-gallery-heading { font-family: var(--font-serif); font-size: 1rem; color: var(--color-burgundy); margin-bottom: 12px; font-weight: 700; }
.dog-gallery-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.dog-gallery-thumb {
  width: calc(20% - 7px);
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: #ede7df;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.dog-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.dog-gallery-thumb:hover img { transform: scale(1.05); }
.dog-gallery-thumb--more img { opacity: 0.5; }
.dog-gallery-more-overlay {
  position: absolute; inset: 0;
  background: rgba(85,2,35,0.7);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--color-gold);
}
.dog-gallery-more-count { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 700; line-height: 1; }
.dog-gallery-more-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.dog-gallery-view-all {
  display: inline-block; margin-top: 10px;
  font-size: 0.8125rem; font-weight: 700;
  color: var(--color-burgundy); background: none;
  border: none; cursor: pointer; padding: 0;
  text-transform: uppercase; letter-spacing: 0.4px;
  text-decoration: none;
}
.dog-gallery-view-all:hover { color: var(--color-gold); }
/* Make featured image clickable when gallery exists */
.profile-photo { cursor: default; }
.profile-photo.has-gallery { cursor: zoom-in; }
@media (max-width: 640px) {
  .dog-gallery-thumb { width: calc(33.333% - 6px); }
}

/* ── Two-Column Row ── */
.profile-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 40px; }

/* ── Show Results Table ── */
.show-results-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.show-results-table th { background: var(--color-burgundy); color: var(--color-gold); padding: 10px 12px; text-align: left; font-family: var(--font-serif); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3px; }
.show-results-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.show-results-table tr:last-child td { border-bottom: none; }
.show-results-table tr:nth-child(even) td { background: #fdfaf8; }
.award-chip { display: inline-block; background: var(--color-gold); color: var(--color-burgundy); font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; }
.show-results-table--full { margin-top: 0; width: 100%; }

/* ── Show Results Archive ── */
.sr-year-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.8rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.sr-year-nav__label { font-weight: 700; color: var(--color-text-muted); margin-right: 4px; }
.sr-year-nav__link {
  padding: 3px 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-burgundy);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
}
.sr-year-nav__link:hover { background: var(--color-burgundy); color: var(--color-gold); border-color: var(--color-burgundy); }
.sr-year-nav__count { margin-left: auto; color: var(--color-text-muted); font-style: italic; }

.sr-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.sr-search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: var(--font-sans);
}
.sr-award-select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background: #fff;
}
.sr-clear-btn {
  padding: 8px 12px;
  background: #f0ece8;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.sr-clear-btn:hover { background: var(--color-border); }
.sr-result-count { font-size: 0.8rem; color: var(--color-text-muted); font-style: italic; }

/* Year header rows */
.sr-year-header {
  scroll-margin-top: 50px; /* offset for sticky year nav */
}
.sr-year-header td {
  background: var(--color-gold) !important;
  padding: 6px 12px !important;
}
.sr-year-label {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-burgundy);
}
.sr-back-top {
  float: right;
  font-size: 0.75rem;
  color: rgba(85,2,35,0.5);
  text-decoration: none;
}
.sr-back-top:hover { color: var(--color-burgundy); }

/* ── Offspring List (now uses show-results-table, link style) ── */
.offspring-list { list-style: none; }
.offspring-list li { padding: 8px 0; border-bottom: 1px solid var(--color-border); font-size: 0.875rem; }
.offspring-list li:last-child { border-bottom: none; }
.offspring-list a,
.show-results-table td a { color: var(--color-burgundy); text-decoration: none; font-weight: 600; }
.offspring-list a:hover,
.show-results-table td a:hover { text-decoration: underline; color: var(--color-gold); }

/* ── Responsive ── */
@media (max-width: 640px) {
  /* Stack photo above metadata */
  .profile-header {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  /* Photo takes full width — cap height so it doesn't dominate */
  .profile-photo {
    max-width: 100%;
    aspect-ratio: 4 / 3;
  }
  /* Name a bit smaller */
  .profile-name { font-size: 1.35rem; }

  /* Metadata cards: stay 2-col on mid-mobile, drop to 1 on small */
  .profile-details { grid-template-columns: 1fr 1fr; gap: 8px 16px; }

  /* Sections below the header */
  .profile-two-col { grid-template-columns: 1fr; gap: 24px; }

  /* Photo strip: 3 across instead of 5 */
  .photo-strip { grid-template-columns: repeat(3, 1fr); }

  /* Profile nav: tighten up */
  .profile-nav { gap: 8px; font-size: 0.8rem; margin-top: 32px; }
}

@media (max-width: 400px) {
  /* Very small: single-column metadata cards */
  .profile-details { grid-template-columns: 1fr; }
  /* Photo strip: 2 across */
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ── Profile Nav ── */
.profile-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--color-card);
  border-radius: 6px;
  font-size: 0.875rem;
}
/* Top nav (prev/next only, above profile photo) — compact, no divider */
.page-wrap > .profile-nav:first-child {
  margin-top: 0;
  margin-bottom: 16px;
}
.page-wrap > .profile-nav:last-of-type {
  margin-top: 20px;
}
.profile-nav__prev { text-align: left; }
.profile-nav__mid  { text-align: center; white-space: nowrap; }
.profile-nav__next { text-align: right; }
.profile-nav a { color: var(--color-burgundy); text-decoration: none; font-weight: 600; }
.profile-nav a:hover { color: var(--color-gold); }
/* legacy sep — hidden with new layout */
.profile-nav-sep { display: none; }

/* ── Dog profile page: tighten page-wrap padding so navs hug header/footer ── */
body.single-dog .page-wrap {
  padding-top: 16px;
  padding-bottom: 8px;
}
body.single-dog .site-footer { margin-top: 8px; }
body.single-dog .pedigree-wrap { margin-bottom: 0; }
body.single-dog .page-wrap > .profile-nav:last-of-type { margin-top: 8px; }