/**
 * Vintage Editorial Ink Cursor — Interactive Print Edition
 * Emran Rafid Custom WordPress Theme
 *
 * Sensation: Fine ink pen moving across tactile printed paper.
 * Handcrafted, premium, understated, and elegant.
 */

:root {
  --er-cursor-ink: #24231F;
  --er-cursor-terracotta: #AD654B;
  --er-cursor-terracotta-light: #E58A6A;
  --er-cursor-paper: #F3EFE5;
  --er-cursor-brown: #49362D;
  --er-cursor-dot-size: 5px;
  --er-cursor-ring-size: 30px;
  --er-cursor-ring-btn-size: 48px;
  --er-cursor-ring-stamp-size: 66px;
  --er-cursor-ring-link-size: 36px;
  --er-cursor-font: 'JetBrains Mono', 'SF Mono', Consolas, Monaco, monospace;
}

/* ========================================================
   PROGRESSIVE ENHANCEMENT: SYSTEM CURSOR REPLACEMENT
   Only hide native cursor when custom cursor successfully initializes
   ======================================================== */
@media (hover: hover) and (pointer: fine) {
  html.er-has-custom-cursor,
  html.er-has-custom-cursor body {
    cursor: none !important;
  }

  html.er-has-custom-cursor a,
  html.er-has-custom-cursor button,
  html.er-has-custom-cursor [role="button"],
  html.er-has-custom-cursor .er-btn,
  html.er-has-custom-cursor .er-card,
  html.er-has-custom-cursor .er-video-thumb-wrap {
    cursor: none !important;
  }

  /* PRESERVE NATIVE CURSORS FOR ACCESSIBILITY & FORM INPUTS */
  html.er-has-custom-cursor input,
  html.er-has-custom-cursor textarea,
  html.er-has-custom-cursor select,
  html.er-has-custom-cursor [contenteditable="true"],
  html.er-has-custom-cursor iframe,
  html.er-has-custom-cursor .tutor-lms-player,
  html.er-has-custom-cursor .woocommerce-checkout,
  html.er-has-custom-cursor [data-cursor="native"],
  html.er-has-custom-cursor [data-cursor="text"] {
    cursor: auto !important;
  }

  html.er-has-custom-cursor input[type="text"],
  html.er-has-custom-cursor input[type="search"],
  html.er-has-custom-cursor input[type="email"],
  html.er-has-custom-cursor input[type="url"],
  html.er-has-custom-cursor input[type="tel"],
  html.er-has-custom-cursor input[type="password"],
  html.er-has-custom-cursor textarea,
  html.er-has-custom-cursor [contenteditable="true"] {
    cursor: text !important;
  }
}

/* ========================================================
   CURSOR DOM STRUCTURE (HARDWARE ACCELERATED)
   ======================================================== */
.er-cursor-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease-out, visibility 0.22s ease-out;
  user-select: none;
}

.er-cursor-container.is-visible {
  opacity: 1;
  visibility: visible;
}

.er-cursor-container.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* 1. SOLID INNER INK DOT (5px) */
.er-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--er-cursor-dot-size);
  height: var(--er-cursor-dot-size);
  margin-top: calc(var(--er-cursor-dot-size) / -2);
  margin-left: calc(var(--er-cursor-dot-size) / -2);
  background-color: var(--er-cursor-ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000000;
  will-change: transform, opacity, background-color;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity 0.2s ease, transform 0.04s linear, background-color 0.22s ease;
}

/* 2. OUTLINED INK RING (30px BASE) */
.er-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--er-cursor-ring-size);
  height: var(--er-cursor-ring-size);
  margin-top: calc(var(--er-cursor-ring-size) / -2);
  margin-left: calc(var(--er-cursor-ring-size) / -2);
  border: 1.5px solid var(--er-cursor-ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  will-change: transform, width, height, margin, border-color, background-color;
  transform: translate3d(-100px, -100px, 0);
  background-color: transparent;
  box-shadow: 0 0 0.5px rgba(36, 35, 31, 0.35);
  transition: width 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s ease,
              border-width 0.18s ease,
              background-color 0.22s ease,
              box-shadow 0.22s ease;
}

/* 3. VINTAGE EDITORIAL STAMP LABEL */
.er-cursor-label {
  font-family: var(--er-cursor-font);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--er-cursor-ink);
  opacity: 0;
  transform: scale(0.65);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  line-height: 1;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.2s ease;
}

/* ========================================================
   INTERACTIVE HOVER STATES
   ======================================================== */

/* STATE A: BUTTONS & CTAS (~48px, Muted Terracotta #AD654B) */
.er-cursor-container.is-button .er-cursor-ring {
  width: var(--er-cursor-ring-btn-size);
  height: var(--er-cursor-ring-btn-size);
  margin-top: calc(var(--er-cursor-ring-btn-size) / -2);
  margin-left: calc(var(--er-cursor-ring-btn-size) / -2);
  border-color: var(--er-cursor-terracotta);
  border-width: 1.5px;
  background-color: rgba(173, 101, 75, 0.08);
  box-shadow: 0 0 0 1px rgba(173, 101, 75, 0.2);
}

.er-cursor-container.is-button .er-cursor-dot {
  background-color: var(--er-cursor-terracotta);
  opacity: 0.65;
  transform: scale(0.75);
}

/* STATE B: COURSE & RESOURCE CARDS (66px Stamp, VIEW ↗) */
.er-cursor-container.is-view .er-cursor-ring {
  width: var(--er-cursor-ring-stamp-size);
  height: var(--er-cursor-ring-stamp-size);
  margin-top: calc(var(--er-cursor-ring-stamp-size) / -2);
  margin-left: calc(var(--er-cursor-ring-stamp-size) / -2);
  border-color: var(--er-cursor-ink);
  border-width: 1.5px;
  background-color: var(--er-cursor-paper);
  box-shadow: 2px 2px 0px rgba(36, 35, 31, 0.35);
}

.er-cursor-container.is-view .er-cursor-dot {
  opacity: 0;
}

.er-cursor-container.is-view .er-cursor-label {
  opacity: 1;
  transform: scale(1);
  color: var(--er-cursor-ink);
}

/* STATE C: PROJECTS & PORTFOLIO IMAGES (66px Stamp, EXPLORE ↗) */
.er-cursor-container.is-explore .er-cursor-ring {
  width: var(--er-cursor-ring-stamp-size);
  height: var(--er-cursor-ring-stamp-size);
  margin-top: calc(var(--er-cursor-ring-stamp-size) / -2);
  margin-left: calc(var(--er-cursor-ring-stamp-size) / -2);
  border-color: var(--er-cursor-ink);
  border-width: 1.5px;
  background-color: var(--er-cursor-paper);
  box-shadow: 2px 2px 0px rgba(36, 35, 31, 0.35);
}

.er-cursor-container.is-explore .er-cursor-dot {
  opacity: 0;
}

.er-cursor-container.is-explore .er-cursor-label {
  opacity: 1;
  transform: scale(1);
  color: var(--er-cursor-ink);
}

/* STATE D: TEXT LINKS (Compact 36px ring) */
.er-cursor-container.is-link .er-cursor-ring {
  width: var(--er-cursor-ring-link-size);
  height: var(--er-cursor-ring-link-size);
  margin-top: calc(var(--er-cursor-ring-link-size) / -2);
  margin-left: calc(var(--er-cursor-ring-link-size) / -2);
  border-color: var(--er-cursor-terracotta);
  border-width: 1.2px;
  background-color: transparent;
}

.er-cursor-container.is-link .er-cursor-dot {
  background-color: var(--er-cursor-terracotta);
}

/* STATE E: POINTER CLICK / INK-STAMP PRESSURE ANIMATION (150-220ms) */
.er-cursor-container.is-clicking .er-cursor-ring {
  border-width: 2.2px;
  box-shadow: 1px 1px 0px rgba(36, 35, 31, 0.5);
  transition-duration: 0.12s;
}

.er-cursor-container.is-clicking.is-button .er-cursor-ring {
  background-color: rgba(173, 101, 75, 0.18);
}

.er-cursor-container.is-clicking.is-view .er-cursor-ring,
.er-cursor-container.is-clicking.is-explore .er-cursor-ring {
  background-color: #ECE5D7;
  box-shadow: 1px 1px 0px rgba(36, 35, 31, 0.5);
}

/* ========================================================
   EXPLICIT THEME-AWARE DARK MODE CONTRAST
   Automatically switch to light cream on dark sections
   ======================================================== */
.er-cursor-container.is-dark .er-cursor-dot {
  background-color: var(--er-cursor-paper);
}

.er-cursor-container.is-dark .er-cursor-ring {
  border-color: var(--er-cursor-paper);
  box-shadow: 0 0 0.5px rgba(243, 239, 229, 0.4);
}

/* Dark: Button Hover */
.er-cursor-container.is-dark.is-button .er-cursor-ring {
  border-color: var(--er-cursor-terracotta-light);
  background-color: rgba(229, 138, 106, 0.16);
  box-shadow: 0 0 0 1px rgba(229, 138, 106, 0.35);
}

.er-cursor-container.is-dark.is-button .er-cursor-dot {
  background-color: var(--er-cursor-terracotta-light);
}

/* Dark: Stamp View / Explore */
.er-cursor-container.is-dark.is-view .er-cursor-ring,
.er-cursor-container.is-dark.is-explore .er-cursor-ring {
  background-color: var(--er-cursor-ink);
  border-color: var(--er-cursor-paper);
  box-shadow: 2px 2px 0px rgba(243, 239, 229, 0.3);
}

.er-cursor-container.is-dark.is-view .er-cursor-label,
.er-cursor-container.is-dark.is-explore .er-cursor-label {
  color: var(--er-cursor-paper);
}

/* Dark: Text Links */
.er-cursor-container.is-dark.is-link .er-cursor-ring {
  border-color: var(--er-cursor-terracotta-light);
}

.er-cursor-container.is-dark.is-link .er-cursor-dot {
  background-color: var(--er-cursor-terracotta-light);
}

/* Dark: Clicking */
.er-cursor-container.is-dark.is-clicking .er-cursor-ring {
  box-shadow: 1px 1px 0px rgba(243, 239, 229, 0.6);
}

/* ========================================================
   ELEGANT EDITORIAL UNDERLINE EFFECT FOR TEXT LINKS
   ======================================================== */
@media (hover: hover) and (pointer: fine) {
  html.er-has-custom-cursor a:not(.er-btn):not(.er-card-media-link):not(.er-nav-pill):not(.er-social-list a):not(.custom-logo-link):not(.er-footer-phone-link):not(.er-open-video-modal) {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    transition: text-decoration-color 0.25s ease, color 0.2s ease;
  }

  html.er-has-custom-cursor a:not(.er-btn):not(.er-card-media-link):not(.er-nav-pill):not(.er-social-list a):not(.custom-logo-link):not(.er-footer-phone-link):not(.er-open-video-modal):hover {
    text-decoration-color: var(--er-cursor-terracotta);
  }

  html.er-has-custom-cursor .er-site-footer a:hover,
  html.er-has-custom-cursor .er-footer-banner a:hover {
    text-decoration-color: var(--er-cursor-terracotta-light);
  }
}

/* ========================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ======================================================== */
@media (prefers-reduced-motion: reduce) {
  .er-cursor-container {
    display: none !important;
  }
  html.er-has-custom-cursor,
  html.er-has-custom-cursor * {
    cursor: auto !important;
  }
}
