/* Penny's Litter 5 photo page — page-specific styles (only loaded by penny-litter-5.html).
   Everything is scoped under .p5-* classes; shared styles.css is untouched. */

.p5-section { padding-bottom: clamp(2.5rem, 6vw, 4rem); }

.p5-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.p5-title { margin: 0 0 0.35rem; }
.p5-subline {
  margin: 0 0 0.35rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 600;
  color: var(--ink);
}
.p5-hint { margin: 0; font-size: 0.92rem; color: var(--muted); }
.p5-reserve { white-space: nowrap; }

/* ——— Layout: one column, 2 photos per row (one puppy per row), Boys section then Girls — all screen sizes ——— */
.p5-wrap { width: min(900px, calc(100% - 2.5rem)); }
.p5-grid { display: block; }
.p5-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.75rem;
  align-items: start;
}
.p5-group + .p5-group { margin-top: 2rem; }
.p5-group-h {
  grid-column: 1 / -1;
  margin: 0;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--line);
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.1;
}
.p5-count {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  vertical-align: middle;
}

/* ——— Photo slot ——— */
.p5-photo { margin: 0; min-width: 0; }
.p5-frame {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1; /* phones: square frame; every photo shown whole (contain) */
  overflow: hidden;
  border-radius: 14px;
  background: var(--cream);
  border: 1.5px dashed var(--line);
  box-shadow: var(--shadow);
}
.p5-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;      /* never crop: whole photo always visible (no heads/faces cut) */
  object-position: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.p5-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.5rem;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  line-height: 1.1;
  letter-spacing: 0.03em;
  color: var(--nav);
}
.p5-ph-dot {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--swatch, #ccc);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.1), 0 0 0 4px #fff;
  opacity: 0.85;
}
/* No photo yet: slot isn't a link target */
.p5-photo:not(.has-photo) .p5-frame { pointer-events: none; cursor: default; }
/* Photo present */
.p5-photo.has-photo .p5-frame { border: 1px solid #e6dccf; background: linear-gradient(180deg, #f6efe6 0%, #efe4d6 100%); }
.p5-photo.has-photo .p5-frame img { opacity: 1; }
.p5-photo.has-photo .p5-placeholder { display: none; }
.p5-photo.has-photo .p5-frame:hover { border-color: var(--accent); }
.p5-frame:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ——— Caption ——— */
.p5-photo figcaption {
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.25;
}
.p5-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.35rem;
  vertical-align: -0.1rem;
  border-radius: 50%;
  background: var(--swatch, #ccc);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.18);
}
.p5-cap-main { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.p5-cap-sub { display: block; font-size: 0.78rem; color: var(--muted); }

.p5-cta { margin-top: clamp(1.75rem, 4vw, 2.5rem); display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* ——— Wider screens: same single column, 2 photos per row, capped width ——— */
@media (min-width: 700px) {
  .p5-frame { aspect-ratio: 4 / 3; } /* wider screens: 4:3 frame, still contain (uncropped) */
  .p5-group { gap: 1.5rem 1.25rem; }
  .p5-group + .p5-group { margin-top: 2.75rem; }
  .p5-cap-main { font-size: 1rem; }
  .p5-cap-sub { font-size: 0.84rem; }
}

/* One puppy = three photos + one Reserve link */
.p5-pup {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.75rem;
  align-items: start;
  padding-top: 0.35rem;
  padding-bottom: 1.4rem;
  margin-bottom: 1.25rem;
  border-bottom: 3px solid var(--nav, #5c4033);
}
.p5-pup:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.5rem;
}
.p5-pup-reserve {
  grid-column: 1 / -1;
  text-align: center;
  margin: 0.15rem 0 0.85rem;
}
.p5-photo-reserve {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  font-size: 0.84rem;
  line-height: 1.2;
  white-space: nowrap;
}
@media (min-width: 700px) {
  .p5-pup { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 1.25rem; }
  .p5-photo-reserve { font-size: 0.9rem; padding: 0.45rem 1.05rem; }
}

/* Pick-spot grid at top (same waiting-list-table styles from styles.css) */
.p5-spots {
  width: 100%;
  margin: 0 0 clamp(1.5rem, 3.5vw, 2.25rem);
  text-align: left;
}
.p5-spots-h {
  margin: 0 0 0.15rem;
  text-align: center;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
}
.p5-spots .waiting-list-table { margin-top: 0.5rem; }
.p5-spots .waiting-list-note { text-align: center; }

/* Pricing & deposit box under the pick-spot grid */
.p5-pricing {
  margin: 0 0 clamp(1.5rem, 3.5vw, 2.25rem);
  padding: 0.9rem 1.1rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}
.p5-pricing .puppy-price-line { margin-top: 0.35rem; }
.p5-pricing .puppy-price-split { margin-bottom: 0.5rem; }
.p5-pricing-note { margin: 0 0 0.5rem; font-size: 0.92rem; line-height: 1.45; color: var(--muted); }
.p5-pricing-link { margin: 0; font-weight: 600; }

/* Reusable litter status pattern (all litter pages).
   Selected puppy: add data-status="adopted" to each of its <figure class="p5-photo"> and
   <span class="p5-adopted-badge">Adopted</span> at the start of its <figcaption>.
   Deposit-held pick spot: use <span class="waiting-reserved">…Reserved</span> in the waiting list. */
.p5-photo[data-status="adopted"] { position: relative; }
.p5-photo[data-status="adopted"] .p5-frame::after {
  content: "Adopted"; position: absolute; top: .6rem; left: .6rem; z-index: 2;
  padding: .3rem .75rem; border-radius: 999px;
  background: var(--pill-fill, #2f7d4f); color: var(--pill-ink, #fff);
  border: 1.5px solid var(--pill-border, transparent); box-sizing: border-box;
  font-weight: 700; font-size: .9rem; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.p5-photo[data-status="adopted"] .p5-frame { position: relative; }
.p5-photo[data-status="adopted"] .p5-frame img { filter: saturate(.85); }
.p5-adopted-badge {
  display: inline-block; margin-right: .4rem; padding: .05rem .5rem; border-radius: 999px;
  background: var(--pill-fill, #2f7d4f); color: var(--pill-ink, #fff);
  border: 1.5px solid var(--pill-border, transparent); box-sizing: border-box;
  font-weight: 700; font-size: .78rem; vertical-align: middle;
}
.p5-photo[data-status="adopted"] .p5-reserve-link,
.p5-photo[data-status="adopted"] a[href*="application.html"] { display: none !important; }

/* Adopted ribbon/badge colors come from collar-pill.js (--pill-fill/--pill-ink/--pill-border on [data-collar]). */


/* ——— Puppy slideshow cards (JS adds .is-slideshow) ———
   Without JS, .p5-pup keeps the multi-photo grid above. */
.p5-pup.is-slideshow {
  grid-column: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  padding: 0;
  margin: 0;
  border-bottom: none;
  background: #fff;
  border: 1px solid var(--line, #e6dccf);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.p5-pup.is-slideshow .p5-slide-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.p5-pup.is-slideshow .p5-slides {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(180deg, #f6efe6 0%, #efe4d6 100%);
  outline: none;
}
.p5-pup.is-slideshow .p5-slides:focus-visible {
  box-shadow: inset 0 0 0 3px var(--accent, #9a6b3f);
}
.p5-pup.is-slideshow .p5-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.28s ease;
  will-change: transform;
}
.p5-pup.is-slideshow .p5-photo {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  min-width: 100%;
}
.p5-pup.is-slideshow .p5-photo figcaption { display: none; }
.p5-pup.is-slideshow .p5-frame {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 0;
  border: none !important;
  box-shadow: none;
  background: transparent;
}
.p5-pup.is-slideshow .p5-frame img {
  object-fit: contain;
  object-position: center;
}
.p5-pup.is-slideshow .p5-slide-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.15rem 0.35rem 0.05rem;
  margin: 0;
}
.p5-pup.is-slideshow .p5-slide-btn {
  position: static;
  transform: none;
  z-index: auto;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #4e2d14;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  text-shadow: none;
  opacity: 0.85;
  -webkit-tap-highlight-color: transparent;
}
.p5-pup.is-slideshow .p5-slide-btn > span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}
.p5-pup.is-slideshow .p5-slide-btn:hover,
.p5-pup.is-slideshow .p5-slide-btn:focus-visible {
  background: transparent;
  color: #4e2d14;
  opacity: 1;
  outline: none;
}
.p5-pup.is-slideshow .p5-slide-btn:focus-visible > span {
  outline: 2px solid #4e2d14;
  outline-offset: 2px;
  border-radius: 2px;
}
.p5-pup.is-slideshow .p5-slide-prev,
.p5-pup.is-slideshow .p5-slide-next { left: auto; right: auto; }
.p5-pup.is-slideshow .p5-slide-count {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: auto;
  margin: 0;
  padding: 0.1rem 0.2rem;
  border: none;
  background: transparent;
  color: #4e2d14;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-shadow: none;
  pointer-events: none;
  user-select: none;
  min-width: 3.5rem;
  text-align: center;
}
.p5-pup.is-slideshow .p5-slide-cap {
  padding-top: 0.25rem;
}
.p5-pup.is-slideshow .p5-slide-cap {
  padding: 0.55rem 0.65rem 0.35rem;
  text-align: center;
  line-height: 1.25;
}
.p5-pup.is-slideshow .p5-pup-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 0.5rem 0;
  box-sizing: border-box;
  gap: 0;
}
.p5-pup.is-slideshow .p5-pup-footer .p5-apply-link {
  margin: 0.25rem auto 0;
  align-self: center;
}
.p5-pup.is-slideshow .p5-pup-footer .p5-pup-photos-updated {
  margin: 0.55rem 0 0; /* ~9px under Reserve pill */
}
.p5-pup.is-slideshow > .p5-pup-photos-updated,
.p5-pup.is-slideshow .p5-slide-card > .p5-pup-photos-updated {
  margin: 0.55rem 0.65rem 0; /* adopted: under caption, tight to admin tools */
  text-align: center;
}
/* 2 cards across; stack to 1 only on very narrow phones */
@media (max-width: 359px) {
  .p5-group:has(.p5-pup.is-slideshow) {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 700px) {
  .p5-pup.is-slideshow .p5-slides { aspect-ratio: 4 / 3; }
}

/* Visitor: latest upload date for this litter */
.p5-photos-updated{margin:.35rem 0 0;font-size:.9rem;color:#6b5e52;font-style:italic}

.p5-group:has(.p5-pup.is-slideshow) {
  align-items: stretch;
}
.p5-group:has(.p5-pup.is-slideshow) > .p5-pup {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Per-pup latest DB photo date under caption (public + admin) */
.p5-pup-photos-updated,
.p5-pup.is-slideshow .p5-pup-photos-updated {
  margin: 0.55rem 0 0;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 400;
  font-style: italic;
  color: #6b5e52;
  text-align: center;
  line-height: 1.3;
}

.p5-pup.is-slideshow .p5-cap-main[hidden] { display: none !important; }
.p5-pup.is-slideshow .p5-slide-cap:not(:has(.p5-cap-main:not([hidden]))) {
  padding-top: 0.35rem;
}
