/*
 * Dpet inner pages (shop, cart, checkout, product, knowledge, regular pages).
 * Loaded after the frozen v7.2.6 stylesheet, which already styles the shared
 * header, navigation, footer and overlays. This file only lays out the page
 * content below the fixed header, using the approved v7.2.6 tokens and the
 * prototype's inner-page title scale (.standalone-page-title).
 * Commerce screens get their full prototype parity in WP-03.
 */

body[data-page="inner"] {
  --dpet-inner-gutter: 40px;
}

/* WordPress core accessibility helper (labels, pagination, cart controls). */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Content column under the fixed header. */
body[data-page="inner"] #main-content {
  display: block;
  width: min(var(--dpet-content-wide, 1180px), calc(100% - var(--dpet-inner-gutter)));
  min-height: 60vh;
  margin-inline: auto;
  padding: calc(var(--header-h) + clamp(26px, 3.2vw, 48px)) 0 clamp(64px, 7vw, 108px);
}

body[data-page="inner"] #main-content img { height: auto; }

/* Page titles follow the prototype's standalone inner-page title. */
body[data-page="inner"] #main-content h1:not(.product_title) {
  margin: 0 0 clamp(18px, 2.4vw, 30px);
  font-size: clamp(46px, 5.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}

body[data-page="inner"] #main-content h1.product_title {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.1;
  letter-spacing: -.02em;
  text-wrap: balance;
}

body[data-page="inner"] .woocommerce-breadcrumb {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}
body[data-page="inner"] .woocommerce-breadcrumb a { color: var(--green); }

/* WooCommerce product grid (carried over from 0.2.2 commerce.css). */
.woocommerce ul.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 18px;
  background: #fff;
  border: 1px solid rgba(21, 82, 50, .10);
  border-radius: var(--radius-lg);
}
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  min-height: 44px;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: #fff;
}
.woocommerce div.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.woocommerce div.product .summary,
.woocommerce div.product div.images { float: none !important; width: auto !important; }
bdi[dir="ltr"] { unicode-bidi: isolate; direction: ltr; }

/* Knowledge center: a single guide on its own address (the list itself uses the v7.2.6 knowledge page styles). */
body.page-knowledge .knowledge-guide { max-width: var(--dpet-reading, 760px); margin-inline: auto; text-align: right; }
body.page-knowledge .knowledge-guide .standalone-page-title { margin: 6px 0 14px; font-size: clamp(36px, 4.6vw, 60px); }
body.page-knowledge .knowledge-guide .article-modal-intro { margin: 0 0 22px; color: var(--muted); font-size: 18px; line-height: 1.7; }
body.page-knowledge .knowledge-guide .article-modal-actions { margin-top: 24px; }
/* The prototype opens guides with a <button>; here it is a real link (each guide has its own address), sized like that button. */
body.page-knowledge a.knowledge-link { font-size: 13.3333px; line-height: normal; }
body.page-knowledge .dpet-knowledge-empty { text-align: center; color: var(--muted); }
body.page-knowledge .dpet-knowledge-empty a { color: var(--green); text-decoration: underline; }

@media (max-width: 980px) {
  body[data-page="inner"] #main-content h1:not(.product_title) { font-size: clamp(40px, 7.5vw, 62px); }
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .woocommerce div.product { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body[data-page="inner"] { --dpet-inner-gutter: 32px; }
  body[data-page="inner"] #main-content { padding-top: calc(var(--header-h) + 20px); padding-bottom: 64px; }
  body[data-page="inner"] #main-content h1:not(.product_title) { font-size: clamp(36px, 10.8vw, 48px); line-height: 1.08; }
  .woocommerce ul.products { gap: 10px; }
  .woocommerce ul.products li.product { padding: 12px; }
}
