/* ==========================================================================
   Rawad Egypt — slide viewer
   Only the slides and the two navigation buttons. Nothing else.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --slide-ms: 560ms;
  --ease: cubic-bezier(0.65, 0.02, 0.3, 1);
  --btn-size: 48px;
  --btn-gap: 10px;
  --btn-edge: 18px;
  --btn-fg: #1f2937;
  --btn-bg: rgba(255, 255, 255, 0.86);
  --btn-bg-hover: #ffffff;
  --btn-border: rgba(17, 24, 39, 0.14);
  --focus: #2563eb;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: #111827;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Deck: fixed viewport, vertical stack of slides, one slide visible at a time
   -------------------------------------------------------------------------- */

.deck {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.track {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.track.is-animating {
  transition: transform var(--slide-ms) var(--ease);
  will-change: transform;
}

.slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.slide__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* never crop */
  object-position: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Navigation buttons — fixed, bottom-right, Up on the left, Down on the right
   -------------------------------------------------------------------------- */

.controls {
  position: fixed;
  right: max(var(--btn-edge), env(safe-area-inset-right));
  bottom: max(var(--btn-edge), env(safe-area-inset-bottom));
  display: flex;
  flex-direction: row; /* Up left, Down right — forced LTR */
  direction: ltr;
  gap: var(--btn-gap);
  z-index: 20;
  pointer-events: none;
}

.nav-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--btn-size);
  height: var(--btn-size);
  padding: 0;
  margin: 0;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.12), 0 1px 2px rgba(17, 24, 39, 0.08);
  transition:
   background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease,
    transform 120ms ease;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

.nav-btn:hover:not(:disabled) {
  background: var(--btn-bg-hover);
  border-color: rgba(17, 24, 39, 0.24);
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.16);
  color: #111827;
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.94);
  background: #ffffff;
}

.nav-btn:focus {
  outline: none;
}

.nav-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.nav-btn:disabled {
  opacity: 0.38;
  cursor: default;
  color: rgba(17, 24, 39, 0.55);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08);
}

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Small screens: keep buttons comfortable but out of the way
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
  :root {
    --btn-size: 46px;
    --btn-edge: 14px;
    --btn-gap: 8px;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion: no sliding animation, no fade
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .track.is-animating {
    transition-duration: 1ms;
  }

  .nav-btn {
    transition-duration: 1ms;
  }

  .nav-btn:active:not(:disabled) {
    transform: none;
  }
}
