/* pf-case-study-modal — portfolio project detail slideshow */

.pf-cs-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  background: var(--color-overlay-scrim, rgba(8, 10, 18, 0.88));
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.pf-cs-overlay.pf-cs-overlay--open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.pf-cs-panel {
  width: 100%;
  max-width: 920px;
  margin: auto;
  background: var(--color-surface, #13162b);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--pf-gallery-radius-panel, var(--radius-xl, 2px));
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.28s ease;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.pf-cs-overlay--open .pf-cs-panel {
  transform: translateY(0);
}

.pf-cs-gallery {
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  /* Per-instance override: set --pf-gallery-radius-display-local (etc.) on this node */
  --pf-gallery-radius-display-local: var(--pf-gallery-radius-display, 0);
  --pf-gallery-radius-frame-local: var(--pf-gallery-radius-frame, 0);
}

.pf-cs-stage-wrap {
  position: relative;
  background: var(--color-surface-2, #0f1220);
  border-radius: var(--pf-gallery-radius-frame-local, var(--pf-gallery-radius-frame, 0));
  overflow: hidden;
}

.pf-cs-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(52vh, 420px);
  max-height: min(62vh, 520px);
  padding: 1rem 3.25rem;
}

.pf-cs-stage img {
  max-width: 100%;
  max-height: min(58vh, 480px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--pf-gallery-radius-display-local, var(--pf-gallery-radius-display, 0));
}

.pf-cs-stage-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--color-text-muted, #9aa3b2);
  font-size: 0.9rem;
}

.pf-cs-counter {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  border-radius: var(--pf-gallery-radius-counter, 2px);
  background: rgba(0, 0, 0, 0.55);
  color: var(--color-text-primary, #e8eaed);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pf-cs-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--pf-gallery-radius-nav, 2px);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.15));
  background: rgba(0, 0, 0, 0.45);
  color: var(--color-text-primary, #fff);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pf-cs-nav-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--color-accent, #5b8dee);
}

.pf-cs-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pf-cs-nav-btn--prev {
  left: 0.65rem;
}

.pf-cs-nav-btn--next {
  right: 0.65rem;
}

.pf-cs-caption {
  padding: 0.65rem 1.25rem 0.85rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #b8bec8);
  font-family: var(--font-mono, monospace);
  border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
  min-height: 2.25rem;
}

.pf-cs-filmstrip {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pf-cs-filmstrip-thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 60px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--pf-gallery-radius-thumb, 6px);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  background: var(--color-surface-2, #0f1220);
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.pf-cs-filmstrip-thumb:hover {
  opacity: 0.85;
}

.pf-cs-filmstrip-thumb.pf-cs-filmstrip-thumb--active {
  opacity: 1;
  border-color: var(--color-accent, #5b8dee);
}

.pf-cs-filmstrip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf-cs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem 1rem;
}

.pf-cs-title {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin: 0 0 0.35rem;
  color: var(--color-text-primary, #e8eaed);
}

.pf-cs-subtitle {
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  color: var(--color-accent, #5b8dee);
  margin-bottom: 0.5rem;
}

.pf-cs-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--color-text-muted, #9aa3b2);
}

.pf-cs-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: var(--color-text-muted, #9aa3b2);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.pf-cs-close:hover {
  color: var(--color-text-primary, #fff);
  border-color: var(--color-border-hover, rgba(255, 255, 255, 0.25));
}

.pf-cs-outcome {
  margin: 0 1.5rem 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--color-accent, #5b8dee);
  background: var(--color-surface-2, rgba(255, 255, 255, 0.03));
  font-size: 0.9rem;
  color: var(--color-text-secondary, #b8bec8);
  line-height: 1.55;
}

.pf-cs-sections {
  padding: 0 1.5rem 1.25rem;
}

.pf-cs-section {
  margin-bottom: 1.5rem;
}

.pf-cs-section-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted, #9aa3b2);
  margin: 0 0 0.5rem;
}

.pf-cs-section-body {
  font-size: 0.9rem;
  color: var(--color-text-secondary, #b8bec8);
  line-height: 1.75;
}

.pf-cs-section-body p {
  margin: 0 0 0.65rem;
}

.pf-cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1.5rem 1.5rem;
}

@media (max-width: 640px) {
  .pf-cs-overlay {
    padding: 0.5rem;
  }

  .pf-cs-stage {
    min-height: 40vh;
    padding: 1rem 2.75rem;
  }

  .pf-cs-header,
  .pf-cs-outcome,
  .pf-cs-sections,
  .pf-cs-tags {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
