/*
Theme Name: Piecegrove Rebuilt
Description: Piecegrove's quilt shop assembled from the reusable site modules.
Template: storefront
Version: 2.0.0
Text Domain: piecegrove-rebuilt
*/

:root {
  --pg-ink: #32251e;
  --pg-paper: #fbf7ef;
  --pg-accent: #783a28;
  --pg-soft: #efe3d6;
  --pg-line: #d4c3b4;
  --pg-muted: #68564c;
  --pg-surface: #fffdf8;
  --pg-heading: Georgia, serif;
  --pg-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --control-ink: var(--pg-ink);
  --control-paper: var(--pg-paper);
  --control-accent: var(--pg-accent);
  --control-line: var(--pg-line);
  --control-soft: var(--pg-soft);
  --control-focus: #9a511e;
  --body-font: var(--pg-body);
  --heading-font: var(--pg-heading);
  --ink: var(--pg-ink);
  --surface: var(--pg-surface);
  --soft: var(--pg-soft);
  --accent: var(--pg-accent);
  --muted: var(--pg-muted);
  --line: var(--pg-line);
}

body { margin: 0; background: var(--pg-paper); color: var(--pg-ink); font: 16px/1.56 var(--pg-body); }
.pg-wrap { width: min(100% - clamp(32px, 5vw, 64px), 1248px); margin-inline: auto; }
.pg-main { padding-block: 20px 24px; min-width: 0; }
.pg-main :is(h1,h2,h3) { color: var(--pg-ink); font-family: var(--pg-heading); line-height: 1.16; }
.pg-main h1 { font-size: clamp(32px, 4.5vw, 55px); font-weight: 700; letter-spacing: -.035em; margin: 0 0 12px; }
.pg-main p { color: var(--pg-muted); }
.pg-main a:not(.cc-control) { color: var(--pg-accent); text-underline-offset: 3px; }
.pg-main :focus-visible { outline: 2px solid var(--control-focus); outline-offset: 3px; }
.pg-main .woocommerce-breadcrumb { font-size: 13px; margin: 0 0 14px; padding: 0; color: var(--pg-muted); background: transparent; }
.pg-main .storefront-breadcrumb { margin: 0; padding: 0; }
.pg-main .storefront-breadcrumb .col-full { margin: 0; padding: 0; max-width: none; }

.pg-catalog-head { margin-bottom: 16px; }
.pg-catalog-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-block: 8px 14px;
}
.pg-catalog-intro p { margin: 0; max-width: 57ch; }
.pg-detail-link { flex: none; font-weight: 700; font-size: 14px; }
.pg-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 10px;
  border-block: 1px solid var(--pg-line);
}
.pg-categories a {
  display: inline-flex;
  padding: 7px 11px;
  color: var(--pg-ink);
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.pg-categories a[aria-current] { background: var(--pg-soft); border-color: var(--pg-line); text-decoration: none; }
.pg-catalog .storefront-sorting {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  margin: 0 0 14px; font-size: 14px;
}
.pg-catalog .storefront-sorting::before,
.pg-catalog .storefront-sorting::after { display: none; }
.pg-catalog :is(.woocommerce-ordering,.woocommerce-result-count,.woocommerce-pagination) { float: none; margin: 0; }
.pg-catalog :is(.woocommerce-ordering select) {
  max-width: 100%; min-height: 38px; color: var(--pg-ink);
  border: 1px solid var(--pg-line); border-radius: 4px;
  background: var(--pg-surface); padding: 5px 24px 5px 8px;
}
.pg-catalog ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
  padding: 0;
}
.pg-catalog ul.products::before, .pg-catalog ul.products::after { display: none; }
.pg-catalog ul.products li.product[class] {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  float: none;
  text-align: left;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--pg-line);
  background: var(--pg-surface);
}
.pg-catalog ul.products li.product > .woocommerce-LoopProduct-link { width: 100%; }
.pg-catalog ul.products li.product img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain;
  background: #f3ebe1; margin: 0 0 9px; border-radius: 3px;
}
.pg-catalog ul.products li.product h2 {
  font: 690 15px/1.35 var(--pg-body); color: var(--pg-ink); margin: 0 0 6px;
}
.pg-catalog ul.products li.product .price { color: var(--pg-accent); font-weight: 650; margin-bottom: 12px; }
.pg-catalog ul.products li.product .cc-button {
  align-self: stretch;
  width: 100%;
  min-width: 0;
  margin: auto 0 0;
  padding-inline: 10px;
}
.pg-catalog .pagination { margin-top: 10px; }
.pg-catalog .product-help { margin-top: 20px; }

.pg-product aside.storefront-product-pagination,
.pg-product .storefront-product-pagination { display: none; }
.pg-product .related ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
}
.pg-product .related ul.products::before, .pg-product .related ul.products::after { display: none; }
.pg-product .related ul.products li.product[class] {
  display: flex;
  flex-direction: column;
  float: none;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--pg-line);
  background: var(--pg-surface);
  text-align: start;
}
.pg-product .related ul.products li.product img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; margin: 0 0 8px; }
.pg-product .related ul.products li.product h2 { font: 650 15px/1.35 var(--pg-body); margin-block: 4px 6px; }
.pg-product .related ul.products li.product .cc-button { margin-top: auto; min-width: 0; width: 100%; padding-inline: 9px; }

.pg-page { max-width: 1120px; margin-inline: auto; }
.pg-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 144px;
  gap: 18px;
  padding: clamp(18px, 4vw, 38px);
  margin-bottom: 22px;
  background: var(--pg-soft);
  border: 1px solid var(--pg-line);
}
.pg-page-head h1 { margin: 0; }
.pg-page-head .pg-back {
  display: inline-block; margin-bottom: 10px; font-size: 13px; font-weight: 700;
}
.pg-page-photo {
  width: min(41%, 380px);
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: 5px;
}
.pg-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.7fr) minmax(200px, 1fr);
  gap: clamp(22px, 5vw, 64px);
  align-items: start;
}
.pg-page-grid:not(:has(aside, .pg-contact-card)) { grid-template-columns: minmax(0, 1fr); max-width: 770px; }
.pg-page-grid--contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-contact-card {
  padding: 17px;
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  min-width: 0;
}
.pg-contact-card .piq-inquiry { margin: 0; }
.pg-contact-card #piq-inquiry-title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.pg-contact-card textarea { min-height: 120px; height: 120px; }
.pg-contact-card :is(input[type="text"],input[type="email"],textarea) {
  border: 1px solid var(--pg-line); background: #fffefa; box-shadow: none;
}
.pg-contact-card [type="submit"] {
  background: var(--pg-accent); color: var(--pg-surface); min-height: 44px; border-radius: 4px;
}
.pg-page-copy { min-width: 0; }
.pg-page-copy h2 { margin: 22px 0 7px; font-size: 26px; }
.pg-page-copy h3 { margin: 16px 0 5px; font-size: 21px; }
.pg-page-copy p { margin: 0 0 12px; }
.pg-page-copy ul, .pg-page-copy ol { padding-inline-start: 1.3rem; margin: 0 0 12px; }
.pg-page-links { background: var(--pg-surface); border: 1px solid var(--pg-line); padding: 16px; }
.pg-page-links h2 { font-size: 20px; margin: 0 0 8px; }
.pg-link-list { padding: 0; margin: 0; list-style: none; }
.pg-link-list li + li { border-top: 1px solid var(--pg-line); }
.pg-link-list a { display: block; padding-block: 8px; font-weight: 650; font-size: 14px; }
.pg-page-layout-2 .pg-page-head, .pg-page-layout-6 .pg-page-head, .pg-page-layout-9 .pg-page-head { background: var(--pg-surface); border-inline: 0; }
.pg-page-layout-3 .pg-page-head, .pg-page-layout-8 .pg-page-head { border: 0; border-inline-start: 3px solid var(--pg-accent); text-align: start; }
.pg-page-layout-4 .pg-page-head, .pg-page-layout-10 .pg-page-head { border: 0; border-bottom: 2px solid var(--pg-line); background: transparent; }
.pg-page-layout-5 .pg-page-links, .pg-page-layout-7 .pg-page-links { background: var(--pg-soft); }
.pg-page--contact :is(input[type="email"],input[type="text"],textarea) { width: 100%; }

@media (max-width: 760px) {
  .pg-main { padding-block: 16px 20px; }
  .pg-catalog-intro { display: block; }
  .pg-catalog-intro p { margin-bottom: 9px; }
  .pg-categories { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .pg-categories a { flex: none; padding-inline: 8px; }
  .pg-catalog ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pg-catalog ul.products li.product[class] { padding: 7px; }
  .pg-catalog ul.products li.product h2 { font-size: 13px; }
  .pg-catalog ul.products li.product .cc-button { font-size: 13px; padding-inline: 6px; gap: 4px; }
  .pg-catalog ul.products li.product .cc-button .cc-icon { width: 15px; height: 15px; }
  .pg-product .related ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pg-product .related ul.products li.product h2 { font-size: 13px; }
  .pg-product .related ul.products li.product .cc-button { font-size: 13px; gap: 4px; padding-inline: 6px; }
  .pg-page-head { min-height: 0; margin-bottom: 16px; }
  .pg-page-grid, .pg-page-grid--contact { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pg-page-copy h2 { font-size: 24px; margin-top: 17px; }
}
@media (max-width: 420px) {
  .pg-page-head:has(.pg-page-photo) { display: grid; }
  .pg-page-photo { width: 100%; max-height: 175px; }
  .pg-catalog .storefront-sorting { margin-bottom: 10px; }
}
