/* PetJovial v27 — conservative mobile/performance hardening */
:root { --pjv27-focus: #0b7d86; }

/* Prevent children from forcing grid/flex parents wider than the viewport. */
main, .site-main, .entry-content, .post-content, .pjhome-v25,
.pj-blog-shell, .pjcompare-shell, .pjclaims-shell, .pjcompany-shell,
.pjguide-shell, .pjvet-shell { min-width: 0; }

.entry-content img, .post-content img, main img,
.entry-content video, .post-content video, main video,
.entry-content iframe, .post-content iframe, main iframe {
  max-width: 100%;
}
img { height: auto; }

/* JS adds this wrapper without changing the table itself or its semantics. */
.pjv27-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  margin-block: 1.25rem;
  border-radius: 10px;
}
.pjv27-table-scroll > table { margin-block: 0 !important; min-width: min(680px, 100%); }
.pjv27-table-scroll:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pjv27-focus) 42%, transparent);
  outline-offset: 3px;
}

/* Long citations, policy URLs and code must never cause page-level horizontal scroll. */
.entry-content a, .post-content a, main a { overflow-wrap: anywhere; }
.entry-content pre, .post-content pre, main pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Visible keyboard focus across custom PetJovial controls. */
:is(.pjhome-v25,.pj-blog-shell,.pjcompare-shell,.pjclaims-shell,.pjcompany-shell,.pjguide-shell,.pjvet-shell)
:is(a,button,input,select,textarea):focus-visible,
.pjv26-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pjv27-focus) 45%, transparent);
  outline-offset: 3px;
}

@media (max-width: 782px) {
  /* 16px prevents Safari/iOS from zooming the viewport when a field receives focus. */
  :is(.pjhome-v25,.pj-blog-shell,.pjcompare-shell,.pjclaims-shell,.pjcompany-shell,.pjguide-shell,.pjvet-shell)
  :is(input[type="search"],input[type="text"],input[type="email"],select,textarea) {
    font-size: 16px !important;
  }

  /* WCAG-friendly physical target size without globally enlarging inline article links. */
  :is(.pjhome-v25,.pj-blog-shell,.pjcompare-shell,.pjclaims-shell,.pjcompany-shell,.pjguide-shell,.pjvet-shell)
  :is(button,.button,[role="button"]),
  .pjv26-button {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Filter bars stay usable without crushing labels into multiple tiny rows. */
  :is(.pj-blog-filters,.pjcompare-filters,.pjclaims-filters,.pjcompany-filters,.pjguide-filters,.pjvet-filters,
      .pj-filter-row,.pj-filter-pills,.filter-buttons) {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: .25rem;
  }
  :is(.pj-blog-filters,.pjcompare-filters,.pjclaims-filters,.pjcompany-filters,.pjguide-filters,.pjvet-filters,
      .pj-filter-row,.pj-filter-pills,.filter-buttons) > * { flex: 0 0 auto; }

  /* Commercial next-step buttons read naturally on narrow screens. */
  .pjv26-decision__actions { display: grid !important; grid-template-columns: 1fr !important; }
  .pjv26-button { width: 100%; justify-content: center; text-align: center; }

  /* Avoid card/grid children setting an implicit minimum width. */
  :is(.pjhome-feature,.pj-blog-card,.pjcompare-card,.pjclaims-card,.pjcompany-card,.pjguide-card,.pjvet-card) {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  :is(.entry-content,.post-content) h1 { font-size: clamp(1.85rem, 8vw, 2.35rem); line-height: 1.08; }
  :is(.entry-content,.post-content) h2 { font-size: clamp(1.4rem, 6vw, 1.8rem); line-height: 1.18; }
  :is(.entry-content,.post-content) h3 { font-size: clamp(1.15rem, 5vw, 1.4rem); line-height: 1.25; }
}

@media (prefers-reduced-motion: reduce) {
  .pjhome-v25 *, .pj-blog-shell *, .pjcompare-shell *, .pjclaims-shell *,
  .pjcompany-shell *, .pjguide-shell *, .pjvet-shell *, .pjv26-decision * {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
