/* Catalog and product layouts. Shared typography comes from type-system.css. */
.catalog-list,
.product-detail {
  padding-inline: max(var(--page-gutter), calc((100vw - var(--content-width)) / 2));
}

/* Product photography and browsing controls */
.product-photo img,
.detail-main-image img { display: block; width: 100%; height: 100%; object-fit: cover; filter: var(--photo-grade); }
.catalog-list { padding-block: var(--section-space); background: var(--cream); }
.catalog-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.catalog-heading .eyebrow { margin-bottom: 16px; }
.catalog-heading h2 { margin: 0; }
.catalog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding-bottom: 4px; }
.catalog-count { margin: 0; color: var(--muted); white-space: nowrap; }
.catalog-note { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 28px; padding-block: 18px; border-block: 1px solid var(--line); color: var(--muted); }
.catalog-note > span { color: var(--clay); font-size: 20px; line-height: 1.3; }
.catalog-note p { margin: 0; max-width: 84ch; }
.catalog-note strong { color: var(--ink); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filter-chip { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 46px; padding: 11px 18px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.filter-chip span { color: var(--muted); font-size: 11px; }
.filter-chip:hover,
.filter-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter-chip:hover span,
.filter-chip.is-active span { color: var(--paper); }

/* Whole-card links avoid duplicate tab stops and keep the action in the flow. */
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.product-card { min-width: 0; border: 1px solid var(--line); background: var(--paper); }
.product-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.product-card-link:focus-visible { outline-offset: 6px; }
.product-photo { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand); }
.product-photo img { transition: transform .4s ease; }
.product-number { position: absolute; top: 18px; left: 18px; padding: 7px 10px; background: rgba(35, 29, 25, .76); color: #fff; font-size: 11px; letter-spacing: .1em; }
.product-card-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-width: 0; padding: clamp(22px, 2.5vw, 32px); }
.product-category { max-width: 100%; overflow-wrap: anywhere; color: var(--muted); text-transform: uppercase; }
.product-card-copy h3 { max-width: 100%; margin: 12px 0; letter-spacing: -.025em; transition: color .2s; }
.product-card-copy p { max-width: 46ch; margin: 0 0 20px; }
.product-detail-link { display: inline-flex; align-items: center; justify-content: space-between; width: 100%; gap: 14px; min-height: 48px; padding-top: 12px; margin-top: auto; border-top: 1px solid var(--line); color: var(--clay); font-size: 13px; font-weight: 600; }
.product-detail-link > span { font-size: 18px; }
.product-card-link:hover h3,
.product-card-link:focus-visible h3 { color: var(--clay); }

/* Product detail */
.product-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; gap: var(--section-gap); padding-block: 24px var(--section-space); }
.detail-gallery { min-width: 0; }
.detail-main-image { position: relative; aspect-ratio: 1; max-height: 580px; margin: 0; overflow: hidden; background: var(--sand); }
.image-caption { margin: 12px 0 0; color: var(--muted); }
.image-caption a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.detail-copy { min-width: 0; padding-top: 24px; }
.detail-copy .eyebrow { margin-bottom: 20px; }
.detail-copy h1 { margin-bottom: 22px; overflow-wrap: break-word; }
.detail-lead { max-width: 44ch; margin: 0; }
.detail-rule { margin-block: 28px 20px; border-top: 1px solid var(--line); }
.detail-example { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; color: var(--muted); }
.detail-example > span { flex-shrink: 0; color: var(--clay); font-size: 20px; line-height: 1.3; }
.detail-button { justify-content: space-between; min-width: min(100%, 250px); }
.detail-secondary-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 24px; margin-top: 20px; }
.return-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); }
.return-link > span { color: var(--clay); }
.return-link:hover { color: var(--ink); }
.detail-signature { display: flex; align-items: center; gap: 12px; margin-top: 32px; color: var(--muted); line-height: 1.5; }
.detail-signature > span { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--clay); border-radius: 50%; color: var(--clay); font: 20px var(--serif); }
.detail-signature p { margin: 0; }
.detail-signature strong { color: var(--ink); font-weight: 600; }

/* Native share and its manual-copy fallback */
.product-share { min-width: 0; max-width: 100%; }
.share-product-button { min-height: 44px; padding: 8px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-family: var(--sans); cursor: pointer; }
.share-product-button:disabled { opacity: .65; cursor: wait; }
.share-status { margin: 0; color: var(--muted); font-size: var(--type-small-copy); line-height: var(--line-small-copy); }
.share-status:not(:empty) { margin-top: 10px; }
.share-url-label { display: block; margin-top: 12px; color: var(--muted); font-size: var(--type-small-copy); line-height: var(--line-small-copy); }
.share-url { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .product-card-link:hover .product-photo img { transform: scale(1.035); }
}

@media (max-width: 850px) {
  .catalog-heading { align-items: flex-start; }
  .catalog-tools { width: 100%; justify-content: space-between; }
  .product-grid { gap: 24px; }
  .product-detail { grid-template-columns: 1fr; gap:32px; }
  .detail-gallery { width:100%;max-width:600px; }
  .detail-main-image { max-height:none; }
  .detail-lead { max-width:54ch; }
  .detail-copy { padding-top: 0; }
}

@media (max-width: 620px) {
  .catalog-heading { gap: 16px; margin-bottom: 22px; }
  .catalog-tools { padding-bottom: 0; }
  .catalog-note { margin-bottom: 24px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
  .filter-chip { justify-content: space-between; padding-inline: 14px; }
  .product-card-copy p { max-width: none; }
  .product-number { top: 16px; left: 16px; }
  .product-detail { grid-template-columns: 1fr; padding-top: 16px; gap: 28px; }
  .detail-main-image { aspect-ratio: 1; max-height: none; }
  .detail-copy .eyebrow { margin-bottom: 18px; }
  .detail-copy h1 { margin-bottom: 20px; }
  .detail-rule { margin-top: 24px; }
  .detail-button { width: 100%; }
  .detail-secondary-actions { justify-content: space-between; }
  .detail-signature { display: none; }
}

/* Full photographs and a short path to the next proposal. */
.catalog-list { scroll-margin-top:24px; }
.detail-image-link { display:block;position:relative;width:100%;height:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:inherit;appearance:none;cursor:zoom-in; }
.detail-image-link:disabled { cursor:default;opacity:1; }
.detail-image-hint[hidden] { display:none; }
.detail-image-link:focus-visible { outline-offset:-5px; }
.detail-image-hint { position:absolute;right:16px;bottom:16px;display:inline-flex;align-items:center;gap:16px;min-height:44px;padding:10px 14px;background:var(--paper);color:var(--ink);font-size:13px;font-weight:600;line-height:1.4; }
.detail-image-hint>span { font-size:20px;line-height:1; }
.related-products { padding:var(--section-space) var(--page-inset);background:var(--cream); }
.related-heading { display:flex;align-items:end;justify-content:space-between;flex-wrap:wrap;gap:24px;margin-bottom:32px; }
.related-heading .eyebrow { margin-bottom:16px; }
.related-product-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px; }
.related-product-link { display:grid;grid-template-columns:140px minmax(0,1fr);min-width:0;border:1px solid var(--line);background:var(--paper); }
.related-product-link>img { width:100%;height:100%;min-height:170px;object-fit:cover;filter:var(--photo-grade); }
.related-product-copy { display:flex;flex-direction:column;align-items:flex-start;min-width:0;padding:22px; }
.related-product-copy>strong { margin:10px 0;font:500 25px/1.2 var(--serif);letter-spacing:-.02em; }
.related-product-action { display:inline-flex;align-items:center;gap:18px;min-height:44px;margin-top:auto;color:var(--clay);font-size:13px;font-weight:600; }
.related-product-link:hover strong { color:var(--clay); }
body.photo-viewer-open { overflow:hidden; }
.photo-dialog { width:min(1040px,calc(100% - 32px));max-width:none;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);padding:20px;border:1px solid var(--line);border-radius:2px;background:var(--paper);color:var(--ink);overflow:auto;overscroll-behavior:contain; }
.photo-dialog::backdrop { background:rgba(33,28,25,.76); }
.photo-dialog-close { position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:center;min-height:48px;margin:0 0 16px auto;padding:10px 22px;border:1px solid var(--ink);border-radius:2px;background:var(--paper);color:var(--ink);font-size:14px;cursor:pointer; }
.photo-dialog-close:hover { background:var(--ink);color:var(--paper); }
.photo-dialog-figure { margin:0; }
.photo-dialog-image { display:block;width:100%;height:auto;max-height:calc(100vh - 240px);max-height:calc(100dvh - 240px);object-fit:contain;background:var(--cream); }
.photo-dialog-caption,.photo-dialog-error { margin:14px 0 0;color:var(--muted);font-size:13px;line-height:1.6; }
@media (max-width:850px) {
  .related-product-link { grid-template-columns:100px minmax(0,1fr); }
  .related-product-copy { padding:18px; }
  .related-product-copy>strong { font-size:23px; }
}
@media (max-width:620px) {
  .related-heading { gap:16px;margin-bottom:24px; }
  .related-product-grid { grid-template-columns:1fr;gap:16px; }
  .related-product-link { grid-template-columns:104px minmax(0,1fr); }
  .related-product-link>img { min-height:150px; }
  .detail-image-hint { right:12px;bottom:12px; }
  .photo-dialog { width:calc(100% - 20px);max-height:calc(100dvh - 20px);padding:16px; }
}
@media print { .photo-dialog,.detail-image-hint { display:none !important; } }
