/* p-boken.css: /boken/ "Vävprovet". The loom photo, then one cloth: six unlabelled warp groups, paper picks for
   the publisher's text, five element wefts laid by a shuttle, a knotted fringe, the cover and the facts slip. */
:root {
  --bk-jord: #5f6d43; --bk-eld: #a14a2c; --bk-luft: #e6dcc6; --bk-vatten: #4f7590; --bk-rymd: #2b3c6b;
  --bk-w: min(1120px, calc(100vw - 2 * var(--gut)));
}

/* hero ------------------------------------------------------------------------------------- */
.bk-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: min(calc(100svh - var(--banner) - var(--bar)), 900px); overflow: clip;
}
.bk-hero-pic { position: relative; grid-column: 2; grid-row: 1; overflow: hidden; }
.bk-hero-pic img { position: absolute; inset: -4% 0 -4% 0; width: 100%; height: 108%; object-fit: cover; object-position: 62% 40%; will-change: transform; }
.bk-near { top: -10%; bottom: -10%; z-index: 2; filter: blur(3px); opacity: .9; will-change: transform; }
.bk-near-1 { left: 3%; width: 11px; }
.bk-near-2 { left: calc(3% + 26px); width: 9px; }
.bk-hero-copy {
  grid-column: 1; grid-row: 1; align-self: center; position: relative; z-index: 3;
  padding: var(--s8) var(--s7) var(--s7) var(--gut); display: grid; gap: var(--s5); justify-items: start;
}
.bk-hero .t-h1 { font-size: clamp(60px, 6.6vw, 112px); line-height: .95; }
.bk-lead { max-width: 30ch; font-size: 21px; line-height: 32px; color: var(--text); }
.bk-slip { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px var(--s5); padding: var(--s4) var(--s4) var(--s4) var(--s5); transform: rotate(-.6deg); }
.bk-slip-facts { grid-column: 1; font: 500 14px/20px var(--f-chrome); letter-spacing: .02em; color: var(--ink-soft); }
.bk-slip-price { grid-column: 1; font: 500 22px/28px var(--f-display); color: var(--ink); }
.bk-slip .btn-buy { grid-column: 2; grid-row: 1 / span 2; }

/* the cloth -------------------------------------------------------------------------------- */
.bk-loom { position: relative; width: var(--bk-w); margin: var(--s9) auto 0; padding: var(--s7) 0 0; }
.bk-warp { position: absolute; inset: 0 0 0 0; display: flex; justify-content: space-around; pointer-events: none; z-index: 0; }
.bk-g { position: relative; display: flex; gap: 5px; height: 100%; }
/* the fringe: each group is tied off in a knot above its loose ends */
.bk-g::after { content: ""; position: absolute; left: 50%; bottom: 26px; width: 30px; height: 16px; margin-left: -15px; border-radius: 50%; background: var(--yarn-wool); box-shadow: 0 2px 3px rgba(0,0,0,.55); }
.bk-g i, .bk-over i {
  display: block; width: 5px; height: 100%; border-radius: 2px;
  background: var(--yarn-wool); box-shadow: 1px 0 2px rgba(0,0,0,.45); opacity: .82;
}
.bk-pick {
  position: relative; z-index: 1; margin: 0 0 var(--s8); background: var(--paper); color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.3), 0 18px 30px -18px rgba(0,0,0,.7);
  padding: var(--s7) max(var(--s7), calc(100% - 64ch - 120px)) var(--s7) 120px;
}
/* paper picks have a woven texture: faint picks along the paper */
.bk-pick::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(87,76,61,.05) 0 1px, transparent 1px 4px); }
.bk-head .t-h2 { margin-bottom: var(--s4); color: var(--ink); }
.bk-head p { max-width: 60ch; }
.bk-desc { margin: 0; }
.bk-desc-q { margin: 0; }
.bk-desc-q > p {
  position: relative; z-index: 1; margin: 0 0 var(--s7); background: var(--paper); color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.3), 0 18px 30px -18px rgba(0,0,0,.7);
  padding: var(--s7) max(var(--s7), calc(100% - 64ch - 120px)) var(--s7) 120px;
  font-size: 21px; line-height: 34px;
}
.bk-desc-q > p:first-child { font: 500 30px/40px var(--f-display); }
.bk-desc-q > p:last-child { font-style: italic; }
/* the three cards are one quotation: one opening mark on the first, one closing mark on the last (as on /forfattaren/) */
.bk-desc-q { quotes: "”" "”"; }
.bk-desc-q > p:first-child::before { content: open-quote; } .bk-desc-q > p:last-child::after { content: close-quote; }
.bk-src { margin-bottom: var(--s9); padding-top: var(--s4); padding-bottom: var(--s4); color: var(--ink-soft); width: fit-content; max-width: 100%; padding-right: var(--s7); }
.bk-legend { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; gap: var(--s3); font: 500 15px/22px var(--f-chrome); letter-spacing: .01em; }
.bk-legend li { display: flex; align-items: center; gap: var(--s3); }
.bk-sw {
  flex: none; display: inline-block; width: 34px; height: 9px; border-radius: 4px; background-color: var(--c);
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.22) 0 2px, transparent 2px 4px, rgba(0,0,0,.18) 4px 5px, transparent 5px 7px);
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* over segments: where a warp group passes OVER a pick, only in the pick's padding (never over text) */
.bk-over { position: absolute; z-index: 2; display: flex; gap: 5px; pointer-events: none; }

/* wefts: a photo strip edged in its thread colour, laid by the shuttle ------------------------ */
.bk-wefts { position: relative; z-index: 1; display: grid; gap: var(--s8); padding-top: var(--s5); }
.bk-weft { position: relative; }
.bk-strip { position: relative; height: 190px; overflow: hidden; clip-path: inset(0 var(--r, 0%) 0 var(--l, 0%)); }
.bk-strip img { width: 100%; height: 100%; object-fit: cover; }
.bk-strip::before, .bk-strip::after {
  content: ""; position: absolute; left: 0; right: 0; height: 9px; z-index: 1; background-color: var(--c);
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.22) 0 2px, transparent 2px 4px, rgba(0,0,0,.2) 4px 5px, transparent 5px 7px);
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.bk-strip::before { top: 0; } .bk-strip::after { bottom: 0; }
.bk-weft .bk-over { z-index: 2; }
.bk-tag {
  position: absolute; z-index: 4; left: -10px; top: -22px; display: inline-flex; align-items: center; gap: var(--s3);
  background: var(--paper); color: var(--ink); padding: 6px 16px 6px 12px;
  font: italic 500 26px/32px var(--f-display); box-shadow: 0 6px 14px -6px rgba(0,0,0,.6);
}
.bk-tag .bk-sw { width: 26px; }
.bk-shuttle {
  position: absolute; z-index: 5; top: 50%; left: 0; width: 132px; height: 28px; margin: -14px 0 0 -66px;
  background:
    radial-gradient(ellipse 30px 6px at 50% 50%, var(--c) 0 96%, transparent 100%),
    linear-gradient(180deg, #b78a5a 0%, #8a5f37 55%, #5e3f22 100%);
  clip-path: polygon(0 50%, 16% 8%, 84% 8%, 100% 50%, 84% 92%, 16% 92%);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.55));
  will-change: transform, opacity; opacity: 0;
}
.bk-fringe {
  position: relative; z-index: 1; height: 76px; margin-top: 0; margin-bottom: 0;
  background: linear-gradient(var(--canvas), var(--canvas)) bottom / 100% 30px no-repeat;
}

/* close: the stone photo full-bleed; the cover and the facts slip lie on it. The bottom zone is exactly the last
   screen under the bar (viewport - footer - bar, footer measured by p-boken.js into --p1-foot), so the last screen
   always opens on photo, never on a cut line. The top zone (>= one footer) makes the close >= 100svh - bar. */
.bk-close { position: relative; display: grid; grid-template-rows: minmax(var(--p1-foot, 261px), auto) minmax(calc(100svh - var(--p1-foot, 261px) - var(--bar)), auto); }
.bk-close-pic { position: absolute; inset: 0; overflow: hidden; margin: 0; }
.bk-close-pic img { position: absolute; inset: -5% 0; width: 100%; height: 110%; object-fit: cover; object-position: 30% 60%; will-change: transform; }
.bk-close-top { position: relative; }
.bk-close-zone { position: relative; display: flex; align-items: flex-end; padding-bottom: var(--s6); }
.bk-close-row { width: var(--bk-w); margin: 0 auto; display: flex; justify-content: flex-end; align-items: flex-end; gap: var(--s6); }
.bk-cover { margin: 0; }
.bk-cover img { box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 26px 40px -16px rgba(0,0,0,.75); }
.bk-cover-phone { display: none; }
.bk-cover-wide img { height: min(450px, calc(100svh - var(--p1-foot, 261px) - var(--bar) - 64px)); width: auto; }
.bk-facts { width: min(640px, 100%); padding: var(--s5) var(--s6); }
.bk-facts .t-h2 { color: var(--ink); margin-bottom: var(--s3); font-size: 36px; }
.bk-facts dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s5); }
.bk-facts dl div { padding: 6px 0 7px; border-bottom: 1px dashed rgba(142,63,40,.45); }
.bk-facts dt { font: 500 13px/18px var(--f-chrome); letter-spacing: .02em; color: var(--ink-soft); }
.bk-facts dd { margin: 0; font: 400 18px/24px var(--f-text); }
.bk-facts-buy { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); margin-top: var(--s4); }
.bk-date { margin-top: var(--s2); font: 500 13px/19px var(--f-chrome); letter-spacing: .02em; color: var(--ink-soft); }

/* phone ------------------------------------------------------------------------------------ */
@media (max-width: 760px) {
  .bk-hero { display: block; min-height: 0; }
  .bk-hero-pic { height: 300px; }
  .bk-hero-pic img { object-position: 50% 40%; }
  .bk-near-1 { left: auto; right: 14%; width: 8px; } .bk-near-2 { left: auto; right: calc(14% + 18px); width: 6px; }
  .bk-hero-copy { padding: var(--s5) var(--gut) var(--s6); gap: var(--s4); }
  .bk-hero .t-h1 { font-size: 50px; line-height: 1; }
  .bk-lead { font-size: 17px; line-height: 26px; }
  .bk-slip { grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--s4); }
  .bk-slip-price { font-size: 19px; line-height: 24px; }
  .bk-g::after { width: 22px; height: 12px; margin-left: -11px; }
  .bk-slip .btn-buy { padding: 0 18px; }
  .bk-loom { margin-top: var(--s8); }
  .bk-g { gap: 4px; } .bk-g i, .bk-over i { width: 3px; } .bk-over { gap: 4px; }
  .bk-pick, .bk-desc-q > p { padding: var(--s6) var(--s5); margin-bottom: var(--s7); }
  .bk-desc-q > p { font-size: 18px; line-height: 29px; }
  .bk-desc-q > p:first-child { font-size: 24px; line-height: 32px; }
  .bk-src { margin-bottom: var(--s8); }
  .bk-wefts { gap: var(--s8); }
  .bk-strip { height: 152px; }
  .bk-tag { left: -6px; top: -26px; font-size: 22px; line-height: 28px; }
  .bk-shuttle { width: 92px; height: 22px; margin: -11px 0 0 -46px; }
  .bk-close-pic img { object-position: 50% 60%; }
  .bk-close-top { display: flex; align-items: flex-start; padding: var(--s7) var(--gut) var(--s5); }
  .bk-cover-phone { display: block; }
  .bk-cover-phone img { width: 190px; height: auto; }
  .bk-cover-wide { display: none; }
  .bk-close-zone { padding-bottom: var(--s4); }
  .bk-facts { width: 100%; padding: var(--s4) var(--s4) var(--s3); }
  .bk-facts .t-h2 { font-size: 28px; margin-bottom: var(--s1); }
  .bk-facts dl { grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
  .bk-facts dl div { padding: 4px 0 5px; }
  .bk-facts dt { font-size: 12px; line-height: 16px; }
  .bk-facts dd { font-size: 16px; line-height: 21px; }
  .bk-facts-buy { margin-top: var(--s3); gap: var(--s1) var(--s4); }
  .bk-facts-buy .btn-buy { padding: 0 20px; }
  .bk-date { font-size: 12px; line-height: 17px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .bk-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bk-hero .t-h1 { font-size: 64px; }
  .bk-pick, .bk-desc-q > p { padding-left: 72px; }
  .bk-close-top { width: var(--bk-w); margin: 0 auto; padding: var(--s7) 0 var(--s5); }
  .bk-cover-phone { display: block; }
  .bk-cover-phone img { width: 220px; height: auto; }
  .bk-cover-wide { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-shuttle { display: none; }
  .bk-strip { clip-path: none; }
}
