/**
 * Green Edge Technologies — security.css
 * CSS layer of content-protection hardening.
 *
 * Features:
 *  1. Image pointer-event & drag protection (all browsers)
 *  2. Selective user-select: none on non-interactive content
 *  3. iOS Safari touch-callout suppression
 *  4. Print-media content blanking (JS fallback in security.js)
 *  5. Prevent selection highlight on hero / card copy-targets
 *  6. Cursor feedback on protected zones
 *
 * All rules use progressive enhancement — if a browser doesn't support
 * a property the rest of the design is unaffected.
 * Vendor prefixes included for maximum cross-browser coverage.
 */

/* ──────────────────────────────────────────────────────────────────────
 * 1. Image protection — disable drag, native context menu opener,
 *    and inline callout (iOS long-press "Save Image")
 * ────────────────────────────────────────────────────────────────────── */
img,
canvas,
video,
svg {
  /* Cross-browser drag prevention */
  -webkit-user-drag: none;
  -khtml-user-drag:  none;
  -moz-user-drag:    none;
  -o-user-drag:      none;
  user-drag:         none;

  /* iOS long-press callout suppression */
  -webkit-touch-callout: none;

  /* Prevent accidental text-selection cursor on images */
  -webkit-user-select: none;
  -moz-user-select:    none;
  -ms-user-select:     none;
  user-select:         none;

  /* Pointer events preserved so hover/click effects still work */
  pointer-events: auto;
}

/* Disable the native image toolbar shown in IE/old Edge */
img {
  -ms-interpolation-mode: nearest-neighbor; /* IE8 compat */
}

/* ──────────────────────────────────────────────────────────────────────
 * 2. Content-area user-select: none
 *    Applied to high-value visual content areas only.
 *    Form fields are explicitly reset to 'text' so users can still type.
 * ────────────────────────────────────────────────────────────────────── */
.hero-section,
.hero-contact-content,
.hero-inner,
.service-card,
.service-card *,
.pricing-card,
.pricing-card *,
.team-card,
.team-card *,
.stat-item,
.stat-item *,
.cert-card,
.cert-card *,
.timeline-item,
.timeline-item *,
.portfolio-card,
.portfolio-card *,
.case-study-card,
.case-study-card *,
.section-header,
.section-header *,
.footer-inner,
.footer-inner *,
.navbar,
.mobile-nav {
  -webkit-user-select: none;
  -moz-user-select:    none;
  -ms-user-select:     none;
  user-select:         none;

  /* iOS */
  -webkit-touch-callout: none;
}

/* Always restore selectability inside interactive form elements */
input,
textarea,
select,
[contenteditable],
[contenteditable] * {
  -webkit-user-select: text !important;
  -moz-user-select:    text !important;
  -ms-user-select:     text !important;
  user-select:         text !important;
  -webkit-touch-callout: default !important;
}

/* cursor:default removed — links and buttons inside these cards
   inherit cursor:pointer from the global components.css cursor rules */

/* ──────────────────────────────────────────────────────────────────────
 * 4. Print protection
 *    Hides all body content when printing; shows a single message.
 *    security.js dynamically injects the same rule as a fallback
 *    in case this stylesheet is blocked.
 * ────────────────────────────────────────────────────────────────────── */
@media print {
  body > *:not(#ge-print-message) {
    visibility: hidden !important;
    display:    none !important;
  }

  body::before {
    content:     "Printing or saving this content is not permitted. © Green Edge Technologies";
    visibility:  visible !important;
    display:     block   !important;
    position:    fixed;
    top:         50%;
    left:        50%;
    transform:   translate(-50%, -50%);
    font-size:   22px;
    font-weight: 600;
    color:       #111;
    text-align:  center;
    line-height: 1.6;
  }
}

/* ──────────────────────────────────────────────────────────────────────
 * 5. Honeypot field — always invisible regardless of CSS reset
 * ────────────────────────────────────────────────────────────────────── */
.ge-hp-field {
  position:      absolute   !important;
  left:          -9999px    !important;
  top:           -9999px    !important;
  width:         1px        !important;
  height:        1px        !important;
  overflow:      hidden     !important;
  opacity:       0          !important;
  pointer-events:none       !important;
  visibility:    hidden     !important;
}

/* ──────────────────────────────────────────────────────────────────────
 * 6. Overlay on hero images to prevent easy right-click → Open in new tab
 *    A transparent pseudo-element sits on top of background images.
 *    Note: only works on elements with position:relative/absolute.
 * ────────────────────────────────────────────────────────────────────── */
.hero-bg-image,
.portfolio-img-wrap,
.case-study-img,
.blog-thumbnail {
  position: relative;
}

.hero-bg-image::after,
.portfolio-img-wrap::after,
.case-study-img::after,
.blog-thumbnail::after {
  content:  "";
  position: absolute;
  inset:    0;          /* top/right/bottom/left: 0 */
  z-index:  1;
  /* Fallback for browsers that don't support 'inset' */
  top:    0;
  right:  0;
  bottom: 0;
  left:   0;
  /* Prevent this decorative overlay from blocking clicks/taps */
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────────────────
 * 7. Disable highlight color on protected sections (Webkit / Blink)
 * ────────────────────────────────────────────────────────────────────── */
.hero-section::selection,
.service-card::selection,
.pricing-card::selection,
.footer-inner::selection,
.navbar::selection {
  background: transparent;
  color:      inherit;
}

.hero-section::-moz-selection,
.service-card::-moz-selection,
.pricing-card::-moz-selection,
.footer-inner::-moz-selection,
.navbar::-moz-selection {
  background: transparent;
  color:      inherit;
}
