/* Detail Overlay */

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  opacity: 0;
  pointer-events: none;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--glass-border);
}

.detail-company {
  line-height: 1.15;
}

.detail-company span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  transition: color 0.3s ease-in-out;
}

.detail-company:hover span {
  color: var(--accent);
}

.detail-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.detail-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s ease-in-out;
}

.detail-nav a:hover {
  color: var(--accent);
}

.detail-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.detail-left {
  width: 40%;
  position: relative;
  flex-shrink: 0;
}

.detail-right {
  width: 60%;
  overflow-y: auto;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-back {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  font-family: 'Google Sans Flex', sans-serif;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.detail-back:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.detail-title {
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  color: var(--text);
}

.detail-items {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  list-style: none;
}

.detail-item {
  display: flex;
  font-size: clamp(0.82rem, 1.2vw, 0.97rem);
  color: var(--text);
}

.detail-item::before {
  content: '·';
  color: var(--accent);
  margin-right: 0.6rem;
}

.detail-contact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Section group */
.detail-sections {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* Section header */
.detail-section-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.63rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-muted);
}

.detail-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.detail-section-header--emergency {
  color: var(--warning)
}

.detail-section-header--emergency::after {
  background: var(--warning-faded)
}

/* Emergency CTA */
.detail-emergency-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 0.6rem 1.6rem;
  border-radius: 99rem;
  border: 0.1rem solid var(--glass-border);
  background: transparent;
  color: var(--text);
  font-family: 'Google Sans Flex', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 1.5rem;
  transition: border-color 0.3s, color 0.3s;
}

.detail-emergency-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-emergency-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.3rem;
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}

.detail-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: var(--glass-background);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: var(--glass-border);
  color: var(--text-muted);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease-in-out, background 0.3s ease-in-out, color 0.3s ease-in-out;
}

.detail-nav-btn:hover {
  border: 0.1rem solid var(--accent);
  color: var(--accent);
}

.detail-nav-btn.prev {
  left: 2rem;
}

.detail-nav-btn.next {
  right: 2rem;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.detail-back:focus-visible,
.detail-nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.detail-company:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.detail-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .detail-emergency-dot {
    animation: none;
  }
}

@media (max-width: 768px) {
  .detail-nav-btn {
    top: auto;
    bottom: 2rem;
    transform: none;
    width: 2.5rem;
    height: 2.5rem;
  }

  .detail-nav-btn.prev {
    left: 1rem;
  }

  .detail-nav-btn.next {
    right: 1rem;
  }

  .detail-header {
    padding: 1rem 1.25rem;
  }

  .detail-body {
    flex-direction: column;
  }

  .detail-left {
    width: 100%;
    height: 45%;
  }

  .detail-right {
    width: 100%;
    height: 55%;
    padding: 1.5rem;
    padding-bottom: 5rem; /* space for nav arrows */
    justify-content: flex-start;
  }

  .detail-title {
    font-size: clamp(1.4rem, 6vw, 2rem);
    margin-bottom: 1rem;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .detail-body {
    flex-direction: row;
  }

  .detail-left {
    width: 40%;
    height: 100%;
  }

  .detail-right {
    width: 60%;
    height: 100%;
    padding: 1.25rem 1.5rem;
    padding-bottom: 1.25rem; /* override mobile arrow padding */
    justify-content: flex-start;
    overflow-y: auto;
  }

  .detail-nav-btn {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
}