/* ===== PRM Career Listings ===== */

/* ---- Root Variables ---- */
.prm-career-listings {
  --prm-cl-blue: #0093BE;
  --prm-cl-black: #000000;
  --prm-cl-white: #FFFFFF;
  --prm-cl-gap: 12px;
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

/* ---- Header Row (Desktop) ---- */
.prm-career-header {
  display: grid;
  grid-template-columns: 3fr 1.5fr 2fr auto;
  gap: clamp(12px, 2vw, 24px);
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.8em;
  color: #000;
  text-transform: none;
  padding: clamp(12px, 2vw, 16px) clamp(16px, 3vw, 24px);
  background-color: transparent;
}

.prm-career-header__cell {
  display: flex;
  align-items: center;
  text-align: left;
}

/* ---- Rows Container ---- */
.prm-career-listings__rows {
  display: flex;
  flex-direction: column;
  gap: var(--prm-cl-gap, 12px);
  width: 100%;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), min-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Career Row (Desktop) ---- */
.prm-career-row {
  display: grid;
  grid-template-columns: 3fr 1.5fr 2fr auto;
  gap: clamp(12px, 2vw, 24px);
  align-items: center;
  background-color: #FFFFFF;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: clamp(12px, 2vw, 16px) clamp(16px, 3vw, 24px);
  transition: box-shadow 0.2s ease;
}

.prm-career-row:hover,
.prm-career-row:focus-within {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ---- Title Cell ---- */
.prm-career-title {
  display: flex;
  align-items: center;
  position: relative;
  gap: 8px;
  text-align: left;
}

.prm-career-title__label {
  display: none; /* Hidden on desktop */
}

.prm-career-title__link {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8em;
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
  display: inline-block;
}

.prm-career-title__link:hover,
.prm-career-title__link:focus-visible {
  color: var(--prm-cl-blue, #0093BE);
  outline: 2px solid var(--prm-cl-blue, #0093BE);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Location Cell ---- */
.prm-career-location {
  display: flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8em;
  color: #000;
  gap: 0; /* No gap on desktop since label is hidden - ensures alignment with header */
  text-align: left;
}

.prm-career-location__value {
  display: inline-block;
}

.prm-career-location__label {
  display: none !important; /* Hidden on desktop */
}

/* Force gap to 0 on desktop to align with header */
@media (min-width: 1025px) {
  .prm-career-location {
    gap: 0 !important;
  }
  
  .prm-career-employment {
    gap: 0 !important;
  }
  
  /* Align location and employment values with header text */
  /* Calculate offset based on grid column alignment issue */
  .prm-career-location__value,
  .prm-career-employment__value {
    position: relative;
    left: 57.8125px; /* Offset to align with header text */
  }
}

/* ---- Employment Type Cell ---- */
.prm-career-employment {
  display: flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8em;
  color: #000;
  gap: 0; /* No gap on desktop since label is hidden - ensures alignment with header */
  text-align: left;
}

.prm-career-employment__value {
  display: inline-block;
}

.prm-career-employment__label {
  display: none; /* Hidden on desktop */
}

/* ---- Apply Button Cell ---- */
.prm-career-apply {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.prm-career-apply__button {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.8em;
  text-transform: uppercase;
  background-color: #0093BE;
  color: #FFFFFF;
  border-radius: 0;
  padding: clamp(8px, 1.5vw, 12px) clamp(16px, 2.5vw, 24px);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.prm-career-apply__button:hover,
.prm-career-apply__button:focus-visible {
  background-color: var(--prm-cl-blue, #0093BE);
  color: #FFFFFF;
  outline: 2px solid var(--prm-cl-blue, #0093BE);
  outline-offset: 2px;
}

/* ---- Empty State ---- */
.prm-career-empty {
  text-align: center;
  padding: clamp(40px, 6vw, 60px) 20px;
  font-family: 'Inter', sans-serif;
  color: #666;
}

/* ---- Loading Animation ---- */
.prm-career-listings__loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  padding: clamp(40px, 6vw, 60px) 20px;
  position: relative;
}

.prm-career-listings__spinner {
  width: 48px;
  height: 48px;
  position: relative;
}

.prm-career-listings__spinner::before,
.prm-career-listings__spinner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #0093BE;
  animation: prm-career-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.prm-career-listings__spinner::before {
  width: 48px;
  height: 48px;
  border-width: 3px;
  border-top-color: #0093BE;
  border-right-color: rgba(0, 147, 190, 0.3);
}

.prm-career-listings__spinner::after {
  width: 36px;
  height: 36px;
  top: 6px;
  left: 6px;
  border-width: 2px;
  border-top-color: rgba(0, 147, 190, 0.6);
  border-right-color: rgba(0, 147, 190, 0.2);
  animation-duration: 0.8s;
  animation-direction: reverse;
}

@keyframes prm-career-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loading overlay state */
.prm-career-listings__rows.is-loading {
  position: relative;
  min-height: 200px;
}

/* Overlay background with blur */
.prm-career-listings__rows.is-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 10;
  border-radius: 4px;
  transition: opacity 0.3s ease;
}

/* Spinner ring - modern double-ring effect using gradient */
.prm-career-listings__rows.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  z-index: 12;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top: 4px solid #0093BE;
  border-right: 4px solid rgba(0, 147, 190, 0.4);
  border-bottom: 4px solid rgba(0, 147, 190, 0.2);
  border-left: 4px solid rgba(0, 147, 190, 0.1);
  animation: prm-career-spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 
    0 0 0 3px rgba(0, 147, 190, 0.1),
    0 0 0 6px rgba(0, 147, 190, 0.05),
    0 4px 12px rgba(0, 147, 190, 0.2);
}

/* ---- Pagination ---- */
.prm-career-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: clamp(24px, 4vw, 40px);
  flex-wrap: wrap;
}

.prm-career-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-family: 'Inter', sans-serif;
  color: #FFFFFF; /* Default white, can be overridden by Elementor controls */
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
  border: none;
  background: transparent;
  cursor: pointer;
}

.prm-career-pagination__link:is(button) {
  font-family: inherit;
  font-size: inherit;
}

/* Prevent browser default active state colors */
.prm-career-pagination__link:active,
.prm-career-pagination__link:active:not(.is-active):not([aria-disabled]) {
  background-color: rgba(0, 147, 190, 0.1) !important;
  color: inherit !important;
  outline: none !important;
}

.prm-career-pagination__link:hover:not(.is-active):not([aria-disabled]),
.prm-career-pagination__link:focus-visible:not(.is-active):not([aria-disabled]) {
  background-color: rgba(0, 147, 190, 0.1);
  outline: 2px solid var(--prm-cl-blue, #0093BE);
  outline-offset: 2px;
  /* Color is controlled by Elementor pagination_color control */
}

.prm-career-pagination__link.is-active {
  background-color: #0093BE;
  color: #FFFFFF;
  font-weight: 600;
}

.prm-career-pagination__link.is-active:active {
  background-color: #0093BE !important;
  color: #FFFFFF !important;
}

.prm-career-pagination__link[aria-disabled],
.prm-career-pagination__link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background-color: transparent !important;
  color: inherit !important;
}

.prm-career-pagination__link[aria-disabled]:active,
.prm-career-pagination__link:disabled:active {
  background-color: transparent !important;
  color: inherit !important;
}

.prm-career-pagination__ellipsis {
  padding: 0 4px;
  color: #666;
}

/* ===== TABLET (768px - 1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
  .prm-career-header {
    display: none; /* Hide header on tablet */
  }

  .prm-career-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: clamp(12px, 2vw, 16px);
  }

  /* Row 1: Title + Apply Button */
  .prm-career-title {
    grid-column: 1;
    grid-row: 1;
  }

  .prm-career-apply {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  /* Row 2: Location + Employment Type */
  .prm-career-location {
    grid-column: 1;
    grid-row: 2;
  }

  .prm-career-employment {
    grid-column: 2;
    grid-row: 2;
  }

  .prm-career-title,
  .prm-career-location,
  .prm-career-employment {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .prm-career-title__label,
  .prm-career-location__label,
  .prm-career-employment__label {
    display: inline;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7em;
    color: #666;
    flex-shrink: 0;
  }
}

/* ===== MOBILE (≤ 767px) ===== */
@media (max-width: 767px) {
  .prm-career-header {
    display: none; /* Hide header on mobile */
  }

  .prm-career-row {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 3vw, 16px);
    align-items: stretch;
  }

  .prm-career-title,
  .prm-career-location,
  .prm-career-employment,
  .prm-career-apply {
    width: 100%;
  }

  .prm-career-title {
    order: 1;
  }

  .prm-career-location {
    order: 2;
  }

  .prm-career-employment {
    order: 3;
  }

  .prm-career-apply {
    order: 4;
    justify-content: stretch;
  }

  .prm-career-apply__button {
    width: 100%;
    text-align: center;
  }

  .prm-career-title,
  .prm-career-location,
  .prm-career-employment {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Show labels on mobile */
  .prm-career-title__label,
  .prm-career-location__label,
  .prm-career-employment__label {
    display: inline;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7em;
    color: #666;
    flex-shrink: 0;
  }

  /* Ensure proper spacing for stacked layout */
  .prm-career-title__link {
    display: block;
  }

  .prm-career-location__value,
  .prm-career-employment__value {
    display: inline;
  }
}

/* ===== Focus States (All Breakpoints) ===== */
.prm-career-title__link:focus-visible,
.prm-career-apply__button:focus-visible,
.prm-career-pagination__link:focus-visible {
  outline: 2px solid var(--prm-cl-blue, #0093BE);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Ensure tap targets meet mobile usability standards */
@media (max-width: 767px) {
  .prm-career-title__link,
  .prm-career-apply__button {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

