@layer base, layout, components, utilities, pages;

/* ========================================
   Unified Hero Component - 2025 Design
   Based on /case-studies/ archive header
   ======================================== */

@layer pages {

/* ----------------------------------------
   CSS Variables
   ---------------------------------------- */
:root {
  --hero-dark: #1a1612;
  --hero-gold: #b38f2d;
  --hero-gold-light: #d8b768;
  --hero-white: #ffffff;
  --hero-text: #faf8f5;
  --hero-text-muted: rgba(255, 255, 255, 0.7);
  --hero-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --hero-content-width: 1400px;
  --hero-gutter: clamp(24px, 5vw, 80px);
}

/* ----------------------------------------
   Base Hero Styles
   ---------------------------------------- */
.unified-hero {
  --hero-height: 480px;
  height: var(--hero-height);
  display: flex;
  align-items: center;
  background: var(--hero-dark);
  border-bottom: none;
  position: relative;
  overflow: hidden;
  /* Break out of parent container constraints */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Top gold accent line */
.unified-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--hero-gold);
}

/* Background watermark text */
.unified-hero::after {
  position: absolute;
  right: var(--hero-gutter);
  bottom: clamp(40px, 8vw, 80px);
  font-size: clamp(80px, 15vw, 200px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
  line-height: 1;
}

/* ----------------------------------------
   Layout
   ---------------------------------------- */
/* Reset container padding inside hero - hero__inner handles its own width/padding */
.unified-hero .container {
  max-width: none;
  padding: 0;
}

.unified-hero__inner {
  max-width: var(--hero-content-width);
  margin: 0 auto;
  padding: 0 var(--hero-gutter);
  display: block;
}

.unified-hero__content {
  max-width: 800px;
}

/* ----------------------------------------
   Eyebrow
   ---------------------------------------- */
.unified-hero__eyebrow {
  color: var(--hero-gold);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.unified-hero__eyebrow::before {
  content: "";
  display: block;
  background: var(--hero-gold);
  width: 48px;
  height: 1px;
}

/* ----------------------------------------
   Title
   ---------------------------------------- */
.unified-hero__title {
  color: var(--hero-white);
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 clamp(16px, 3vw, 24px);
}

/* ----------------------------------------
   Lead Text
   ---------------------------------------- */
.unified-hero__lead {
  color: var(--hero-text-muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.8;
  max-width: 60ch;
  margin: 0;
}

/* ----------------------------------------
   Meta (Updated date, etc.)
   ---------------------------------------- */
.unified-hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(150, 130, 110, 0.78);
  margin: clamp(16px, 3vw, 24px) 0 0;
}

.unified-hero__meta dt,
.unified-hero__meta dd {
  margin: 0;
}

.unified-hero__meta dt {
  font-weight: 600;
}

.unified-hero__meta dd::before {
  content: ": ";
}

/* Custom meta HTML container */
.unified-hero__meta-custom {
  margin-top: clamp(16px, 3vw, 24px);
}

/* ----------------------------------------
   Actions (CTA Buttons)
   ---------------------------------------- */
.unified-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: clamp(24px, 4vw, 32px);
}

.unified-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  padding: 14px 28px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: all 0.25s var(--hero-ease);
}

.unified-hero__cta--primary {
  background: var(--hero-gold);
  color: var(--hero-white);
  border: 2px solid var(--hero-gold);
}

.unified-hero__cta--primary:hover,
.unified-hero__cta--primary:focus-visible {
  background: var(--hero-gold-light);
  border-color: var(--hero-gold-light);
}

.unified-hero__cta--secondary {
  background: transparent;
  color: var(--hero-text-muted);
  border: 1px solid rgba(150, 130, 110, 0.45);
}

.unified-hero__cta--secondary::after {
  content: "\2192";
  font-size: 0.9rem;
}

.unified-hero__cta--secondary:hover,
.unified-hero__cta--secondary:focus-visible {
  border-color: rgba(248, 250, 252, 0.9);
  color: var(--hero-text);
  background: rgba(150, 130, 110, 0.16);
}

/* ----------------------------------------
   Watermark Variants (via data attribute)
   ---------------------------------------- */
.unified-hero[data-watermark="cases"]::after { content: "CASES"; }
.unified-hero[data-watermark="solutions"]::after { content: "SOLUTIONS"; }
.unified-hero[data-watermark="columns"]::after { content: "COLUMNS"; }
.unified-hero[data-watermark="news"]::after { content: "NEWS"; }
.unified-hero[data-watermark="faq"]::after { content: "FAQ"; }
.unified-hero[data-watermark="facilities"]::after { content: "FACILITIES"; }
.unified-hero[data-watermark="resources"]::after { content: "RESOURCES"; }

/* ----------------------------------------
   Minimal Variant (same height, no watermark)
   ---------------------------------------- */
.unified-hero--minimal {
  /* Same height as default */
}

.unified-hero--minimal::after {
  display: none;
}

/* ----------------------------------------
   Background Image Variant
   ---------------------------------------- */
.unified-hero--with-bg {
  background: transparent;
}

.unified-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.unified-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Dark overlay gradient for text readability */
.unified-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(26, 22, 18, 0.92) 0%,
    rgba(26, 22, 18, 0.85) 40%,
    rgba(26, 22, 18, 0.6) 100%
  );
}

/* Ensure content is above background */
.unified-hero--with-bg .unified-hero__inner {
  position: relative;
  z-index: 1;
}

/* Keep watermark above background but below content */
.unified-hero--with-bg::after {
  z-index: 0;
}

/* ----------------------------------------
   Responsive
   ---------------------------------------- */
@media (max-width: 1024px) {
  .unified-hero::after {
    display: none;
  }
}

@media (max-width: 680px) {
  .unified-hero {
    --hero-height: 360px;
  }

  .unified-hero__title {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .unified-hero__eyebrow {
    font-size: 0.72rem;
    gap: 12px;
  }

  .unified-hero__eyebrow::before {
    width: 32px;
  }

  .unified-hero__lead {
    font-size: 1rem;
  }

  .unified-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .unified-hero__cta {
    min-width: auto;
    width: 100%;
    text-align: center;
  }
}

/* ----------------------------------------
   Animations
   ---------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .unified-hero__eyebrow,
  .unified-hero__title,
  .unified-hero__lead,
  .unified-hero__meta,
  .unified-hero__actions {
    animation: heroFadeIn 0.5s var(--hero-ease) backwards;
  }

  .unified-hero__eyebrow { animation-delay: 0.05s; }
  .unified-hero__title { animation-delay: 0.1s; }
  .unified-hero__lead { animation-delay: 0.15s; }
  .unified-hero__meta { animation-delay: 0.2s; }
  .unified-hero__actions { animation-delay: 0.25s; }
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

}
