/* ======================================================
   TECHIN 510 – Slide-Deck-Specific Styles
   Scroll-snap, progress bar, nav dots, edit mode
   ====================================================== */

html {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

/* --- Slide Container --- */
.slide {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--slide-pad);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.slide.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Botanical bg gradient (each slide) */
.slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 85%, var(--green-dark) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(34, 60, 34, 0.2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Inner border */
.slide::after {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  border: 1px solid rgba(193, 167, 120, 0.08);
  border-radius: 2px;
  pointer-events: none;
  z-index: 0;
}

.slide > * {
  position: relative;
  z-index: 1;
}

/* --- Title Slides --- */
.slide.title-slide {
  align-items: center;
  text-align: center;
}

.title-slide .accent-line {
  margin-left: auto;
  margin-right: auto;
}

.title-slide .subtitle {
  max-width: 50ch;
}

.title-slide .dots {
  justify-content: center;
}

/* --- Slide Number (bottom-right) --- */
.slide-num {
  position: absolute;
  bottom: clamp(1rem, 2vh, 1.8rem);
  right: clamp(1.5rem, 3vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1vw, 0.75rem);
  color: var(--fg-muted);
  z-index: 2;
}

/* === Progress Bar === */
#progress {
  position: fixed;
  top: 48px; /* below site nav */
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  z-index: 1000;
  transition: width 0.25s ease;
}

/* === Nav Dots === */
#nav-dots {
  position: fixed;
  right: clamp(0.6rem, 1.2vw, 1rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(193, 167, 120, 0.2);
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  padding: 0;
}

.nav-dot:hover {
  background: rgba(193, 167, 120, 0.5);
}

.nav-dot.active {
  background: var(--gold);
  transform: scale(1.3);
}

/* === Edit Mode === */
.edit-btn {
  position: fixed;
  top: 60px; /* below site nav */
  left: 12px;
  width: 32px;
  height: 32px;
  background: rgba(193, 167, 120, 0.15);
  border: 1px solid rgba(193, 167, 120, 0.25);
  border-radius: 4px;
  color: var(--gold);
  font-size: 14px;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.edit-btn:hover,
body:hover .edit-btn {
  opacity: 1;
}

body.editing .edit-btn {
  opacity: 1;
  background: var(--gold);
  color: var(--bg);
}

body.editing [contenteditable="true"] {
  outline: 1px dashed rgba(193, 167, 120, 0.35);
  outline-offset: 3px;
  cursor: text;
}

/* === Slide-specific Responsive === */
@media (max-height: 700px) {
  .slide {
    padding: clamp(1.5rem, 4vw, 3rem);
  }
}

@media (max-height: 500px) {
  .slide {
    padding: clamp(1rem, 3vw, 2rem);
  }
}

/* === Light Theme Slide Overrides === */
[data-theme="light"] .slide::before {
  background:
    radial-gradient(ellipse 80% 60% at 15% 85%, rgba(200, 220, 200, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(200, 220, 200, 0.15) 0%, transparent 70%);
}

[data-theme="light"] .slide::after {
  border-color: rgba(154, 125, 78, 0.1);
}

[data-theme="light"] .edit-btn {
  background: rgba(154, 125, 78, 0.12);
  border-color: rgba(154, 125, 78, 0.25);
}

[data-theme="light"] body.editing .edit-btn {
  background: var(--gold);
  color: #fff;
}

[data-theme="light"] .nav-dot {
  background: rgba(154, 125, 78, 0.25);
}

[data-theme="light"] .nav-dot:hover {
  background: rgba(154, 125, 78, 0.5);
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  .slide {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
