/* =====================================================================
   Custom styles for Alishan Bhuiyan – Photography Portfolio
   - 3-way theme switcher (Light / Dark / System)
   - "@alishanbhuiyan" signature overlay on portfolio photos
   - Watermarked-download affordances + toast
   These are plain CSS classes (not Tailwind utilities) so they render
   identically on every page, including the ones that don't load the
   Tailwind CDN.
   ===================================================================== */

/* ---------- Theme switcher (segmented control) ---------- */
.theme-switch-li {
  list-style: none;
  margin-top: 1rem;
}
@media (min-width: 768px) {
  .theme-switch-li {
    margin-top: 0;
    margin-left: 0.75rem;
  }
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.04);
}
html.dark .theme-switch {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.theme-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.55;
  transition: background 0.2s ease, opacity 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.theme-btn:hover {
  opacity: 1;
}
.theme-btn svg {
  width: 16px;
  height: 16px;
}
.theme-btn[aria-pressed="true"] {
  opacity: 1;
  background: #000;
  color: #fff;
}
html.dark .theme-btn[aria-pressed="true"] {
  background: #fff;
  color: #000;
}

/* ---------- Signature overlay on portfolio photos ---------- */
.wm-figure {
  position: relative;
}

.wm-label {
  position: absolute;
  bottom: 12px;
  left: 14px;
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.wm-download {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 11;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.wm-figure:hover .wm-download,
.wm-download:focus-visible {
  opacity: 1;
  transform: none;
}
.wm-download:hover {
  background: rgba(0, 0, 0, 0.8);
}
.wm-download svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}
/* Touch devices: no hover, so keep the button always visible. */
@media (hover: none) {
  .wm-download {
    opacity: 0.85;
    transform: none;
  }
}

/* ---------- Download toast ---------- */
#wm-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  z-index: 99999;
  padding: 10px 18px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 13.5px;
  font-family: "Signika", ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
html.dark #wm-toast {
  background: rgba(255, 255, 255, 0.92);
  color: #000;
}
#wm-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Fancybox: signed-download toolbar button ---------- */
.fancybox__toolbar .f-button.wm-fb-btn svg {
  width: 22px;
  height: 22px;
}

/* ---------- Fancybox lightbox: signature and caption overlays ---------- */
.wm-label-lightbox {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.wm-caption-lightbox {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 60px;
  z-index: 9;
  padding: 16px;
  font-family: "Signika", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* ---------- Scroll-reveal (staggered cascade) ----------
   Uses the `transform` shorthand (not the individual translate/scale
   properties) because iOS Safari fails to *transition* those, which made the
   motion silently disappear on iPhone/mobile. The reveal now lives only on
   non-rotated wrappers, so it can't clash with the tilted photo frames. */
html.js .reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  filter: blur(6px);
  transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    filter 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
  will-change: opacity, transform, filter;
  -webkit-backface-visibility: hidden;
}
html.js .reveal.in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- Photo caption on hover (uses the image alt text) ---------- */
.wm-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  padding: 28px 12px 38px;
  font-family: "Signika", ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.3;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.wm-figure:hover .wm-caption {
  opacity: 1;
  transform: none;
}
/* Touch devices have no hover — a tap opens the lightbox — so reveal the
   description automatically (the standard mobile-gallery pattern). */
@media (hover: none) {
  .wm-caption {
    opacity: 1;
    transform: none;
    font-size: 12px;
    padding: 22px 12px 34px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0));
  }
}


/* ---------- Solidarity ribbon (subtle, consistent on every page) ---------- */
.solidarity-wrap {
  width: 100%;
  text-align: center;
}
.solidarity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px auto 20px;
  padding: 5px 14px;
  border-radius: 9999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4b5563;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}
html.dark .solidarity {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}
.solidarity .sol-flag {
  font-size: 13px;
  line-height: 1;
}
