/* Cane Corso Ancestry: framed portrait, original image pixels and proportions
   are preserved. This stylesheet only loads on public dog profiles. */
.dog-profile .profile-photo.dog-portrait {
  display: block;
  align-self: start;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  margin: 0;
  border-radius: 18px;
  border: 1px solid rgba(195, 166, 108, .48);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(5, 15, 18, .13), 0 1px 2px rgba(5, 15, 18, .06);
  overflow: hidden;
}
.dog-portrait-heading,
.dog-portrait-caption {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
}
.dog-portrait-heading { padding: 4px 4px 12px; }
.dog-portrait-eyebrow {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.dog-portrait-count {
  color: var(--gold-soft);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dog-portrait-responsive {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.dog-portrait-open {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 11px;
  background: transparent;
  text-decoration: none;
  cursor: zoom-in;
}
/* Do not impose an aspect ratio, crop, filter or dark letterbox on the dog. */
.dog-profile .profile-photo.dog-portrait .dog-portrait-image {
  display: block;
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  height: auto;
  /* The small viewport stays steady when Safari's browser bars collapse. */
  max-height: min(620px, 70vh);
  max-height: min(620px, 70svh);
  object-fit: contain;
  object-position: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  transform: none;
  filter: none;
}
.dog-portrait-expand {
  position: absolute;
  right: 9px;
  bottom: 9px;
  border: 1px solid rgba(188, 174, 138, .46);
  border-radius: 100px;
  background: rgba(9, 18, 21, .8);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 7px 11px;
  line-height: 1.2;
  pointer-events: none;
}
.dog-portrait-caption {
  padding: 12px 4px 8px;
  align-items: flex-start;
}
.dog-portrait-caption-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.dog-portrait-caption-copy strong {
  color: var(--text);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.dog-portrait-caption-copy small {
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.dog-portrait-kennel {
  color: var(--muted);
  font-size: .73rem;
  text-align: right;
  max-width: 45%;
  overflow-wrap: anywhere;
}
.dog-portrait-thumbnails {
  display: flex;
  align-items: stretch;
  gap: 9px;
  padding: 10px 4px 3px;
  margin: 3px 0 0;
  border-top: 1px solid var(--line-soft);
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.dog-portrait-thumb {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 4px;
  background: transparent;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  touch-action: manipulation;
}
.dog-profile .profile-photo.dog-portrait .dog-portrait-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  transform: none;
}
.dog-portrait-thumb span {
  position: absolute;
  bottom: 3px;
  right: 3px;
  border-radius: 4px;
  padding: 0 3px;
  font-size: .65rem;
  color: #fff;
  background: rgba(9, 18, 21, .78);
}
.dog-portrait-thumb.is-active,
.dog-portrait-thumb[aria-pressed="true"] {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.dog-portrait-thumb:hover { border-color: var(--gold); }
.dog-portrait-empty { padding: 0 12px; text-align: center; color: var(--muted); }

/* Native dialog provides focus containment and Escape behavior on iOS Safari,
   Chromium and desktop browsers. Fallback keeps the original photo link. */
.dog-photo-lightbox {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1060px, calc(100vw - 24px));
  height: min(92vh, 880px);
  height: min(92svh, 880px);
  max-width: calc(100vw - 24px);
  max-height: 92vh;
  max-height: 92svh;
  padding: 0;
  border: 1px solid rgba(195, 166, 108, .42);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .3);
  overflow: hidden;
}
.dog-photo-lightbox:not([open]) { display: none; }
.dog-photo-lightbox::backdrop { background: rgba(5, 10, 12, .88); }
.dog-photo-lightbox-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}
.dog-photo-lightbox-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line-soft);
}
.dog-photo-lightbox-topbar strong {
  min-width: 0;
  flex: 1;
  font-size: .96rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dog-photo-lightbox-topbar span {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: .82rem;
}
.dog-photo-lightbox-actions { display: flex; gap: 7px; }
.dog-photo-lightbox-actions button,
.dog-photo-lightbox-nav {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  font: inherit;
}
.dog-photo-lightbox-actions button:hover,
.dog-photo-lightbox-nav:hover { border-color: var(--gold); }
/* The image viewport, not the page below, owns touch and pointer gestures.
   Pinch zoom is a transform on the fitted photo, with JS-clamped panning
   so every part of the animal stays inspectable. */
.dog-photo-lightbox-stage {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}
.dog-photo-lightbox-viewport {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: zoom-out;
}
.dog-photo-lightbox-viewport[data-zoomed="true"] { cursor: grab; }
.dog-photo-lightbox-viewport[data-zoomed="true"]:active { cursor: grabbing; }
.dog-photo-lightbox-viewport img {
  display: block;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  margin: 0;
  border-radius: 3px;
  object-fit: contain;
  object-position: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
}
.dog-photo-lightbox-viewport[data-zoomed="true"] img {
  will-change: transform;
}
.dog-photo-lightbox-stage.is-zoomed .dog-photo-lightbox-viewport img {
  object-fit: contain;
}
.dog-photo-lightbox-nav {
  flex: none;
  font-size: 1.6rem;
  line-height: 1;
  padding: 4px 10px;
}
.dog-photo-lightbox-nav[hidden] { display: none !important; }
.dog-photo-lightbox-caption {
  display: grid;
  flex: none;
  gap: 4px;
  margin: 0;
  min-height: 54px;
  border-top: 1px solid var(--line-soft);
  padding: 9px 17px;
  color: var(--muted);
  font-size: .83rem;
  overflow-wrap: anywhere;
}
.dog-photo-lightbox-caption small {
  display: block;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.45;
}
@media (max-width: 760px) {
  .dog-profile .profile-photo.dog-portrait { padding: 10px; border-radius: 14px; }
  .dog-profile .profile-photo.dog-portrait .dog-portrait-image {
    max-height: min(405px, 51vh);
    max-height: min(405px, 51svh);
  }
  .dog-portrait-heading { padding-bottom: 9px; }
  .dog-portrait-caption { padding-top: 10px; }
  .dog-portrait-kennel { max-width: 40%; }
  .dog-portrait-thumb { flex-basis: 65px; width: 65px; height: 65px; }
  .dog-photo-lightbox {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: calc(100vh - 20px);
    height: calc(100svh - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100svh - 20px);
    border-radius: 12px;
  }
  .dog-photo-lightbox-topbar { gap: 6px; padding: 9px; }
  .dog-photo-lightbox-actions { gap: 3px; }
  .dog-photo-lightbox-actions button { font-size: .75rem; min-width: 42px; padding: 8px; }
  .dog-photo-lightbox-stage { padding: 5px; gap: 1px; }
  .dog-photo-lightbox-nav { min-width: 40px; padding: 6px; }
  .dog-photo-lightbox-viewport img { max-width: 100%; max-height: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .dog-portrait-open,
  .dog-portrait-thumb { scroll-behavior: auto; transition: none; }
}


/* Accessible fallback when scripts are disabled; primary full-size link is
   already available without JS, and every additional photo remains reachable. */
.dog-portrait-nojs {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  padding: 8px 4px;
}
.dog-portrait-nojs a {
  color: var(--gold-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* Profile details: vertical, readable ancestry and breathing room. */
.dog-profile .profile-intro { min-width: 0; padding-top: 9px; }
.dog-profile .profile-quick-parents {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 18px 0 24px;
}
.dog-profile .profile-quick-parents > div {
  min-width: 0;
  padding: 10px 12px 12px 15px;
  border-left: 3px solid var(--gold);
  border-bottom: 1px solid var(--line-soft);
}
.dog-profile .profile-quick-parents span {
  display: block;
  margin-bottom: 4px;
  letter-spacing: .08em;
}
.dog-profile .profile-quick-parents a,
.dog-profile .profile-quick-parents strong {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  line-height: 1.45;
}
.dog-profile .registration-line {
  padding: 3px 0 8px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.dog-profile .profile-facts-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 17px;
}
.dog-profile .profile-facts-heading h2 {
  font-size: 1.12rem;
  margin: 0;
  line-height: 1.5;
}
.dog-profile .profile-facts {
  display: grid;
  grid-template-columns: minmax(108px, 35%) minmax(0, 1fr);
  margin: 12px 0 6px;
  column-gap: 16px;
  row-gap: 0;
  align-items: stretch;
}
.dog-profile .profile-facts dt,
.dog-profile .profile-facts dd {
  padding: 13px 0 14px;
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dog-profile .profile-facts dt {
  color: var(--muted);
  font-size: .83rem;
  font-weight: 550;
}
.dog-profile .profile-facts dd { font-size: .92rem; color: var(--text); }
.dog-profile .profile-facts dd small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}
.dog-profile .profile-report-actions {
  margin: 24px 0 20px;
  padding: 19px 0 4px;
  border-top: 1px solid var(--line-soft);
}
.dog-profile .profile-report-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .85rem;
  line-height: 1.45;
  font-weight: 550;
}
.dog-profile .profile-review-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--gold-soft);
  font-size: .75rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  line-height: 1.4;
}
.dog-profile .panel-heading { gap: 12px; flex-wrap: wrap; }
.dog-profile .panel-heading .profile-review-chip { margin-left: auto; }
.dog-profile .profile-manage-actions { margin-top: 14px; }
@media (max-width: 760px) {
  .dog-profile .profile-intro { padding-top: 2px; }
  .dog-profile .profile-quick-parents {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    margin: 14px 0 22px;
  }
  .dog-profile .profile-quick-parents > div { padding: 9px 10px 11px 13px; }
  .dog-profile .profile-facts {
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
    gap: 0 12px;
    margin-top: 9px;
  }
  .dog-profile .profile-facts dt,
  .dog-profile .profile-facts dd { padding: 12px 0 13px; }
  .dog-profile .profile-report-actions { margin: 22px 0 16px; }
}

/* Public verification status stays concise; source metadata remains internal. */
.dog-profile .profile-evidence-summary {
  padding: 11px 0 0;
  margin: 15px 0 6px;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.55;
  border-top: 1px solid var(--line-soft);
}
