/* ============================================
   IP HUSE - Open positions (iph-role / iph-pane)
   Image panels that work as tabs, with one detail pane per position.
   ip-huse-page.js adds .iph-ready to <html> when it runs. Until then,
   and without JavaScript, the panels stay hidden and every position is
   listed with its title visible.
   Needs the custom properties set on .employer-page--iph in ip-huse-page.css.
   ============================================ */

.iph-roles { display: none; }
.iph-ready .iph-roles {
  display: flex;
  gap: 0.5rem;
  height: clamp(340px, 40vw, 500px);
}
.iph-role {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--color-text-inverse);
  text-align: left;
  background: var(--color-midnight);
  transition: flex-grow 0.7s var(--iph-ease), height 0.6s var(--iph-ease);
}
.iph-role[aria-selected="true"] {
  flex-grow: 5;
  cursor: default;
}
.iph-role:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}
.iph-role img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.55) brightness(0.6);
  transform: scale(1.06);
  transition: filter 0.7s ease, transform 1.2s var(--iph-ease);
}
.iph-role:not([aria-selected="true"]):hover img {
  filter: saturate(0.95) brightness(0.9);
  transform: scale(1.12);
}
.iph-role[aria-selected="true"] img {
  filter: none;
  transform: scale(1);
}
.iph-role__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 22, 40, 0.88) 0%, rgba(10, 22, 40, 0.35) 38%, rgba(10, 22, 40, 0) 65%);
}
.iph-role__closed {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.75rem;
  display: flex;
  justify-content: center;
  transition: opacity 0.3s ease 0.35s;
}
.iph-role__closed span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  letter-spacing: 0.01em;
}
.iph-role__open {
  position: absolute;
  left: clamp(1.25rem, 3vw, 2.5rem);
  bottom: clamp(1.25rem, 3vw, 2.25rem);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.iph-role__name {
  display: block;
  font-size: clamp(1.75rem, 3.5vw, 2.875rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.iph-role__person {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--iph-blush);
  margin-top: 0.75rem;
}
.iph-role[aria-selected="true"] .iph-role__closed {
  opacity: 0;
  transition-delay: 0s;
}
.iph-role[aria-selected="true"] .iph-role__open {
  opacity: 1;
  transition-delay: 0.3s;
}

.iph-pane {
  margin-top: 0.5rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--surface-utility);
  border-radius: var(--radius-md);
  font-size: clamp(0.875rem, 1.3vw, 1rem);
  line-height: 1.7;
  color: rgba(250, 248, 245, 0.82);
}
.iph-pane[hidden] { display: none; }
.iph-pane__title {
  font-family: var(--font-body);
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  font-weight: 300;
  color: var(--color-text-inverse);
  margin: 0 0 1.25rem;
}
/* With JS the image panel carries the title; keep it for screen readers. */
.iph-ready .iph-pane__title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.iph-pane__lead {
  max-width: 880px;
  font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
  line-height: 1.6;
  color: var(--color-text-inverse);
  margin: 0 0 clamp(1.75rem, 3.5vw, 2.75rem);
  text-wrap: pretty;
}
.iph-pane__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 0 2.5rem;
}
.iph-pane__label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-gold);
  margin: 0 0 0.625rem;
}
.iph-pane__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.iph-pane__list li {
  padding-left: 1.2rem;
  margin-bottom: 0.375rem;
  background: linear-gradient(rgba(196, 145, 138, 0.6), rgba(196, 145, 138, 0.6)) 0 0.8em / 10px 2px no-repeat;
}
.iph-pane__contact {
  line-height: 1.6;
  margin: 0 0 1.5rem;
}
.iph-ready .iph-pane:not([hidden]) > * {
  animation: iphPaneIn 0.6s var(--iph-ease) 0.12s both;
}
@keyframes iphPaneIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.iph-note {
  max-width: var(--iph-max);
  margin: 2rem auto 0;
  font-size: clamp(0.875rem, 1.3vw, 1rem);
  font-style: italic;
  line-height: 1.7;
  color: #666;
}

/* ---- Mobile: stacked panels ---- */
@media (max-width: 768px) {
  .iph-ready .iph-roles {
    flex-direction: column;
    gap: 0.375rem;
    height: auto;
  }
  .iph-role {
    flex: none;
    width: 100%;
    height: 64px;
  }
  .iph-role[aria-selected="true"] { height: 250px; }
  .iph-role__closed {
    inset: 0;
    justify-content: flex-start;
    align-items: center;
    padding: 0 1.25rem;
  }
  .iph-role__closed span {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 1.25rem;
  }
  .iph-role__open {
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.125rem;
    white-space: normal;
  }
  .iph-role__name { font-size: 1.875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .iph-ready .iph-pane:not([hidden]) > * { animation: none; }
  .iph-role,
  .iph-role img { transition: none; }
}
