/* ============================================================
   Block: Hero (.hero-cover)
   Dulce de Leche Design System
   ============================================================ */

.hero-cover {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-cover .wrap {
  position: relative;
  z-index: 3;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Showcase (homepage) ---- */
.hero-cover {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--paper) 0%, var(--cream-50) 100%);
  padding: var(--space-6) 0;
}

/* ── Showcase wariant: full-screen slideshow ──────────────────── */
.hero-cover--showcase {
  background: var(--ink);
  padding: 0;
  align-items: center;
}

/* Slideshow container */
.hero-cover-slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-cover-slideshow .hero-cover-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  will-change: opacity;
}

.hero-cover-slideshow .hero-cover-bg[data-active="true"] {
  opacity: 1;
}

/* Single image fallback */
.hero-cover > .hero-cover-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* Scrim — przyciemnienie zdjęcia */
.hero-cover-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 65% 60% at 50% 48%,
      color-mix(in srgb, var(--espresso) 62%, transparent) 0%,
      transparent 78%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--espresso) 50%, transparent) 0%,
      color-mix(in srgb, var(--espresso) 40%, transparent) 45%,
      color-mix(in srgb, var(--espresso) 55%, transparent) 100%
    );
  z-index: 1;
  pointer-events: none;
}

/* Dolny gradient → manifest (espresso brown) */
.hero-cover-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30vh;
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--espresso) 60%, transparent) 50%,
    var(--espresso) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* Content warstwowy — ponad scrim i gradient */
.hero-cover-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: clamp(120px, 16vh, 200px) var(--gutter) clamp(100px, 14vh, 180px);
  max-width: var(--max);
  margin: 0 auto;
}

/* On-dark overrides dla showcase */
.hero-cover--showcase h1.hero-title {
  color: var(--cream-50);
}

.hero-cover--showcase h1.hero-title em {
  color: var(--gold);
}

.hero-cover--showcase .hero-sub {
  color: color-mix(in srgb, var(--cream-50) 85%, transparent);
}

.hero-cover--showcase .chapter {
  color: var(--gold);
}

.hero-cover--showcase .chapter .roman {
  color: var(--gold);
}

.hero-cover--showcase .chapter .bar {
  background: currentColor;
}

/* Hero strony głównej — treść wyśrodkowana */
.hero-cover--showcase .hero-copy {
  text-align: center;
  align-items: center;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}
.hero-cover--showcase .chapter {
  justify-content: center;
}
.hero-cover--showcase .chapter::after {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
  flex: none;
}
.hero-cover--showcase .hero-sub {
  margin-left: auto;
  margin-right: auto;
}
.hero-cover--showcase .hero-meta {
  justify-content: center;
}
/* Miękki cień dla czytelności na jasnym tle */
.hero-cover--showcase .hero-title,
.hero-cover--showcase .hero-sub,
.hero-cover--showcase .chapter {
  text-shadow: 0 2px 28px color-mix(in srgb, var(--espresso) 65%, transparent);
}




/* Scroll hint */
.hero-cover-scroll {
  position: absolute;
  bottom: 8vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 20px;
  color: color-mix(in srgb, var(--cream-50) 50%, transparent);
  animation: scrollBounce 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
  50%       { transform: translateX(-50%) translateY(8px); opacity: 0.9; }
}

/* Standard wariant — bg-image przez własny div zamiast inline style na <section> */
.hero-cover--standard {
  min-height: 65dvh;
  padding: var(--space-6) 0;
  align-items: flex-end;
}

.hero-cover-bg-standard {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Gradient standard: scrim góra + espresso dół (jak showcase) */
.hero-cover--standard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--espresso) 40%, transparent) 0%,
    color-mix(in srgb, var(--espresso) 15%, transparent) 25%,
    transparent 48%,
    color-mix(in srgb, var(--espresso) 65%, transparent) 72%,
    var(--espresso) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Styl podstrony: wyśrodkowanie + złota kreska + bottom-anchor ── */

/* Wyśrodkowanie treści */
.hero-cover--standard .hero-copy,
.hero-cover--plain .hero-copy {
  text-align: center;
}

.hero-cover--standard .hero-sub,
.hero-cover--plain .hero-sub {
  margin-left: auto;
  margin-right: auto;
}

.hero-cover--standard .hero-meta,
.hero-cover--plain .hero-meta {
  justify-content: center;
}

/* Złota kreska nad tytułem */
.hero-cover--standard .hero-title::before,
.hero-cover--plain .hero-title::before {
  content: '';
  display: block;
  width: 44px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto var(--space-3);
}

/* Plain: subtelny gradient nawet bez zdjęcia — głębia tła */
.hero-cover--plain::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    color-mix(in srgb, var(--karmel) 18%, transparent) 0%,
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}

.hero-cover .hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--space-3);
  align-items: end;
  min-height: calc(100vh - 200px);
}

.hero-copy {
  padding-top: var(--space-6);
  position: relative;
  z-index: 2;
}

h1.hero-title {
  font-family: var(--display);
  font-weight: 350;
  font-variation-settings: "opsz" 144;
  font-size: var(--text-h1);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}

h1.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--karmel);
}

.hero-sub {
  margin-top: var(--space-3);
  max-width: 38ch;
  font-family: var(--display);
  font-style: italic;
  font-weight: 350;
  font-size: var(--text-lede);
  line-height: 1.35;
  color: var(--espresso);
}

.hero-meta {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.hero-photo-frame {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 4 / 5;
  background: radial-gradient(
    120% 80% at 50% 30%,
    var(--cream-50) 0%,
    var(--cream-100) 65%,
    var(--cream-200) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-photo-frame img {
  width: 110%;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* ---- Standard (z fotografią) ---- */
.hero-cover--standard .hero-copy {
  color: var(--cream-50);
}

.hero-cover--standard h1.hero-title {
  color: var(--cream-50);
}

.hero-cover--standard h1.hero-title em {
  color: var(--gold);
}

.hero-cover--standard .hero-sub {
  color: color-mix(in srgb, var(--cream-50) 85%, transparent);
}

.hero-cover--standard .chapter {
  color: var(--gold);
}

.hero-cover--standard .chapter .roman {
  color: var(--gold);
}

.hero-cover--standard .chapter .bar {
  background: color-mix(in srgb, var(--gold) 60%, transparent);
}

/* ---- Plain (utility) ---- */
.hero-cover--plain {
  min-height: 65dvh;
  background: var(--espresso);
  padding: var(--space-6) 0;
  display: flex;
  align-items: flex-end;
}

.hero-cover--plain.is-light {
  background: var(--cream-50);
}

.hero-cover--plain .hero-copy {
  color: var(--cream-50);
}

.hero-cover--plain.is-light .hero-copy {
  color: var(--ink);
}

h2.hero-title {
  font-family: var(--display);
  font-weight: 350;
  font-style: italic;
  font-variation-settings: "opsz" 144;
  font-size: var(--text-h2);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-2);
  color: var(--cream-50);
}

.hero-cover--plain.is-light h2.hero-title {
  color: var(--ink);
}

.hero-cover--plain .hero-sub {
  color: color-mix(in srgb, var(--cream-50) 80%, transparent);
}

.hero-cover--plain.is-light .hero-sub {
  color: var(--espresso);
}

.hero-cover--plain .chapter.on-dark {
  color: var(--gold);
}

/* ---- Reveal animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---- Chapter marker ---- */
.chapter {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--karmel);
  margin-bottom: var(--space-3);
}

.chapter .roman {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--karmel);
}

.chapter .bar {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: color-mix(in srgb, var(--karmel) 60%, transparent);
}

.chapter.on-dark {
  color: var(--gold);
}

.chapter.on-dark .roman {
  color: var(--gold);
}

.chapter.on-dark .bar {
  background: color-mix(in srgb, var(--gold) 60%, transparent);
}

/* ---- Buttons — defined in dl-system.css ---- */

/* ---- Responsive ---- */
@media (max-width: 1080px) {
  .hero-cover .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hero-cover--standard,
  .hero-cover--plain {
    align-items: flex-end;
  }
}
