/* ==========================================================================
   Blok „Nagłówek strony usługi” (.phead.phead--media): tekst 11/24, zdjęcie 13/24
   na pochylonym arkuszu, dwie pływające karty z faktami.
   Źródło (prototyp): assets/css/podstrona.css, podstrony/audyt.css (.au-ticks → .phead__ticks), podstrony/outsourcing.css (równe kolumny)
   ========================================================================== */

.phead {
  background: var(--paper-2);
  padding: calc(var(--nav-overlap) + clamp(1.25rem, 2.2vw, 1.75rem)) 0 calc(var(--ledger-lift) + clamp(2rem, 3.5vw, 2.75rem));
}

.phead__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem); align-items: end;
}
.phead h1 {
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.5rem); line-height: 1.08; letter-spacing: -.02em;
  margin: 0; max-width: 11ch; color: var(--navy);
}
.phead__lead {
  font-size: clamp(1.25rem, 1.05rem + .8vw, 1.625rem); font-weight: 400; line-height: 1.3;
  letter-spacing: -.01em; color: var(--navy-900); margin: 0 0 .9rem; max-width: 30ch; text-wrap: balance;
}
.phead__text { color: var(--muted); font-size: 1.0625rem; max-width: 58ch; margin: 0; }
.phead__actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-top: 1.75rem; }
.phead__note { margin: 1rem 0 0; font-size: .875rem; color: var(--muted); }

.phead--media {
  position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(48% 70% at 88% 8%, rgba(221, 230, 240, .95), rgba(221, 230, 240, 0) 70%),
    radial-gradient(38% 55% at 4% 100%, rgba(253, 227, 211, .55), rgba(253, 227, 211, 0) 70%),
    var(--paper-2);
}
.phead--media .phead__grid { grid-template-columns: minmax(0, 11fr) minmax(0, 13fr); align-items: stretch; column-gap: clamp(2rem, 6vw, 6rem); }
.phead--media .phead__body { display: flex; flex-direction: column; justify-content: center; padding-block: .5rem; }
.phead--media h1 {
  max-width: 12ch; margin: 0 0 1.1rem;
  font-size: clamp(2.375rem, 1.3rem + 3.4vw, 4rem); line-height: 1.02; letter-spacing: -.04em;
}
.phead--media .phead__lead { max-width: 24ch; font-weight: 500; color: var(--navy); letter-spacing: -.015em; }
.phead--media .phead__actions .btn--lg { padding-inline: 1.5em; }
.phead--media .phead__actions .btn--lg:has(.btn__badge) { padding-right: 1.6em; }

.phead__visual { position: relative; z-index: 0; display: grid; min-height: 380px; margin: 1rem 0 1.25rem; }
/* the sheet under the photograph and the dotted patch at its corner */
.phead__visual::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  border-radius: 30px; background: linear-gradient(160deg, #dbe5f0, #eef3f8);
  transform: rotate(-3deg) translate(-10px, 12px);
}
.phead__visual::after {
  content: ""; position: absolute; z-index: -1; right: -26px; top: -24px; width: 150px; height: 120px;
  background: radial-gradient(circle, rgba(35, 66, 105, .28) 1.3px, transparent 1.6px) 0 0 / 14px 14px;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
  mask-image: radial-gradient(closest-side, #000 55%, transparent);
}
.phead__media {
  position: relative; margin: 0; min-height: 340px; overflow: hidden;
  border-radius: 26px; background: var(--navy-50); box-shadow: var(--shadow-md);
}
.phead__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Floating cards: white, 18px, the float shadow; an icon dot, a short title, one line */
.phead__facts { list-style: none; margin: 0; padding: 0; }
.fcard {
  position: absolute; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .8rem; align-items: center;
  max-width: 17.5rem; padding: .85rem 1.1rem .85rem .85rem;
  background: rgba(255, 255, 255, .97); border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(22, 42, 67, .06), var(--shadow-float);
  color: var(--navy-900); text-decoration: none;
}
@supports (backdrop-filter: blur(1px)) {
  .fcard { background: rgba(255, 255, 255, .93); backdrop-filter: saturate(1.6) blur(12px); }
}
.fcard--a { left: clamp(-3rem, -3vw, -1.5rem); bottom: 2.25rem; }
.fcard--b { right: clamp(-1.75rem, -1.6vw, -1rem); top: 1.75rem; }
.fcard__icon {
  grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange); color: var(--navy-900); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.fcard__icon .icon { width: 1.2rem; height: 1.2rem; stroke-width: 2; }
.fcard__icon--navy { background: var(--navy-900); color: var(--orange-400); box-shadow: none; }
.fcard b { display: block; font-family: var(--font-display); font-size: 1rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.fcard small { display: block; font-family: var(--font-ui); font-size: .8125rem; line-height: 1.35; color: var(--muted); }
.fcard__big { font-size: 1.75rem !important; font-weight: 700 !important; letter-spacing: -.035em !important; line-height: 1 !important; font-variant-numeric: tabular-nums; }
.fcard__big span { font-size: .55em; font-weight: 600; letter-spacing: -.01em; color: var(--muted); margin-left: .15em; }
a.fcard { transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
a.fcard:hover { box-shadow: inset 0 0 0 1px rgba(22, 42, 67, .08), 0 2px 6px rgba(22, 42, 67, .08), 0 22px 40px -16px rgba(22, 42, 67, .4); }
a.fcard:hover b { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }

/* a list card: a title row, then checked rows or chips */
.fcard--list { grid-template-columns: minmax(0, 1fr); gap: .55rem; padding: .95rem 1.1rem 1rem; max-width: 16rem; }
.fcard__head { display: flex; align-items: center; gap: .55rem; font-family: var(--font-ui); font-size: .75rem; font-weight: 500; letter-spacing: .01em; color: var(--muted); }
.fcard__head i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-50); }
.fcard__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.fcard__rows li { display: flex; align-items: center; gap: .55rem; font-size: .9375rem; font-weight: 500; line-height: 1.25; color: var(--navy-900); }
.fcard__rows .icon { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--navy-900); color: #fff; stroke-width: 2.6; }
.fcard__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.fcard__chips span { font-family: var(--font-ui); font-size: .8125rem; font-weight: 500; line-height: 1; color: var(--navy-900); background: var(--navy-50); border-radius: var(--radius-pill); padding: .45em .75em; }
.fcard__chips span.is-on { background: var(--navy-900); color: #fff; }
/* a meter card (Monitoring): one bar with the order threshold */
.fcard__meter { position: relative; height: 10px; border-radius: 6px; background: var(--navy-50); box-shadow: inset 0 0 0 1px var(--line); margin: .2rem 0 .35rem; }
.fcard__meter i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: calc(18% - 2px); border-radius: 4px; background: var(--orange); }
.fcard__meter u { position: absolute; left: 20%; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--navy-900); }
.fcard__row { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--font-ui); font-size: .8125rem; color: var(--muted); }
.fcard__row b { display: inline; font-family: var(--font-ui); font-size: .8125rem; font-weight: 600; color: var(--navy-900); font-variant-numeric: tabular-nums; }

/* entrance, then a slow float (one card rises while the other settles) */
@media (prefers-reduced-motion: no-preference) {
  .fcard { animation: fcard-in .9s var(--ease) both, fcard-float 7s ease-in-out 1.2s infinite alternate; }
  .fcard--a { animation-delay: .45s, 1.4s; }
  .fcard--b { animation-delay: .7s, 2.6s; }
  @keyframes fcard-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }
  @keyframes fcard-float { to { transform: translateY(-7px); } }
  a.fcard:hover { animation-play-state: paused; }
}

/* Trzy znaczniki pod przyciskami (prototyp: .au-ticks na stronie Audyt) */
.phead__ticks { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1.25rem 0 0; padding: 0; }
.phead__ticks li {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-ui); font-size: .875rem; font-weight: 500; line-height: 1.2; color: var(--navy-900);
}
.phead__ticks .icon { width: 20px; height: 20px; padding: 4px; border-radius: 50%; background: var(--navy-900); color: #fff; stroke-width: 2.8; }

/* Wariant „równe kolumny” (prototyp: Outsourcing) – oba przyciski w jednym wierszu */
@media (min-width: 901px) {
  .phead--media.phead--even .phead__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(2rem, 4.5vw, 4rem); }
  .phead--media.phead--even .phead__actions { column-gap: .75rem; }
  .phead--media.phead--even .phead__actions .btn--lg { padding-inline: 1.3em; }
  .phead--media.phead--even .phead__actions .btn--lg:has(.btn__badge) { padding-right: 1.45em; }
}

@media (max-width: 900px) {
.phead__grid { grid-template-columns: minmax(0, 1fr); }
  .phead h1 { max-width: 14ch; }
  .phead--media h1 { max-width: 12ch; } /* as in the prototype, where .phead--media h1 comes after the 14ch rule */
  .phead--media .phead__grid { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .phead__visual { order: -1; min-height: 0; margin: 0 .5rem 1.25rem 0; }
  .phead__media { min-height: 0; aspect-ratio: 16 / 10; border-radius: 22px; }
  .phead__visual::after { right: -14px; top: -16px; }
  .fcard--a { left: .75rem; bottom: -1.5rem; }
  .fcard--b { right: -.5rem; top: .75rem; }
}

@media (max-width: 560px) {
.phead__actions .btn { flex: 1 1 100%; justify-content: center; }
  .fcard--b { display: none; }
  .fcard--a { max-width: calc(100% - 1.5rem); }
  .fcard--list small { display: none; }
  .fcard--list { gap: .45rem; padding: .8rem 1rem .85rem; }
  .phead__visual::before { transform: rotate(-2deg) translate(-6px, 8px); }
}
