/* WiwiOpportunity — opportunity detail page */

main.detail-page {
  max-width: 1020px;
  padding-top: clamp(24px, 4vw, 44px);
  padding-bottom: clamp(44px, 6vw, 72px);
}

.back-link {
  display: inline-block;
  padding-bottom: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--link);
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
  text-decoration: none;
}

.detail-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-panel);
  background: #fff;
  box-shadow: 0 8px 20px rgba(46, 20, 81, 0.07);
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-title {
  font-size: clamp(24px, 3.6vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.detail-meta {
  font-size: 15px;
  font-weight: 600;
  color: rgba(46, 20, 81, 0.62);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 22px;
  margin-top: 4px;
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.detail-block .micro-label {
  margin-bottom: 6px;
}

.detail-text {
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.detail-text--pre {
  white-space: pre-line;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.info-card {
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-card);
  background: var(--bg-page);
}

.info-card .micro-label {
  padding-bottom: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(46, 20, 81, 0.07);
  font-size: 14px;
}

.info-row-label {
  color: rgba(46, 20, 81, 0.55);
}

.info-row-value {
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.detail-fav.is-on {
  border-color: rgba(224, 72, 90, 0.5);
  color: #e0485a;
}

.detail-apply {
  padding: 14px 20px;
  font-size: 15px;
}

.detail-missing {
  padding: 40px;
  text-align: center;
  font-weight: 600;
  color: var(--ink-3);
}

/* Skeleton while the record loads */

.detail-card--skeleton .sk--title {
  width: 70%;
  height: 34px;
}

.detail-card--skeleton .sk--block {
  width: 100%;
  height: 120px;
  border-radius: var(--r-card);
}

/* Media / carousel ---------------------------------------------------------- */

.detail-media {
  position: relative;
  margin: calc(-1 * clamp(22px, 4vw, 40px)) calc(-1 * clamp(22px, 4vw, 40px)) 6px;
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  overflow: hidden;
  background: var(--bg-chip);
}

.detail-media-img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.carousel-slide[hidden] {
  display: none;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(1, 9, 32, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  transition: background 0.16s var(--ease);
}

.carousel-nav:hover {
  background: rgba(1, 9, 32, 0.8);
}

.carousel-nav--prev {
  left: 12px;
}

.carousel-nav--next {
  right: 12px;
}

.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 7px;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.16s var(--ease), transform 0.16s var(--ease);
}

.carousel-dot.is-active {
  background: #fff;
  transform: scale(1.25);
}

/* Member gate: apply links are members-only ------------------------------- */

.detail-apply--locked {
  cursor: pointer;
}

.detail-gate-hint {
  margin-top: -8px;
  font-size: 12.5px;
  text-align: center;
  color: var(--ink-4);
}

body.has-gate {
  overflow: hidden;
}

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(46, 20, 81, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: gate-fade 0.18s ease-out;
}

.gate-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  padding: clamp(24px, 4vw, 34px);
  border-radius: var(--r-panel, 20px);
  background: #fff;
  box-shadow: 0 24px 60px rgba(46, 20, 81, 0.35);
  text-align: center;
  animation: gate-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.gate-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-4);
  cursor: pointer;
}

.gate-close:hover {
  background: rgba(46, 20, 81, 0.06);
  color: var(--ink);
}

.gate-icon {
  font-size: 34px;
}

.gate-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.gate-text {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.gate-later {
  margin-top: 4px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink-4);
  text-decoration: underline;
  cursor: pointer;
}

.gate-later:hover {
  color: var(--ink);
}

@keyframes gate-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gate-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-overlay,
  .gate-dialog {
    animation: none;
  }
}
