/* Public master page (/m/{slug}) — standalone, mobile-first.
   Intentionally independent of the cabinet design-system stylesheet: this page
   is served to the open web and must stay light.

   Canonical brand/status/type/spacing/radius/shadow tokens now live in
   tokens.css (loaded BEFORE this file in every template's <head> — see the
   public templates). This :root block ONLY aliases the historic names below
   onto the canonical ones so every existing `var(--brand)` etc. rule further
   down keeps working unchanged (UX Wave 3 batch B — root-cause fix for the
   old parallel-declaration bug: this file used to re-declare the SAME
   colours under DIFFERENT names, drifting from cabinet.css over time). */
:root {
  --card: var(--surface);
  --muted: var(--ink-2);
  --brand: var(--rose);
  --brand-hi: var(--rose-hi);
  --brand-ink: var(--on-rose);
  --radius: var(--r);
  --shadow: var(--shadow-card);

  /* --bg / --ink / --line used to be re-declared here too, but they were
     already the SAME name AND SAME value as the canonical tokens (not a
     rename) — tokens.css already supplies them, nothing to alias. */

  /* NOT aliased, deliberately: these two COLLIDE IN NAME with tokens.css's
     --rose-soft / --rose-softer but hold DIFFERENT, page-specific values (a
     lighter portrait-ring / chip tint scale unique to this page — the
     canonical --rose-soft is a darker shade). Aliasing them onto the
     canonical tokens would silently shift the avatar ring and chip-fill
     colours; out of scope for this batch. Declared here, AFTER tokens.css,
     so these local values win the cascade for this page. */
  --rose-soft: #f3e4e8;   /* ring / pill fill around the hero portrait */
  --rose-softer: #faf1f4; /* chip fill */

  /* Page-specific, no cabinet equivalent — untouched. */
  --shadow-photo: 0 14px 34px rgba(120,60,80,.20), 0 4px 10px rgba(40,25,30,.10);
  --polaroid-shadow: 0 10px 20px rgba(40,30,20,.18), 0 2px 6px rgba(40,30,20,.1);

  /* Page-local accessible star colour (see .review__stars below) — no
     canonical token exists at this exact darkness. */
  --star: #9a6f14;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Android font boosting → giant native pickers; mirror cabinet.css. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
option { font-size: var(--fs-sm, 13px); }
/* ── Accessibility utilities (UX Wave 3 batch C) ──────────────────────────
   Mirrors cabinet.css's .sr-only / .sr-only-focusable (same standard clip
   pattern). Duplicated rather than shared: this page loads its own
   stylesheet, independent of the cabinet surface — see master.css's header
   comment. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Hidden until keyboard focus — mirror of cabinet.css (owner: the link was
   permanently visible without this base rule). */
.sr-only-focusable:not(:focus):not(:focus-within) {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sr-only-focusable:focus,
.sr-only-focusable:focus-within {
  position: fixed; top: 8px; left: 8px; z-index: 10000;
  width: auto; height: auto; padding: 10px 18px; margin: 0;
  overflow: visible; clip: auto; white-space: normal;
  background: var(--brand); color: var(--brand-ink);
  border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow);
}
body {
  margin: 0;
  font-family: var(--font); /* Manrope, via tokens.css — DESIGN.md brand font */
  font-size: 16px;
  line-height: 1.5;
  /* Warm "tabletop" wash so the scattered polaroids read as pinned photos. */
  background:
    radial-gradient(ellipse at 20% 10%, #f4e6d3 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, #f0dde2 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}
/* Content sits above the decorative polaroid layer; flex column so phones can
   reorder the gallery below the reviews (see responsive rules). */
.page { position: relative; z-index: 10; display: flex; flex-direction: column;
        max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }
.muted { color: var(--muted); }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }

/* Centred "portrait card": one big circular photo, then name / rating / chips /
   address / contacts / CTA stacked and centred under it. (Redesign 2026-07-09 —
   the scattered polaroid gallery around it is intentionally left as-is.) */
.hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  background: var(--card);
  border-radius: var(--r-lg); /* was hardcoded 22px — exact canonical value */
  padding: 30px 22px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.avatar {
  /* Big — roughly the height of a portfolio tile (owner: «на высоту плитки»).
     Explicit square width+height (not aspect-ratio) — a flex item with
     aspect-ratio mis-sizes on iOS Safari. */
  width: min(260px, 72vw); height: min(260px, 72vw);
  border-radius: 50%;
  object-fit: cover;
  /* white gap + soft rose ring around the portrait */
  box-shadow: 0 0 0 5px var(--card), 0 0 0 9px var(--rose-soft), var(--shadow-photo);
  margin-bottom: 20px;
}
.avatar--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: var(--brand-ink);
  font-size: 4rem; font-weight: 600; text-transform: uppercase;
}
/* Tap the round photo → view it large (see .avatar-zoom). */
.avatar--zoom { cursor: zoom-in; }
.avatar--zoom:focus-visible { outline: 2px solid var(--brand); outline-offset: 6px; }
.avatar-zoom {
  display: none; position: fixed; inset: 0; z-index: 60;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(20, 14, 16, .82); cursor: zoom-out;
}
.avatar-zoom.is-open { display: flex; }
.avatar-zoom img {
  max-width: min(92vw, 560px); max-height: 88vh;
  border-radius: var(--r); /* was off-scale 14px — nearest canonical (16) */
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.hero h1 {
  font-size: 1.95rem; margin: 0 0 2px;
  overflow-wrap: break-word; word-break: break-word; text-wrap: balance;
}
.hero__salon { margin: 0 0 12px; }
.addr {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .95rem; color: var(--muted); margin: 0 0 18px;
}
.addr .pin { width: 16px; height: 16px; color: var(--brand); flex-shrink: 0; }
/* When the master has map coordinates the address is a link that scrolls to the
   map section below — give it a tap affordance without changing its look. */
.addr--link {
  text-decoration: none; cursor: pointer; padding: 4px 8px; border-radius: 999px;
  transition: color .15s, background .15s;
}
.addr--link:hover { color: var(--brand); background: var(--rose-softer); }
.addr--link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Extra-specialisation chips under the name (centred pills). */
.hero__tags {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 7px; margin: 0 0 12px; max-width: 520px;
}
.hero__tag {
  display: inline-block; padding: 4px 13px; border-radius: 999px;
  background: var(--rose-softer); border: 1px solid var(--rose-soft);
  color: #6c4a53; font-size: .85rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.bio { margin: 0; white-space: pre-line; }

.services { list-style: none; margin: 0; padding: 0; }
.service {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.service:last-child { border-bottom: 0; }
.service__main { display: flex; flex-direction: column; }
.service__name { font-weight: 600; }
.service__desc { font-size: .85rem; }
/* price + Book button on ONE line, right-aligned (not stacked). */
.service__meta { display: flex; flex-direction: row; align-items: center; gap: 12px; white-space: nowrap; }
.service__price { font-weight: 600; }

/* ── Polaroids ──────────────────────────────────────────────────────────
   Shared frame look, used both for the decorative background scatter and the
   gallery stack. */
.polaroid {
  background: #fdfaf5;
  padding: 12px 12px 36px;
  box-shadow: var(--polaroid-shadow);
  border-radius: 2px;
  cursor: pointer;
  will-change: transform, filter;
  /* overshoot lift; z-index drops back only after the visual settles (0.3s) */
  transition: transform 320ms cubic-bezier(.2,.9,.3,1.2), box-shadow 260ms,
              filter 320ms, z-index 0s .3s;
}
.polaroid::after {           /* subtle paper sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,255,255,.4), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(0,0,0,.03), transparent 70%);
}
.polaroid-photo {
  width: 100%; aspect-ratio: 1/1;
  object-fit: cover;            /* <img> in the stack */
  background-size: cover; background-position: center;  /* div in the scatter */
  display: block; border-radius: 1px; position: relative; overflow: hidden;
}
.polaroid-caption {
  font-family: 'Caveat', cursive;
  font-size: 20px; line-height: 1; color: #3a2e2a;
  text-align: center; margin-top: 10px;
  transform: rotate(-1deg);
}
.polaroid-tape {
  position: absolute; width: 60px; height: 18px;
  top: -8px; left: 50%;
  background: rgba(212,192,130,.55);
  border: 1px solid rgba(180,158,100,.3);
  transform: translateX(-50%) rotate(-3deg);
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* Decorative background layer: fixed, pinned to the edges, faded "behind glass".
   Float-motion JS writes --tx/--ty; --rot is the per-photo base angle (inline). */
.polaroid-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.polaroid-layer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(239,233,227,.45) 0%, transparent 60%),
    linear-gradient(180deg, rgba(255,250,245,.15) 0%, rgba(239,233,227,.25) 100%);
  -webkit-backdrop-filter: blur(1.5px) saturate(.75);
  backdrop-filter: blur(1.5px) saturate(.75);
}
.polaroid-layer .polaroid {
  position: absolute; width: 180px; pointer-events: auto;
  filter: saturate(.7) brightness(.96) opacity(.78);
  z-index: 1;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) rotate(var(--rot, 0deg));
}
.polaroid-layer .polaroid:hover {       /* steps out of the fog */
  transform: translate(var(--tx, 0px), var(--ty, 0px)) rotate(0deg) scale(1.08) !important;
  box-shadow: 0 20px 38px rgba(40,30,20,.28), 0 6px 12px rgba(40,30,20,.18);
  z-index: 50 !important;
  filter: saturate(1.05) brightness(1.02) opacity(1);
  transition: transform 280ms cubic-bezier(.2,.9,.3,1.2), box-shadow 280ms,
              filter 280ms, z-index 0s;
}

/* The in-content portfolio block is hidden on wide screens — there, the
   scattered polaroids ARE the gallery. It only appears when the viewport is
   too narrow for the scatter (≤640px), as a swipeable row. */
.sec-gallery { display: none; }
/* Gallery stack: newest on top, a centred column of polaroids. */
.gallery--polaroid { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.gallery--polaroid .polaroid {
  position: relative; width: min(300px, 86%); margin: 0;
  transform: rotate(var(--rot, 0deg));
}
.gallery--polaroid .polaroid:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 20px 38px rgba(40,30,20,.22), 0 6px 12px rgba(40,30,20,.14);
}

/* ── Zoom-view (lightbox) ─────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 1000; display: none;
  grid-template-rows: 1fr; place-items: center; padding: 24px;
  background: rgba(20,15,18,.88);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: lbFade 240ms ease;
}
.lightbox.is-open { display: grid; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lb-polaroid {
  background: #fdfaf5; padding: 18px 18px 50px; border-radius: 2px;
  box-shadow: 0 30px 60px rgba(0,0,0,.5), 0 10px 20px rgba(0,0,0,.3);
  max-width: min(540px, 86vw); max-height: 86vh;
  display: flex; flex-direction: column;
  transform: rotate(-1.5deg); animation: lbRise 320ms cubic-bezier(.2,.9,.3,1.1);
}
@keyframes lbRise {
  from { transform: rotate(-8deg) scale(.7); opacity: 0; }
  to   { transform: rotate(-1.5deg) scale(1); opacity: 1; }
}
.lb-polaroid .polaroid-photo { width: min(480px, 76vw); height: min(480px, 76vw); }
.lb-polaroid .polaroid-caption { font-size: 30px; margin-top: 16px; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff; font-size: 22px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  transition: background 160ms, transform 160ms;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 24px; right: 24px; }
.lb-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.75); font-size: 13px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  padding: 6px 14px; border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) {
  .polaroid, .lb-polaroid { animation: none; transition: none; }
}

.hours { width: 100%; border-collapse: collapse; }
.hours td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr:last-child td { border-bottom: 0; }

.map { width: 100%; height: 300px; border: 0; border-radius: var(--r-sm); } /* was off-scale 12px */
.maplink { display: inline-block; margin-top: 10px; color: var(--brand); text-decoration: none; }

/* Hero contacts — centred row of icon+label pills that wrap on narrow screens. */
.hero__contacts {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px; margin-bottom: 20px; width: 100%;
}
.hero__contacts a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 9px 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500;
  max-width: 100%; transition: border-color .15s, color .15s;
}
.hero__contacts a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero__contacts a:hover { border-color: var(--brand-hi); color: var(--brand); }
.ci { width: 20px; height: 20px; display: block; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: var(--r-sm); /* was off-scale 12px */
  font-weight: 600;
  text-decoration: none; cursor: pointer; border: 0;
}
.btn--book { background: var(--brand); color: var(--brand-ink); width: 100%; }
.btn--book:hover { background: var(--brand-hi); }
/* In the centred hero the CTA shouldn't stretch edge-to-edge. */
.hero .btn--book { width: min(340px, 100%); min-height: 50px; }
.book-foot { margin: 8px 0 24px; }

.page-foot { text-align: center; font-size: .85rem; padding-top: 8px; }
.page-foot p { margin: 0 0 6px; }
.page-foot p:last-child { margin-bottom: 0; }

/* Web booking (P2) */
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--r-sm); /* was hardcoded 10px — exact canonical value */
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.slot-btn:hover { border-color: var(--brand); color: var(--brand); }

/* Reviews (P3) */
/* Hero rating → a small rose pill linking to the reviews section. */
.rating { margin: 0 0 12px; }
.rating a {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--rose-soft); color: #7d3b4c;
  font-weight: 600; font-size: .9rem; text-decoration: none;
  padding: 5px 13px; border-radius: 999px;
}
/* Horizontal, swipeable review tiles (works on mobile + desktop). */
.reviews {
  list-style: none; margin: 0 0 16px; padding: 2px 0 12px;
  display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.review {
  flex: 0 0 auto; width: min(280px, 78%);
  scroll-snap-align: start;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px; /* was off-scale 12px */
}
.review__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.review__name { font-weight: 600; }
/* --star (#9a6f14, master.css :root): darkened from the old #e0a83b, which
   read at only ~2.1:1 on --bg. AA-checked: 3.74:1 against --bg (#efe9e3) —
   clears the 3:1 non-text/graphical-glyph minimum (stars are a decorative
   rating icon, not body copy; 4.5:1 does not apply). */
.review__stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.review__text { margin: 4px 0 0; }
.review-thanks {
  background: var(--good-soft); border: 1px solid var(--good); color: var(--ink);
  padding: 10px 14px; border-radius: var(--r-sm); /* was hardcoded 10px */
}
.review-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.review-form input, .review-form select, .review-form textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); /* was hardcoded 10px — exact canonical value */
  background: var(--bg); color: var(--ink);
}
.review-note { font-size: .8rem; margin: 0; }
.review-consent a { color: var(--brand); }

@media (min-width: 560px) {
  .hero { padding: 34px 24px 28px; }
  .hero h1 { font-size: 2.15rem; }
}

/* Mid widths: the scatter starts to crowd the content — shrink it and drop
   all but the two "anchor" polaroids. */
/* Mid widths: the scatter just shrinks (still the gallery). */
@media (max-width: 920px) {
  .polaroid-layer .polaroid { width: 132px; }
}

/* Phones: no decorative scatter at all; the portfolio block appears below the
   reviews as a swipeable row (matching the reviews carousel). */
@media (max-width: 640px) {
  .polaroid-layer { display: none; }
  /* Reorder via flex on .page: reviews, then gallery, then footer bits. */
  #reviews   { order: 1; }
  .sec-gallery { display: block; order: 2; }
  .book-foot { order: 3; }
  .page-foot { order: 4; }
  .gallery--polaroid {
    flex-direction: row; flex-wrap: nowrap;
    align-items: flex-start; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; padding-bottom: 8px;
  }
  .gallery--polaroid .polaroid { flex: 0 0 auto; width: min(240px, 72%); scroll-snap-align: start; }
}
