/* Shop pages: the printables list (featured band, filters, cards or list) and the download page.
   Loads after styles.css and article.css. Gift guides will use the same list. */

/* Header without a photo: text only */
.article-head--text { grid-template-columns: minmax(0, 1fr); }
.article-head--text .article-head__title { max-width: 32ch; }
.article-head--text .article-head__lede { max-width: 72ch; }

/* ---------- Featured: a slim dark band, four products in a row ---------- */

.featured__inner { padding-top: 40px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 20px; }
.featured__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--col-gap); }
.featured__link { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--text-on-dark); font-weight: var(--weight-regular); text-decoration: none; }
.featured__link:hover { color: var(--text-on-dark); }
.featured__link:focus-visible { outline: 2px solid var(--ink-rust-lift); outline-offset: 8px; }
.featured__art { margin-bottom: 16px; }
.featured__art .card-paper { zoom: 0.5; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35); }
.featured__link:hover .card-paper, .featured__link:focus-visible .card-paper { transform: translateY(-4px) rotate(0deg); box-shadow: 0 14px 24px rgba(0, 0, 0, 0.38); }
.featured__name { font: 500 20px/1.3 var(--font-serif); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: var(--underline-offset); transition: text-decoration-color 120ms ease; }
.featured__link:hover .featured__name { text-decoration-color: var(--ink-rust-lift); }
.featured__price { font-weight: var(--weight-semibold); }

/* ---------- List: layout ---------- */

.shop { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.shop__title { margin-bottom: 32px; font-size: 32px; line-height: 1.2; }
.shop__layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: 56px; align-items: start; }
.shop-filters[hidden] { display: none; }
/* Without the filters (no JavaScript) the products take the full width */
.shop__layout:has(.shop-filters[hidden]) { grid-template-columns: minmax(0, 1fr); }

/* ---------- Filters ---------- */

.shop-filters { position: sticky; top: 24px; }
.shop-filters__toggle { display: none; }
.shop-filters__form { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.shop-filters__group { width: 100%; margin: 0; padding: 0; border: 0; min-width: 0; }
.shop-filters__group legend { padding: 0 0 8px; }
.check {
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--rule-soft);
  cursor: pointer;
}
.check:last-child { border-bottom: 1px solid var(--rule-soft); }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ink-moss); cursor: pointer; }
.check input:focus-visible { outline: 2px solid var(--ink-moss); outline-offset: 3px; }
.check__label { flex: 1; font-size: var(--text-sm); }
.check__count { font-size: var(--text-xs); color: var(--ink-bark); }
.shop-filters__clear {
  min-height: var(--tap-min);
  padding: 0;
  border: 0;
  background: none;
  font: var(--weight-semibold) var(--text-sm)/1 var(--font-sans);
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: var(--underline-offset);
  text-decoration-color: transparent;
}
.shop-filters__clear:hover, .shop-filters__clear:focus-visible { text-decoration-color: var(--link-underline); }
.shop-filters__clear:focus-visible { outline: 2px solid var(--ink-moss); outline-offset: 3px; }

/* ---------- Bar: count, sort, view ---------- */

.shop-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding-bottom: 16px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule-soft);
}
.shop-bar[hidden] { display: none; }
.shop-bar__count { font-weight: var(--weight-semibold); }
.shop-bar__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.shop-bar__sort { display: flex; align-items: center; gap: 10px; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.shop-bar__sort select {
  height: var(--tap-min);
  padding: 0 36px 0 12px;
  border: 1px solid var(--ink-brass);
  border-radius: 0;
  background: var(--paper-cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23292420' stroke-width='1.5'/%3E%3C/svg%3E") right 12px center no-repeat;
  appearance: none;
  font: 400 var(--text-sm) var(--font-sans);
  color: var(--ink-bark);
  cursor: pointer;
}
.shop-bar__sort select:focus-visible { outline: 2px solid var(--ink-moss); outline-offset: 2px; }
.view-switch { display: flex; }
.view-switch button {
  min-height: var(--tap-min);
  padding: 0 16px;
  border: 1px solid var(--ink-brass);
  background: var(--paper-cream);
  font: var(--weight-semibold) var(--text-sm)/1 var(--font-sans);
  color: var(--ink-bark);
  cursor: pointer;
}
.view-switch button + button { border-left: 0; }
.view-switch button[aria-pressed="true"] { background: var(--action-primary); border-color: var(--action-primary); color: var(--action-primary-text); }
.view-switch button:focus-visible { outline: 2px solid var(--ink-moss); outline-offset: 2px; position: relative; }

.shop__empty { padding: 40px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font: 400 var(--text-md)/1.5 var(--font-serif); }
.shop__empty[hidden] { display: none; }

/* ---------- Product: shared ---------- */

.product { position: relative; }
.products .product[hidden] { display: none; } /* stronger than the view layout rules */
.product__art { display: flex; align-items: center; justify-content: center; background: var(--surface-raised); overflow: hidden; }
.product__art .card-paper { box-shadow: var(--shadow-card); }
.product:hover .card-paper { transform: translateY(-6px) rotate(0deg); }
.product__text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
/* Product names in the sans: easier to scan in a shop grid. Page headlines stay in the serif. */
.product__title { font: var(--weight-semibold) 20px/1.3 var(--font-sans); letter-spacing: 0; }
.product__title a { color: var(--ink-bark); font-weight: inherit; }
.product__title a:hover { color: var(--action-primary-hover); }
.product__title a:focus-visible { outline: 2px solid var(--ink-moss); outline-offset: 4px; }
.product__price { font-weight: var(--weight-regular); white-space: nowrap; }
.product__shop { font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--ink-bark); }
/* Gifts: photo tile, or a caption until the photo exists */
.product__art--photo { align-items: flex-end; justify-content: flex-start; }
.product__art--photo img { width: 100%; height: 100%; object-fit: cover; }
.product__photo-note { padding: 14px 16px; font-size: var(--text-sm); font-weight: var(--weight-regular); line-height: 1.4; color: var(--ink-bark); }
.products--list .product__photo-note { display: none; }
/* Affiliate note under the page intro */
.shop-note { font-size: var(--text-sm); }

/* Type and occasion as quiet pills; each one filters the list */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  position: relative;
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  background: var(--paper-linen);
  font: var(--weight-regular) var(--text-xs)/1.2 var(--font-sans);
  color: var(--ink-bark);
  text-decoration: none;
  transition: background 120ms ease;
}
/* The pill looks 28px tall but takes taps across 44px */
.tag::after { content: ""; position: absolute; inset: -8px 0; }
.tag:hover { background: color-mix(in srgb, var(--ink-brass) 18%, var(--paper-linen)); color: var(--ink-bark); }
.tag:focus-visible { outline: 2px solid var(--ink-moss); outline-offset: 2px; }

/* Card view: picture, title, price, pills. The short text shows in the list view. */
.products--cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px var(--col-gap); }
.products--cards .product { display: flex; flex-direction: column; gap: 16px; }
.products--cards .product__art { aspect-ratio: 1 / 1; }
.products--cards .card-paper { zoom: 0.52; }
.products--cards .product__summary { display: none; }
/* Text fills the card, so the pills always sit on the bottom line */
.products--cards .product__text { flex: 1; }
.products--cards .tags { margin-top: auto; padding-top: 10px; }

/* List view: picture | title, price, short text and pills */
.products--list { display: flex; flex-direction: column; }
.products--list .product {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  /* One reading column next to the picture; empty rows above and below keep it centred */
  grid-template-areas: "art ." "art title" "art price" "art summary" "art tags" "art .";
  grid-template-rows: 1fr auto auto auto auto 1fr;
  column-gap: 28px;
  row-gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.products--list .product__text { display: contents; }
.products--list .product__art { grid-area: art; aspect-ratio: 1 / 1; align-self: center; } /* square, like the cards */
.products--list .card-paper { zoom: 0.32; }
.products--list .product__title { grid-area: title; }
.products--list .product__summary { grid-area: summary; max-width: 80ch; margin-top: 4px; }
.products--list .tags { grid-area: tags; align-self: start; }
/* Price under the title, bold; the shop name after it in small type */
.products--list .product__price { grid-area: price; font-weight: var(--weight-semibold); }

/* ---------- Download page ---------- */

.download { padding-top: 32px; padding-bottom: var(--section-y); }
.download__crumbs ol { margin-bottom: 24px; }
.download__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 64px; align-items: start; }
.download__preview {
  position: sticky;
  top: 24px;
  padding: 72px 48px 32px;
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}
.download__preview .card-paper { zoom: 1.15; box-shadow: var(--shadow-card); }
.download__preview-note { align-self: flex-start; font-size: var(--text-sm); }
/* Gift photo: fills the panel edge to edge */
.download__preview--photo { padding: 0; aspect-ratio: 1 / 1; gap: 0; }
.download__preview--photo img { width: 100%; height: 100%; object-fit: cover; }
.download__photo-slot { width: 100%; height: 100%; display: flex; align-items: flex-end; padding: 20px; font-size: var(--text-sm); }
.download__info { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.download__title { font-size: 36px; line-height: 1.12; }
.download__summary { font: 400 var(--text-md)/1.5 var(--font-serif); }
.download__price { margin-top: 8px; font: 500 var(--text-xl)/1.1 var(--font-serif); }
.download__buy { width: 100%; min-height: 56px; }
.download__note { font-size: var(--text-sm); }
.download__includes { width: 100%; margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.download__includes ul { display: flex; flex-direction: column; gap: 8px; }
.download__includes li { position: relative; padding-left: 26px; }
.download__includes li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 7px; height: 7px; background: var(--ink-rust); }
.download__facts { width: 100%; margin: 16px 0 0; border-top: 1px solid var(--rule-soft); }
.download__facts div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.download__facts dt { font: var(--weight-semibold) var(--text-xs)/1.6 var(--font-sans); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.download__facts dd { margin: 0; }

.download__body { margin-top: 24px; margin-bottom: var(--section-y); background: var(--surface-raised); }
/* How it works / Good to know: a linen band, set a little smaller than an article */
.download__prose { padding-top: 56px; padding-bottom: 64px; }
.download__prose h2 { font-size: var(--text-lg); }
/* Desktop: the sections sit side by side. An intro paragraph runs across the top;
   each heading and what follows it take one column (dense fills column 2 from the top). */
@media (min-width: 901px) {
  .download__prose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; column-gap: 64px; align-content: start; }
  .download__prose > * { grid-column: 1 / -1; max-width: 700px; }
  .download__prose > h2:nth-of-type(1), .download__prose > h2:nth-of-type(1) ~ * { grid-column: 1; }
  .download__prose > h2:nth-of-type(2), .download__prose > h2:nth-of-type(2) ~ * { grid-column: 2; }
  .download__prose > h2 { margin-top: 0; }
  .download__prose > p:first-child + h2 { margin-top: 32px; }
}
@media (max-width: 900px) {
  .download__prose h2 { margin-top: 40px; }
  .download__prose > h2:first-child { margin-top: 0; }
}

.download__more { padding-bottom: var(--section-y); display: flex; flex-direction: column; gap: 32px; }
.download__more .section-title { font-size: var(--text-xl); }
.download__more-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.download__more-head a { min-height: var(--tap-min); display: inline-flex; align-items: center; white-space: nowrap; }

/* ---------- Tablet ---------- */

@media (max-width: 1200px) {
  .shop__layout { grid-template-columns: 200px minmax(0, 1fr); column-gap: 40px; }
  .products--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download__grid { column-gap: 40px; }
  .download__preview .card-paper { zoom: 0.9; }
}

/* ---------- Phone ---------- */

@media (max-width: 900px) {
  .shop__title { margin-bottom: 20px; font-size: 28px; }
  .featured__inner { padding-top: 28px; padding-bottom: 32px; gap: 16px; }
  .featured__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .featured__art { margin-bottom: 10px; }
  .featured__art .card-paper { zoom: 0.36; }
  .featured__name { font-size: 18px; }
  .shop__layout { display: flex; flex-direction: column; gap: 20px; }

  /* Filters fold into one "Filter" bar */
  .shop-filters { position: static; width: 100%; border: 1px solid var(--ink-brass); }
  .shop-filters__toggle {
    min-height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: var(--weight-semibold);
    list-style: none;
    cursor: pointer;
  }
  .shop-filters__toggle::-webkit-details-marker { display: none; }
  .shop-filters__toggle::after { content: "+"; margin-left: auto; font: 400 24px/1 var(--font-serif); }
  .shop-filters[open] .shop-filters__toggle::after { content: "–"; }
  .shop-filters__toggle:focus-visible { outline: 2px solid var(--ink-moss); outline-offset: 2px; }
  .shop-filters__form { padding: 8px 16px 16px; gap: 20px; }

  .shop-bar { margin-bottom: 24px; }
  .products--cards { grid-template-columns: 1fr; gap: 40px; }
  .products--cards .card-paper { zoom: 0.58; }
  .products--list .product { grid-template-columns: 100px minmax(0, 1fr); grid-template-areas: "art title" "art price" "art tags"; grid-template-rows: auto auto 1fr; column-gap: 16px; }
  .products--list .product__art { align-self: start; }
  .products--list .card-paper { zoom: 0.19; }
  .products--list .product__title { margin-top: 4px; }
  .products--list .product__summary { display: none; }
  .products--list .product__price { align-self: start; }

  .download { padding-top: 16px; }
  .download__crumbs ol { margin-bottom: 12px; }
  .download__grid { display: flex; flex-direction: column; gap: 28px; }
  .download__preview { position: static; width: 100%; padding: 40px 20px 20px; gap: 24px; }
  .download__preview--photo { padding: 0; }
  .download__preview .card-paper { zoom: 0.8; }
  .download__title { font-size: 30px; line-height: 1.15; }
  .download__prose { padding-top: 40px; padding-bottom: 48px; }
  .download__more .section-title { font-size: 26px; }
  .download__summary { font-size: 20px; }
  .download__facts div { grid-template-columns: 110px minmax(0, 1fr); }
  .download__more { gap: 24px; }
  .download__more-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
