/* ==========================================================================
   Blok „Nagłówek strony firmowej” (.chead): granatowy grunt z siatką, wszystko wyśrodkowane,
   pierwszy blok strony (arkusz .lift) leży na jego dolnej krawędzi.
   Źródło (prototyp): assets/css/podstrony/firma.css; zdjęcie w tle: podstrony/producenci.css (.pr-hero__photo → .chead__photo)
   ========================================================================== */

.chead {
  position: relative; isolation: isolate; overflow: hidden; color: #fff; text-align: center;
  background: url("../../assets/img/siatka-granat.svg") center / cover no-repeat, var(--navy-ground);
  padding: calc(var(--nav-overlap) + clamp(1.5rem, 3vw, 2.5rem)) 0 calc(var(--ledger-lift) + clamp(2.75rem, 5vw, 4rem));
}
/* with a photo the grid lies in .chead__photo::after – the ground stays plain (prototype: .p-producenci .chead) */
.chead:has(> .chead__photo) { background: var(--navy-ground); }
/* a faint orange arc under the copy: the ribbon's colour, never text */
.chead::after {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: calc(var(--ledger-lift) * -1.4);
  width: min(1100px, 130vw); aspect-ratio: 2.2; transform: translateX(-50%);
  border-radius: 50%; border-top: 1.5px solid rgba(248, 120, 49, .38);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}

.chead .crumbs ol { justify-content: center; color: #b9c7da; }
.chead .crumbs a { color: #c9d4e2; }
.chead .crumbs a:hover { color: #fff; }
.chead .crumbs [aria-current] { color: #fff; }
.chead .crumbs li + li::before { border-color: rgba(255, 255, 255, .45); }

.chead__body { display: flex; flex-direction: column; align-items: center; max-width: 52rem; margin-inline: auto; }
.chead .eyebrow.eyebrow { margin-bottom: 1.25rem; }
.chead h1 {
  margin: 0 0 1.1rem; max-width: 16ch; color: #fff; text-wrap: balance;
  font-size: clamp(2.375rem, 1.3rem + 3.4vw, 4rem); line-height: 1.02; letter-spacing: -.04em;
}
.chead__lead {
  margin: 0 0 .9rem; max-width: 34ch; text-wrap: balance;
  font-size: clamp(1.25rem, 1.05rem + .8vw, 1.625rem); font-weight: 500; line-height: 1.3; letter-spacing: -.015em; color: #fff;
}
.chead__text { margin: 0; max-width: 60ch; color: #c9d4e2; font-size: 1.0625rem; line-height: 1.65; }
.chead__text + .chead__text { margin-top: .8em; }
/* dłuższy tekst (kilka akapitów, np. Ekologia): szerzej niż tytuł, żeby zajmował mniej linii */
.chead__body:has(.chead__text + .chead__text) { max-width: 62rem; }
.chead__body:has(.chead__text + .chead__text) .chead__text { max-width: none; text-wrap: pretty; }
.chead__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 1rem; margin-top: 1.9rem; }

@media (max-width: 560px) {
  .chead { text-align: left; }
  .chead::after { display: none; }
  .chead .crumbs ol { justify-content: flex-start; }
  .chead__body { align-items: flex-start; }
  .chead__actions { justify-content: stretch; }
  .chead__actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* Zdjęcie w tle (opcjonalne) */
.chead__photo { position: absolute; inset: 0; z-index: -2; display: block; overflow: hidden; }
.chead__photo img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 100% 50%;
  mix-blend-mode: luminosity; opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 55%);
  mask-image: linear-gradient(90deg, transparent 20%, #000 55%);
  animation: chead-photo-in 1.8s var(--ease) both;
}
.chead__photo::after {
  content: ""; position: absolute; inset: 0;
  background:
    url("../../assets/img/siatka-granat.svg") center / cover no-repeat,
    radial-gradient(46% 62% at 50% 50%, rgba(16, 33, 58, .88), rgba(16, 33, 58, .5) 100%),
    linear-gradient(180deg, rgba(16, 33, 58, .55) 0%, rgba(16, 33, 58, 0) 30%, rgba(16, 33, 58, 0) 55%, #10213a 100%);
}
@keyframes chead-photo-in { from { transform: scale(1.06); } }

@media (max-width: 640px) {
  /* tekst do lewej: grunt gęstnieje równo, zdjęcie widać nad i pod tekstem */
  .chead__photo img { object-position: 80% 50%; -webkit-mask-image: none; mask-image: none; }
  .chead__photo::after {
    background:
      url("../../assets/img/siatka-granat.svg") center / cover no-repeat,
      linear-gradient(180deg, rgba(16, 33, 58, .6) 0%, rgba(16, 33, 58, .8) 22%, rgba(16, 33, 58, .86) 70%, #10213a 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chead__photo img { animation: none; }
}
