
/* Shared motion and viewport-sized cover. */
@media (min-width: 821px) {
  .home .pb-page > .hero.wrap {
    min-height: min(700px, calc(100svh - 166px));
    margin-top: 18px;
  }

  .home .hero > .wp-block-group:first-child {
    padding: clamp(18px, 4.6vh, 48px) clamp(26px, 4.7vw, 76px);
  }

  .home .hero h1 {
    font-size: clamp(2.55rem, min(6vw, 9svh), 6rem);
    margin-bottom: clamp(12px, 2vh, 24px);
  }

  .home .hero .eyebrow { margin-bottom: clamp(10px, 2vh, 22px); }
  .home .hero .actions { margin-top: clamp(10px, 2vh, 22px); gap: 8px 18px; }
  .home .hero-bottom { margin-top: clamp(12px, 2.7vh, 28px); padding-top: clamp(8px, 1.5vh, 15px); }
}

@media (min-width: 821px) and (max-height: 660px) {
  .home .hero h1 { font-size: clamp(2.35rem, 7.5svh, 4rem); }
  .home .hero .intro { line-height: 1.5; }
  .home .hero .hero-photo { min-height: 280px; }
}

@media (max-width: 520px) {
  .home .hero > .wp-block-group:first-child { padding: 22px 20px; }
  .home .hero h1 { font-size: clamp(2.55rem, 10vw, 3.5rem); margin-bottom: 15px; }
  .home .hero .eyebrow { margin-bottom: 12px; }
  .home .hero .intro { line-height: 1.5; }
  .home .hero .actions { margin-block: 13px 0; }
  .home .hero-bottom { margin-top: 13px; padding-top: 9px; }
  .home .hero .hero-photo { aspect-ratio: 2.2; }
}

@media (prefers-reduced-motion: no-preference) {
  .pb-page .pagetop h1, .pb-page .portrait h1 {
    animation: pb-page-enter .65s cubic-bezier(.2,.75,.25,1) both;
  }

  .pb-page :is(.dogcard .image, .contactbox, .gallerygrid figure, .litterrow, .wp-block-button__link),
  .cta .wp-block-button__link {
    transition: transform .4s cubic-bezier(.2,.75,.25,1), border-radius .5s ease, box-shadow .4s ease;
  }

  @media (hover: hover) and (pointer: fine) {
    .pb-page :is(.dogcard:hover .image, .contactbox:hover, .gallerygrid figure:hover) {
      transform: translateY(-3px);
      border-radius: 16px;
      box-shadow: 0 10px 26px rgb(26 51 37 / .12);
    }
    .pb-page :is(.litterrow:hover, .wp-block-button__link:hover), .cta .wp-block-button__link:hover {
      transform: translateY(-2px);
    }
  }

  @supports (animation-timeline: view()) {
    .pb-page > :is(.section, .doggrid, .gallerygrid, .servicegrid),
    .pb-page .articlelayout .prose > h2,
    .wp-site-blocks > .cta .wrap {
      animation: pb-content-enter linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }

    .pb-page > :is(.section, .doggrid, .gallerygrid, .servicegrid):focus-within {
      animation: none;
    }
  }
}

@keyframes pb-page-enter {
  from { opacity: .65; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

@keyframes pb-content-enter {
  from { opacity: .75; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Service cards keep their frame and spacing in every state. */
.pb-page .servicegrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 32px);
}

.pb-page .servicegrid > .service {
  min-width: 0;
  margin: 0;
  padding: clamp(22px, 3vw, 42px);
  border: 1px solid #d7ddd0;
  border-radius: 20px;
  background: #fbfaf5;
}

.pb-page .servicegrid > .service .eyebrow { margin-bottom: 14px; }
.pb-page .servicegrid > .service h2 { margin-block: 0 10px; }

.pb-page .servicegrid > .service:focus-within {
  border-color: #889b88;
  background: #fffdf7;
}

@media (prefers-reduced-motion: no-preference) {
  .pb-page .servicegrid > .service {
    transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
  }
}

@media (hover: hover) and (pointer: fine) {
  .pb-page .servicegrid > .service:hover {
    border-color: #acb9a6;
    background: #fffdf7;
    box-shadow: 0 6px 20px rgb(26 51 37 / .07);
  }
}

@media (max-width: 760px) {
  .pb-page .servicegrid { grid-template-columns: minmax(0, 1fr); }
}

/* Mobile cover: portrait first, with the headline and actions on a solid panel. */
@media (max-width: 600px) {
  .home .pb-page > .hero.wrap {
    width: calc(100% - 24px);
    margin-top: 12px;
    border-radius: 22px;
  }

  .home .hero .hero-photo {
    grid-row: 1;
    min-height: 0;
    aspect-ratio: 1.62;
  }

  .home .hero .hero-photo .wp-block-image img { object-position: 72% 57%; }
  .home .hero .hero-photo .photo-note { display: none; }

  .home .hero > .wp-block-group:first-child { padding: 20px 22px 22px; }
  .home .hero .eyebrow { font-size: .64rem; letter-spacing: .09em; margin: 0 0 11px; }
  .home .hero h1 {
    font-size: clamp(2rem, 8.9vw, 3.2rem);
    letter-spacing: -.06em;
    margin: 0 0 12px;
  }

  .home .hero .intro { font-size: .875rem; line-height: 1.45; margin: 0; }
  .home .hero .actions { gap: 2px 14px; margin: 12px 0 0; }
  .home .hero .actions .wp-block-button__link { min-height: 44px; padding: 10px 15px; font-size: .8125rem; }
  .home .hero .actions .textlink { font-size: .8125rem; }
  .home .hero-bottom { gap: 10px; margin: 9px 0 0; padding-top: 9px; }
  .home .hero-bottom span { font-size: .65rem; }
  .home .hero-bottom strong { font-size: 1.05rem; }
}

/* Let the image itself reserve space on mobile, including WebKit. */
@media (max-width: 820px) {
  .home .hero .hero-photo { aspect-ratio: auto; }
  .home .hero .hero-photo .wp-block-image {
    position: static;
    margin: 0;
    width: 100%;
  }
  .home .hero .hero-photo .wp-block-image img {
    display: block;
    width: 100%;
    height: auto !important;
    aspect-ratio: 1.62;
    max-height: none;
    object-fit: cover;
    object-position: 72% 57%;
    animation: none;
  }
}

/* Keep the logos in the same compositing layer as the page background. */
.home .pb-page > .partners-section {
  animation: none;
  isolation: auto;
}

.home .partners-section .partner-logos,
.home .partners-section .partner-logos figure.wp-block-image {
  background: transparent;
}

.home .partners-section .partner-logos figure.wp-block-image {
}

.home .partners-section .partner-logos figure.wp-block-image img {
  background: transparent;
  mix-blend-mode: normal;
}

/* Mobile navigation keeps WordPress's dialog controls and focus handling. */
@media (max-width: 1000px) {
  .pb-navigation .wp-block-navigation__responsive-container-open {
    border-radius: 999px;
    padding-inline: 14px;
    background: #fbfaf5;
  }

  .pb-navigation .wp-block-navigation__responsive-container.is-menu-open {
    position: fixed !important;
    inset: 0 !important;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    width: 100%;
    height: 100dvh;
    padding: 0 !important;
    overflow: hidden;
    background: rgb(24 41 32 / .36) !important;
  }

  .pb-navigation .is-menu-open .wp-block-navigation__responsive-close {
    box-sizing: border-box;
    width: min(420px, 92vw);
    max-width: none;
    height: 100%;
    margin: 0;
    padding: max(20px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 24px 0 0 24px;
    background: #f7f5ee;
    box-shadow: -12px 0 40px rgb(14 33 23 / .18);
  }

  .pb-navigation .is-menu-open .wp-block-navigation__responsive-dialog { min-height: 100%; display: flex; flex-direction: column; }
  .pb-navigation .is-menu-open .wp-block-navigation__responsive-container-close {
    border-radius: 50%;
    background: #fbfaf5;
  }

  .pb-navigation .is-menu-open .wp-block-navigation__responsive-container-content {
    padding-top: 58px !important;
    flex: 1;
    padding-bottom: 12px;
  }

  .pb-navigation .is-menu-open .wp-block-navigation-item__content {
    padding-block: 12px !important;
    font-size: 1.1rem;
  }

  .pb-navigation .is-menu-open .wp-block-navigation__responsive-container-content::after {
    content: "";
    display: block;
    align-self: center;
    flex: none;
    width: 59px;
    height: 59px;
    margin: auto auto 8px;
    border-top: 20px solid transparent;
    background-origin: content-box;
    background: url("dog-paw.svg") center / contain no-repeat;
  }
}

@media (max-width: 1000px) and (prefers-reduced-motion: no-preference) {
  .pb-navigation .wp-block-navigation__responsive-container.is-menu-open { animation: none; }
  .pb-navigation .is-menu-open .wp-block-navigation__responsive-close {
  }
}


/* Desktop cover caption stays in the quiet lower-left area of the photo. */
@media (min-width: 821px) {
  .home .hero .hero-photo .photo-note {
    inset: auto auto clamp(16px, 2.4vw, 36px) clamp(16px, 2.4vw, 36px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: min(52%, 280px);
    padding: 11px 14px 11px 13px;
    border-left: 2px solid #e4b799;
    border-radius: 0 10px 10px 0;
    background: #182b20ed;
    color: #fbf7ee;
    text-align: left;
    text-wrap: balance;
  }

  .home .hero .hero-photo .photo-note p { margin: 0; }
  .home .hero .hero-photo .photo-note p:first-child {
    font: italic 400 clamp(1rem, 1.45vw, 1.35rem)/1.25 Lora, Georgia, serif;
  }

  .home .hero .hero-photo .photo-note p.small {
    order: -1;
    color: #e4b799;
    font: 650 .64rem/1.35 Manrope, Arial, sans-serif;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
}

@media (max-width: 1000px) {
  .header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .pb-navigation .wp-block-navigation__responsive-container.is-menu-open {
    animation: none !important;
    direction: ltr;
  }

  .pb-navigation .is-menu-open .wp-block-navigation__responsive-close {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    margin: 0;
  }
}

/* Reveal the anchored drawer without translating the links WordPress focuses. */
@media (max-width: 1000px) {
  .pb-navigation .wp-block-navigation__responsive-container.is-menu-open {
    inset: 0 !important;
    width: auto;
    max-width: 100%;
    overflow: hidden;
  }

  .pb-navigation .is-menu-open .wp-block-navigation__responsive-close {
    inset: 0 0 0 auto !important;
    height: auto;
    transform: none !important;
  }
}

@media (max-width: 1000px) and (prefers-reduced-motion: no-preference) {
  .pb-navigation .is-menu-open .wp-block-navigation__responsive-close {
    animation: pb-menu-reveal-right .28s cubic-bezier(.2,.75,.25,1) !important;
  }
}

@keyframes pb-menu-reveal-right {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0); }
}

.pb-navigation.pb-menu-pointer .is-menu-open .wp-block-navigation-item__content:focus {
  outline: none;
}

/* Application button in the shared closing section. */
.cta .wp-block-button.button.light .wp-block-button__link {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 13px 20px 13px 22px;
  border: 1px solid #f1c9ab;
  border-radius: 999px;
  background: #e8b796;
  color: #25382d;
  box-shadow: 0 6px 18px rgb(12 27 19 / .18);
  font-size: .95rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: left;
}

.cta .wp-block-button.button.light .wp-block-button__link::after {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-right: 3px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.cta .wp-block-button.button.light .wp-block-button__link:hover { background: #f4c9ab; }
.cta .wp-block-button.button.light .wp-block-button__link:focus-visible {
  outline: 2px solid #f8f4e9;
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .cta .wrap > .wp-block-buttons,
  .cta .wp-block-button.button.light,
  .cta .wp-block-button.button.light .wp-block-button__link { width: 100%; }
}

/* The three featured dogs form a one-over-two layout on phones. */
@media (max-width: 600px) {
  .home .pb-page > .section > .doggrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 14px;
  }

  .home .pb-page > .section > .doggrid > .dogcard:first-child {
    grid-column: 1 / -1;
  }

  .home .pb-page > .section > .doggrid > .dogcard .image {
    border-radius: 14px;
  }

  .home .pb-page > .section > .doggrid > .dogcard h3 {
    min-height: 0;
    margin: 10px 0 4px;
    font-size: 1.25rem;
  }

  .home .pb-page > .section > .doggrid > .dogcard .details {
    margin-top: 0;
    font-size: .75rem;
  }
}

.pb-menu-contacts { display: none; }

@media (max-width: 1000px) {
  .pb-navigation .is-menu-open .wp-block-navigation__responsive-container-content:has(.pb-menu-contacts)::after {
    display: none;
  }

  .pb-navigation .is-menu-open .pb-menu-contacts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    align-items: center;
    align-self: stretch;
    margin: auto 0 0;
    padding: 16px 0 0;
    border-top: 1px solid #c9d0c2;
  }

  .pb-menu-contacts a {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: fit-content;
    grid-column: 1;
    color: #284331;
    font-weight: 650;
    font-size: .9375rem;
    text-decoration: underline;
    text-decoration-color: #a5afa0;
    text-underline-offset: .25em;
  }

  .pb-menu-contacts::after {
    content: "";
    grid-column: 2;
    grid-row: 1 / 3;
    width: 36px;
    height: 36px;
    background: url("dog-paw.svg") center / contain no-repeat;
  }
}

/* The WordPress template wrapper spans the whole header, including the top line. */
.wp-site-blocks > header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 50;
}

.wp-site-blocks > header.wp-block-template-part .header {
  position: relative;
  top: auto;
}

@media (min-width: 783px) {
  .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
}

@media (min-width: 601px) and (max-width: 782px) {
  .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; }
}

@media (max-width: 1000px) {
  .pb-navigation .is-menu-open .pb-menu-contacts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 8px;
  }

  .pb-menu-contacts::after {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    margin: 4px 0 9px;
    width: 33px;
    height: 33px;
  }
}

@media (max-width: 1000px) {
  .pb-navigation .is-menu-open .pb-menu-contacts {
    border-top: 0;
    padding-top: 0;
  }

  .pb-menu-contacts::after { margin: 12px 0; }

  .pb-menu-contacts a:first-child {
    width: 100%;
    border-top: 1px solid #c9d0c2;
    padding-top: 5px;
  }
}

@media (max-width: 1000px) {
  .pb-navigation .is-menu-open .pb-menu-contacts {
    flex: 1 0 auto;
    grid-template-rows: minmax(57px, 1fr) auto auto;
    margin-top: 0;
  }
}

@media (max-width: 1000px) {
  .pb-menu-contacts::after { grid-row: 3; align-self: end; width: 58px; height: 58px; border-radius: 50%; background: url(probriard-telegram-logo.jpg) center / cover no-repeat; }
  .pb-navigation .is-menu-open .pb-menu-contacts { grid-template-rows: auto auto minmax(82px, 1fr); padding-top: 10px; }
}

@media (max-width: 1000px) {
  .pb-menu-contacts a:first-child { border-top: 0; padding-top: 0; }
  .pb-menu-contacts::after {
    width: 70px;
    height: 70px;
    border-radius: 0;
    background: url(probriard-logo-transparent.svg) center / contain no-repeat;
  }
}

@media (max-width: 1000px) {
  .pb-menu-contacts a { gap: 9px; }

  .pb-menu-contacts a::before {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: center / contain no-repeat;
  }

  .pb-menu-contacts a[href^="https://t.me/"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23284331' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4 20-7ZM22 2 11 13'/%3E%3C/svg%3E");
  }

  .pb-menu-contacts a[href^="tel:"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23284331' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 18 18 0 0 1-7.9-2.8 18 18 0 0 1-5.5-5.5A18 18 0 0 1 3.6 5.7 2 2 0 0 1 5.6 3.5h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1l-1.3 1.3a14 14 0 0 0 5.2 5.2l1.3-1.3a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.1 1.4Z'/%3E%3C/svg%3E");
  }
}

/* A softer silhouette for the three featured portraits. */
.home .pb-page > .section > .doggrid > .dogcard .image {
  border-radius: clamp(22px, 3.2vw, 44px) clamp(18px, 2.5vw, 34px)
    clamp(10px, 1.4vw, 18px) clamp(13px, 1.7vw, 22px);
}

@media (max-width: 600px) {
  .home .pb-page > .section > .doggrid > .dogcard .image {
    border-radius: 21px 17px 10px 12px;
  }

  .home .pb-page > .section > .doggrid > .dogcard:first-child .image {
    border-radius: 30px 24px 14px 17px;
  }
}

.home .pb-page > .section > .doggrid > .dogcard[href$="/briary/ziva/"] .image img {
  object-fit: cover;
}

/* Shared photo silhouette; edge-to-edge cover and document scans have their own frame. */
.pb-page {
  --photo-corners: clamp(20px, 2.7vw, 38px) clamp(17px, 2.15vw, 30px)
    clamp(10px, 1.3vw, 18px) clamp(13px, 1.65vw, 23px);
  --photo-thumb-corners: 20px 16px 10px 13px;
}

.pb-page figure.wp-block-image:not(.pedigree-image, .hero-photo figure, .partner-logos figure),
.pb-page .portrait > img,
.home .pb-page .split .wp-block-image {
  border-radius: var(--photo-corners);
}

.pb-page figure.wp-block-image:not(.pedigree-image, .hero-photo figure, .partner-logos figure) {
  overflow: hidden;
}

.pb-page .gallerygrid figure.wp-block-image,
.pb-page .gallerygrid figure.wp-block-image:hover,
.pb-page .doggrid .dogcard .image,
.pb-page .doggrid .dogcard.pb-tilt .image {
  border-radius: var(--photo-thumb-corners);
}

@media (max-width: 600px) {
  .pb-page {
    --photo-corners: 25px 20px 12px 16px;
    --photo-thumb-corners: 19px 16px 10px 12px;
  }
}

/* Round the visible photo itself, without a taller letterboxed image box. */
.home .pb-page .split figure.wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

@media (max-width: 650px) {
  .wp-block-group.game-section.wrap { width: calc(100% - 20px); }
  .game-page { padding-block: 24px 20px; }
  .game-page .crumbs { margin-bottom: 14px; }
  .game-page .lead { line-height: 1.5; }
  .game-section .game-frame { min-height: 320px; }
  .game-section .game-actions { margin-top: 10px; gap: 10px; }
}
