/* MonPiz lookbook, digital edition: pages read by scrolling down, like a PDF.
   On a phone each page is a sheet as wide as the screen, with a thin dark line
   between pages; on a computer the sheets sit centred on the dark green, like a
   PDF viewer. Photos keep their own proportions. Colours come from theme.py (custom properties written in
   index.html); the fonts are the print ones. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--forest);
  color: var(--body);
  font: 400 1rem/1.55 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }

:root {
  --sheet: 100vw;                                /* width of a page: the whole screen */
  --pw: var(--sheet);
  --pad: clamp(1.25rem, calc(var(--sheet) * 0.07), 4rem);
  --gap: 6px;                                    /* between pages */
  --display: "Fraunces Display", Georgia, serif;
  --serif: "Fraunces Text", Georgia, serif;
  --small: clamp(0.66rem, calc(var(--sheet) * 0.018), 0.78rem);
}

/* --- the pages ------------------------------------------------------------------------------ */
.book { display: flex; flex-direction: column; align-items: center; gap: var(--gap); padding-bottom: 6rem; outline: none; }
.page { width: min(100%, var(--sheet)); scroll-margin-top: 0; } /* 100%: no sideways scroll under a desktop scrollbar */
.sheet {
  position: relative;
  display: flex; flex-direction: column;
  padding: calc(var(--pad) * 0.7) var(--pad) var(--pad);
  background: var(--paper);
  overflow: hidden;
}

.folio {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-bottom: calc(var(--pad) * 0.45);
  font-size: var(--small); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.folio__head { display: flex; align-items: baseline; gap: 0.7em; min-width: 0; }
.folio__index {
  display: inline-flex; align-items: center; gap: 0.45em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  padding: 0.35em 0; /* a larger target for a thumb */
}
.folio__index::before { content: ""; width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--accent); }
.folio__index:hover { color: var(--accent); }
.folio > span:last-child { font: 400 calc(var(--small) * 1.25) var(--display); letter-spacing: 0; color: var(--accent); }

/* Photos at full page width and in their own proportions. */
.wide { margin: 0 calc(-1 * var(--pad)); position: relative; }
.wide > img { width: 100%; }
.wide--photo { margin: calc(-0.7 * var(--pad)) calc(-1 * var(--pad)) calc(-1 * var(--pad)); }
.bleed { position: absolute; inset: 0; }
.bleed img { width: 100%; height: 100%; object-fit: cover; }

/* --- type ------------------------------------------------------------------------------------ */
.kicker { font-size: var(--small); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5em; }
.title {
  font: 500 clamp(1.8rem, calc(var(--pw) * 0.085), 3.4rem)/1.04 var(--display);
  color: var(--ink); letter-spacing: -0.01em;
  margin-bottom: 0.55em; max-width: 14ch;
}
/* Retailers: the headline on one line ("Una rete di 30 negozi"), sized to the page. */
.page--retailers_map .title { max-width: none; white-space: nowrap; font-size: clamp(1.4rem, calc(var(--pw) * 0.072), 3.4rem); }
.lead { font: 400 clamp(0.92rem, calc(var(--pw) * 0.036), 1.12rem)/1.55 var(--serif); max-width: 34rem; }
.lead + .lead { margin-top: 0.8em; }
.body { font-size: clamp(0.86rem, calc(var(--pw) * 0.034), 1rem); line-height: 1.55; max-width: 34rem; }

/* --- cover ----------------------------------------------------------------------------------- */
.page--cover .sheet { padding: 0 0 var(--pad); min-height: 100svh; }
.cover__top { position: relative; }
.cover__banner img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; clip-path: var(--ridge-clip); }
.cover__ridge { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 1.4; }
.ridge--wide { display: none; }
.cover__body {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.2rem var(--pad) 0;
}
.cover__logo img { width: clamp(8.5rem, 40vw, 15rem); height: auto; }
.cover__tagline { margin-top: 0.6rem; font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink); }
.cover__boots { width: min(72%, 30rem); margin: 0.8rem auto 0.6rem; }
.cover__boots img { width: 100%; mix-blend-mode: multiply; }
.cover__claim { font: 400 clamp(1rem, 4vw, 1.4rem)/1.4 var(--serif); color: var(--ink); max-width: 26rem; }
.cover__highlights {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; margin-top: 0.8rem;
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint);
}
.cover__hint { margin-top: auto; padding-top: 1.4rem; font-size: 0.8rem; color: var(--ink); text-decoration: none; }
.cover__hint::after {
  content: ""; display: block; width: 1px; height: 2rem; margin: 0.6rem auto 0;
  background: var(--ink); transform-origin: top; animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

/* --- brand, details, contents ---------------------------------------------------------------- */
.page--brand .wide { margin-top: 1.4rem; margin-bottom: calc(-1 * var(--pad)); }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 1rem; margin-top: 0.6rem; }
.details img { width: 70%; height: auto; aspect-ratio: 1; object-fit: cover; margin-bottom: 0.6rem; }
.details h3 { font: 500 1.05rem/1.2 var(--serif); color: var(--ink); }
.details p { font-size: 0.82rem; line-height: 1.4; color: var(--muted); }

.page--contents .sheet { padding: 0; }
.contents { display: grid; grid-template-columns: 1fr 48%; min-height: 100%; }
.contents__list { padding: calc(var(--pad) * 0.7) 0.9rem var(--pad) calc(var(--pad) * 0.8); }
.page--contents .title { font-size: clamp(2rem, calc(var(--pw) * 0.09), 3.2rem); margin-bottom: 0.4rem; }
.contents__photo { position: relative; }
.contents__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 60%; }
.toc { margin-top: 0.2rem; }
.toc > li { border-top: 1px solid var(--rule); padding: 0.35rem 0 0.4rem; }
.toc a { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; text-decoration: none; }
.toc__entry { font: 500 clamp(1rem, calc(var(--pw) * 0.04), 1.4rem)/1.15 var(--display); color: var(--ink); }
.toc__children { margin-top: 0.25rem; }
.toc__children a { padding: 0.12rem 0 0.12rem 0.6rem; font: 400 clamp(0.8rem, calc(var(--pw) * 0.028), 0.95rem)/1.3 var(--serif); color: var(--body); }
.toc__page { font: 400 0.78rem var(--display); color: var(--accent); }
.toc a:hover { color: var(--accent); }

/* --- section opener and full-bleed pages ----------------------------------------------------- */
.page--opener .sheet, .page--feature .sheet { padding: 0; background: var(--forest); color: var(--on-dark); aspect-ratio: 4 / 5; }
.page--photo .sheet { background: var(--forest); }
.page--opener .sheet::before, .page--feature .sheet::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, transparent 35%, rgb(20 24 16 / 0.85));
}
.opener__text, .feature__text { position: relative; z-index: 2; margin-top: auto; padding: 0 var(--pad) var(--pad); }
.opener__number {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 0.6rem; border-bottom: 1px solid rgb(255 255 255 / 0.35);
  font: 400 1rem var(--display); color: var(--on-dark-accent);
}
.opener__number span { font: var(--small) "Inter", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark); }
.opener__name { font: 500 clamp(4.5rem, calc(var(--sheet) * 0.24), 13rem)/0.88 var(--display); letter-spacing: -0.035em; margin: 1rem 0 1rem -0.05em; }
.opener__intro { max-width: 30rem; color: var(--on-dark-muted); font-size: 0.95rem; }
.opener__count { margin-top: 0.8rem; font: 400 1rem var(--display); color: var(--on-dark-accent); }
.feature__label { font-size: var(--small); letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark-accent); }
.feature__title { font: 500 clamp(2rem, calc(var(--pw) * 0.1), 3.6rem)/1.02 var(--display); margin: 0.5rem 0; }
.feature__body { max-width: 26rem; color: var(--on-dark-muted); }

/* --- model: the shoe first, materials in one discreet row ------------------------------------ */
.model__hero .placeholder { aspect-ratio: 4 / 3; }
.model__text { padding-top: calc(var(--pad) * 0.6); }
.model__name {
  font: 500 clamp(2.8rem, calc(var(--pw) * 0.15), 6rem)/0.92 var(--display); color: var(--ink);
  letter-spacing: -0.02em; margin: 0 0 0.35em -0.04em;
}
.materials {
  display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: 0.6rem;
  margin-top: 0.4rem;
}
/* Same style as the spec labels (Costruzione, Incluso ...). */
.materials__label, .colors__label {
  font-size: var(--small); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.materials__label { margin-top: 1.1rem; }
.materials img, .materials__empty { display: block; width: 100%; aspect-ratio: var(--ratio, 1.9); object-fit: cover; border-radius: 3px; background: var(--studio); }
.materials__name { display: block; margin-top: 0.3rem; font-size: 0.66rem; line-height: 1.25; color: var(--muted); }

/* --- spec rows ------------------------------------------------------------------------------- */
.specs { margin-top: 0.8rem; border-top: 1px solid var(--rule); max-width: 34rem; }
.specs div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); font-size: 0.88rem; }
.specs dt { font-size: var(--small); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); padding-top: 0.12rem; }
.specs dd { color: var(--ink); text-align: right; }
.specs--inline { display: flex; flex-wrap: wrap; gap: 0 1.6rem; border-top: 0; }
.specs--inline div { flex-direction: column; gap: 0; border: 0; padding: 0.3rem 0 0; }
.specs--inline dd { text-align: left; }

/* --- product --------------------------------------------------------------------------------- */
.shots { display: grid; gap: 2px; }
.shots--3, .shots--4 { grid-template-columns: 1fr 1fr; }
.shots--3 .shot:first-child { grid-column: span 2; }
.shot { position: relative; }
.studio { background: var(--backdrop, var(--studio)); }
.studio img { width: 100%; }
.shot .placeholder { aspect-ratio: 4 / 3; }
.shot figcaption {
  position: absolute; left: var(--pad); top: 0.8rem;
  font-size: var(--small); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
}
.shots--3 .shot figcaption, .shots--4 .shot figcaption { left: 0.8rem; }
.closeup {
  position: absolute; right: var(--pad); bottom: 0.9rem; width: 26%; max-width: 12rem;
  box-shadow: 0 0 0 3px var(--paper);
}
.closeup img { width: 100%; aspect-ratio: 1; object-fit: cover; }
/* As in print: the detail as a full-height column beside the shoe (220 of 595 pt). */
.shots--closeup { grid-template-columns: 1fr 37%; }
.shots--closeup .closeup { position: relative; right: auto; bottom: auto; width: auto; max-width: none; box-shadow: none; }
.shots--closeup .closeup img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.shots--closeup .closeup figcaption { padding: 1.4rem 0.8rem 0.7rem; font-size: var(--small); letter-spacing: 0.14em; }
.closeup figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0.3rem 0.4rem;
  font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-dark);
  background: linear-gradient(transparent, rgb(0 0 0 / 0.55));
}
.product__text { padding-top: calc(var(--pad) * 0.6); }
.product__name { font: 500 clamp(2rem, calc(var(--pw) * 0.1), 3.4rem)/1 var(--display); color: var(--ink); margin-bottom: 0.4em; }
.product__name--variant { font-style: italic; }  /* material variant of the model: Cortina *Dakar* */
.colors { margin-top: 0.7rem; }
.colors__label { margin-bottom: 0.45rem; }
.colors__chips { display: flex; flex-wrap: wrap; gap: 0.7rem 0.5rem; }
.colors__chips li {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  width: clamp(3.6rem, calc(var(--pw) * 0.15), 4.6rem);
}
.chip__name {
  font-size: 0.68rem; line-height: 1.2; text-align: center; color: var(--muted);
  overflow-wrap: anywhere; hyphens: auto;
}
.chip.is-current + .chip__name { color: var(--ink); }
.chip {
  width: clamp(1.9rem, calc(var(--pw) * 0.085), 2.6rem); aspect-ratio: 1; padding: 0;
  border: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
  background: var(--studio); box-shadow: 0 0 0 1px var(--rule);
}
.chip img { width: 100%; height: 100%; object-fit: cover; }
.chip.is-current { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }

.placeholder {
  display: grid; place-items: center; background: var(--studio);
  font-size: var(--small); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

/* --- retailers ------------------------------------------------------------------------------- */
.map { margin: 1rem 0 0; }
.map svg { width: 100%; height: auto; overflow: visible; }
.map__sky { fill: none; stroke: var(--rule); stroke-width: 1.2; }
/* The radius is an SVG attribute: Safari on iPhone ignores `r` set in CSS and draws no dot. */
.map__dot circle { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
.map__dot text { font: 600 12px "Inter", sans-serif; fill: var(--on-dark); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.map__dot:hover circle, .map__dot:focus-visible circle { fill: var(--ink); }
.map__city {
  font: 400 15px var(--serif); fill: var(--ink);
  paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; /* stays readable over a dot */
}
.map figcaption, .map__hint { font-size: 0.8rem; color: var(--muted); }
.map__hint { margin-top: 0.6rem; }

.region + .region { margin-top: 1rem; }
.region__name { font: 500 1.25rem/1.2 var(--display); color: var(--ink); padding-bottom: 0.4rem; border-bottom: 1px solid var(--ink); }
.region__name span { font: 400 0.8rem "Inter", sans-serif; color: var(--faint); }
.store { scroll-margin-top: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule); line-height: 1.3; }
.store__name { font: 500 0.98rem/1.25 var(--serif); color: var(--ink); text-decoration: none; }
.store__town { margin-left: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.store__links { display: flex; flex-wrap: wrap; gap: 0 0.9rem; margin-top: 0.15rem; font-size: 0.76rem; }
.store__links a { color: var(--accent); }
.store--shop .store__name { color: var(--accent); }
.store__shop {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.45rem;
  padding: 0.38rem 0.85rem 0.38rem 0.7rem; border-radius: 999px;
  background: var(--accent); color: var(--paper); text-decoration: none;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.store__shop svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.store__shop:hover { background: var(--ink); }

/* --- closing --------------------------------------------------------------------------------- */
.closing__body { margin: 2rem 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.closing__logo { width: 10rem; height: auto; margin: 0.4rem 0 1.4rem; }
.closing__title { font: 500 clamp(1.5rem, calc(var(--pw) * 0.064), 2.6rem)/1.1 var(--display); color: var(--ink); margin-bottom: 0.9rem; }
.closing__contacts { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--ink); }
.closing__contacts p { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1.2rem; }
.closing__contacts a { color: var(--ink); }
.closing__legal { margin-top: 1.6rem; font-size: 0.75rem; color: var(--faint); }


/* --- controls -------------------------------------------------------------------------------- */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 20; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s ease; }

.dock {
  position: fixed; left: 50%; bottom: calc(0.8rem + env(safe-area-inset-bottom)); z-index: 20;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.2rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgb(36 41 31 / 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--on-dark);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.dock.is-away { transform: translate(-50%, 160%); opacity: 0; }
.dock button { background: none; border: 0; cursor: pointer; border-radius: 999px; }
.dock__turn { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; }
.dock__turn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock__turn:disabled { opacity: 0.3; cursor: default; }
.dock__count { padding: 0 0.9rem; height: 2.6rem; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.dock__total { color: var(--on-dark-muted); }
.dock__label { display: none; margin-left: 0.6rem; padding-left: 0.6rem; border-left: 1px solid rgb(255 255 255 / 0.3); font-size: 0.8rem; color: var(--on-dark-muted); }
.dock button:hover { background: rgb(255 255 255 / 0.1); }

.overview {
  position: fixed; inset: 0; z-index: 30;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper);
  padding: 0 var(--pad) 3rem;
}
.overview[hidden] { display: none; }
.overview__head {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 0; margin-bottom: 0.6rem; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.overview__logo { width: 6.5rem; height: auto; }
.overview__close { border: 1px solid var(--ink); background: none; border-radius: 999px; padding: 0.35rem 1rem; cursor: pointer; }
.overview__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: 1.1rem 0.8rem; }
.thumb { display: block; text-decoration: none; }
.thumb img, .thumb__paper {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--studio);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}
.thumb__paper {
  display: flex; align-items: flex-end; padding: 0.5rem;
  background: #fffdf8; font: 500 0.9rem/1.1 var(--display); color: var(--ink);
}
.thumb__caption { display: block; margin-top: 0.35rem; font-size: 0.72rem; line-height: 1.3; color: var(--muted); }
.thumb__caption b { font-weight: 400; font-family: var(--display); color: var(--accent); margin-right: 0.2rem; }
.thumb.is-current img, .thumb.is-current .thumb__paper { outline: 2px solid var(--ink); outline-offset: 2px; }

/* --- wider screens: sheets on a table ------------------------------------------------------ */
@media (min-width: 960px) {
  /* Computer: pages the size of a magazine page, on a dark green table. */
  :root { --sheet: 920px; --gap: 2.2rem; }
  .book { padding-top: 2.2rem; }
  .page .sheet { box-shadow: 0 10px 40px rgb(0 0 0 / 0.35); }
  /* On a computer the cover is the same page as on a phone, sized to the first screen:
     the photo with the mountain edge on top, the boots take the room that is left. */
  .page--cover .sheet { min-height: 0; height: max(36rem, calc(100vh - 4.4rem)); padding-bottom: 1rem; }
  .cover__top { flex: 0 0 auto; }
  .cover__banner img { aspect-ratio: auto; height: 28vh; min-height: 10rem; clip-path: var(--ridge-clip-wide); }
  .ridge--phone { display: none; }
  .ridge--wide { display: inline; }
  .cover__ridge { stroke-width: 1.6; }
  .cover__body { flex: 1; min-height: 0; padding-top: 0.4rem; }
  .cover__boots { flex: 1; min-height: 6rem; width: 100%; position: relative; margin: 0.6rem 0; }
  .cover__boots img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
  .cover__hint { padding-top: 0.6rem; }
  .cover__hint::after { height: 1.2rem; }
  .cover__logo img { width: clamp(8rem, 20vh, 13rem); }
  .cover__tagline { margin-top: 0.4rem; }
  .cover__claim { font-size: clamp(0.95rem, 2.1vh, 1.2rem); }
  .cover__highlights { margin-top: 1.1rem; }
  /* Contents: the photo whole at its own proportions, the list compact beside it (as in print). */
  .contents { grid-template-columns: 1fr 48%; align-items: stretch; }
  .contents__photo img { position: static; height: auto; display: block; }
  .contents__list { padding: 2rem 2.2rem 2rem var(--pad); }
  .page--contents .title { font-size: 3.2rem; margin-bottom: 0.6rem; }
  .toc > li { padding: 0.32rem 0 0.36rem; }
  .toc__entry { font-size: 1.3rem; }
  .toc__children { margin-top: 0.1rem; }
  .toc__children a { padding: 0.08rem 0 0.08rem 0.8rem; font-size: 0.92rem; }
  .toc__page { font-size: 0.8rem; }
  .dock__label { display: inline; }
  .details { grid-template-columns: repeat(4, 1fr); }
  .overview__grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .cover__hint::after { animation: none; }
  html { scroll-behavior: auto; }
  .progress span { transition: none; }
  .dock { transition: none; }
}
