/* =============================================================================
   LIAM VISUALS — i18n switcher + Image protection visual styles
   ============================================================================= */

/* ========== LANGUAGE SWITCHER ========== */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-right: 12px;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
}
.lang-switcher__btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  font-weight: 500;
  color: var(--ink-mute);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .25s var(--ease), background .25s var(--ease);
  background: transparent;
}
.lang-switcher__btn:hover {
  color: var(--ink);
}
.lang-switcher__btn.is-active {
  background: var(--accent);
  color: #FFFFFF;
}
@media (max-width: 700px) {
  /* On mobile, language switcher sits before the hamburger; keep it compact */
  .lang-switcher {
    margin-right: 8px;
  }
  .lang-switcher__btn {
    font-size: 10px;
    padding: 3px 8px;
  }
}

/* ========== WATERMARK OVERLAY ========== */
/* Applied to .protected-image (figures, gallery items, etc.) via JS.
   Renders a diagonal "© LIAM VISUALS" pattern via pseudo-element, very subtle
   in normal view, more visible on screenshots / dark backgrounds. */
.protected-image {
  position: relative;
  -webkit-touch-callout: none; /* iOS Safari long-press menu */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
.protected-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200' viewBox='0 0 400 200'%3E%3Ctext x='200' y='100' fill='%23ffffff' fill-opacity='0.10' font-family='-apple-system,system-ui,sans-serif' font-size='14' font-weight='500' letter-spacing='4' text-anchor='middle' dominant-baseline='central' transform='rotate(-22 200 100)'%3E\u00A9 LIAM VISUALS%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 320px 160px;
  mix-blend-mode: difference;
  opacity: 0.7;
}
/* Slightly stronger on hover (when user is more likely to be capturing) */
.protected-image:hover::after {
  opacity: 0.9;
}
/* Don't double-watermark when an image is INSIDE another protected element */
.protected-image .protected-image::after {
  display: none;
}
/* Prevent the watermark from interfering with click handlers on the figure itself */
.protected-image > * { position: relative; z-index: 1; }

/* The image inside protected containers — extra image-level locking */
.protected-image img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  pointer-events: none; /* the parent figure handles clicks */
}
/* But for clickable hero figures, we need pointer events on the IMAGE too
   for hover scale to work. Use a child-style override: */
.project__img[data-open-gallery] img,
.carousel-card .carousel-card__media img,
.proj-gallery__item img,
.gallery-view__item img,
.country-card__media img {
  pointer-events: auto;
}

/* ========== DEVTOOLS / PROTECTION TOAST ========== */
.lv-protection-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9000;
  padding: 14px 22px;
  background: rgba(0, 0, 0, 0.92);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: calc(100vw - 32px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.lv-protection-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Light mode: keep dark toast for contrast (it's a warning) */

@media (max-width: 700px) {
  .lv-protection-toast {
    font-size: 12px;
    padding: 12px 18px;
    bottom: 16px;
  }
}

/* ========== LOW-RES IMAGE GUARD ========== */
/* Even if Liam uploads 6000px JPGs by accident, cap display size.
   The real fix is to optimize images before upload (see optimize-images.py). */
.project__img img,
.proj-gallery__item img,
.gallery-view__item img,
.lightbox__img,
.proj-lb__img {
  /* max-width handled by parent grid; this is a safety net */
  image-rendering: -webkit-optimize-contrast;
}
