/* KeptPaw 2.4: product hierarchy, comparable artwork and task-first creation.
 * Extend the shared tokens; no scroll-reveal or JS-hidden content. */

/* Shared content edges; shell padding sits outside the usable page width. */
body.epb-site { --kp-page-gutter: var(--space-sm); }
body.epb-site :is(.epb-content-shell, .epb-shop-shell, .epb-global-nav, .epb-local-nav) {
  max-width: calc(var(--page-shell) + (var(--kp-page-gutter) * 2));
  padding-inline: var(--kp-page-gutter);
}
body.epb-site .epb-footer,
body.home.epb-site .epb-footer { padding-inline: var(--kp-page-gutter); }

/* Override WordPress's automatic centering without widening reading text. */
body.epb-site .epb-content-shell > :is(.wp-block-post-title, .wp-block-post-date, .wp-block-query-title, .wp-block-query, .wp-block-post-template),
body.epb-site .epb-content-shell > .wp-block-post-content > :not(.aligncenter):not(.alignleft):not(.alignright) {
  margin-inline: 0 !important;
}
body.epb-site .epb-content-shell > .wp-block-post-template { padding-inline-start: 0; }
body.epb-site .epb-content-shell .wp-block-post-content > .kp-workflow { padding-inline: 0; }
body.epb-site :is(.kp-split-section, .kp-photo-grades, .epb-detail-grid) > * { margin-block: 0; }

/* Long documents keep their title, date and body in one reading column. */
body.epb-site:is(.single-post, .kp-page-privacy, .kp-page-terms, .kp-page-refunds, .kp-page-shipping, .kp-page-digital-delivery) .epb-content-shell > :is(.wp-block-post-title, .wp-block-post-date, .wp-block-post-content) {
  width: 100%;
  max-width: var(--page-reading);
  margin-inline: auto !important;
}

/* WooCommerce's cart, checkout and product templates do not use our shell. */
body.epb-site.single-product .wp-site-blocks > .wp-block-group.woocommerce.product {
  border: 0;
  padding: 0;
}
body.epb-site:is(.woocommerce-cart, .woocommerce-checkout, .single-product) main,
body.epb-site.woocommerce-checkout .wp-site-blocks > header.wp-block-template-part > header.wp-block-group {
  width: 100%;
  max-width: calc(var(--page-shell) + (var(--kp-page-gutter) * 2));
  margin-inline: auto !important;
  padding-inline: var(--kp-page-gutter);
}
body.epb-site.woocommerce-cart .wc-block-grid__products { margin-inline: 0; }
body.epb-site.woocommerce-cart .wc-block-grid__product { border-inline-width: 0; }

/* Login and password recovery share a compact, consistently aligned column. */
body.epb-site.woocommerce-account:not(.logged-in) .epb-content-shell > :is(.wp-block-post-title, .wp-block-post-content) {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto !important;
}

/* One shared outer edge for every homepage section, at every breakpoint. */
body.home.epb-site .kp-apple-home > :is(
  .kp-apple-hero, .kp-apple-proof, .kp-apple-gallery,
  .kp-apple-process, .kp-apple-faq, .kp-apple-offer
) {
  width: calc(100% - (var(--kp-page-gutter) * 2));
  max-width: var(--page-shell);
  margin-inline: auto;
}
body.home.epb-site .kp-apple-home > :is(.kp-apple-gallery, .kp-apple-process, .kp-apple-faq) {
  padding-inline: 0;
}
body.home.epb-site .kp-apple-hero {
  border-radius: var(--radius-lg);
  margin-block-start: var(--space-md);
}

body.home.epb-site .kp-apple-home a { white-space: normal; }
body.home.epb-site .kp-apple-hero { grid-template-areas: "copy" "visual"; }
body.home.epb-site .kp-apple-hero .kp-photo-hero__caption {
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}
body.home.epb-site .kp-apple-hero .kp-photo-hero__caption h1 {
  font-size: clamp(2.5rem, 10.5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  max-width: 15ch;
  margin-bottom: var(--space-sm);
}
body.home.epb-site .kp-apple-hero .kp-plate-caption { margin-bottom: var(--space-sm); }
body.home.epb-site .kp-apple-hero .kp-hero-lede { max-width: 36ch; }
body.home.epb-site .kp-apple-hero .epb-actions { margin-top: var(--space-md); }
body.home.epb-site .kp-apple-hero .kp-photo-hero__image img {
  aspect-ratio: 3 / 2;
  object-fit: contain;
}
body.home.epb-site .kp-apple-hero .kp-hero-facts {
  max-width: 40ch;
  font-size: var(--text-sm);
  line-height: 1.45;
  margin-bottom: 0;
}

body.home.epb-site .kp-apple-proof h2,
body.home.epb-site .kp-apple-gallery .kp-section-head h2,
body.home.epb-site :where(.kp-apple-process, .kp-apple-faq) .kp-section-head h2 {
  font-size: clamp(2rem, 3.8vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.06;
  max-width: 18ch;
}
body.home.epb-site .kp-apple-proof .kp-before-after__figure--finished img {
  object-fit: contain;
  background: var(--color-paper);
}
body.home.epb-site .kp-apple-gallery { padding-block: var(--space-3xl); }
body.home.epb-site .kp-apple-gallery .kp-section-head { max-width: none; }
body.home.epb-site .kp-apple-gallery .kp-direction-strip {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: var(--space-md);
}
body.home.epb-site .kp-style-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
body.home.epb-site .kp-style-card .wp-block-image { margin: 0; overflow: hidden; }
body.home.epb-site .kp-style-card .wp-block-image a { display: block; }
body.home.epb-site .kp-style-card .wp-block-image a:focus-visible { outline-offset: -4px; }
body.home.epb-site .kp-style-card .wp-block-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  display: block;
  object-fit: contain;
  border-radius: 0;
  transition: transform var(--dur-hover) var(--ease-out);
}
body.home.epb-site .kp-style-card__copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  gap: var(--space-xs);
  margin: 0;
}
body.home.epb-site .kp-style-card__copy h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0;
}
body.home.epb-site .kp-style-card__copy p { margin: 0; color: var(--color-muted); }
body.home.epb-site .kp-style-card__copy p:last-child { margin-top: auto; padding-top: var(--space-2xs); }
body.home.epb-site .kp-style-card__copy a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-base);
  line-height: 1.4;
}
body.home.epb-site .kp-apple-process .kp-step-sequence li {
  background: var(--color-surface);
  min-height: 0;
  gap: var(--space-xs);
  padding: var(--space-md);
}
body.home.epb-site .kp-apple-process .kp-step-sequence strong { font-size: var(--text-lg); }
body.home.epb-site .kp-apple-faq { padding-block: var(--space-3xl); }

/* A page title introduces a task; it does not postpone the task. */
body.epb-site.kp-page-create .epb-content-shell,
body.epb-site.kp-page-examples .epb-content-shell {
  padding-block-start: var(--space-xl);
}
body.epb-site.kp-page-create .epb-content-shell > .wp-block-post-title,
body.epb-site.kp-page-examples .epb-content-shell > .wp-block-post-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.06;
  margin-bottom: var(--space-md);
  max-width: 22ch;
}
body.epb-site .kp-create-intro { max-width: var(--page-reading); margin: 0 0 var(--space-lg); }
body.epb-site .kp-create-intro .epb-lead { font-size: var(--text-md); margin-bottom: 0; }
body.epb-site .kp-create-task-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-md);
  margin: 0;
  max-width: none;
}
body.epb-site .kp-create-order,
body.epb-site .kp-create-review {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  margin: 0;
  min-width: 0;
}
body.epb-site .kp-create-order { background: var(--color-paper); }
body.epb-site :where(.kp-create-order, .kp-create-review) h2 {
  font-size: clamp(1.625rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
}
body.epb-site .kp-create-order :where(p, ul) { font-size: var(--text-base); }
body.epb-site .kp-create-order ul { padding-left: var(--space-md); }
body.epb-site .kp-create-order .epb-actions { margin-top: var(--space-md); }
body.epb-site .kp-create-review { scroll-margin-top: 8rem; }
body.epb-site .kp-create-review > p { font-size: var(--text-base); }
body.epb-site .kp-create-review .epb-intake-wrap {
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: var(--space-lg) 0 0;
  max-width: none;
}
body.epb-site .kp-create-review .epb-intake-wrap > h2 { font-size: var(--text-lg); }
body.epb-site .kp-create-review .epb-intake-wrap > p { font-size: var(--text-base); }
body.epb-site .epb-style-hint { display: block; margin-top: var(--space-2xs); }
body.epb-site .kp-create-guidance { margin-block: var(--space-xl); max-width: none; }
body.epb-site .kp-create-guidance > h2 { font-size: var(--text-xl); }
body.epb-site .kp-disclosure {
  background: var(--color-paper);
  border-radius: var(--radius-md);
  padding: 0 var(--space-md);
  margin: var(--space-xs) 0;
}
body.epb-site .kp-disclosure summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 3.5rem;
  padding-block: var(--space-sm);
  color: var(--color-ink);
}
body.epb-site .kp-disclosure > :last-child:not(summary) { padding-bottom: var(--space-md); }
body.epb-site .kp-disclosure > :not(summary) { color: var(--color-ink-2); }
body.epb-site .kp-gallery-entry { scroll-margin-top: 8rem; align-items: center; }
body.epb-site .kp-gallery-entry__pair .wp-block-image:last-child img {
  object-fit: contain;
  background: var(--color-paper);
}
body.epb-site .kp-gallery-entry__caption { padding-bottom: 0; }
body.epb-site .kp-style-actions { margin-top: var(--space-md); }
body.epb-site .kp-style-actions .wp-block-button__link { white-space: normal; }

/* Physical feedback is pointer-led; keyboard state/focus stays immediate. */
body.epb-site :where(.wp-element-button, .epb-intake-submit) {
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-hover) ease, color var(--dur-hover) ease;
}
html[data-kp-input="keyboard"] body.epb-site :where(.wp-element-button, .epb-intake-submit):active { transform: none; }
html[data-kp-input="keyboard"] body.epb-site .wp-block-details summary::after { transition: none; }
body.epb-site .wp-block-details[data-kp-animating] { overflow: hidden; }
body.epb-site .wp-block-details summary:focus-visible { outline-offset: -3px; }

@media (min-width: 40rem) {
  body.epb-site { --kp-page-gutter: var(--space-md); }
  body.home.epb-site .kp-apple-hero .kp-photo-hero__caption { padding-inline: var(--space-xl); }
  body.home.epb-site .kp-apple-hero .epb-actions { flex-direction: row; }
  body.home.epb-site .kp-apple-gallery .kp-direction-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.home.epb-site .kp-style-card__copy { padding: var(--space-md); }
  body.home.epb-site .kp-style-card__copy h3 { font-size: clamp(1.25rem, 2vw, 1.625rem); }
}
@media (min-width: 48rem) {
  body.epb-site:is(.kp-page-digital-pet-gift, .kp-page-pet-memorial-portrait) .kp-split-section {
    row-gap: var(--space-md);
  }
  body.epb-site:is(.kp-page-digital-pet-gift, .kp-page-pet-memorial-portrait) .kp-split-section > h2 {
    grid-row: span 2;
  }
  body.epb-site:is(.kp-page-digital-pet-gift, .kp-page-pet-memorial-portrait) .kp-split-section > p {
    grid-column: 2;
  }
}
/* Below this width the order summary cannot sustain a readable second column. */
@media (max-width: 59.999rem) {
  body.epb-site.woocommerce-checkout .wc-block-components-sidebar-layout {
    flex-direction: column;
    gap: var(--space-md);
  }
  body.epb-site.woocommerce-checkout .wc-block-components-sidebar-layout > :is(.wc-block-components-main, .wc-block-components-sidebar) {
    flex: 0 1 auto;
    width: 100%;
    margin-inline: 0;
  }
}
@media (min-width: 60rem) {
  body.epb-site .epb-nav .kp-mobile-product-link { display: none; }
  body.home.epb-site .kp-apple-hero {
    grid-template-areas: "copy visual";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 34rem;
  }
  body.home.epb-site .kp-apple-hero .kp-photo-hero__caption { padding: var(--space-xl); }
  body.home.epb-site .kp-apple-hero .kp-photo-hero__caption h1 { font-size: var(--text-hero); }
  body.home.epb-site .kp-apple-hero .kp-photo-hero__image { display: flex; align-items: center; }
  body.home.epb-site .kp-apple-hero .kp-photo-hero__image img { height: auto; object-fit: contain; }
  body.home.epb-site .kp-apple-proof { margin-top: var(--space-xl); }
  body.home.epb-site .kp-style-card__copy { padding: var(--space-lg); }
  body.epb-site .kp-create-task-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--space-xl); }
  body.epb-site .kp-create-order,
  body.epb-site .kp-create-review { padding: var(--space-lg); }
}
@media (hover: hover) and (pointer: fine) {
  body.home.epb-site .kp-style-card .wp-block-image a:hover img { transform: scale(1.012); }
  body.epb-site .kp-style-actions .wp-block-button__link:hover { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  body.home.epb-site .kp-style-card .wp-block-image a:hover img,
  body.epb-site .kp-style-actions .wp-block-button__link:hover,
  body.epb-site :where(.wp-element-button, .epb-intake-submit):active { transform: none; }
  body.home.epb-site .kp-style-card .wp-block-image img,
  body.epb-site :where(.wp-element-button, .epb-intake-submit) { transition: none; }
}
