/* Reign Wala, the bag page: one leather of The Everywhere Bag. (The real site's copy is reignwala-site/src/styles/bag.css.)
   Same ground, ink, type and hairlines as the homepage. The only tinted surface on the whole site is the field the
   bag sits on here: the page's own warm white with a breath of this leather's colour (--c), so the render's white
   ground melts away under the multiply blend. The field is a plain block, never sticky (sticky breaks the blend).
   The first screen holds the bag, its views, the name, her words, the six leathers and the button; every other fact
   sits below the fold, open, never folded. On a phone: the name, the pictures, the button, then her words. */

.page-bag { --tint: 9%; --field: color-mix(in srgb, var(--c) var(--tint), #efe9df); }
/* a saturated blue over this warm cream goes grey, which is the placeholder look again: Cobalt takes a lighter breath */
.bag-cobalt-blue { --tint: 3%; }

/* ---------------------------------------------------------------- first screen */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "stage" "buy" "words" "note"; padding-top: clamp(22px, 5vw, 40px); }
.pdp-title { grid-area: title; }
.pdp-title .label { display: inline-flex; align-items: center; min-height: 32px; transition: color 200ms; }
.pdp-title .label:hover { color: var(--ink); }
.pdp-title h1 { margin-top: 2px; font-size: var(--t-title-s); line-height: 1.02; letter-spacing: -0.024em; }
.pdp-finish { margin-top: 10px; }

/* the views: a strip to swipe on a phone */
.pdp-stage { grid-area: stage; margin-top: 24px; min-width: 0; }
.views { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.view { position: relative; flex: 0 0 100%; aspect-ratio: 5 / 4; overflow: hidden; background: var(--field); isolation: isolate; scroll-snap-align: start; scroll-snap-stop: always; }
.view img { position: absolute; left: 5%; top: 50%; width: 90%; height: auto; max-width: none; transform: translateY(-50%); mix-blend-mode: multiply; }
/* (9 Nov) the real leather whole (a square in the 5:4 frame, on the leather's tint), so its pull and zip both show */
.view--leather img { left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; transform: none; mix-blend-mode: normal; }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.thumbs { display: flex; gap: 10px; }
.thumb { position: relative; width: 56px; aspect-ratio: 5 / 4; overflow: hidden; background: var(--field); isolation: isolate; }
.thumb img { position: absolute; left: 0; top: 50%; width: 100%; height: auto; max-width: none; transform: translateY(-50%); mix-blend-mode: multiply; }
.thumb--leather img { top: 0; height: 100%; object-fit: cover; transform: none; mix-blend-mode: normal; }
/* the ring sits inside the thumbnail, so nothing reaches past the column's edge */
.thumb::before { content: ""; position: absolute; inset: 0; z-index: 1; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow 240ms; }
.thumb:hover::before { box-shadow: inset 0 0 0 1px var(--line-strong); }
.thumb[aria-pressed="true"]::before { box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 3px var(--page); }
.thumb::after { content: ""; position: absolute; inset: -8px -5px; }
.view-name { font-size: var(--t-label); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; color: var(--quiet); text-align: right; }

/* her words about this leather */
.pdp-words { grid-area: words; margin-top: 30px; display: grid; gap: 12px; }
.pdp-words p { font-family: var(--serif); font-size: var(--t-lead); line-height: 1.45; color: var(--soft); max-width: 26em; text-wrap: pretty; }

/* the six leathers and the button */
.pdp-buy { grid-area: buy; margin-top: 26px; }
.pick-dots { display: flex; flex-wrap: wrap; margin: 4px 0 0 -9px; }
.pick-dots a { display: grid; place-items: center; width: 40px; height: 44px; }
.pick-dots a::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.1); transition: transform 320ms var(--ease), box-shadow 320ms var(--ease); }
.pick-dots a:hover::before, .pick-dots a:focus-visible::before { transform: scale(1.14); }
.pick-dots a[aria-current="page"]::before { box-shadow: 0 0 0 2.5px var(--page), 0 0 0 3.5px var(--ink); }
.pick-dots a:focus-visible { outline: none; }
.buy { margin-top: 16px; display: grid; gap: 12px; }
.buy-btn { width: 100%; }
/* once the bag is in the cart the button opens the cart instead of adding another, so it carries no price */
.buy-btn.is-in-cart .price { display: none; }
.buy-few { font-size: var(--t-small); font-weight: 500; color: var(--plum); }
.buy-note { font-size: var(--t-small); line-height: 1.6; color: var(--soft); }
.buy-sold { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: var(--t-h3); }
.buy-sold span { font-family: var(--sans); font-size: var(--t-body); color: var(--soft); }
.buy-out form { position: relative; display: flex; margin-top: 6px; border-bottom: 1px solid var(--line-strong); }
/* the sign-up line darkens and draws to full width on focus (as in the footer; currentColor follows the ground) */
.buy-out form::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 420ms var(--ease); }
.buy-out form:focus-within::after { transform: scaleX(1); }
.buy-out input { flex: 1; min-width: 0; height: 48px; padding: 0 2px; border: 0; border-radius: 0; background: none; font: inherit; font-size: var(--t-input); color: var(--ink); }
.buy-out input::placeholder { color: var(--quiet); }
.buy-out input:focus-visible { outline: none; }
.buy-out form button { min-height: 48px; padding: 0 2px 0 14px; font-size: var(--t-label); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500; }
.buy-out .fine { font-size: var(--t-small); line-height: 1.55; color: var(--quiet); }
.buy-out .fine.is-done { color: var(--ink); font-family: var(--serif); font-size: var(--t-lead); }
.buy-links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 0 24px; font-size: var(--t-label); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; color: var(--soft); }
.buy-links li { display: flex; align-items: center; }
/* (10 Nov) the small links glow under the hand, as the header's do */
.buy-links a, .buy-links button { min-height: 40px; display: inline-flex; align-items: center; letter-spacing: inherit; text-transform: inherit; font-weight: inherit; transition: color 320ms var(--ease), text-shadow 420ms var(--ease); }
@media (hover: hover) { .buy-links a:hover, .buy-links button:hover { color: var(--oxblood); text-shadow: 0 0 14px rgba(196, 64, 54, 0.45), 0 0 2px rgba(196, 64, 54, 0.25); } }
.buy-links .shared { margin-left: 10px; letter-spacing: 0.06em; color: var(--ink); }

/* the note about the pictures, under them */
.pdp-note { grid-area: note; margin-top: 28px; font-family: var(--serif); font-style: italic; font-size: var(--t-small); line-height: 1.55; color: var(--soft); max-width: 40em; }

/* ------------------------------------------------------------- good to know */
/* An editorial spread on the page itself: four parts, one rhythm (--part) between them, every rule the site's own
   hairline. 1 The facts, in a row of four (2 by 2 on a phone). 2 What it holds, three pockets side by side.
   3 Wear it four ways, the homepage's 2 by 2. 4 Three notes, each under the owner's own line icon. */
.good { --part: calc(var(--gap-in) * 0.7); }
.good-head { margin-bottom: calc(var(--gap-in) * 0.5); }
.good-head h2 { margin-top: 10px; }
.good-notes { display: grid; gap: var(--part); }
.good-notes h3 { font-size: var(--t-h3); line-height: 1.25; letter-spacing: -0.006em; }
.good-notes p, .good-notes dd { color: var(--soft); font-size: var(--t-body); line-height: 1.6; text-wrap: pretty; }
.good-notes .link { display: inline-block; margin-top: 20px; }
.good-holds > h3, .good-ways > h3 { font-size: var(--t-sub); line-height: 1.15; letter-spacing: -0.012em; margin-bottom: 24px; }

/* 1 the facts: small-caps label over a serif value, hairlines between */
.spec { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.spec > div { padding: 20px 16px 22px 0; border-bottom: 1px solid var(--line); }
.spec > div:nth-child(even) { padding: 20px 0 22px 18px; border-left: 1px solid var(--line); }
.spec dt { font-family: var(--sans); font-size: var(--t-label); line-height: 1.5; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; color: var(--quiet); }
.spec dd { margin-top: 12px; font-family: var(--serif); font-size: 19px; line-height: 1.2; letter-spacing: -0.012em; color: var(--ink); text-wrap: balance; }

/* 2 what it holds: stacked with hairlines on a phone, three columns from 900 */
.holds > div { padding: 20px 0 24px; border-top: 1px solid var(--line); }
.holds > div:last-child { padding-bottom: 0; }
.holds dt { font-family: var(--serif); font-size: var(--t-h3); line-height: 1.25; letter-spacing: -0.006em; color: var(--ink); }
.holds dd { margin-top: 10px; }

/* 3 wear it four ways: the homepage's grid, in serif */
.good-ways .ways-grid { order: 0; margin-top: 0; }
.good-ways .ways-grid li { padding: 20px 16px 22px 0; font-size: var(--t-h3); line-height: 1.3; }
.good-ways .ways-grid li:nth-child(even) { padding: 20px 0 22px 18px; }
.good-ways p { margin-top: 24px; max-width: 40em; }

/* 4 the last three notes, each headed by a line icon. The icon is placed by its ink, not its box: --ix is where the ink
   starts from the left of the drawing and --ib where it ends at the bottom (96 by 96 units, measured from each path
   with its stroke), so the ink starts exactly on the text's left edge and all three end on one line above the heading. */
.good-trio { --ico: 68; --k: calc(var(--ico) / 96); border-top: 1px solid var(--line); }
.good-trio article { padding: 32px 0 36px; }
.good-trio article + article { border-top: 1px solid var(--line); }
.good-trio h3 { margin-top: 24px; }
.good-trio h3 + p { margin-top: 10px; }
.good-trio p + p { margin-top: 10px; }
.good-ico { display: block; position: relative; width: 1px; height: calc(var(--k) * 67px); }
.good-ico .vi-svg { position: absolute; display: block; left: calc(var(--ix) * var(--k) * -1px); top: calc((67 - var(--ib)) * var(--k) * 1px); width: calc(var(--ico) * 1px); height: calc(var(--ico) * 1px); overflow: visible; color: var(--ink); }
.good-trio .icon-host { cursor: default; }

/* ---------------------------------------------------------- additional colors */
/* The other bags shown, as the same cards as the home page, quieter: the leather photograph, the name and the price,
   nothing else. The whole card is one link (the name's, stretched over the card); the bag shows first and a mouse
   turns it to the leather. Two across on a phone, three on a tablet, all in one row from 1100px (--n, set by
   tools/build-pages.py to how many there are). */
.others .bags { margin-top: 40px; grid-template-columns: repeat(2, 1fr); gap: 48px 16px; }
.bag--quiet { cursor: pointer; }
.bag--quiet .bag-meta { position: static; border-top: 0; padding-top: 18px; }
.bag--quiet .bag-row { display: block; }
.bag--quiet .bag-name { font-size: var(--t-h3); line-height: 1.25; letter-spacing: -0.012em; }
.bag--quiet .bag-price { display: block; margin-top: 6px; }
.bag--quiet .bag-name a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.bag--quiet .bag-name a:focus-visible { outline: none; }
.bag--quiet .bag-name a:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 6px; }
@media (hover: hover) and (pointer: fine) {
  .bag--quiet:hover .bag-view { opacity: 0; }
  .bag--quiet:hover .bag-view .render { transform: translateY(-50%) scale(0.985); }
}

/* --------------------------------------------------------------- the buy bar */
/* Comes up once the main button has scrolled away above; goes when it returns. */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(247, 245, 241, 0.94); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border-top: 1px solid var(--line); transform: translateY(105%); transition: transform 320ms var(--ease-leave); }
.buybar[data-on="true"] { transform: none; transition: transform 520ms var(--ease); }
.buybar p { display: grid; min-width: 0; }
.buybar .nm { font-family: var(--serif); font-size: var(--t-lead); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar .pr { font-size: var(--t-small); line-height: 1.4; color: var(--soft); }
.buybar .btn { height: 44px; padding: 0 22px; flex: none; }
.page-bag .footer .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* ============================================================== 560 and up */
@media (min-width: 560px) {
  .others .bags { grid-template-columns: repeat(3, 1fr); gap: 56px clamp(20px, 2.4vw, 32px); }
  .thumb { width: 64px; }
}

/* ============================================================== 900 and up */
@media (min-width: 900px) {
  /* the bag on the left; the words, the leathers and the button beside it, centred on the field */
  .pdp { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: 1fr auto auto auto 1fr auto; column-gap: clamp(40px, 6vw, 104px); grid-template-areas: "stage ." "stage title" "stage words" "stage buy" "stage ." "note ."; padding-top: clamp(32px, 4vw, 56px); }
  .pdp-stage { grid-row: 1 / 6; margin-top: 0; align-self: start; }
  .pdp-words { margin-top: 24px; }
  .pdp-buy { margin-top: 30px; max-width: 440px; }
  .pdp-note { margin-top: 18px; }
  /* one frame; the thumbnails cross-fade between the views */
  .views { display: grid; overflow: hidden; }
  .view { grid-area: 1 / 1; opacity: 0; transition: opacity 260ms var(--ease-leave); }
  .view.is-on { opacity: 1; transition: opacity 620ms var(--ease); }
  .stage-foot { margin-top: 14px; }
  .thumb { width: 72px; }

  .good-holds > h3, .good-ways > h3 { margin-bottom: 32px; }
  .spec { grid-template-columns: 1fr 1.7fr 1fr 1fr; }
  .spec > div, .spec > div:nth-child(even) { padding: 30px 32px 34px; border-left: 1px solid var(--line); }
  .spec > div:first-child { padding-left: 0; border-left: 0; }
  .spec > div:last-child { padding-right: 0; }
  .spec dd { margin-top: 14px; font-size: clamp(20px, 1.6vw, 24px); }
  .holds { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .holds > div { padding: 28px 32px 32px; border-top: 0; border-left: 1px solid var(--line); }
  .holds > div:first-child { padding-left: 0; border-left: 0; }
  .holds > div:last-child { padding: 28px 0 32px 32px; }
  .holds dd { margin-top: 12px; }
  .good-ways .ways-grid li { padding: 22px 32px 24px 0; font-size: var(--t-h3); }
  .good-ways .ways-grid li:nth-child(even) { padding: 22px 0 24px 32px; }
  .good-ways p { margin-top: 28px; }
  .good-trio { --ico: 80; display: grid; grid-template-columns: repeat(3, 1fr); }
  .good-trio article { padding: 40px clamp(24px, 3vw, 44px) 0; }
  .good-trio article + article { border-top: 0; border-left: 1px solid var(--line); }
  .good-trio article:first-child { padding-left: 0; }
  .good-trio article:last-child { padding-right: 0; }
}

@media (min-width: 1100px) {
  .others .bags { grid-template-columns: repeat(var(--n, 5), 1fr); gap: 0 clamp(20px, 2.2vw, 32px); }
}

@media (prefers-reduced-motion: reduce) {
  .view, .view.is-on, .buybar, .buybar[data-on="true"], .pick-dots a::before, .buy-out form::after { transition: none; }
}

/* three across (560 to 1099): the lone row of two sits centred under the three */
@media (min-width: 560px) and (max-width: 1099px) {
  .others .bags { grid-template-columns: repeat(6, 1fr); }
  .others .bags > li { grid-column: span 2; }
  .others .bags > li:nth-child(4) { grid-column: 2 / span 2; }
  .others .bags > li:nth-child(5) { grid-column: 4 / span 2; }
}
