/* ==========================================================================
   АНКОМ — shared sections: page hero, photo placeholder, CTA, contact links, footer, phone action bar
   ========================================================================== */

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-top: 64px; padding-bottom: 20px; }
.page-hero .eyebrow { margin-bottom: 20px; }
.page-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-hi);
}
.page-hero__lead {
  max-width: 36em;
  margin-top: 18px;
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--muted);
}


/* ---------- CTA banner ---------- */
.cta {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 60px;
  padding-bottom: 60px;
}
.cta__title {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-3xl);
  line-height: 1.25;
  color: var(--text-hi);
}
.cta__text { font-size: var(--fs-md); color: var(--muted); }

/* ---------- Contact links: Viber / Telegram / mail rows (contacts page, «Зв’язок з майстром» block) ---------- */
.contact-links { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.contact-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'name arrow' 'value arrow';
  align-items: center;
  gap: 3px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.contact-links li:first-child .contact-link { border-top: 1px solid var(--line); }
.contact-link__name { grid-area: name; font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; color: var(--dim); transition: color 0.2s; }
.contact-link__value { grid-area: value; overflow: hidden; font-size: var(--fs-md); color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.contact-link__arrow { grid-area: arrow; color: var(--dim); transition: color 0.2s; }
.contact-link:hover { border-color: var(--line-4); }
.contact-link:hover .contact-link__name,
.contact-link:hover .contact-link__arrow { color: var(--hot); }
/* ↗ turns to →. The path turns, not the <svg>: a turning <svg> is a composited bitmap (blurry while moving,
   snaps crisp at the end), a turning path stays a vector every frame. Centre = the viewBox centre = the arrow's */
.contact-link__arrow path { transform-origin: 50% 50%; transition: rotate 0.35s cubic-bezier(0.45, 0, 0.2, 1); }
@media (hover: hover) and (pointer: fine) {
  .contact-link:hover .contact-link__arrow path { rotate: 45deg; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); }

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1fr 1.3fr;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 32px;
}
.site-footer .logo { margin-bottom: 16px; }
.site-footer__about { max-width: 280px; margin-bottom: 26px; font-size: var(--fs-sm); line-height: 1.6; color: var(--muted); }
.site-footer__title {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text);
}
.site-footer__hours { margin: -6px 0 12px; font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); }
.site-footer__list { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.site-footer__list a,
.site-footer__list span { font-size: var(--fs-sm); color: var(--muted); text-decoration: none; }
.site-footer__list a { transition: color 0.2s; }
.site-footer__list a:hover { color: var(--text); }
.site-footer__address { display: block; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); text-decoration: none; transition: color 0.2s; }
.site-footer__address small { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; color: var(--dim); transition: color 0.2s; }
.site-footer__address small svg { flex-shrink: 0; translate: 0 calc(6px - 0.36em); translate: 0 calc(6px - 0.5cap); } /* centre on the capitals */
.site-footer__address:hover,
.site-footer__address:hover small { color: var(--hot); }

/* wordmark: the logo's (sprite), outlined, exactly the container width */
.site-footer__mark { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); overflow: hidden; container-type: inline-size; }
.site-footer__wordmark {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 487.8 / 104.2;
  margin: 8px 0 clamp(20px, 3.5cqi, 48px); /* air between the wordmark and the bottom bar */
  overflow: visible;
  fill: none;
  stroke: var(--line-4);
  stroke-width: 1px; /* non-scaling (the sprite path): a hairline at any size */
  user-select: none;
}
/* its iris moves (motion.css): six sliding blades clipped to the disc + the rim, as in the preloader; at rest the
   blades sit at the logo's aperture */
.site-footer__iris { transform-box: fill-box; transform-origin: center; } /* the box is centred on the iris */
.site-footer__blade { transform: translate(5.69px, -21.25px); } /* build-logo.py --preloader: logo slide */
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 24px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--dim);
}
.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
}
.site-footer__meta a { color: var(--dim); text-decoration: none; }
.site-footer__meta a:hover { color: var(--text-3); }

/* open / closed indicator (js/motion.js sets data-state from the Kyiv time) */
.open-status {
  display: inline-flex;
  align-items: baseline; /* the dot is aligned to the capitals, not to the line box (mono caps sit above its middle) */
  gap: 9px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--text-3);
}
.open-status::before {
  content: '';
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--dim);
  /* an empty flex item's baseline is its bottom edge: lift the dot so its centre sits at half the cap height */
  transform: translateY(calc(4px - 0.36em));
  transform: translateY(calc(4px - 0.5cap));
}
.open-status[data-state='open'] { color: var(--text-hi); }
.open-status[data-state='open']::before { background: #6fcf86; box-shadow: 0 0 0 4px rgba(111, 207, 134, 0.16); }
.open-status[data-state='closed']::before { background: var(--error); }

/* ---------- Responsive ---------- */
@media (max-width: 1023.98px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767.98px) {
  .page-hero { padding-top: 44px; }
  .cta__inner { padding-top: 44px; padding-bottom: 44px; }
  .cta__title { font-size: var(--fs-2xl); }
  .cta .btn--xl { width: 100%; font-size: var(--fs-xl); padding: 16px 24px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; }
}
/* phones: the footer's nav and contacts as two compact columns with ~30 px tap rows; contact rows ≥ 44 px */
@media (max-width: 767.98px) {
  .site-footer nav .site-footer__list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
  .site-footer__list a { display: inline-block; padding: 5px 0; }
  .contact-link { padding: 12px 0; }
}

/* ---------- Phone action bar (< 768 px): call + open status ----------
   Open (or no JS): «Зателефонувати» is the main action. Closed (motion.js → data-state="closed"): «Написати»
   (to the page's Viber / Telegram rows) takes over and the call shrinks to an icon. Hidden while the 3D story fills
   the screen (html.mbar-off), under the preloader, with the menu open and while a form field has focus (the on-screen
   keyboard is up; no forms now — css/forms.css). */
.mbar { display: none; }
@media (max-width: 767.98px) {
  .mbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 58; /* under the menu scrim (59), header (60), preloader (80) and curtain (100) */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--bg-2);
    border-top: 1px solid var(--line-2);
    transition: transform 0.3s var(--ease-out), visibility 0s linear 0s;
  }
  .mbar__status { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
  .mbar__call,
  .mbar__write {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--hot);
    color: #1a1512;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-md);
    text-decoration: none;
    white-space: nowrap;
  }
  /* call: the phone icon centred on the capitals of «Зателефонувати» (baseline + shift, as the other icon labels);
     wrap + align-content keep that line centred in the 46 px button. Closed (icon only): no shift, just centred */
  .mbar__call { align-items: baseline; flex-wrap: wrap; align-content: center; }
  .mbar__call svg { flex-shrink: 0; translate: 0 calc(8px - 0.36em); translate: 0 calc(8px - 0.5cap); }
  .mbar__write { display: none; }
  .mbar[data-state='closed'] .mbar__write { display: inline-flex; }
  .mbar[data-state='closed'] .mbar__call { width: 46px; padding: 0; background: transparent; border-color: var(--line-4); color: var(--text); align-items: center; }
  .mbar[data-state='closed'] .mbar__call svg { translate: none; }
  .mbar[data-state='closed'] .mbar__call-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html.mbar-off .mbar,
  html.menu-open .mbar,
  html.story-3d:not(.is-story-ready) .mbar,
  html:has(:is(.lead-form, .quick-form) :focus) .mbar { transform: translateY(100%); visibility: hidden; transition: transform 0.25s var(--ease-out), visibility 0s linear 0.25s; }
  .site-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); } /* the last footer line stays clear of the bar */
}
/* narrowest phones: while closed the two buttons need the whole bar (the leading «Написати» plus the call icon say enough) */
@media (max-width: 374.98px) {
  .mbar[data-state='closed'] .mbar__status { display: none; }
  .mbar[data-state='closed'] .mbar__write { flex: 1 1 auto; }
}
