/* Hallmark · redesign: full · genre: modern-minimal · theme: brand · scope: app · signature: a wax sculpture in a curved cherry-red collection cover. */
/* Critique: The category and count share the cover. The first pair of products remains within reach on a phone. */
@import url("tokens.css");

@font-face {
  font-family: Fraunces;
  src: url(fonts/fraunces-latin.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  src: url(fonts/fraunces-latin-ext.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02FF,U+0304,U+0308,U+0329,U+1E00-1EFF,U+20A0-20CF;
}
@font-face {
  font-family: "DM Sans";
  src: url(fonts/dmsans-latin.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url(fonts/dmsans-latin-ext.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02FF,U+0304,U+0308,U+0329,U+1E00-1EFF,U+20A0-20CF;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 1rem/1.5 var(--text);
}
h1, h2, p, dl, dd { margin: 0; }
h1, h2 { font-family: var(--display); min-width: 0; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-weight: 600; font-size: clamp(2rem, 4.5vw, 3.8rem); line-height: 1.02; letter-spacing: -.055em; }
h2 { font-weight: 600; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { color: var(--wine-deep); background: var(--blush); }
.skip { position: fixed; z-index: 3; left: .5rem; top: .5rem; padding: .8rem; background: var(--surface); transform: translateY(-170%); }
.skip:focus { transform: none; }

.masthead { background: var(--surface); border-bottom: 1px solid var(--rule); }
.brand-row { display: flex; justify-content: center; padding: 1.15rem var(--gutter) .9rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--wine); }
.brand-mark { width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--blush); display: grid; place-items: center; }
.brand img { width: 1.7rem; height: 2rem; object-fit: contain; }
.wordmark { display: grid; font: 550 2rem/.98 var(--brand-face); letter-spacing: -.06em; }
.wordmark i { justify-self: end; margin-top: .14rem; font: italic .91rem/1 var(--signature); letter-spacing: -.035em; }
.category-nav { padding: 0 var(--gutter) .9rem; }
.nav-inner {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .25rem;
  max-width: 29rem; margin: 0 auto; padding: .24rem;
  background: var(--track); border-radius: var(--pill);
}
.category-link {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  color: var(--muted); min-height: 2.75rem; padding: .4rem .5rem; border-radius: var(--pill);
  font-size: .94rem; font-weight: 600; line-height: 1.15; text-align: center;
}
.category-link.selected { background: var(--wine); color: var(--surface); }

.page { max-width: calc(var(--measure) + 2 * var(--gutter)); padding: 0 var(--gutter) 3rem; margin-inline: auto; }
.collection-heading {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  margin-block: clamp(1rem,2.2vw,1.85rem) clamp(.9rem,2vw,1.5rem);
  padding: clamp(1.15rem,3.4vw,2.7rem); border-radius: var(--feature-radius);
  color: var(--surface); background-color: var(--wine-deep);
}
.collection-heading.with-cover { min-height: clamp(8.5rem,18vw,15rem); }
.collection-title { position: relative; z-index: 1; }
.collection-heading h1 { font-size: clamp(2rem,5.6vw,4.6rem); line-height: .98; }
.collection-heading h1 span { display: block; }
.count { display: flex; align-items: center; gap: .5rem; margin-top: clamp(.6rem,1vw,.9rem); color: var(--pale); font-size: .9rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.count::before { content: ""; width: 1.25rem; height: 1px; background: currentColor; }
.collection-cover {
  position: absolute; z-index: 0; inset: 0 0 0 auto; width: 48%;
  border-radius: 43% 0 0 0 / 100% 0 0 0;
  box-shadow: -.65rem 0 0 var(--rose), -1.52rem 0 0 var(--merlot);
  background: var(--mat);
}
.collection-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; border-radius: inherit; }
.product-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(.7rem,2vw,1.5rem); }
.product-card, .product-link { min-width: 0; display: flex; flex-direction: column; }
.product-link {
  flex: 1; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--card-radius);
  background: var(--surface); transition: border-color .16s;
}
.card-picture { aspect-ratio: 1.28; overflow: hidden; background: var(--mat); }
.card-picture img { width: 100%; height: 100%; object-fit: cover; }
.card-caption { display: flex; flex: 1; flex-direction: column; gap: .65rem; padding: clamp(.75rem,1.8vw,1.3rem); }
.card-caption h2 { font-size: clamp(1.08rem,2vw,1.7rem); line-height: 1.14; letter-spacing: -.045em; text-wrap: pretty; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: .3rem; }
.price { display: inline-block; color: var(--wine); font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.price .from { font-weight: 500; }
.price.on-request { color: var(--muted); font-weight: 450; }
.open-product {
  display: grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem;
  border-radius: 50%; background: var(--track); color: var(--wine);
}
.open-product::after {
  content: ""; width: .35rem; height: .35rem; border: solid currentColor; border-width: 1.6px 1.6px 0 0;
  transform: translateX(-1px) rotate(45deg);
}
footer { display: flex; justify-content: center; padding: .8rem 1rem 1.5rem; border-top: 1px solid var(--rule); }
footer a, .back, .edit-link, .text-button { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .94rem; font-weight: 600; color: var(--wine); }
footer a, .edit-link, .text-button { text-decoration: underline; text-underline-offset: .23em; }
.edit-link { padding-inline: .5rem; align-self: start; }
.back { gap: .55rem; margin-block: .65rem; }
.back span { font-size: 1.6rem; line-height: .6; }

.product-detail {
  display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,1fr);
  grid-template-areas: "gallery title" "gallery info"; grid-template-rows: min-content 1fr;
  gap: 1.45rem clamp(1.6rem,4.3vw,3.8rem); align-items: start;
}
.product-title { grid-area: title; padding-top: 1.2rem; display: grid; justify-items: start; gap: 1rem; }
.product-title > .price { padding: .24rem .8rem; border-radius: var(--pill); background: var(--blush); font-size: 1.08rem; }
.product-title > .on-request { background: var(--track); }
.gallery { grid-area: gallery; min-width: 0; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--rule) var(--paper); border-radius: var(--feature-radius); }
.slide { display: block; flex: 0 0 100%; min-width: 0; aspect-ratio: 1/1.02; background: var(--mat); scroll-snap-align: start; cursor: zoom-in; }
.slide img { width: 100%; height: 100%; object-fit: contain; }
.thumbnails { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; }
.thumbnail { padding: 3px; border: 2px solid transparent; border-radius: .75rem; }
.thumbnail img { object-fit: cover; border-radius: .43rem; }
.thumbnail[aria-current] { border-color: var(--wine); }
.product-info { grid-area: info; min-width: 0; }
.product-description { white-space: pre-line; line-height: 1.62; font-size: 1.06rem; }
.product-description, .specs dt, .specs dd { overflow-wrap: anywhere; }
.specs { margin-top: 1.25rem; border-block: 1px solid var(--rule); }
.specs div { display: grid; grid-template-columns: minmax(6rem,.6fr) minmax(0,1.4fr); gap: .85rem; padding: .9rem 0; }
.specs div + div { border-top: 1px solid var(--rule); }
.specs dt { font-weight: 650; }
.specs dd { color: var(--muted); white-space: pre-line; }
.product-info > .secondary { margin-top: 1.25rem; }

.empty-state { display: grid; justify-items: center; gap: 1rem; margin-block: 1.35rem; padding: clamp(2rem,6vw,4.5rem) 1rem; border: 1px solid var(--rule); border-radius: var(--feature-radius); background: var(--surface); text-align: center; }
.empty-state img { object-fit: contain; }
.empty-state p { color: var(--muted); }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 2.9rem; padding: .65rem 1.15rem; border: 1px solid var(--wine); border-radius: var(--pill); font-weight: 600; }
.primary { background: var(--wine); color: var(--surface); }
.secondary { color: var(--wine); background: var(--surface); }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; margin-top: 1rem; }
.admin-bar form { margin: 0; }
.text-button { border: 0; padding: .4rem; background: none; }
.form-page { width: min(100%, 38rem); margin: 0 auto; padding: 1.2rem var(--gutter) 4rem; }
.error, .notice { padding: .8rem 1rem; border-radius: .75rem; }
.error { background: var(--blush); color: var(--wine-deep); }
.notice { background: var(--green-paper); color: var(--green); margin-top: 1rem; }
.primary:active, .product-link:active .open-product { background: var(--wine-deep); color: var(--surface); }
.secondary:active, .category-link:not(.selected):active { background: var(--blush); }
@media (hover: hover) {
  .product-link:hover { border-color: var(--rose); }
  .product-link:hover .open-product, .primary:hover { background: var(--wine-deep); color: var(--surface); }
  .secondary:hover, .category-link:not(.selected):hover { background: var(--blush); color: var(--wine); }
  .back:hover, footer a:hover, .text-button:hover { color: var(--wine-deep); }
}
@media (max-width: 42rem) {
  .brand-row { padding: .7rem var(--gutter) .6rem; }
  .brand-mark { width: 2.5rem; height: 2.5rem; }
  .wordmark { font-size: 1.7rem; }
  .wordmark i { font-size: .83rem; }
  .category-nav { padding-bottom: .65rem; }
  .category-link { font-size: .87rem; gap: .48rem; }
  .collection-heading.with-cover { min-height: 8.35rem; }
  .collection-heading h1 { font-size: clamp(1.85rem,8.3vw,3rem); }
  .collection-cover { width: 42%; box-shadow: -.4rem 0 0 var(--rose), -.92rem 0 0 var(--merlot); }
  .count { font-size: .83rem; }
  .card-picture { aspect-ratio: 1.03; }
  .card-caption { gap: .5rem; }
  .card-bottom .price { font-size: .87rem; }
  .open-product { width: 1.4rem; height: 1.4rem; }
  .back { margin-block: .32rem; }
  .product-detail { grid-template-columns: minmax(0,1fr); grid-template-areas: "title" "gallery" "info"; grid-template-rows: auto; gap: 1rem; }
  .product-title { gap: .65rem; padding: 0; }
  .product-title > .price { font-size: 1rem; }
  .slide { aspect-ratio: 1.06; }
  .product-description { font-size: 1rem; }
}
@media (max-width: 22rem) {
  .category-nav { padding-inline: .45rem; }
  .nav-inner { grid-template-columns: minmax(0,1.07fr) minmax(0,.93fr); }
  .category-link { font-size: .81rem; padding-inline: .15rem; gap: .25rem; white-space: nowrap; }
  .collection-heading { padding: 1rem; }
  .collection-heading h1 { font-size: 1.75rem; }
  .card-caption { padding: .62rem; }
}
@media (min-width: 48rem) {
  .brand-row { padding-block: .65rem .55rem; }
  .category-nav { padding-bottom: .65rem; }
  .collection-heading { margin-block: 1rem 1.1rem; padding: 1.05rem 2rem; }
  .collection-heading.with-cover { min-height: 10rem; }
  .collection-heading h1 { font-size: clamp(2.9rem,4.4vw,3.25rem); }
  .collection-heading .count { margin-top: .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
