/* 
   ==========================================================================
   Adv. Eliram Elgarably - Premium Real Estate Law Firm Website
   Design System & Styling
   ========================================================================== 
*/

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;600;700;800&family=Cinzel:wght@400;600;700;800&family=Heebo:wght@400;500;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS VARIABLES - Premium Luxury Theme */
:root {
  /* Color Palette */
  --color-primary: #0A1128;      /* Rich Deep Navy */
  --color-secondary: #101F42;    /* Navy Charcoal */
  --color-accent-gold: #C5A880;  /* Subtle Soft Gold */
  --color-accent-gold-bright: #E5C494; /* Brighter gold for highlights */
  --color-gold-dark: #8F724C;    /* Antique Dark Gold */
  --color-bg-light: #F8F9FA;     /* Warm Off-White */
  --color-bg-dark: #070C1E;      /* Deep background shade */
  --color-text-dark: #1C2541;    /* Primary Text Dark */
  --color-text-light: #F4F5F7;   /* Primary Text Light */
  --color-text-muted: #6C7A89;   /* Muted Grey Text */
  --color-border: rgba(197, 168, 128, 0.25); /* Subtle Gold Border */
  --color-border-hover: rgba(197, 168, 128, 0.6);
  --color-white: #FFFFFF;
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(10, 17, 40, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.3);

  /* Fonts */
  --font-en-head: 'Cinzel', serif;
  --font-en-body: 'Inter', sans-serif;
  --font-he: 'Assistant', sans-serif;

  /* Layout and Transition Variables */
  --max-width: 1200px;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: all 0.2s ease-in-out;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  
  /* Spacing */
  --space-unit: 1rem;
}

/* ==========================================================================
   Language Configuration & Reset
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Default Body configuration */
body {
  font-family: var(--font-he);
  background-color: var(--color-bg-light);
  color: var(--color-text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Bilingual Language Toggling Utility */
body.lang-he {
  font-family: var(--font-he);
}

body.lang-en {
  font-family: var(--font-en-body);
}

/* Show/hide elements based on active language */
body.lang-he [lang="en"] {
  display: none !important;
}

body.lang-en [lang="he"] {
  display: none !important;
}

/* Header typography modifications for English */
body.lang-en h1,
body.lang-en h2,
body.lang-en h3,
body.lang-en h4,
body.lang-en h5,
body.lang-en h6,
body.lang-en .navbar-logo-text,
body.lang-en .hero-title {
  font-family: var(--font-en-head);
  letter-spacing: 0.05em;
}

body.lang-he h1,
body.lang-he h2,
body.lang-he h3,
body.lang-he h4,
body.lang-he h5,
body.lang-he h6 {
  font-family: var(--font-he);
  font-weight: 700;
}

/* Links & Buttons Reset */
a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  outline: none;
}

/* ==========================================================================
   Typography & Reusable Layout Components
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Sections Styling */
section {
  padding: 8rem 0;
  position: relative;
}

.section-dark {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.section-subtitle {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--color-accent-gold);
  letter-spacing: 0.2rem;
  margin-bottom: 0.8rem;
  display: block;
  font-weight: 600;
}

.section-title {
  font-size: 2.5rem;
  color: inherit;
  position: relative;
  display: inline-block;
  padding-bottom: 1.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent-gold), transparent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.btn-gold {
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
  border: 1px solid var(--color-accent-gold);
  box-shadow: 0 4px 15px rgba(197, 168, 128, 0.2);
}

.btn-gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.6s;
}

.btn-gold:hover::before {
  left: 100%;
}

.btn-gold:hover {
  background-color: var(--color-accent-gold-bright);
  box-shadow: 0 6px 20px rgba(197, 168, 128, 0.4);
  transform: translateY(-2px);
}

.btn-outline {
  border: 1px solid var(--color-accent-gold);
  color: var(--color-accent-gold);
  background-color: transparent;
}

.btn-outline:hover {
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* Small button variant (e.g., navbar consultation CTA) */
.btn-sm {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
}

/* ==========================================================================
   Navigation Bar (Glassmorphism & RTL aware)
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition-smooth);
  border-bottom: 1px solid transparent;
}

.header-scrolled {
  background-color: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px var(--glass-shadow);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 90px;
  transition: var(--transition-smooth);
}

.header-scrolled .navbar {
  height: 75px;
}

/* Logo */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-icon,
.logo-img {
  height: 45px;
  width: 45px;
  object-fit: contain;
}

.navbar-logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-light);
  line-height: 1.1;
  white-space: nowrap; /* Logo name stays on one line in both languages */
}

/* The English logo name is longer — size it to match the Hebrew header */
body.lang-en .navbar-logo-text {
  font-size: 1.2rem;
}

/* English nav labels are wider; tighten spacing so the full menu fits
   on one line just like the Hebrew version */
body.lang-en .nav-menu {
  gap: 1.8rem;
}

@media (max-width: 1200px) and (min-width: 769px) {
  body.lang-en .nav-menu {
    gap: 1.1rem;
  }

  body.lang-en .nav-link {
    font-size: 0.85rem;
  }

  body.lang-en .nav-actions {
    gap: 0.8rem;
  }
}

.header-scrolled .navbar-logo-text {
  color: var(--color-text-light);
}

.navbar-logo-subtext {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--color-accent-gold);
  text-transform: uppercase;
  display: block;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

.nav-link {
  color: var(--color-text-light);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  white-space: nowrap; /* Keep multi-word EN labels ("Practice Areas") on one line */
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background-color: var(--color-accent-gold);
  transition: var(--transition-smooth);
}

.nav-link:hover {
  color: var(--color-accent-gold);
}

.nav-link:hover::after {
  width: 100%;
}

/* ==========================================================================
   Nav Dropdown — "מחשבונים" / "Calculators"
   ========================================================================== */
.nav-item-dropdown {
  position: relative;
}

/* Toggle reuses .nav-link styling; reset native <button> chrome */
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-dropdown-caret {
  flex-shrink: 0;
  margin-block-start: 2px;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Caret flips when the panel is open (hover, keyboard focus, or JS toggle) */
.nav-item-dropdown:hover .nav-dropdown-caret,
.nav-item-dropdown:focus-within .nav-dropdown-caret,
.nav-item-dropdown.open .nav-dropdown-caret {
  transform: rotate(180deg);
}

/* Keep the gold colour + underline of the toggle in sync with the panel */
.nav-item-dropdown:hover .nav-dropdown-toggle,
.nav-item-dropdown:focus-within .nav-dropdown-toggle,
.nav-item-dropdown.open .nav-dropdown-toggle {
  color: var(--color-accent-gold);
}

.nav-item-dropdown:hover .nav-dropdown-toggle::after,
.nav-item-dropdown:focus-within .nav-dropdown-toggle::after,
.nav-item-dropdown.open .nav-dropdown-toggle::after {
  width: 100%;
}

/* The flyout panel */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 230px;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  background-color: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  box-shadow: 0 18px 40px var(--glass-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1100;
  transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0s linear 0.35s;
}

/* Invisible bridge so the cursor can travel from toggle to panel without a gap */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -0.75rem;
  left: 0;
  right: 0;
  height: 0.75rem;
}

/* Subtle pointer/notch above the panel */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background-color: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  border-left: 1px solid var(--glass-border);
}

.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown:focus-within .nav-dropdown,
.nav-item-dropdown.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0s;
}

.nav-dropdown li {
  list-style: none;
}

.nav-dropdown-link {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--color-text-light);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.nav-dropdown-link:hover,
.nav-dropdown-link:focus-visible {
  background-color: rgba(197, 168, 128, 0.12);
  color: var(--color-accent-gold);
  padding-inline-start: 1.25rem;
}

/* Language and Contact wrapper */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.lang-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 18px;
  color: var(--color-text-light);
  transition: var(--transition-smooth);
  opacity: 0.6;
}

.lang-btn:hover {
  opacity: 0.9;
}

body.lang-he .lang-btn-he,
body.lang-en .lang-btn-en {
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
  opacity: 1;
}

/* In-drawer language switcher (mobile only; built by JS from the page's own
   language links so it works on every page regardless of path depth). Hidden
   on desktop — the header pill handles language there. */
.nav-menu-lang { display: none; }

body.lang-he .nav-menu-lang__opt.lang-btn-he,
body.lang-en .nav-menu-lang__opt.lang-btn-en {
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
  opacity: 1;
  box-shadow: 0 2px 12px rgba(197, 168, 128, 0.28);
}

/* Mobile Toggle Hamburger */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  width: 44px;          /* full 44px tap target */
  height: 44px;
  padding: 13px 10px;   /* keeps the visible bars ~24x18 inside the target */
  cursor: pointer;
  z-index: 1100;
  border: none;
  background: transparent;
  border-radius: var(--border-radius-sm);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-toggle span {
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: var(--color-text-light);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease;
}

/* Mobile Toggle Hamburger Active State (forms an X) */
.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu backdrop overlay (created by JS, shown only on mobile) */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1040;
  background-color: rgba(5, 9, 20, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Lock background scroll while the mobile drawer is open */
body.nav-open {
  overflow: hidden;
}

/* Mobile-only header actions (language switch + hamburger).
   Hidden on desktop; revealed by the mobile media query. */
.navbar-mobile-actions {
  display: none;
  align-items: center;
}

/* ==========================================================================
   Hero Section (Luxury background & styling)
   ========================================================================== */

.hero {
  /* Reserve the fixed header height via padding-top (box-sizing: border-box)
     so content centers in the *visible* area below the header instead of the
     full viewport. This keeps the gap below the header tight and balanced.
     min-height lets the hero grow for longer content (e.g. English) without
     clipping under the header. */
  height: auto;
  min-height: max(640px, 100vh);
  padding-top: 90px; /* clears the 90px fixed header */
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-bg-dark);
}

.hero-bg-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.35); /* Darken image to allow text readability */
}

/* Ambient gradient glows */
.hero-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: radial-gradient(circle at 70% 30%, rgba(197, 168, 128, 0.1) 0%, transparent 60%),
              linear-gradient(180deg, rgba(7, 12, 30, 0.8) 0%, rgba(7, 12, 30, 0.4) 50%, rgba(7, 12, 30, 0.95) 100%);
}

/* Luxury 2-Column Grid for Hero Section */
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 3;
  width: 100%;
  /* The header clearance is now handled by .hero's padding-top, so the grid
     only needs modest breathing room. Bottom padding keeps content clear of
     the stats bar that overlaps the hero by -50px. */
  padding-top: 2rem;
  padding-bottom: 4rem;
}

body.lang-he .hero-grid {
  direction: rtl;
}

body.lang-en .hero-grid {
  direction: ltr;
}

.hero-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

body.lang-he .hero-text-col {
  text-align: right;
  align-items: flex-start;
}

body.lang-en .hero-text-col {
  text-align: left;
  align-items: flex-start;
}

/* English copy runs much longer than the Hebrew equivalent; slightly smaller
   type keeps the EN hero the same visual height as the HE hero. */
body.lang-en .hero-title {
  font-size: 3.2rem;
}

body.lang-en .hero-lead {
  font-size: 1.15rem;
}

/* Portrait Column Styles */
.hero-portrait-col {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUpPortrait 1.2s cubic-bezier(0.25, 1, 0.5, 1) 0.5s forwards;
}

.hero-portrait-wrapper {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 0.75; /* 3:4 vertical ratio */
  z-index: 2;
}

/* Glowing background halo behind portrait */
.hero-portrait-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(197, 168, 128, 0.15) 0%, transparent 70%);
  z-index: -2;
  pointer-events: none;
}

.hero-portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(197, 168, 128, 0.35); /* luxury gold border */
  transition: transform 0.5s ease, filter 0.5s ease;
}

/* Double gold offset frame */
.hero-portrait-wrapper::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-accent-gold);
  border-radius: var(--border-radius-lg);
  z-index: -1;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

body.lang-he .hero-portrait-wrapper::before {
  left: auto;
  right: -15px;
}

/* Hover micro-animations */
.hero-portrait-wrapper:hover .hero-portrait-image {
  transform: scale(1.02);
}

.hero-portrait-wrapper:hover::before {
  transform: translate(8px, 8px);
}

body.lang-he .hero-portrait-wrapper:hover::before {
  transform: translate(-8px, 8px);
}

/* Frosted glass name tag overlay */
.hero-portrait-nametag {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 12, 30, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(197, 168, 128, 0.3);
  border-radius: 8px;
  padding: 0.8rem 1.8rem;
  width: 85%;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  z-index: 3;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-portrait-nametag:hover {
  border-color: var(--color-accent-gold);
  box-shadow: 0 15px 40px rgba(197, 168, 128, 0.2);
}

.hero-portrait-nametag h4 {
  color: var(--color-white);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.hero-portrait-nametag p {
  color: var(--color-accent-gold);
  font-size: 0.75rem;
  margin: 0.2rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

@keyframes fadeInUpPortrait {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Stacking & Resizing for Hero section */
@media (max-width: 991px) {
  .hero {
    height: auto;
    min-height: 100vh;
    /* Only reserve the mobile header height (80px); no extra stacked padding */
    padding-top: 80px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }
  
  .hero-text-col {
    align-items: center;
    text-align: center;
  }
  
  body.lang-he .hero-text-col {
    text-align: center;
    align-items: center;
  }
  
  body.lang-en .hero-text-col {
    text-align: center;
    align-items: center;
  }
  
  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-portrait-wrapper {
    max-width: 300px;
    margin: 0 auto;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--color-accent-gold);
  color: var(--color-accent-gold);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  background-color: rgba(197, 168, 128, 0.08);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.hero-title {
  font-size: 3.8rem;
  color: var(--color-white);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s cubic-bezier(0.25, 1, 0.5, 1) 0.2s forwards;
}

.hero-title span {
  color: var(--color-accent-gold);
}

.hero-lead {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 3rem;
  max-width: 650px;
  font-weight: 300;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s cubic-bezier(0.25, 1, 0.5, 1) 0.4s forwards;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s cubic-bezier(0.25, 1, 0.5, 1) 0.6s forwards;
}

/* Animations */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Stats Bar Section
   ========================================================================== */

.stats-bar {
  padding: 0;
  margin-top: -50px; /* Overlap Hero slightly */
  position: relative;
  z-index: 10;
  font-family: 'Heebo', sans-serif; /* Distinct, geometric type for the stats band only */
}

.stats-container {
  background: var(--color-primary);
  border: 1px solid var(--color-border);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-md);
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.stat-item {
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20%;
  height: 60%;
  width: 1px;
  background-color: var(--color-border);
  inset-inline-end: -1rem; /* RTL-aware boundary line */
}

/* Small gold icon above each stat — matches the site's existing icon language */
.stat-icon {
  color: var(--color-accent-gold);
  opacity: 0.85;
  margin-bottom: 0.7rem;
  line-height: 0;
}

.stat-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--color-accent-gold);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-feature-settings: "tnum"; /* Tabular numerals for smooth count animation */
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
}

/* Small unit beside a counted number (e.g. "שעות" / "hours") */
.stat-affix {
  font-size: 1.4rem;
  font-weight: 600;
  opacity: 0.8;
}

/* Non-numeric stat cell (e.g. "עב · EN") — sized to match the counters,
   no count-up, gentle entrance to stay consistent with the band */
.stat-number--text {
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 1s cubic-bezier(0.25, 1, 0.5, 1) 0.3s forwards;
}

.stat-number--text [dir="ltr"] {
  unicode-bidi: isolate;
}

.stat-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--color-text-light);
  letter-spacing: 0.1rem;
  font-weight: 500;
}

/* ==========================================================================
   Practice Areas Section (Hover card grid)
   ========================================================================== */

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.practice-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.practice-card-image-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.practice-card-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 17, 40, 0.1) 40%, rgba(10, 17, 40, 0.6) 100%);
  z-index: 2;
  transition: var(--transition-smooth);
}

.practice-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
  filter: brightness(0.85);
}

.practice-card-content {
  padding: 2.5rem 2rem 2.2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.practice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent-gold), var(--color-gold-dark));
  transform: scaleX(0);
  transition: var(--transition-smooth);
  transform-origin: left;
  z-index: 10;
}

body.lang-he .practice-card::before {
  transform-origin: right;
}

.practice-icon {
  width: 60px;
  height: 60px;
  background-color: var(--color-white);
  border: 2px solid var(--color-accent-gold);
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 170px;
  inset-inline-start: 2rem;
  transition: var(--transition-smooth);
  color: var(--color-accent-gold);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 5;
}

.practice-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.practice-card-title {
  font-size: 1.25rem;
  color: var(--color-text-dark);
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  transition: var(--transition-fast);
  font-weight: 700;
}

body.lang-en .practice-card-title {
  font-family: var(--font-en-head);
  letter-spacing: 0.5px;
  font-size: 1.15rem;
}

.practice-card-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 1.2rem;
}

.practice-card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent-gold);
  transition: var(--transition-smooth);
  cursor: pointer;
  width: fit-content;
  text-decoration: none;
}

.practice-card-link .arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  margin-inline-start: 6px;
}

/* Hover States for Practice Card */
.practice-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 45px rgba(197, 168, 128, 0.18);
  border-color: var(--color-accent-gold);
}

.practice-card:hover::before {
  transform: scaleX(1);
}

.practice-card:hover .practice-card-image-wrapper::after {
  background: linear-gradient(to bottom, rgba(10, 17, 40, 0) 20%, rgba(197, 168, 128, 0.25) 100%);
}

.practice-card:hover .practice-card-image {
  transform: scale(1.06);
  filter: brightness(1.05);
}

.practice-card:hover .practice-icon {
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
  transform: rotate(5deg) scale(1.05);
  box-shadow: 0 8px 20px rgba(197, 168, 128, 0.3);
}

.practice-card:hover .practice-card-link {
  color: var(--color-gold-dark);
}

body.lang-en .practice-card:hover .arrow {
  transform: translateX(5px);
}

body.lang-he .practice-card:hover .arrow {
  transform: translateX(-5px);
}

/* ==========================================================================
   Purchase Tax Calculator (Simulator)
   ========================================================================== */

.calculator-wrapper {
  max-width: 900px;
  margin: 0 auto;
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

/* Calc Controls Column */
.calc-controls {
  padding: 4rem;
}

.calc-results {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-text-light);
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.calc-results::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(197, 168, 128, 0.08) 0%, transparent 60%);
  border-radius: 50%;
}

.calc-group {
  margin-bottom: 2.5rem;
}

.calc-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text-dark);
}

.calc-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.calc-radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Custom Styled Radio Button Selection — elegant 2x2 cards */
.calc-radio-card {
  position: relative;
  border: 1.5px solid var(--color-border);
  padding: 1.5rem 1.1rem 1.35rem;
  border-radius: var(--border-radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  background-color: var(--color-white);
  overflow: hidden;
}

/* Gold accent bar that sweeps in on selection */
.calc-radio-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg, #8F724C, #E5C494, #8F724C);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s ease;
}

.calc-radio-card:hover {
  border-color: rgba(197, 168, 128, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(28, 37, 65, 0.08);
}

.calc-radio-card input[type="radio"] {
  display: none;
}

/* Icon medallion */
.calc-radio-card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(197, 168, 128, 0.1);
  color: var(--color-accent-gold);
  transition: var(--transition-smooth);
}

.calc-radio-card .card-icon svg {
  width: 24px;
  height: 24px;
}

.calc-radio-card .card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-dark);
  line-height: 1.3;
}

.calc-radio-card .card-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* Selected-state check badge */
.calc-radio-card .card-check {
  position: absolute;
  top: 0.7rem;
  inset-inline-end: 0.7rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--color-accent-gold);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition-smooth);
}

.calc-radio-card .card-check svg {
  width: 12px;
  height: 12px;
}

.calc-radio-card.active {
  background-color: rgba(197, 168, 128, 0.06);
  border-color: var(--color-accent-gold);
  box-shadow: 0 8px 24px rgba(197, 168, 128, 0.16);
}

.calc-radio-card.active::before {
  transform: scaleX(1);
}

.calc-radio-card.active .card-icon {
  background-color: var(--color-accent-gold);
  color: var(--color-white);
  transform: scale(1.05);
}

.calc-radio-card.active .card-check {
  opacity: 1;
  transform: scale(1);
}

/* Disabled-person sub-type toggle (revealed only when that card is selected) */
.calc-subtype {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition: grid-template-rows 0.4s ease, opacity 0.35s ease, margin-top 0.35s ease;
}

.calc-subtype.open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 1.1rem;
}

.calc-subtype-inner {
  overflow: hidden;
}

.calc-subtype-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.55rem;
}

.calc-subtype-toggle {
  display: inline-flex;
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.25rem;
  gap: 0.25rem;
}

.calc-subtype-toggle button {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.calc-subtype-toggle button.active {
  background-color: var(--color-accent-gold);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(197, 168, 128, 0.3);
}

/* Gift checkbox disabled state (when disabled/blind track is selected) */
.calc-checkbox-container.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Input sliders & text inputs */
.calc-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--color-bg-light);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--border-radius-sm);
  padding: 0.25rem 1rem;
  transition: var(--transition-fast);
  gap: 0.5rem;
}

.calc-input-wrapper:focus-within {
  border-color: var(--color-accent-gold);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}

.calc-currency-symbol {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-accent-gold);
}

.calc-text-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.8rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-dark);
  outline: none;
}

/* Bilingual order for currency symbols inside text inputs */
body.lang-he .calc-currency-symbol {
  order: 2;
}
body.lang-he .calc-text-input {
  order: 1;
}
body.lang-en .calc-currency-symbol {
  order: 1;
}
body.lang-en .calc-text-input {
  order: 2;
}

/* Slider styling */
.calc-range-wrapper {
  margin-top: 1rem;
}

.calc-range-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  outline: none;
}

.calc-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent-gold);
  cursor: pointer;
  transition: var(--transition-fast);
}

.calc-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--color-accent-gold-bright);
}

.calc-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Calculator Results view */
.results-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.results-title {
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--color-accent-gold);
  letter-spacing: 0.1rem;
  margin-bottom: 0.5rem;
}

.results-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.1;
}

#tax-result-value {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.3rem;
}

.results-value span {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--color-accent-gold);
}

.results-breakdown {
  flex-grow: 1;
}

.breakdown-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  padding-bottom: 0.5rem;
}

.breakdown-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  gap: 1.5rem;
}

.breakdown-item span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.breakdown-item.total {
  font-weight: 700;
  color: var(--color-accent-gold);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.8rem;
  margin-top: 0.5rem;
}

.calc-disclaimer {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
  margin-top: 2rem;
}

/* Print Branded Report Button */
.calc-print-wrapper {
  margin-top: 1.5rem;
  text-align: center;
}

.calc-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.6rem;
  background: transparent;
  border: 1px solid var(--color-accent-gold);
  border-radius: var(--border-radius-sm);
  color: var(--color-accent-gold);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: var(--transition-fast);
}

.calc-print-btn:hover {
  background: var(--color-accent-gold);
  color: var(--color-primary);
}

.calc-print-btn svg {
  flex-shrink: 0;
}

/* ==========================================================================
   About Section (Double Column Bio & Frame)
   ========================================================================== */

.about-columns {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 5rem;
  align-items: center;
}

/* Photo frame with double gold borders */
.about-image-container {
  position: relative;
  display: flex;
  justify-content: center;
}

.about-image-frame {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
  border-radius: var(--border-radius-md);
  z-index: 2;
}

.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  filter: grayscale(0.15) contrast(1.05);
}

/* Double Golden Border Offset Frames */
.about-image-container::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-accent-gold);
  border-radius: var(--border-radius-md);
  z-index: 1;
  pointer-events: none;
  transition: var(--transition-smooth);
}

body.lang-he .about-image-container::before {
  left: auto;
  right: -15px;
}

.about-image-container::after {
  content: '';
  position: absolute;
  bottom: -15px;
  right: -15px;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(197, 168, 128, 0.3);
  border-radius: var(--border-radius-md);
  z-index: 1;
  pointer-events: none;
  transition: var(--transition-smooth);
}

body.lang-he .about-image-container::after {
  right: auto;
  left: -15px;
}

.about-image-container:hover::before {
  transform: translate(5px, 5px);
}

.about-image-container:hover::after {
  transform: translate(-5px, -5px);
}

.about-text-content {
  display: flex;
  flex-direction: column;
}

.about-tagline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-accent-gold);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.about-bio-para {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.about-values-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.value-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.value-bullet {
  width: 8px;
  height: 8px;
  background-color: var(--color-accent-gold);
  border-radius: 50%;
  margin-top: 0.6rem;
  flex-shrink: 0;
}

.value-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-dark);
}

.value-text span {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Luxury Contact Form Section
   ========================================================================== */

.contact-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 5rem;
}

/* Contact information column */
.contact-info-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-card {
  background-color: var(--color-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 3rem;
  color: var(--color-text-light);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 3rem;
}

.method-item {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
}

.method-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-gold);
  flex-shrink: 0;
}

.method-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.method-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--color-accent-gold);
  letter-spacing: 0.1rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.method-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-light);
}

/* Form Container column */
.contact-form-container {
  background: var(--color-white);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--border-radius-md);
  padding: 4rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.03);
  position: relative;
}

/* Floating labels Form Elements */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.form-full-width {
  grid-column: span 2;
}

.form-group {
  position: relative;
  margin-bottom: 1rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 1.2rem 1rem 0.6rem;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  background-color: var(--color-bg-light);
  color: var(--color-text-dark);
  font-size: 1rem;
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  transition: var(--transition-fast);
  outline: none;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group label {
  position: absolute;
  top: 1rem;
  inset-inline-start: 1rem;
  color: var(--color-text-muted);
  transition: var(--transition-fast);
  pointer-events: none;
  font-size: 0.95rem;
}

/* Floating label effect on focus or input text presence */
.form-input:focus ~ label,
.form-input:not(:placeholder-shown) ~ label,
.form-textarea:focus ~ label,
.form-textarea:not(:placeholder-shown) ~ label,
.form-select:focus ~ label,
.form-select:valid ~ label {
  top: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-accent-gold);
  font-weight: 600;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-bottom: 2px solid var(--color-accent-gold);
  background-color: rgba(197, 168, 128, 0.03);
}

/* Custom CSS validation support using :user-valid & :user-invalid */
.form-input:user-invalid,
.form-textarea:user-invalid {
  border-bottom: 2px solid #D9534F; /* Red for invalid */
}

.form-input:user-valid:focus,
.form-textarea:user-valid:focus {
  border-bottom: 2px solid #5CB85C; /* Green for valid */
}

/* Submit container */
.form-submit-container {
  margin-top: 2.5rem;
  display: flex;
  justify-content: flex-end;
}

/* Form Submission overlay loading spinner */
.form-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius-md);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.form-loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success State Screen */
.success-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(92, 184, 92, 0.1);
  color: #5CB85C;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition-smooth) 0.2s;
}

.form-loading-overlay.success .success-checkmark {
  opacity: 1;
  transform: scale(1);
}

.success-message {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-dark);
  text-align: center;
  margin-bottom: 1rem;
}

.success-sub {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: var(--color-bg-dark);
  color: var(--color-text-light);
  padding: 6rem 0 3rem;
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 5rem;
  margin-bottom: 4rem;
}

.footer-logo-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1.5rem;
  line-height: 1.8;
  max-width: 320px;
}

.footer-title {
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--color-accent-gold);
  letter-spacing: 0.1rem;
  margin-bottom: 2rem;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.footer-link:hover {
  color: var(--color-accent-gold);
  transform: translateX(5px);
}

body.lang-he .footer-link:hover {
  transform: translateX(-5px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-legal-links {
  display: flex;
  gap: 2rem;
}

/* ==========================================================================
   Responsive & Tablet / Mobile Drawer styles
   ========================================================================== */

@media (max-width: 1024px) {
  section {
    padding: 6rem 0;
  }

  .hero-title {
    font-size: 3rem;
  }

  body.lang-en .hero-title {
    font-size: 2.7rem;
  }
  
  .practice-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .calculator-wrapper {
    grid-template-columns: 1fr;
  }
  
  .about-columns {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
  
  .about-image-container {
    max-width: 380px;
    margin: 0 auto;
  }
  
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 80px;
  }
  
  .mobile-nav-toggle {
    display: flex;
  }
  
  /* Slide-out Mobile Menu Drawer — standard side drawer pattern */
  .nav-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-end: -100%; /* off-screen side depends on RTL/LTR */
    width: min(86vw, 340px);
    height: 100vh;
    height: 100dvh; /* respects mobile browser chrome */
    background-color: var(--color-primary);
    border-inline-start: 1px solid var(--color-border);
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    /* Top padding clears the fixed mobile header so the first item sits below it */
    padding: calc(80px + 1.25rem) 1.75rem calc(1.75rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1050;
    transition: inset-inline-end 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: -16px 0 44px rgba(0, 0, 0, 0.45);
  }

  .nav-menu.active {
    inset-inline-end: 0;
  }

  .nav-menu > li {
    width: 100%;
  }

  .nav-link {
    display: block;
    width: 100%;
    font-size: 1.08rem;
    font-weight: 600;
    padding: 1rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  body.lang-he .nav-menu .nav-link,
  body.lang-he .nav-menu .nav-dropdown-toggle { text-align: right; }
  body.lang-en .nav-menu .nav-link,
  body.lang-en .nav-menu .nav-dropdown-toggle { text-align: left; }

  /* The desktop hover-underline is irrelevant inside the drawer */
  .nav-menu .nav-link::after { display: none; }

  /* Dropdown becomes an inline accordion inside the mobile drawer */
  .nav-item-dropdown {
    width: 100%;
  }

  .nav-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 1.08rem;
    font-weight: 600;
    padding: 1rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .nav-item-dropdown.open .nav-dropdown-caret {
    transform: rotate(180deg);
  }

  .nav-dropdown {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: hidden;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .nav-dropdown::before,
  .nav-dropdown::after {
    display: none;
  }

  /* On touch, hover/focus must not reveal the panel — only an explicit tap */
  .nav-item-dropdown:hover .nav-dropdown,
  .nav-item-dropdown:focus-within .nav-dropdown {
    transform: none;
    visibility: hidden;
    pointer-events: none;
    max-height: 0;
  }

  .nav-item-dropdown.open .nav-dropdown {
    transform: none;
    visibility: visible;
    pointer-events: auto;
    max-height: 420px;
  }

  .nav-dropdown-link {
    display: block;
    font-size: 0.98rem;
    font-weight: 500;
    padding: 0.8rem 0.75rem;
    color: var(--color-accent-gold);
    white-space: normal;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  body.lang-he .nav-dropdown-link { text-align: right; }
  body.lang-en .nav-dropdown-link { text-align: left; }

  .nav-dropdown-link:hover,
  .nav-dropdown-link:focus-visible {
    padding-inline-start: 0.75rem; /* no slide effect on mobile */
    color: var(--color-accent-gold-bright);
  }

  .nav-actions {
    display: none; /* Hide desktop action buttons on mobile, show in header/drawer */
  }

  /* Only the hamburger lives in the mobile header bar now — the language
     switch has moved into the drawer for a cleaner, less cramped header.
     !important overrides the inline display:none baked into the markup. */
  .navbar-mobile-actions {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    margin-inline-start: auto;
  }

  .navbar-mobile-actions .lang-switcher {
    display: none; /* relocated into the slide-out drawer */
  }

  /* Language selector pinned to the bottom of the drawer */
  .nav-menu-lang {
    display: block;
    width: 100%;
    margin-top: auto;              /* push to the bottom of the flex column */
    padding-top: 1.6rem;
    border-top: 1px solid rgba(197, 168, 128, 0.22);
  }

  .nav-menu-lang__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
  }

  body.lang-en .nav-menu-lang__head { flex-direction: row; }
  body.lang-he .nav-menu-lang__head { flex-direction: row-reverse; }

  .nav-menu-lang__globe {
    flex-shrink: 0;
    opacity: 0.85;
  }

  .nav-menu-lang__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .nav-menu-lang__options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 14px;
  }

  .nav-menu-lang__opt {
    text-align: center;
    padding: 0.72rem 0.5rem;
    font-size: 0.98rem;
    font-weight: 600;
    border-radius: 10px;
    color: var(--color-text-light);
    opacity: 0.6;
    transition: var(--transition-smooth);
  }

  .nav-menu-lang__opt:hover,
  .nav-menu-lang__opt:focus-visible {
    opacity: 0.92;
  }
  
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    padding: 2.5rem 1.5rem;
  }
  
  .stat-item:nth-child(2)::after {
    display: none;
  }
  
  .practice-grid {
    grid-template-columns: 1fr;
  }
  
  .calc-controls {
    padding: 2.5rem;
  }
  
  .calc-results {
    padding: 2.5rem;
  }
  
  .contact-form-container {
    padding: 2.5rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-full-width {
    grid-column: span 1;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer-legal-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.4rem;
  }

  body.lang-en .hero-title {
    font-size: 2.1rem;
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .stat-item::after {
    display: none !important;
  }
  
  .calc-radio-group {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Recent Articles (Featured Blog Section) & Article Layouts
   ========================================================================== */

.recent-articles {
  background-color: var(--color-bg-light);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 6rem 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 3.5rem;
}

.article-card {
  position: relative;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.article-card-image-wrapper {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
}

.article-card-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 17, 40, 0) 50%, rgba(10, 17, 40, 0.4) 100%);
  z-index: 1;
}

.article-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
  filter: brightness(0.9);
}

.article-badge {
  position: absolute;
  top: 1.25rem;
  inset-inline-start: 1.25rem;
  background-color: var(--color-primary);
  color: var(--color-accent-gold);
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-border);
  z-index: 6; /* Sit above the stretched card link (z-index: 5) */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: var(--transition-fast);
}

.article-badge:hover {
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
  border-color: var(--color-accent-gold);
  box-shadow: 0 4px 12px rgba(197, 168, 128, 0.2);
}

.article-card-content {
  padding: 2.25rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.article-card-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-dot {
  opacity: 0.5;
}

.article-card-title {
  font-size: 1.25rem;
  color: var(--color-text-dark);
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.45;
  transition: var(--transition-fast);
}

.article-card-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

.article-card-title a:hover {
  color: var(--color-accent-gold-bright);
}

.article-card-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  flex-grow: 1;
}

/* Creative Author Badge Style */
.article-author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(197, 168, 128, 0.15);
  margin-top: auto;
}

.author-avatar-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-accent-gold);
  box-shadow: 0 0 10px rgba(197, 168, 128, 0.25);
  position: relative;
  transition: var(--transition-smooth);
}

.author-avatar-wrapper::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid var(--color-white);
  border-radius: 50%;
  pointer-events: none;
}

.author-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text-dark);
  line-height: 1.2;
}

.author-title {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.articles-action {
  text-align: center;
  margin-top: 4rem;
}

/* Card Hover Animations */
.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(197, 168, 128, 0.12);
  border-color: var(--color-accent-gold);
}

.article-card:hover .article-card-image {
  transform: scale(1.05);
  filter: brightness(1);
}

.article-card:hover .author-avatar-wrapper {
  transform: scale(1.08) rotate(5deg);
  border-color: var(--color-accent-gold-bright);
  box-shadow: 0 0 15px rgba(197, 168, 128, 0.4);
}

.article-card:hover .article-card-title a {
  color: var(--color-accent-gold-bright);
}

/* Stretched Link Pattern to make cards fully clickable */
.practice-card-link::after,
.article-card-title a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
}

/* Full Article Page & Listing Styles */
.articles-header {
  padding: 8rem 0 4rem;
  background-color: var(--color-primary);
  background-image: linear-gradient(135deg, var(--color-primary) 0%, var(--color-bg-dark) 100%);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-white);
}

.articles-header .section-subtitle {
  color: var(--color-accent-gold-bright);
}

.articles-header h1 {
  font-size: 3rem;
  font-family: var(--font-en-head);
  letter-spacing: 1px;
  margin-top: 0.5rem;
  color: var(--color-white);
}

body.lang-he .articles-header h1 {
  font-family: var(--font-he);
  font-weight: 800;
  letter-spacing: 0;
}

.article-page-body {
  padding: 5rem 0;
  background-color: var(--color-bg-light);
}

.article-detail-wrapper {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.03);
}

.article-detail-hero {
  width: 100%;
  height: 400px;
  overflow: hidden;
  position: relative;
}

.article-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-detail-content {
  padding: 4rem 3.5rem;
}

body.lang-he .article-detail-content {
  text-align: right;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.article-detail-meta .article-badge {
  position: static;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.article-detail-title {
  font-size: 2.2rem;
  color: var(--color-text-dark);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 2rem;
}

.article-detail-author-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background-color: var(--color-bg-light);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
  margin-bottom: 3rem;
}

.article-detail-author-box .author-avatar-wrapper {
  width: 52px;
  height: 52px;
}

.article-body-text {
  font-size: 1.12rem;
  color: var(--color-text-dark);
  line-height: 1.85;
}

.article-body-text p {
  margin-bottom: 1.5rem;
}

.article-body-text h2 {
  font-size: 1.6rem;
  color: var(--color-primary);
  margin: 2.5rem 0 1.25rem;
  font-weight: 700;
  border-bottom: 2px solid var(--color-accent-gold);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.article-body-text ul, .article-body-text ol {
  margin-bottom: 1.5rem;
  margin-inline-start: 1.5rem;
}

.article-body-text li {
  margin-bottom: 0.5rem;
}

.article-detail-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(197, 168, 128, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Responsive Rules for Articles */
@media (max-width: 992px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .article-detail-hero {
    height: 300px;
  }
  
  .article-detail-content {
    padding: 3rem 2rem;
  }
}

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .articles-header h1 {
    font-size: 2.2rem;
  }
  
  .article-detail-title {
    font-size: 1.8rem;
  }
}

/* ==========================================================================
   Articles Carousel / Horizontal Slider Styling (Homepage)
   ========================================================================== */

.articles-slider-wrapper {
  position: relative;
  width: 100%;
  margin-top: 3.5rem;
  display: flex;
  align-items: center;
}

.articles-slider-container {
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 1.5rem 0.5rem; /* Room for card shadows */
  margin: -1.5rem -0.5rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.articles-slider-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.articles-slider-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
}

/* Fixed card sizes inside the horizontal slider */
.articles-slider-track .article-card {
  width: 360px;
  min-width: 360px;
  scroll-snap-align: start;
}

/* Slider Navigation Arrows */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transition: var(--transition-fast);
}

.slider-arrow svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.slider-arrow:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 10px 30px rgba(7, 12, 30, 0.2);
}

/* LTR defaults */
.slider-arrow-prev {
  left: -24px;
}
.slider-arrow-next {
  right: -24px;
}

/* RTL layout overrides */
body.lang-he .slider-arrow-prev {
  right: -24px;
  left: auto;
}
body.lang-he .slider-arrow-next {
  left: -24px;
  right: auto;
}

/* Rotate chevron icons in RTL mode */
body.lang-he .slider-arrow-prev svg {
  transform: rotate(180deg);
}
body.lang-he .slider-arrow-next svg {
  transform: rotate(180deg);
}

/* Responsive Overrides */
@media (max-width: 1240px) {
  .slider-arrow-prev {
    left: 10px;
  }
  .slider-arrow-next {
    right: 10px;
  }
  body.lang-he .slider-arrow-prev {
    right: 10px;
    left: auto;
  }
  body.lang-he .slider-arrow-next {
    left: 10px;
    right: auto;
  }
}

@media (max-width: 768px) {
  .articles-slider-track {
    gap: 1.5rem;
  }
  .articles-slider-track .article-card {
    width: 290px;
    min-width: 290px;
  }
  .slider-arrow {
    display: none; /* Rely on native swipe on mobile viewports */
  }
}

/* ==========================================================================
   Practice Pages: Related Articles Section
   ========================================================================== */

.related-articles-section {
  margin-top: 4rem;
  border-top: 1px solid rgba(197, 168, 128, 0.15);
  padding-top: 3.5rem;
}

.related-articles-title {
  font-size: 1.65rem;
  color: var(--color-text-dark);
  margin-bottom: 2.5rem;
  text-align: center;
  font-weight: 700;
  position: relative;
}

body.lang-en .related-articles-title {
  font-family: var(--font-en-head);
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.related-articles-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background-color: var(--color-accent-gold);
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

.related-articles-grid .article-card {
  width: 100%;
  min-width: 0; /* Let grid system control size */
}

@media (max-width: 820px) {
  .related-articles-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ==========================================================================
   Transaction Cost Calculators (calculators/* sub-pages)
   Built entirely on the site's design tokens — navy / gold, no foreign colours.
   ========================================================================== */
.txcalc-hero {
  padding: 10rem 0 4rem;
  background-color: var(--color-primary);
  background-image: linear-gradient(135deg, var(--color-primary) 0%, var(--color-bg-dark) 100%);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-white);
}
.txcalc-hero h1 {
  font-size: 2.6rem;
  color: var(--color-white);
  margin-top: 0.5rem;
  font-weight: 800;
}
.txcalc-hero .txcalc-hero-sub {
  display: block;
  max-width: 760px;
  margin: 1rem auto 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
}
.txcalc-breadcrumb {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
}
.txcalc-breadcrumb a { color: var(--color-accent-gold); }
.txcalc-breadcrumb a:hover { color: var(--color-accent-gold-bright); }
.txcalc-breadcrumb .sep { margin: 0 0.5rem; opacity: 0.5; }

.txcalc-body {
  padding: 4rem 0 5rem;
  background-color: var(--color-bg-light);
}
.txcalc-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-accent-gold);
  font-weight: 600;
  margin-bottom: 2rem;
}
.txcalc-back:hover { color: var(--color-primary); }

/* Two-column layout: inputs | summary */
.txcalc-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: start;
}
.txcalc-card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 1.4rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.03);
}

/* Frame each input component as its own card for clear separation.
   Functionality inside each block (fee %↔₪ toggle, icons, collapses) is untouched. */
.txcalc-card > .txcalc-field,
.txcalc-card > .txcalc-slider,
.txcalc-card > .txcalc-block,
.txcalc-card > .txcalc-govfees,
.txcalc-card > .txcalc-index {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 14px rgba(10, 17, 40, 0.04);
  margin-bottom: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.txcalc-card > .txcalc-field,
.txcalc-card > .txcalc-slider,
.txcalc-card > .txcalc-block,
.txcalc-card > .txcalc-index {
  padding: 1.3rem;
}
.txcalc-card > .txcalc-field:focus-within,
.txcalc-card > .txcalc-slider:focus-within,
.txcalc-card > .txcalc-block:focus-within,
.txcalc-card > .txcalc-index:focus-within,
.txcalc-card > .txcalc-field:hover,
.txcalc-card > .txcalc-slider:hover,
.txcalc-card > .txcalc-block:hover,
.txcalc-card > .txcalc-govfees:hover,
.txcalc-card > .txcalc-index:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 6px 20px rgba(10, 17, 40, 0.06);
}
.txcalc-card > *:last-child { margin-bottom: 0; }

/* Mortgage block: group heading + toggles cleanly inside one card */
.txcalc-block > .txcalc-section-title {
  margin: 0 0 1rem;
  padding-top: 0;
  border-top: none;
}
.txcalc-block > *:last-child { margin-bottom: 0; }

/* Fields */
.txcalc-field { margin-bottom: 1.8rem; }
.txcalc-field-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
  color: var(--color-text-dark);
}
.txcalc-input {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-bg-light);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--border-radius-sm);
  padding: 0.25rem 1rem;
  transition: var(--transition-fast);
}
.txcalc-input:focus-within {
  border-color: var(--color-accent-gold);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}
.txcalc-input .sym {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-accent-gold);
}
.txcalc-input input,
.txcalc-input select {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.7rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-dark);
  outline: none;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
body.lang-he .txcalc-input .sym { order: 2; }
body.lang-he .txcalc-input input { order: 1; }
body.lang-en .txcalc-input .sym { order: 1; }
body.lang-en .txcalc-input input { order: 2; }
.txcalc-input.sym-end .sym { order: 2; }       /* % symbol after the field both langs */
.txcalc-input--sm input { font-size: 1rem; padding: 0.5rem 0; }

/* Primary field — the deal price is the central figure of the transaction,
   so it gets a larger, gold-tinted treatment that stands apart from the
   secondary cost inputs. */
.txcalc-card > .txcalc-field.txcalc-field--primary {
  background: linear-gradient(135deg, rgba(229, 196, 148, 0.12), rgba(197, 168, 128, 0.04));
  border-color: var(--color-border-hover);
  box-shadow: 0 8px 26px rgba(143, 114, 76, 0.10);
  padding: 1.7rem 1.6rem;
}
.txcalc-card > .txcalc-field.txcalc-field--primary:hover,
.txcalc-card > .txcalc-field.txcalc-field--primary:focus-within {
  box-shadow: 0 10px 30px rgba(143, 114, 76, 0.16);
}
.txcalc-field--primary .txcalc-field-label {
  font-size: 1.08rem;
  margin-bottom: 0.85rem;
}
.txcalc-field--primary .txcalc-input {
  background-color: var(--color-white);
  border-color: var(--color-border-hover);
  border-radius: var(--border-radius-md);
  padding: 0.45rem 1.2rem;
}
.txcalc-field--primary .txcalc-input .sym {
  font-size: 1.7rem;
}
.txcalc-field--primary .txcalc-input input {
  font-size: 2.1rem;
  font-weight: 700;
  padding: 0.55rem 0;
  letter-spacing: 0.3px;
}

.txcalc-select {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: var(--color-bg-light);
  border-radius: var(--border-radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-dark);
  font-family: inherit;
  cursor: pointer;
}
.txcalc-select:focus-visible { outline: 2px solid var(--color-accent-gold); }

/* Help tooltip (bilingual bubble, tap-friendly) */
.txcalc-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: rgba(197, 168, 128, 0.18);
  color: var(--color-gold-dark);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.txcalc-tip:hover, .txcalc-tip:focus-visible {
  background-color: var(--color-accent-gold);
  color: var(--color-white);
  outline: none;
}
.txcalc-tip-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-start: 50%;
  transform: translateX(50%);
  width: max-content;
  max-width: 250px;
  background: var(--color-primary);
  color: var(--color-text-light);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: start;
  padding: 0.7rem 0.9rem;
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 30;
  pointer-events: none;
}
body.lang-en .txcalc-tip-bubble { transform: translateX(-50%); }
.txcalc-tip:hover .txcalc-tip-bubble,
.txcalc-tip:focus-within .txcalc-tip-bubble,
.txcalc-tip.open .txcalc-tip-bubble { display: block; }

/* Buyer-type radio cards reuse .calc-radio-card; this is a 4-up grid */
.txcalc-buyer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

/* Slider rows */
.txcalc-slider { margin-bottom: 1.8rem; }
.txcalc-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.txcalc-slider-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-dark);
}
.txcalc-slider-controls { display: flex; align-items: center; gap: 0.6rem; }
.txcalc-fee-value {
  min-width: 52px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-gold-dark);
  background: rgba(197, 168, 128, 0.1);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  padding: 0.3rem 0.5rem;
  font-family: inherit;
}
input.txcalc-fee-value { cursor: pointer; }
input.txcalc-fee-value.editing {
  background: var(--color-white);
  border-color: var(--color-accent-gold);
  cursor: text;
}
.txcalc-feemode {
  display: inline-flex;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.18rem;
  gap: 0.18rem;
}
.txcalc-feemode button {
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
}
.txcalc-feemode button.active {
  background: var(--color-accent-gold);
  color: var(--color-white);
}
.txcalc-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--color-border);
}
.txcalc-mini > div { display: flex; flex-direction: column; gap: 0.15rem; }
.txcalc-mini span:first-child { font-size: 0.72rem; color: var(--color-text-muted); }
.txcalc-mini span:last-child { font-size: 0.9rem; font-weight: 700; color: var(--color-text-dark); font-variant-numeric: tabular-nums; }

/* Collapsible government-fees card */
.txcalc-govfees {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  margin-bottom: 1.8rem;
  overflow: visible;
}
.txcalc-govfees-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  background: var(--color-bg-light);
  border-top-left-radius: var(--border-radius-md);
  border-top-right-radius: var(--border-radius-md);
}
.txcalc-govfees.collapsed .txcalc-govfees-head {
  border-bottom-left-radius: var(--border-radius-md);
  border-bottom-right-radius: var(--border-radius-md);
}
.txcalc-govfees-head .ttl {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-text-dark);
}
.txcalc-govfees-badge {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-gold-dark);
  font-variant-numeric: tabular-nums;
}
.txcalc-govfees-caret {
  margin-inline-start: auto;
  transition: transform 0.3s ease;
  color: var(--color-text-muted);
}
.txcalc-govfees.collapsed .txcalc-govfees-body { display: none; }
.txcalc-govfees:not(.collapsed) .txcalc-govfees-caret { transform: rotate(180deg); }
.txcalc-govfees-body { padding: 0.5rem 1.2rem 1.2rem; }
.txcalc-govfees-desc { font-size: 0.8rem; color: var(--color-text-muted); margin: 0.5rem 0 0.9rem; }
.txcalc-feecheck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  font-size: 0.88rem;
}
.txcalc-feecheck:last-of-type { border-bottom: none; }
.txcalc-feecheck .lbl { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--color-text-dark); }
.txcalc-feecheck input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-accent-gold); cursor: pointer; }
.txcalc-feecheck .price { font-weight: 700; color: var(--color-text-dark); font-variant-numeric: tabular-nums; }
.txcalc-govfees-note {
  margin-top: 0.9rem;
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  background: rgba(197, 168, 128, 0.07);
  border-radius: var(--border-radius-sm);
  padding: 0.7rem 0.85rem;
}
.txcalc-extlink { color: var(--color-gold-dark); font-weight: 600; font-size: 0.8rem; }
.txcalc-extlink:hover { color: var(--color-accent-gold); }

/* Toggle switches & sub-fields */
.txcalc-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-gold-dark);
  margin: 1.8rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.txcalc-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.txcalc-toggle-text { display: flex; flex-direction: column; gap: 0.2rem; }
.txcalc-toggle-text .nm { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.9rem; color: var(--color-text-dark); }
.txcalc-toggle-text .sub { font-size: 0.78rem; color: var(--color-text-muted); }
.txcalc-switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.txcalc-switch input { opacity: 0; width: 0; height: 0; }
.txcalc-switch .track {
  position: absolute;
  inset: 0;
  background: #cfd4da;
  border-radius: 999px;
  transition: var(--transition-fast);
}
.txcalc-switch .track::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  inset-inline-start: 3px;
  top: 3px;
  background: var(--color-white);
  border-radius: 50%;
  transition: var(--transition-fast);
}
.txcalc-switch input:checked + .track { background: var(--color-accent-gold); }
.txcalc-switch input:checked + .track::before { inset-inline-start: 23px; }
.txcalc-switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.35); }
.txcalc-subfield {
  margin: 0.5rem 0 1rem;
  padding-inline-start: 1rem;
  border-inline-start: 2px solid var(--color-accent-gold);
}
.txcalc-subfield label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 0.4rem; }

/* Index-linkage panel (Amendment 9) */
.txcalc-index {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 1.2rem;
  margin-bottom: 1.8rem;
  background: rgba(197, 168, 128, 0.04);
}
.txcalc-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.txcalc-index-head .ttl { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.95rem; font-weight: 700; color: var(--color-text-dark); }
.txcalc-index-state { display: flex; align-items: center; gap: 0.6rem; }
.txcalc-index-state .lbl { font-size: 0.78rem; font-weight: 500; color: var(--color-text-muted); }
.txcalc-index-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-bottom: 0.9rem; }
.txcalc-index-result {
  margin-top: 0.4rem;
  padding: 0.8rem 1rem;
  border: 1px dashed var(--color-accent-gold);
  border-radius: var(--border-radius-sm);
  background: var(--color-white);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--color-text-dark);
}
.txcalc-index-result b { font-variant-numeric: tabular-nums; }
.txcalc-index-result .accent { color: var(--color-gold-dark); }

.txcalc-warning {
  margin: 0.9rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-sm);
  background: rgba(197, 168, 128, 0.12);
  border: 1px solid var(--color-border-hover);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text-dark);
}
.txcalc-status { font-size: 0.85rem; font-weight: 700; }
.txcalc-status.is-ok { color: #2E7D32; }
.txcalc-status.is-warning { color: var(--color-gold-dark); }

/* Summary panel */
.txcalc-summary { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 1.5rem; }
.txcalc-summary-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.03);
}
.txcalc-table { width: 100%; border-collapse: collapse; }
.txcalc-table th {
  text-align: start;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--color-border);
}
.txcalc-table th:last-child, .txcalc-table td:last-child { text-align: end; white-space: nowrap; }
.txcalc-table td {
  padding: 0.7rem 0;
  font-size: 0.9rem;
  color: var(--color-text-dark);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-variant-numeric: tabular-nums;
}
.txcalc-table td:first-child { display: flex; align-items: center; gap: 0.4rem; }
.txcalc-table tr.total-row td {
  font-weight: 800;
  color: var(--color-primary);
  border-top: 2px solid var(--color-accent-gold);
  border-bottom: none;
  padding-top: 0.9rem;
}
.txcalc-brackets {
  margin-top: 1.2rem;
  padding: 1rem;
  background: var(--color-bg-light);
  border-radius: var(--border-radius-sm);
}
.txcalc-brackets-title { font-size: 0.82rem; font-weight: 700; color: var(--color-gold-dark); margin-bottom: 0.6rem; }
.txcalc-bracket-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 0.3rem 0;
  font-variant-numeric: tabular-nums;
}
.txcalc-bracket-row.taxable { color: var(--color-text-dark); font-weight: 600; }
.txcalc-grandtotal {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-radius: var(--border-radius-md);
  padding: 1.5rem 1.8rem;
  text-align: center;
  color: var(--color-white);
}
.txcalc-grandtotal .lbl { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); margin-bottom: 0.4rem; }
.txcalc-grandtotal .val { font-size: 2.1rem; font-weight: 800; color: var(--color-accent-gold-bright); font-variant-numeric: tabular-nums; }

/* Donut */
.txcalc-donut-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.03);
  text-align: center;
}
.txcalc-donut-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--color-text-dark); margin-bottom: 1.2rem; }
.txcalc-donut { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.txcalc-donut svg { transform: rotate(-90deg); }
.txcalc-ring-bg { stroke: rgba(10, 17, 40, 0.08); }
.txcalc-ring-fg { stroke: var(--color-accent-gold); transition: stroke-dashoffset 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.txcalc-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.txcalc-donut-center span:first-child { font-size: 0.78rem; color: var(--color-text-muted); }
.txcalc-donut-center span:last-child { font-size: 1.6rem; font-weight: 800; color: var(--color-primary); font-variant-numeric: tabular-nums; }
.txcalc-chart-tooltip {
  position: absolute;
  display: none;
  background: var(--color-primary);
  color: var(--color-text-light);
  font-size: 0.74rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--border-radius-sm);
  pointer-events: none;
  transform: translate(-50%, -130%);
  white-space: nowrap;
  z-index: 5;
}
.txcalc-chart-tooltip.visible { display: block; }
.txcalc-legend { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.2rem; }
.txcalc-legend > div { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; color: var(--color-text-muted); }
.txcalc-legend .dot { width: 12px; height: 12px; border-radius: 50%; }
.txcalc-legend .dot.fg { background: var(--color-accent-gold); }
.txcalc-legend .dot.bg { background: rgba(10, 17, 40, 0.12); }

/* Client-meta card, toolbar, CTA, disclaimer */
.txcalc-meta-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  margin-top: 2.5rem;
  overflow: hidden;
}
.txcalc-meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-text-dark);
}
.txcalc-meta-head .caret { transition: transform 0.3s ease; color: var(--color-text-muted); }
.txcalc-meta-card.collapsed .txcalc-meta-body { display: none; }
.txcalc-meta-card:not(.collapsed) .txcalc-meta-head .caret { transform: rotate(180deg); }
.txcalc-meta-body { padding: 0 1.5rem 1.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.txcalc-meta-body label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 0.4rem; }
.txcalc-meta-body input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--color-bg-light);
  border-radius: var(--border-radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--color-text-dark);
}
.txcalc-meta-body input:focus-visible { outline: none; border-color: var(--color-accent-gold); box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15); }

.txcalc-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 2rem; }
.txcalc-toolbar .btn { display: inline-flex; align-items: center; gap: 0.5rem; }

.txcalc-cta {
  margin-top: 2.5rem;
  padding: 2.2rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  text-align: center;
}
.txcalc-cta h3 { font-size: 1.35rem; color: var(--color-text-dark); margin-bottom: 0.7rem; }
.txcalc-cta p { color: var(--color-text-muted); margin-bottom: 1.5rem; max-width: 620px; margin-inline: auto; }
.txcalc-cta-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.txcalc-disclaimer {
  margin-top: 2rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 1.2rem 1.4rem;
}
.txcalc-disclaimer strong { color: var(--color-text-dark); }

/* Related-guides block on calculator pages */
.txcalc-related {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
}
.txcalc-related h3 { font-size: 1.1rem; color: var(--color-text-dark); margin-bottom: 1.2rem; }
.txcalc-related-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.txcalc-related-links a {
  display: block;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-dark);
  transition: var(--transition-fast);
}
.txcalc-related-links a:hover {
  border-color: var(--color-accent-gold);
  background: rgba(197, 168, 128, 0.05);
  color: var(--color-gold-dark);
}
@media (max-width: 768px) { .txcalc-related-links { grid-template-columns: 1fr; } }

/* Responsive */
@media (max-width: 992px) {
  .txcalc-layout { grid-template-columns: 1fr; gap: 2rem; }
  .txcalc-summary { position: static; }
}
@media (max-width: 768px) {
  .txcalc-hero { padding: 8rem 0 3rem; }
  .txcalc-hero h1 { font-size: 1.9rem; }
  /* Prevent horizontal overflow on narrow screens: let the single-column grid
     and its flex children shrink below their content's intrinsic min-width
     (default `min-width: auto`), which otherwise forces the layout wider than
     the viewport and shifts the whole RTL page sideways. */
  .txcalc-card, .txcalc-summary, .txcalc-summary-card, .txcalc-donut-card { min-width: 0; }
  /* The fee value only ever shows a short percentage — stop the text input
     from claiming its ~180px default width and blowing out the slider row. */
  .txcalc-fee-value { width: 4.25rem; min-width: 0; flex: 0 0 auto; }
  .txcalc-summary-card, .txcalc-donut-card { padding: 1.5rem; }
  .txcalc-card { padding: 0.9rem; }
  .txcalc-card > .txcalc-field,
  .txcalc-card > .txcalc-slider,
  .txcalc-card > .txcalc-block,
  .txcalc-card > .txcalc-index { padding: 1.1rem; }
  .txcalc-meta-body { grid-template-columns: 1fr; }
  .txcalc-index-grid { grid-template-columns: 1fr; }
  .txcalc-table { font-size: 0.85rem; }
  /* Larger touch targets */
  .txcalc-feemode button { width: 38px; height: 34px; }
  .txcalc-tip { width: 22px; height: 22px; }
  .txcalc-input input, .txcalc-input select { padding: 0.85rem 0; }
  .txcalc-card > .txcalc-field.txcalc-field--primary { padding: 1.3rem; }
  .txcalc-field--primary .txcalc-input input { font-size: 1.7rem; }
  .txcalc-field--primary .txcalc-input .sym { font-size: 1.4rem; }
}
@media (max-width: 380px) {
  .txcalc-buyer-grid { grid-template-columns: 1fr; }
  .txcalc-mini { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ==========================================================================
   Floating WhatsApp Contact Button
   Injected on every page by js/main.js (.whatsapp-float).
   Mirrors automatically for RTL/LTR via logical inset-inline-end:
   bottom-left in Hebrew, bottom-right in English.
   ========================================================================== */
:root {
  --wa-green: #25D366;
  --wa-green-dark: #1EBE57;
  --wa-size: 60px;
}

.whatsapp-float {
  position: fixed;
  inset-block-end: 26px;
  inset-inline-end: 26px;
  z-index: 990; /* above page content, below header(1000)/drawer(1050)/overlays */
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  /* enter animation */
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  animation: wa-enter 0.5s cubic-bezier(0.25, 1, 0.5, 1) 1.1s forwards;
}

@keyframes wa-enter {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* The circular action button */
.whatsapp-float__btn {
  position: relative;
  flex: 0 0 auto;
  width: var(--wa-size);
  height: var(--wa-size);
  border-radius: 50%;
  background: linear-gradient(145deg, #2BE96E, var(--wa-green-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.42),
              0 4px 10px rgba(10, 17, 40, 0.25);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
              box-shadow 0.3s ease;
  z-index: 2;
}

.whatsapp-float__btn svg {
  width: 56%;
  height: 56%;
  display: block;
}

/* Gentle attention pulse ring (very subtle) */
.whatsapp-float__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wa-green);
  z-index: -1;
  animation: wa-pulse 2.4s ease-out infinite;
}

@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Sliding label (revealed on hover / focus on desktop) */
.whatsapp-float__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  background: var(--color-white);
  color: var(--color-primary);
  font-family: var(--font-he);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(10, 17, 40, 0.18);
  /* tucked behind the button, slides out toward the page center */
  padding: 0;
  margin-inline-end: -30px;
  padding-inline-end: 30px;
  transition: max-width 0.45s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.3s ease,
              padding 0.45s ease;
}

body.lang-en .whatsapp-float__label { font-family: var(--font-en-body); }

.whatsapp-float:hover .whatsapp-float__label,
.whatsapp-float:focus-visible .whatsapp-float__label {
  max-width: 320px;
  opacity: 1;
  padding-block: 12px;
  padding-inline-start: 18px;
}

.whatsapp-float:hover .whatsapp-float__btn {
  transform: scale(1.06);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.55),
              0 5px 12px rgba(10, 17, 40, 0.3);
}

.whatsapp-float:hover .whatsapp-float__btn::before { animation: none; opacity: 0; }

.whatsapp-float:focus-visible { outline: none; }
.whatsapp-float:focus-visible .whatsapp-float__btn {
  box-shadow: 0 0 0 3px var(--color-white),
              0 0 0 6px var(--wa-green-dark),
              0 8px 22px rgba(37, 211, 102, 0.42);
}

/* One-time greeting tooltip bubble */
.whatsapp-tooltip {
  position: fixed;
  inset-block-end: calc(26px + var(--wa-size) + 16px);
  inset-inline-end: 26px;
  z-index: 991;
  max-width: 250px;
  background: var(--color-white);
  color: var(--color-text-dark);
  font-family: var(--font-he);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 14px 38px 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  box-shadow: 0 14px 34px rgba(10, 17, 40, 0.22);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

body.lang-en .whatsapp-tooltip {
  font-family: var(--font-en-body);
  padding: 14px 16px 14px 38px;
}

.whatsapp-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.whatsapp-tooltip__text { display: block; }
.whatsapp-tooltip__text strong { color: var(--color-gold-dark); font-weight: 700; }

/* little pointer triangle toward the button */
.whatsapp-tooltip::after {
  content: "";
  position: absolute;
  inset-block-end: -7px;
  inset-inline-end: calc(var(--wa-size) / 2 + 26px - 7px);
  width: 14px;
  height: 14px;
  background: var(--color-white);
  border-inline-end: 1px solid var(--color-border);
  border-block-end: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.whatsapp-tooltip__close {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 8px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
}
body.lang-en .whatsapp-tooltip__close { inset-inline-end: auto; inset-inline-start: 8px; }
.whatsapp-tooltip__close:hover { background: var(--color-bg-light); color: var(--color-primary); }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float { animation: none; opacity: 1; transform: none; }
  .whatsapp-float__btn::before { animation: none; opacity: 0; }
  .whatsapp-tooltip { transition: opacity 0.3s ease; transform: none; }
}

/* Tablet / mobile: slightly smaller, label hidden (tooltip carries the message) */
@media (max-width: 768px) {
  :root { --wa-size: 56px; }
  .whatsapp-float { inset-block-end: 20px; inset-inline-end: 18px; }
  .whatsapp-float__label { display: none; }
  .whatsapp-tooltip { inset-inline-end: 18px; inset-block-end: calc(20px + var(--wa-size) + 14px); }
  .whatsapp-tooltip::after { inset-inline-end: calc(var(--wa-size) / 2 + 18px - 7px); }
}

/* ==========================================================================
   Mobile Readability Pass (typography audit)
   Reading text >= 16px, results/data >= ~15px, labels >= 12.5px, and all
   form controls >= 16px so iOS Safari never auto-zooms on focus.
   Everything stays in rem so user font-size preferences are respected.
   ========================================================================== */
@media (max-width: 768px) {
  /* Card descriptions are real reading text -> full 16px */
  .practice-card-desc,
  .article-card-desc,
  .footer-link,
  .footer-logo-desc,
  .success-sub {
    font-size: 1rem;
  }

  /* Long-form article body: 17px reads noticeably better in Hebrew */
  .article-detail-content {
    font-size: 1.0625rem;
  }

  /* Homepage tax simulator results — core feature, was 13.6px */
  .breakdown-item {
    font-size: 0.95rem;
  }
  .breakdown-title {
    font-size: 0.95rem;
  }

  /* Standalone calculators: results table was 13.6px on mobile */
  .txcalc-table {
    font-size: 0.92rem;
  }
  .txcalc-table th {
    font-size: 0.8rem;
  }

  /* Stats band labels under the big numbers */
  .stat-label {
    font-size: 0.95rem;
  }

  /* Drawer language section: label was 11.5px; options match nav links */
  .nav-menu-lang__label {
    font-size: 0.78rem;
  }
  .nav-menu-lang__opt,
  .nav-dropdown-link {
    font-size: 1rem;
  }

  /* Legal fine print: keep small but never below ~12.8px */
  .calc-disclaimer {
    font-size: 0.8rem;
  }

  /* iOS auto-zoom guard: any focusable control below 16px triggers zoom.
     These two were 14.4px / 15.2px on the calculator pages. */
  .txcalc-select,
  .txcalc-meta-body input {
    font-size: 1rem;
  }

  /* Micro-labels/tooltips were 11.5px — keep all text at the 12px floor */
  .txcalc-tip,
  .txcalc-mini span:first-child,
  .txcalc-chart-tooltip {
    font-size: 0.75rem;
  }
}
