/* ==========================================================================
   Dusty Owl Art — Image Protection Core (CSS layer)
   STEP 2 / 5

   Defence-in-depth, layer 1. Removes the browser affordances that make
   copying easy: drag-out, long-press "Save Image", text selection, and
   places a transparent shield over every guarded artwork.

   Pair with protect.js (JS layer) and the .htaccess hotlink rules.
   ========================================================================== */

/* Kill drag + iOS long-press callout on ALL images by default */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;   /* iOS Safari: no "Save Image" sheet */
}

/* --------------------------------------------------------------------------
   v22 — METİN SEÇİMİ ARTIK SERBEST

   ÖNCEKİ KURAL: `body { user-select: none }` → TÜM sitede metin seçilemiyordu.
   Korunması gereken şey GÖRSELLER; metni kilitlemek koruma sağlamıyor ama
   gerçek müşteriye zarar veriyordu:

     · Sipariş numarasını, indirme bağlantısını, hediye kartı kodunu, kupon
       kodunu, IBAN'ı veya KVKK metnini seçip KOPYALAYAMIYORDU. Destek
       yazışmasında "sipariş numaranızı gönderin" demek imkânsız hâle geliyordu.
     · Seçerek-okuma (select-to-speak), sözlük/çeviri eklentileri ve bazı ekran
       okuyucu gezinme kipleri seçime dayanır — hepsi kırılıyordu.
     · Kaynağı görüntüle/geliştirici araçları zaten metni veriyor; yani kural
       kararlı birini bir saniye bile yavaşlatmıyordu. Tipik "güvenlik
       görünümü, gerçek maliyet" kuralı.

   Görsel koruması OLDUĞU GİBİ duruyor: sürükleme engeli, iOS uzun-basma
   menüsü, .img-guard şeffaf katmanı ve protect.js. Yalnızca METİN serbest.
   Metin seçimini kapatmak gereken yerlerde .no-select sınıfı hâlâ kullanılabilir.
   -------------------------------------------------------------------------- */
body { -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; }

/* Generic "do not select" utility */
.no-select,
.protected-img,
.img-guard {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* --------------------------------------------------------------------------
   THE GUARD WRAPPER
   Markup:
     <figure class="img-guard">
       <img src="art.webp" class="protected-img" alt="Artwork title">
     </figure>
   The ::after pseudo-element is a transparent overlay that intercepts
   right-clicks and drags so they can never reach the real <img>.
   -------------------------------------------------------------------------- */
.img-guard {
  position: relative;
  display: block;
  overflow: hidden;
  line-height: 0;
  margin: 0;
}

.img-guard > img,
.img-guard > .protected-img {
  display: block;
  width: 100%;
  height: 100%;                  /* Resmin mat alanını doldurması için */
  object-fit: contain;             /* Resmin oranını koruyup çerçeveye sığması için */
  pointer-events: none;          /* the <img> itself is inert to the cursor */
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

.img-guard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;       /* invisible shield over the artwork */
  cursor: default;
}

/* --------------------------------------------------------------------------
   OPTIONAL: faint tiled brand watermark.
   Add the modifier class:  <figure class="img-guard img-guard--wm"> … </figure>
   -------------------------------------------------------------------------- */
.img-guard--wm::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='150'><text x='10' y='95' transform='rotate(-28 130 75)' fill='%23ffffff' font-family='Georgia, serif' font-size='20' letter-spacing='3'>DUSTY OWL ART</text></svg>");
  background-repeat: repeat;
}

/* --------------------------------------------------------------------------
   Keep form fields fully usable — the admin panel must accept typing/paste.
   -------------------------------------------------------------------------- */
input,
textarea,
select,
[contenteditable="true"],
[data-allow-copy],
[data-allow-copy] * {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* --------------------------------------------------------------------------
   Print guard — hide artwork from "Print to PDF" attempts.
   -------------------------------------------------------------------------- */
@media print {
  .img-guard,
  .protected-img,
  .no-print {
    display: none !important;
  }
}

/* If protect.js detects DevTools (optional feature), you may blur content: */
.devtools-open .img-guard > img {
  filter: blur(18px);
  transition: filter 0.15s ease;
}
