/**
 * SEOHEAD UI tokens + CTA contrast fix (P0-01).
 * .text-content a must not override .btn text color.
 */
:root {
  --seohead-navy: #193349;
  --seohead-canvas: #ffffff;
  --seohead-primary: #407fbf;
  --seohead-primary-hover: #198bff;
  --seohead-primary-active: #1262b3;
  --seohead-btn-fg: #ffffff;
  --seohead-link: #0a75c2;
  --seohead-accent-kontrol: #c45c26;
  --seohead-border: rgba(0, 0, 0, 0.14);
  --seohead-muted: #555555;
}

/* Primary buttons: force readable text on blue in all states */
.btn,
a.btn,
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:focus,
a.btn:focus-visible,
a.btn:active,
button.btn,
.text-content a.btn,
.text-content a.btn:link,
.text-content a.btn:visited,
.text-content a.btn:hover,
.text-content a.btn:focus,
.text-content a.btn:focus-visible,
.text-content a.btn:active,
.page-content a.btn,
.page-content a.btn:link,
.page-content a.btn:visited,
.page-content a.btn:hover,
.page-content a.btn:focus,
.repositioning-home-scenarios a.btn,
.repositioning-home-scenarios a.btn:visited,
.seohead-commercial a.btn,
.seohead-commercial a.btn:visited {
  color: var(--seohead-btn-fg) !important;
  -webkit-text-fill-color: var(--seohead-btn-fg) !important;
  text-decoration: none !important;
}

.btn:hover,
a.btn:hover,
.text-content a.btn:hover {
  background-color: var(--seohead-primary-hover);
}

.btn:active,
a.btn:active,
.text-content a.btn:active {
  background-color: var(--seohead-primary-active);
}

.btn:focus-visible,
a.btn:focus-visible,
.text-content a.btn:focus-visible {
  outline: 2px solid var(--seohead-primary-hover);
  outline-offset: 2px;
}

/* Transparent / outline buttons keep brand blue text */
.btn--transparent,
a.btn--transparent,
a.btn--transparent:link,
a.btn--transparent:visited {
  color: var(--seohead-primary) !important;
  -webkit-text-fill-color: var(--seohead-primary) !important;
  background-color: transparent;
}

/* Commercial / B04 block */
.seohead-commercial {
  margin: 0 0 1.5rem;
  padding: 1.5rem 1.25rem;
  background: #f7f9fb;
  border: 1px solid var(--seohead-border);
  border-radius: 4px;
}

.seohead-commercial--hero {
  margin-top: 0;
}

/*
 * About hero (/ave-lazutin/): keep portrait clean; type sits in a local panel
 * (no hard horizontal band across the face).
 */
.intro-pic--about {
  min-height: clamp(320px, 52vw, 520px) !important;
  padding-top: 3.5rem !important;
  padding-bottom: 1.75rem !important;
  justify-content: flex-end !important;
}

.intro-pic--about picture,
.intro-pic--about > img {
  z-index: 0 !important;
}

/* Soft left wash only — no mid-face cutoff */
.intro-pic--about::after {
  z-index: 1 !important;
  height: 100% !important;
  opacity: 1 !important;
  background: linear-gradient(
    105deg,
    rgba(12, 28, 42, 0.72) 0%,
    rgba(12, 28, 42, 0.35) 38%,
    rgba(12, 28, 42, 0.08) 62%,
    transparent 78%
  ) !important;
}

.intro-pic--about img,
.intro-pic--about picture img {
  object-fit: cover !important;
  object-position: 50% 22% !important;
}

.intro-pic--about .breadcrumbs,
.intro-pic--about .container {
  position: relative;
  z-index: 2;
}

.intro-pic--about .container {
  margin-top: auto !important;
}

.intro-pic--about .intro-pic__headers-flex {
  flex-grow: 0 !important;
  justify-content: flex-end !important;
  gap: 0.65rem;
  margin-top: 0 !important;
  max-width: min(100%, 28rem);
  padding: 0.85rem 1rem;
  border-radius: 4px;
  background: rgba(12, 28, 42, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.intro-pic--about .intro-pic__title {
  order: 0 !important;
  margin-top: 0 !important;
  max-width: none;
}

.intro-pic--about .intro-pic__text {
  order: 1 !important;
  display: flex !important;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.1rem;
  grid-template-columns: none !important;
  max-width: none;
}

.intro-pic--about .intro-pic__property {
  margin: 0 !important;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.35;
  opacity: 0.95;
  grid-column: auto !important;
}

.intro-pic--about .intro-pic__property br {
  display: none;
}

@media (min-width: 768px) {
  .intro-pic--about {
    min-height: clamp(380px, 42vw, 560px) !important;
  }

  .intro-pic--about .intro-pic__title {
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    line-height: 1.1;
  }

  .intro-pic--about .intro-pic__property--mob-hidden {
    display: block !important;
  }
}

/* About page — services list + CTA */
.seohead-about-services {
  margin: 0.75rem 0 1.25rem;
  padding-left: 1.15rem;
}

.seohead-about-services li {
  margin: 0 0 0.65rem;
}

.seohead-about-services a {
  white-space: nowrap;
}

body.seohead-ia-on .text-content [data-about-cta="1"],
.section-productivity__text [data-about-cta="1"],
.seohead-commercial[data-about-cta="1"] {
  margin-top: 1.5rem;
}

/* Related services — chips, not comma prose */
.seohead-related {
  margin: 1.15rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--seohead-border);
}

.seohead-related__label {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--seohead-muted);
}

.seohead-related__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.seohead-related__list a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--seohead-border);
  border-radius: 999px;
  background: #fff;
  color: var(--seohead-link) !important;
  -webkit-text-fill-color: var(--seohead-link) !important;
  text-decoration: none !important;
  font-size: 0.95rem;
  line-height: 1.2;
}

.seohead-related__list a:hover,
.seohead-related__list a:focus-visible {
  border-color: var(--seohead-primary);
  background: #eef5fb;
  outline: none;
}

.seohead-related__list a:focus-visible {
  outline: 2px solid var(--seohead-primary-hover);
  outline-offset: 2px;
}

.seohead-commercial h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  text-transform: none;
  letter-spacing: normal;
}

.seohead-commercial__price {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.seohead-commercial ol {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

/* Compact IA home hero — keep intro_img, avoid old oversized empty shell */
body.seohead-ia-on .page-content--repositioning .intro-pic--main,
body.seohead-ia-on .page-content--repositioning .intro-pic {
  position: relative;
  min-height: clamp(220px, 38vw, 420px) !important;
  height: auto !important;
  padding-top: 1.5rem !important;
  padding-bottom: 1.25rem !important;
  background-color: #193349;
  overflow: hidden;
}

body.seohead-ia-on .page-content--repositioning .intro-pic picture {
  display: block !important;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body.seohead-ia-on .page-content--repositioning .intro-pic picture img,
body.seohead-ia-on .page-content--repositioning .intro-pic > img {
  display: block !important;
  width: 100%;
  height: 100%;
  max-height: none !important;
  object-fit: cover;
  /* person stays on the right; text reads on the left */
  object-position: 72% center;
}

/*
 * Legacy ::after is z-index:-1 → buried under the photo → white H1 on light mockups.
 * Put the scrim ABOVE the image.
 */
body.seohead-ia-on .page-content--repositioning .intro-pic--main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(12, 28, 42, 0.82) 0%,
    rgba(12, 28, 42, 0.62) 34%,
    rgba(12, 28, 42, 0.22) 58%,
    transparent 76%
  );
}

body.seohead-ia-on .page-content--repositioning .intro-pic--main::after {
  display: none !important; /* avoid double wash */
}

body.seohead-ia-on .page-content--repositioning .intro-pic .container {
  position: relative;
  z-index: 2;
}

body.seohead-ia-on .page-content--repositioning .intro-pic__title {
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: none;
  max-width: 40rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.seohead-ia-on .page-content--repositioning .intro-pic__property {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  opacity: 0.95;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.seohead-ia-on .page-content--repositioning .intro-pic__socials,
body.seohead-ia-on .page-content--repositioning .intro-pic--socials .intro-pic__socials {
  margin: 1rem 0 0 !important;
  position: static !important;
}

body.seohead-ia-on .page-content--repositioning .intro-pic__headers-flex {
  flex-grow: 0;
  max-width: min(100%, 36rem);
}

body.seohead-ia-on .page-content--repositioning .intro-pic .visually-hidden {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 0.5rem !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: normal !important;
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
  font-weight: 700;
}

/* Single-services: tighten content after B04 */
body.seohead-ia-on .text-content > .seohead-commercial:first-child {
  margin-top: 0;
}

body.seohead-ia-on.single-services .page-content {
  padding-top: 1.5rem;
}

/* F-P0-01: reserve space so fixed contact bar does not cover content */
@media (max-width: 1023px) {
  body.seohead-ia-on {
    --seohead-fixed-socials-space: calc(3.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.seohead-ia-on,
  body.seohead-ia-on .page-content,
  body.seohead-ia-on .site-content,
  body.seohead-ia-on main,
  body.seohead-ia-on .wrapper {
    padding-bottom: var(--seohead-fixed-socials-space) !important;
  }

  body.seohead-ia-on .socials-block--fixed {
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  /* Avoid triple CTA while mobile drawer is open */
  body.seohead-ia-on:has(.header.is-open) .socials-block--fixed {
    transform: translate3d(0, 110%, 0);
    pointer-events: none;
  }
}

/* Service masthead photo under H1 — full frame, no crop */
body.seohead-ia-on .text-content > .seohead-service-masthead {
  margin: 0 0 1.25rem;
  max-width: 42rem;
}

body.seohead-ia-on .text-content > .seohead-service-masthead img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  border-radius: 6px;
}

/* Legacy: if photo still after B04 — plain image, hide lens */
body.seohead-ia-on .text-content > .seohead-commercial + p,
body.seohead-ia-on .text-content > .seohead-commercial + img {
  margin: 0.75rem 0 1.25rem;
  max-width: 28rem;
}

body.seohead-ia-on .text-content > .seohead-commercial + p .image,
body.seohead-ia-on .text-content > .seohead-commercial + p button.image {
  display: block;
  max-width: 100%;
  pointer-events: none;
  cursor: default;
  background: transparent;
  border: 0;
  padding: 0;
}

body.seohead-ia-on .text-content > .seohead-commercial + p button.image > svg {
  display: none !important;
}

body.seohead-ia-on .text-content > .seohead-commercial + p img,
body.seohead-ia-on .text-content > .seohead-commercial + img,
body.seohead-ia-on .text-content > .seohead-commercial + p button.image img {
  display: block;
  width: 100%;
  max-width: 22rem;
  max-height: 12.5rem !important;
  height: auto !important;
  object-fit: cover;
  border-radius: 4px;
}

/* F-P0-04: kontrol packaging */
body.seohead-ia-on .seohead-offer-lead {
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.15rem;
  background: #fff7f2;
  border: 1px solid rgba(196, 92, 38, 0.35);
  border-left: 4px solid var(--seohead-accent-kontrol);
  border-radius: 4px;
}

body.seohead-ia-on .seohead-pack-grid {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 720px) {
  body.seohead-ia-on .seohead-pack-grid {
    grid-template-columns: 1fr 1fr;
  }
}

body.seohead-ia-on .seohead-pack-card {
  margin: 0;
  padding: 1rem 1.1rem;
  background: #f7f9fb;
  border: 1px solid var(--seohead-border);
  border-radius: 4px;
}

body.seohead-ia-on .seohead-pack-card h2,
body.seohead-ia-on .seohead-pack-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

body.seohead-ia-on .seohead-result-flow {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 900px) {
  body.seohead-ia-on .seohead-result-flow {
    grid-template-columns: repeat(3, 1fr);
  }
}

body.seohead-ia-on .seohead-result-flow__item {
  margin: 0;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid var(--seohead-border);
  border-radius: 4px;
}

body.seohead-ia-on .seohead-result-flow__item strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--seohead-navy);
}

body.seohead-ia-on .seohead-steps {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: seohead-step;
  display: grid;
  gap: 0.65rem;
}

body.seohead-ia-on .seohead-steps li {
  position: relative;
  margin: 0;
  padding: 0.85rem 0.95rem 0.85rem 3rem;
  background: #f7f9fb;
  border: 1px solid var(--seohead-border);
  border-radius: 4px;
  counter-increment: seohead-step;
}

body.seohead-ia-on .seohead-steps li::before {
  content: counter(seohead-step);
  position: absolute;
  left: 0.75rem;
  top: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--seohead-accent-kontrol);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Prevent rare horizontal overflow on very narrow phones (incl. 320) */
@media (max-width: 360px) {
  body.seohead-ia-on .text-content,
  body.seohead-ia-on .page-content,
  body.seohead-ia-on .seohead-commercial {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.seohead-ia-on .text-content a.btn,
  body.seohead-ia-on .seohead-commercial a.btn {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
  }
}
