/* =====================================================================
   UX Enhancements bundle — prisha-misuy.co.il
   Created 2026-05-09
   - Top scroll progress bar
   - Last-updated + reading-time pill
   - Floating TOC (desktop) / inline (mobile)
   - Print-friendly stylesheet
   ===================================================================== */

/* ============================================================
   1. TOP SCROLL PROGRESS BAR
   ============================================================ */
.uxe-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #C9A24D 0%, #15803D 100%);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s ease-out;
  pointer-events: none;
}

/* ============================================================
   2. META PILL (reading time + last updated)
   ============================================================ */
.uxe-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: rgba(11, 46, 74, 0.06);
  border: 1px solid rgba(11, 46, 74, 0.1);
  border-radius: 999px;
  font-size: 0.86rem;
  color: #4b5563;
  margin: 14px 0 8px;
  flex-wrap: wrap;
}
.uxe-meta-pill > span { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.uxe-meta-pill svg { width: 14px; height: 14px; color: #C9A24D; }
.uxe-meta-pill .uxe-meta-divider { width: 1px; height: 14px; background: rgba(11, 46, 74, 0.2); }
@media (max-width: 600px) {
  .uxe-meta-pill { font-size: 0.8rem; gap: 10px; padding: 6px 12px; }
  .uxe-meta-pill .uxe-meta-divider { display: none; }
}

/* ============================================================
   3. TABLE OF CONTENTS
   ============================================================ */
/* Floating TOC (desktop, sticky on left side in RTL = visual right) */
.uxe-toc {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 22px;
  margin: 24px 0;
  font-family: inherit;
}
.uxe-toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #0B2E4A;
  font-size: 1rem;
  font-weight: 700;
}
.uxe-toc-title svg { width: 18px; height: 18px; color: #C9A24D; }
.uxe-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: uxe-toc;
}
.uxe-toc li {
  counter-increment: uxe-toc;
  padding: 5px 0;
  border-bottom: 1px dashed #e5e7eb;
}
.uxe-toc li:last-child { border-bottom: none; }
.uxe-toc li::before {
  content: counter(uxe-toc) ". ";
  color: #C9A24D;
  font-weight: 700;
  margin-left: 4px;
}
.uxe-toc li.uxe-toc-h3 {
  padding-right: 18px;
  font-size: 0.92rem;
  border-bottom: none;
  padding-top: 2px;
  padding-bottom: 2px;
}
.uxe-toc li.uxe-toc-h3::before { content: "·"; }
.uxe-toc a {
  color: #0B2E4A;
  text-decoration: none;
  font-size: 0.96rem;
  line-height: 1.4;
}
.uxe-toc a:hover { color: #C9A24D; text-decoration: underline; }
.uxe-toc a.is-active { color: #C9A24D; font-weight: 700; }

/* Mobile: collapsible */
.uxe-toc-toggle {
  background: none;
  border: none;
  margin-right: auto;
  cursor: pointer;
  padding: 4px;
  color: #4b5563;
  font-family: inherit;
}
.uxe-toc-toggle svg { width: 18px; height: 18px; transition: transform 0.2s; }
.uxe-toc.is-collapsed .uxe-toc-toggle svg { transform: rotate(-90deg); }
.uxe-toc.is-collapsed ol { display: none; }

/* ============================================================
   4. PRINT-FRIENDLY STYLESHEET
   ============================================================ */
@media print {
  /* Hide non-essential UI */
  header.site-header,
  footer.site-footer,
  .igtax-service-hero .hero-bg-svg,
  .hero-image,
  .hero-lead-form-card,
  .crov2-bottom-bar,
  .crov2-ticker,
  .crov2-loss-calc,
  .cro-sticky-cta,
  .cro-exit-popup,
  .uxe-progress-bar,
  .igchat-trigger, .igchat-window,
  .google-reviews-widget,
  .bottom-lead-section,
  .igtax-illustration-break,
  .uxe-toc-toggle,
  nav, button, .skip-link, .cookie-banner,
  iframe { display: none !important; }

  /* Universal reset for printing */
  body { background: #fff !important; color: #000 !important; font-size: 11pt; line-height: 1.5; }
  main, main#content { max-width: none !important; padding: 0 !important; }
  .page-wrapper { max-width: none !important; }

  /* Headings */
  h1 { font-size: 22pt; color: #000 !important; page-break-after: avoid; margin: 8mm 0 4mm; }
  h2 { font-size: 16pt; color: #000 !important; page-break-after: avoid; margin: 6mm 0 3mm; padding: 0 !important; background: none !important; border: none !important; }
  h2 .h2-text span { color: #000 !important; text-shadow: none !important; }
  h3 { font-size: 13pt; color: #000 !important; }

  /* Hero — keep just the H1, byline, subtitle */
  .igtax-service-hero {
    background: none !important;
    color: #000 !important;
    padding: 0 0 8mm !important;
    border-bottom: 1pt solid #000;
    margin-bottom: 8mm;
  }
  .igtax-service-hero h1, .igtax-service-hero p { color: #000 !important; }
  .hero-text { width: 100% !important; }
  .igtax-byline { color: #555 !important; }
  .igtax-byline strong { color: #000 !important; }

  /* Tables */
  table { border-collapse: collapse; width: 100%; page-break-inside: avoid; }
  table th, table td { border: 1pt solid #444; padding: 4pt 6pt; }

  /* Lists */
  ul, ol { margin: 4mm 0; }
  ul li, ol li { page-break-inside: avoid; }

  /* Tax brand byline at top of every page */
  body::before {
    content: "אילנית גנימה — יועצת מס מורשית · רישיון 45633 · prisha-misuy.co.il · 052-827-1191";
    display: block;
    font-size: 9pt;
    color: #555;
    border-bottom: 1pt solid #ccc;
    padding-bottom: 4pt;
    margin-bottom: 8pt;
  }

  /* Footer note */
  body::after {
    content: "מסמך זה נוצר באתר prisha-misuy.co.il. למידע מעודכן ופרטני, פנו לאילנית גנימה: 052-827-1191";
    display: block;
    font-size: 9pt;
    color: #555;
    border-top: 1pt solid #ccc;
    margin-top: 8mm;
    padding-top: 4pt;
    text-align: center;
  }

  /* Links — show URL after text for printed page */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
  a[href^="/"]::after {
    content: " (https://prisha-misuy.co.il" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }

  /* Avoid page breaks in awkward places */
  section, article, .igtax-cta-box { page-break-inside: avoid; }

  /* Strong page breaks before main sections */
  section.content-section { page-break-inside: auto; }
  h1, h2, h3 { page-break-after: avoid; }

  /* Don't print emoji or decorative SVG */
  .igtax-h2-with-icon svg.h2-vivid, .h2-vivid { display: none !important; }
}

/* ============================================================
   5. PRINT BUTTON (visible inline near reading meta)
   ============================================================ */
.uxe-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1.5px solid #C9A24D;
  border-radius: 999px;
  color: #A78032;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.uxe-print-btn:hover { background: #C9A24D; color: #fff; }
.uxe-print-btn svg { width: 14px; height: 14px; }
