/* Presentation slider (no inline CSS) */
.slider {
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(1100px, 100%);
  margin: 1rem auto;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  background: transparent;
}
.slides {
  position: relative;
  height: 100%;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 600ms ease, transform 600ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide.active {
  opacity: 1;
  transform: scale(1);
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}
.controls {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  margin: .75rem auto;
  flex-wrap: wrap;
}
.controls button {
  border: 0;
  padding: .6rem .9rem;
  border-radius: .75rem;
  background: #111827;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.controls button:focus-visible { outline: 3px solid #7c3aed; outline-offset: 2px; }
.progress {
  display: flex;
  gap: .35rem;
  justify-content: center;
  margin: .25rem auto 0;
  flex-wrap: wrap;
  max-width: min(1100px, 100%);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  opacity: .6;
}
.dot.active { opacity: 1; background: #7c3aed; }
@media (max-width: 720px) {
  .slider { border-radius: .75rem; 
  background: #fff;
}
  .controls button { padding: .55rem .8rem; }
}
/* ===== Mobile optimizations ===== */
@media (max-width: 720px) {
  .slider {
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
    border-radius: 12px;
  
  background: #fff;
}
  .slide img {
    object-fit: contain; /* fill the viewport width, crop if needed */
  }
  #post-hero .hero-title { 
    margin-bottom: .3rem;
  }
  #post-hero .hero-sub { 
    margin-top: 0;
    margin-bottom: .5rem;
  }
  .controls { 
    margin-top: .4rem; 
    gap: .4rem; 
  }
  .controls button { 
    padding: .45rem .6rem; 
    border-radius: .6rem;
  }
  .dot { width: 8px; height: 8px; }
}
/* --- Fit/Fill mode classes --- */
.slider.fit .slide img { object-fit: contain; }
.slider.fill .slide img { object-fit: cover; }
/* Desktop default: fit (white bars if aspect doesn't match) */
@media (min-width: 821px) {
  .slider { border-radius: 1rem; }
  .slide img { object-fit: contain; }
}
/* Mobile default already defined to cover in previous patch */
/* === Overlay controls on slider (desktop & mobile) === */
.slider { position: relative; }
.slider .controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: auto;
  transform: none;
  z-index: 10;
  display: flex;
  gap: .5rem;
  align-items: center;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(6px);
  padding: .35rem .5rem;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.slider .controls button {
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #111827;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  line-height: 1;
}
.slider .controls button:focus-visible { outline: 3px solid #7c3aed; outline-offset: 2px; }

/* === Progress dots — override any global .progress styles === */
.slider .progress {
  pointer-events: none;
  position: absolute;
  right: 12px;
  bottom: 4px;
  left: auto;
  transform: none;
  display: flex !important;
  align-items: center;
  gap: .35rem;
  min-height: 16px;
  background: transparent !important;
  width: auto;
  z-index: 9;
  padding: .2rem .4rem;
  border-radius: .5rem;
}
.slider .progress .dot {
  pointer-events: auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d1d5db;
  opacity: .7;
}
.slider .progress .dot.active { background: #7c3aed; opacity: 1; }

@media (max-width: 820px) {
  .slider .controls {
    bottom: 10px;
    padding: .25rem .4rem;
    gap: .35rem;
  }
  .slider .controls button {
    width: 36px;
    height: 36px;
    border-width: 1.5px;
    font-size: .95rem;
  }
  .slider .progress {
  pointer-events: none; bottom: 4px; gap: .25rem; }
  .slider .progress .dot {
  pointer-events: auto; width: 8px; height: 8px; }
}
/* === Mobile Fit (white bars): vertical side controls & dots === */
@media (max-width: 820px) {
  .slider.fit .controls {
    position: absolute;
    right: max(4px, env(safe-area-inset-right));
    top: 50%;
    bottom: auto;
    left: auto;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .35rem;
    background: rgba(255,255,255,.8);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
  }
  .slider.fit .controls button {
    width: 40px;
    height: 40px;
  }
  .slider.fit .progress {
    position: absolute;
    left: max(4px, env(safe-area-inset-left));
    top: 50%;
    bottom: auto;
    right: auto;
    transform: translateY(-50%);
    display: flex !important;
    flex-direction: column;
    gap: .3rem;
    background: transparent !important;
    padding: .25rem 0;
    border-radius: 8px;
    pointer-events: none; /* container non-blocking */
  }
  .slider.fit .progress .dot {
    width: 8px;
    height: 8px;
    pointer-events: auto; /* dots remain clickable */
  }
}
