/* ===== PRM Homepage Hero ===== */

.prm-hero {
  position: relative;
  width: 100%;
  min-height: clamp(480px, var(--prm-hero-height, 80vh), 100vh);
  overflow: hidden;
  isolation: isolate;
  
  /* CSS Variables */
  --hero-pad: 24px;
  --cta-size: 44px;
  --cta-radius: 12px;
}

.prm-hero__empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* ===== Background Layers ===== */

.prm-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.prm-hero__bg-layer {
  position: absolute;
  inset: 0;
  background-image: var(--bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity;
}

.prm-hero__bg-layer.is-current {
  opacity: 1;
  z-index: 1;
}

.prm-hero__bg-layer.is-next {
  z-index: 0;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .prm-hero__bg-layer {
    transition: opacity 0ms;
  }
}

/* ===== Background Overlay ===== */

.prm-hero__bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: #000000;
  opacity: 0;
  pointer-events: none;
  /* Opacity is controlled by Elementor control */
}

/* ===== Headline ===== */

.prm-hero__headline-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center; /* vertical center */
  z-index: 3;
  pointer-events: none; /* headline is decorative; keep links below clickable */
}

.prm-hero__headline-inner {
  max-width: var(--headline-max, 40%);
  /* Padding is controlled via Elementor controls; default fallback */
  padding: 0;
}

/* Desktop: Match section-l left padding for alignment, plus additional padding to move headline right */
@media (min-width: 1025px) {
  .prm-hero .prm-hero__headline-inner {
    /* Increased left padding to bring headline further to the right/center */
    /* Use !important to override Elementor control default of 0 */
    padding-left: clamp(6rem, 14vw + 3rem, 18rem) !important;
  }
}

.prm-hero__headline {
  color: #fff;
  line-height: 0.95;
  letter-spacing: 0.5px;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Obvia', sans-serif;
  text-transform: uppercase;
}

.prm-hero__headline .line-1 {
  font-family: 'Obvia', sans-serif;
  font-weight: 700;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  display: block;
  margin: 0;
}

.prm-hero__headline .line-2 {
  font-family: 'Obvia', sans-serif;
  font-weight: 400;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  display: block;
  margin: 0;
  margin-top: 0.1em; /* Small spacing between lines */
  white-space: nowrap; /* Keep "Is Earned" on one line */
}

/* ===== Grid ===== */

.prm-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 0;
  gap: 0;
  height: 100%;
  min-height: clamp(480px, var(--prm-hero-height, 80vh), 100vh);
  position: relative;
  z-index: 2;
}

.prm-hero__third {
  position: relative;
  isolation: isolate;
  cursor: pointer;
  outline: none !important;
  border: none !important;
  min-height: 100%;
}

.prm-hero__third:focus,
.prm-hero__third:focus-visible,
.prm-hero__third:hover,
.prm-hero__third.is-active,
.prm-hero__third.is-active:focus,
.prm-hero__third.is-active:focus-visible {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* ===== Overlays ===== */

.prm-hero__third-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 220ms ease;
  z-index: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Elementor outputs the gradient automatically on .is-active */
/* No hardcoded gradient here — Elementor injects it dynamically via Group_Control_Background */
.prm-hero__third.is-active .prm-hero__third-overlay {
  /* Gradient is applied by Elementor's Group_Control_Background */
}

/* ===== Footer (Titles) ===== */

.prm-hero__third-footer {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: var(--hero-pad, 24px);
  color: #fff;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  box-sizing: border-box;
}

.prm-hero__kicker {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.prm-hero__title {
  font-size: clamp(18px, 2.5vw, 32px);
  line-height: 1.2;
  font-weight: normal;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Reserve 2-line height so titles align at the top across columns */
  min-height: 2.4em;
}

.prm-hero__third:not(.is-active) .prm-hero__title {
  color: rgba(255, 255, 255, 0.7);
  font-weight: normal;
}

.prm-hero__third.is-active .prm-hero__title {
  color: #fff;
  font-weight: bold;
}

/* ===== CTA Button ===== */

.prm-hero__cta {
  position: absolute;
  right: var(--hero-pad, 24px);
  bottom: var(--hero-pad, 24px);
  /* Use shared nav button token */
  width: 50px;
  height: 50px;
  border-radius: 10px;
  border: 2px solid #0093BE;
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  place-items: center;
  color: #0093BE;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 200ms ease, background 200ms ease, border-color 200ms ease;
  z-index: 3;
  text-decoration: none;
  pointer-events: auto;
}

.prm-hero__cta:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(0) scale(1.05);
}

.prm-hero__third.is-active .prm-hero__cta {
  opacity: 1;
  transform: translateY(0);
}

.prm-hero__third.is-active .prm-hero__cta:hover {
  transform: translateY(0) scale(1.05);
}

/* Desktop: button stays at bottom */
@media (min-width: 1025px) {
  .prm-hero__cta {
    bottom: var(--hero-pad, 24px);
    top: auto;
  }
  
  .prm-hero__third.is-active .prm-hero__cta {
    transform: translateY(0);
  }
}

.prm-hero__cta:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.prm-hero__cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: #0093BE;
}

.prm-hero__cta-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  color: #0093BE;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .prm-hero__cta {
    transition: opacity 0ms, transform 0ms;
  }
}

/* ===== Responsive: Stack Thirds ===== */

@media (max-width: 1024px) {
  /* Remove fixed height from hero container when stacked */
  .prm-hero {
    min-height: auto;
    height: auto;
  }
  
  .prm-hero__grid {
    grid-template-columns: 1fr;
    /* Remove fixed height - let grid shrink to fit thirds */
    min-height: auto;
    height: auto;
    /* Ensure no gaps between rows */
    row-gap: 0;
    grid-row-gap: 0;
    gap: 0;
    grid-gap: 0;
  }
  
  .prm-hero__third {
    height: 20vh;
    min-height: 20vh;
    max-height: 20vh;
    /* Ensure thirds fill their grid row completely with no gaps */
    align-self: stretch;
    margin: 0;
    padding: 0;
    /* On mobile/tablet, whole section is clickable */
    cursor: pointer;
  }
  
  /* First third (top section) needs extra height to account for header overlap */
  .prm-hero__third:first-child {
    height: calc(20vh + 30px);
    min-height: calc(20vh + 30px);
    max-height: calc(20vh + 30px);
  }
  
  .prm-hero__headline-inner {
    max-width: 100%;
    padding: clamp(24px, 4vw, 48px);
  }
  
  /* Hide headline when layout stacks to avoid awkward overlap */
  /* Always hide when stacked, regardless of data-hide-headline-bp setting */
  .prm-hero__headline-wrap {
    display: none !important;
  }
  
  /* Vertically center CTA button on mobile/tablet to avoid title overlap */
  .prm-hero__cta {
    top: 50%;
    bottom: auto;
    right: var(--hero-pad, 24px);
    transform: translateY(-50%);
    opacity: 0;
  }
  
  .prm-hero__third.is-active .prm-hero__cta {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@media (max-width: 767px) {
  .prm-hero {
    min-height: auto;
    height: auto;
  }
  
  .prm-hero__grid {
    min-height: auto;
    height: auto;
    /* Ensure no gaps between rows on mobile */
    row-gap: 0;
    grid-row-gap: 0;
  }
  
  .prm-hero__third {
    height: 20vh;
    min-height: 20vh;
    /* Ensure thirds fill their grid row completely */
    align-self: stretch;
    /* On mobile, whole section is clickable */
    cursor: pointer;
  }
  
  /* First third (top section) needs extra height to account for header overlap on mobile */
  .prm-hero__third:first-child {
    height: calc(20vh + 100px);
    min-height: calc(20vh + 100px);
    max-height: calc(20vh + 100px);
  }
  
  .prm-hero__headline-inner {
    padding: 24px;
  }
  
  .prm-hero__headline .line-1,
  .prm-hero__headline .line-2 {
    font-size: clamp(36px, 8vw, 72px);
  }
  
  .prm-hero__title {
    font-size: clamp(16px, 4vw, 24px);
  }
  
  .prm-hero__third-footer {
    padding: 20px;
  }
  
  /* Hide arrow buttons on mobile - they interfere with title text */
  .prm-hero__cta {
    display: none !important;
  }
}

/* ===== Hide Headline at Breakpoint ===== */

@media (max-width: 768px) {
  .prm-hero[data-hide-headline-bp="768"] .prm-hero__headline-wrap,
  .prm-hero[data-hide-headline-bp="600"] .prm-hero__headline-wrap,
  .prm-hero[data-hide-headline-bp="480"] .prm-hero__headline-wrap {
    display: none;
  }
}

@media (max-width: 600px) {
  .prm-hero[data-hide-headline-bp="600"] .prm-hero__headline-wrap,
  .prm-hero[data-hide-headline-bp="480"] .prm-hero__headline-wrap {
    display: none;
  }
}

@media (max-width: 480px) {
  .prm-hero[data-hide-headline-bp="480"] .prm-hero__headline-wrap {
    display: none;
  }
}

@media (max-width: 1024px) {
  .prm-hero[data-hide-headline-bp="1024"] .prm-hero__headline-wrap {
    display: none;
  }
}

@media (max-width: 992px) {
  .prm-hero[data-hide-headline-bp="992"] .prm-hero__headline-wrap {
    display: none;
  }
}

@media (max-width: 900px) {
  .prm-hero[data-hide-headline-bp="900"] .prm-hero__headline-wrap {
    display: none;
  }
}

/* ===== RTL Support ===== */

[dir="rtl"] .prm-hero__headline-inner {
  padding-left: 0;
}

/* Desktop RTL: Match section-l right padding for alignment, plus additional padding to move headline left */
@media (min-width: 1025px) {
  [dir="rtl"] .prm-hero .prm-hero__headline-inner {
    /* Increased right padding to bring headline further to the left/center */
    /* Use !important to override Elementor control default of 0 */
    padding-right: clamp(6rem, 14vw + 3rem, 18rem) !important;
    padding-left: 0 !important;
  }
}

[dir="rtl"] .prm-hero__third-footer {
  left: auto;
  right: 0;
}

[dir="rtl"] .prm-hero__cta {
  right: auto;
  left: var(--hero-pad, 24px);
}

/* ===== Interactive Mouse Effects (Desktop Only) ===== */

/* Base container */
.prm-hero-interactive {
  position: relative;
  overflow: hidden;
}

/* Flashlight effect - radial highlight following mouse */
.prm-hero-interactive.prm-hero-has-flashlight::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease-out;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.3) 0,
    rgba(255, 255, 255, 0.15) 100px,
    transparent 200px
  );
  mix-blend-mode: screen;
  z-index: 100;
  will-change: background;
}

/* Show flashlight only when pointer is inside */
.prm-hero-interactive.prm-hero-has-flashlight.is-pointer-inside::after {
  opacity: 1;
}

/* Custom cursor - white chevron pointing up-left (northwest) */
.prm-hero-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: opacity 80ms ease-out;
  opacity: 0;
  z-index: 9999;
  will-change: transform;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  /* Rotate 45deg to point northwest (up-left) */
  transform: translate3d(-50%, -50%, 0) rotate(45deg);
}

/* Chevron shape using borders - creates a "<" shape */
.prm-hero-cursor::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 2px;
  background: #ffffff;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: left center;
}

.prm-hero-cursor::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 2px;
  background: #ffffff;
  transform: translateY(-50%) rotate(-45deg);
  transform-origin: left center;
}

/* Show the cursor when pointer is inside a hero with custom cursor */
.prm-hero-interactive.prm-hero-has-custom-cursor.is-pointer-inside ~ .prm-hero-cursor,
body.has-custom-cursor-active .prm-hero-cursor {
  opacity: 1;
}

/* Hovering over a project tile - slight emphasis */
.prm-hero-cursor.is-over-project {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}

/* Click feedback - reduce opacity */
.prm-hero-cursor.is-clicking {
  opacity: 0.6;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Hide native cursor only when custom cursor is enabled (desktop only) */
@media (hover: hover) and (pointer: fine) {
  .prm-hero-interactive.prm-hero-has-custom-cursor {
    cursor: none !important;
  }
  
  .prm-hero-interactive.prm-hero-has-custom-cursor .prm-hero__third {
    cursor: none !important;
  }
  
  .prm-hero-interactive.prm-hero-has-custom-cursor .prm-hero__cta {
    cursor: none !important;
  }
  
  .prm-hero-interactive.prm-hero-has-custom-cursor * {
    cursor: none !important;
  }
}

/* Flashlight off for touch devices */
@media (hover: none), (pointer: coarse) {
  .prm-hero-interactive::after {
    display: none;
  }
}

