/* ==========================================================================
   Moduł Hero — sekcja powitalna (baner) + rotacja nagłówka.
   Wartości 1:1 z theme/baurad/css/home.css (sekcja "Hero" i rotator .br-rot-*),
   ale scope'owane pod .mod-hero, dzięki czemu hero wygląda poprawnie na
   dowolnej stronie (nie tylko tam, gdzie dołączono home.css).
   Tokeny BAURAD z wartościami zapasowymi — działa też w motywie bez tokenów.
   ========================================================================== */

@keyframes modHeroWordIn {
  0%   { opacity: 0; transform: translateY(0.62em) scale(0.97); filter: blur(10px); }
  55%  { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Rotator: stos linii w jednej komórce siatki, aktywna linia animuje słowa. */
.mod-hero .br-rot-stack { display: grid; }
.mod-hero .br-rot-line {
  grid-area: 1 / 1;
  display: block;
  pointer-events: none;
}
.mod-hero .br-rot-line[aria-hidden="true"] { visibility: hidden; }
.mod-hero .br-rot-word {
  display: inline-block;
  will-change: transform, filter, opacity;
}

/* --- Sekcja hero --------------------------------------------------------- */
.mod-hero {
  position: relative;
  background: var(--color-paper, #f7f3e8);
  overflow: hidden;
}
.mod-hero .br-hero__img {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 62%;
  background-size: cover;
  background-position: 62% 78%;
  will-change: transform;
}
.mod-hero .br-hero__fade {
  position: absolute;
  top: 0; bottom: 0;
  left: 28%;
  width: 34%;
  background: linear-gradient(90deg, var(--color-paper, #f7f3e8) 0%, rgba(247,243,232,0.86) 40%, rgba(247,243,232,0) 100%);
  pointer-events: none;
}
.mod-hero .br-hero__logo {
  position: absolute;
  top: 50%;
  left: 68%;
  width: clamp(120px, 13vw, 190px);
  height: auto;
  margin-top: -1%;
  transform: translate(-50%, -50%);
  will-change: transform;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 34px rgba(255,255,255,1));
}
.mod-hero .br-hero__inner {
  position: relative;
  max-width: clamp(64rem, 88vw, 120rem);
  margin: 0 auto;
  padding: 6.5rem var(--space-4, 2rem) var(--space-15x, 7.5rem);
}
.mod-hero .br-hero__copy {
  max-width: 46%;
  will-change: transform, opacity;
}
.mod-hero .br-banner-title {
  font-family: var(--font-ui, inherit);
  /* Rozmiar ustawiony wprost - świadomie BEZ odwołania do tokenu
     --text-hero z theme/baurad/css/tokens.css (jego rampa ograniczała
     tytuł hero na typowych szerokościach). */
  /* font-size: var(--text-hero, clamp(3rem, 5vw, 4rem)); */ /* wyłączone */
  font-size: clamp(3rem, 5vw, 4rem);
  font-weight: 700;
  line-height: var(--text-hero-lh, 1.1);
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-3, 1.5rem);
  color: var(--color-ink, #2b2622);
}
.mod-hero .br-hero__sub {
  font-size: var(--text-body-lg, 1.25rem);
  line-height: var(--text-body-lg-lh, 1.62);
  color: var(--color-ink-2, #6b645e);
  margin: 0;
  max-width: 32.5rem;
}

/* --- Opakowanie modułu w motywie (elements/modules.html) ----------------- */
/* Motyw opakowuje każdy moduł w kartę z nagłówkiem (nazwa instancji). Hero
   to sekcja pełnej szerokości, więc opakowanie neutralizujemy, a nazwę
   instancji ukrywamy. Selektor :has() — w starszych przeglądarkach nazwa
   instancji pozostanie widoczna (wpis kosmetyczny). */
section.module:has(> .module-body > .mod-hero) {
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
section.module:has(> .module-body > .mod-hero) > .neon-card-title { display: none; }

/* --- Responsywność ------------------------------------------------------- */
@media (max-width: 1024px) {
  .mod-hero .br-hero__copy { max-width: 48%; }
  .mod-hero .br-hero__fade { left: 20%; width: 40%; }
  .mod-hero .br-hero__logo { left: 70%; width: clamp(104px, 14vw, 150px); }
}
@media (max-width: 864px) {
  .mod-hero { display: flex; flex-direction: column; }
  .mod-hero .br-hero__inner { padding: var(--space-8, 4rem) var(--space-4, 2rem) var(--space-5, 2.5rem); order: 1; }
  .mod-hero .br-hero__copy { max-width: 100%; }
  .mod-hero .br-hero__img {
    position: relative;
    width: 100%;
    height: 19rem;
    order: 2;
    background-position: 68% 82%;
  }
  .mod-hero .br-hero__fade { display: none; }
  .mod-hero .br-hero__logo {
    top: auto;
    bottom: 9.5rem;
    left: 2rem;
    margin: 0;
    width: 6rem;
    transform: translateY(50%);
  }
}
@media (max-width: 480px) {
  .mod-hero .br-hero__inner { padding: var(--space-6, 3rem) var(--space-3, 1.5rem) var(--space-4, 2rem); }
  .mod-hero .br-hero__logo { bottom: 7rem; left: 1.5rem; width: 5.5rem; }
  .mod-hero .br-hero__img { height: 14.5rem; }
}

/* --- Redukcja ruchu ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .mod-hero .br-rot-word { animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important; }
  .mod-hero .br-hero__img, .mod-hero .br-hero__copy { transform: none !important; opacity: 1 !important; }
  .mod-hero .br-hero__logo { transform: translate(-50%, -50%) !important; }
}
