/*
Theme Name: Vista Website Design
Theme URI: https://vistawebsitedesign.com
Author: Vista Website Design
Author URI: https://vistawebsitedesign.com
Description: A lightweight, Elementor-optimized theme for Vista Website Design. Features a built-in responsive WordPress menu with dropdown support, dark/green branding, and zero conflicts with Elementor page building.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vista-theme
Tags: one-page, custom-colors, custom-logo, dark, modern, elementor
*/

/* ========== VARIABLES ========== */
:root {
  --green: #7AC143;
  --green-dark: #5A9A2F;
  --green-light: #8FD45A;
  --green-glow: rgba(122, 193, 67, 0.15);
  --black: #0A0A0A;
  --black-light: #111111;
  --black-card: #161616;
  --black-border: #222222;
  --white: #FFFFFF;
  --gray: #999999;
  --gray-light: #CCCCCC;
  --gray-dark: #666666;
  --cream: #F7F5F0;
  --cream-border: #DDD8CC;
  --charcoal: #2A2A2A;
  --charcoal-light: #555555;
}

/* ========== RESET ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ========== NAVBAR ========== */
.vista-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: all 0.4s ease;
}
.vista-header.scrolled {
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--black-border);
}
.vista-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  position: relative;
}

/* Logo — large, overhanging */
.vista-logo {
  flex-shrink: 0; line-height: 0;
  position: relative; z-index: 2;
}
.vista-logo a { display: inline-block; line-height: 0; }
.vista-logo img,
.vista-logo .custom-logo-link img,
.vista-logo .custom-logo {
  height: 130px; width: auto; max-width: 260px;
  object-fit: contain; transition: height 0.4s ease;
  margin-top: 8px;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.4));
}
.vista-header.scrolled .vista-logo img,
.vista-header.scrolled .vista-logo .custom-logo-link img,
.vista-header.scrolled .vista-logo .custom-logo {
  height: 64px; margin-top: 0;
}

/* Nav Menu */
.vista-nav { display: flex; align-items: center; }
.vista-nav ul {
  display: flex; align-items: center; gap: 28px;
  list-style: none; margin: 0; padding: 0;
}
.vista-nav ul li { position: relative; }
.vista-nav ul li a {
  color: var(--gray-light); font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 500; letter-spacing: 0.3px;
  transition: color 0.3s; position: relative; padding: 8px 0;
  display: inline-block;
}
.vista-nav ul li a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px; background: var(--green);
  transition: width 0.3s;
}
.vista-nav ul li a:hover { color: var(--white); }
.vista-nav ul li a:hover::after { width: 100%; }

/* Active page */
.vista-nav ul li.current-menu-item > a,
.vista-nav ul li.current_page_item > a,
.vista-nav ul li.current-menu-ancestor > a {
  color: var(--white);
}
.vista-nav ul li.current-menu-item > a::after,
.vista-nav ul li.current_page_item > a::after {
  width: 100%;
}

/* Dropdown */
.vista-nav ul li.menu-item-has-children > a::before {
  content: '';
  display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 6px; vertical-align: middle;
  transition: transform 0.3s;
}
.vista-nav ul li.menu-item-has-children:hover > a::before {
  transform: rotate(180deg);
}
/* Invisible bridge to maintain hover between link and dropdown */
.vista-nav ul li.menu-item-has-children {
  padding-bottom: 0;
}
.vista-nav ul li.menu-item-has-children::after {
  content: '';
  position: absolute;
  top: 100%; left: -16px; right: -16px;
  height: 20px;
  background: transparent;
  pointer-events: none;
}
.vista-nav ul li.menu-item-has-children:hover::after {
  pointer-events: auto;
}
.vista-nav ul .sub-menu {
  display: none; position: absolute; top: 100%; left: -16px;
  margin-top: 18px;
  background: rgba(16,16,16,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--black-border);
  border-radius: 12px; padding: 10px 0;
  min-width: 240px; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 100; list-style: none;
}
.vista-nav ul li.menu-item-has-children:hover > .sub-menu {
  display: flex;
}
/* Keep dropdown open while hovering over it */
.vista-nav ul .sub-menu:hover {
  display: flex;
}
.vista-nav ul .sub-menu li { padding: 0; }
.vista-nav ul .sub-menu li a {
  display: block; padding: 11px 24px; font-size: 14px;
  color: var(--gray-light); white-space: nowrap;
  transition: all 0.2s;
}
.vista-nav ul .sub-menu li a::after { display: none; }
.vista-nav ul .sub-menu li a:hover {
  color: var(--green-light);
  background: rgba(122,193,67,0.07);
}
.vista-nav ul .sub-menu li.current-menu-item a {
  color: var(--green);
}

/* CTA Button in nav — auto-applied to "Book a Call" items */
.vista-nav ul li.vista-cta-item > a {
  background: var(--green) !important;
  color: var(--black) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  padding: 9px 22px !important;
  border-radius: 8px;
  transition: all 0.3s !important;
}
.vista-nav ul li.vista-cta-item > a::after { display: none !important; }
.vista-nav ul li.vista-cta-item > a::before { display: none !important; }
.vista-nav ul li.vista-cta-item > a:hover {
  background: var(--green-light) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(122,193,67,0.3);
}

/* Hamburger */
.vista-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; background: none; border: none; padding: 8px; z-index: 10001;
}
.vista-hamburger span {
  width: 28px; height: 2px; background: var(--white);
  transition: all 0.3s; border-radius: 2px;
}
.vista-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.vista-hamburger.open span:nth-child(2) { opacity: 0; }
.vista-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  .vista-header-inner { padding: 0 20px; min-height: 70px; }
  .vista-logo img,
  .vista-logo .custom-logo-link img,
  .vista-logo .custom-logo {
    height: 78px; margin-top: 4px;
  }
  .vista-hamburger { display: flex; }
  .vista-nav {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,10,10,0.98);
    justify-content: center; align-items: center;
    z-index: 10000;
  }
  .vista-nav.open { display: flex; }
  .vista-nav ul {
    flex-direction: column; gap: 24px; text-align: center;
  }
  .vista-nav ul li a { font-size: 22px; }
  .vista-nav ul .sub-menu {
    position: static; display: flex;
    background: transparent; border: none; box-shadow: none;
    padding: 8px 0 0 0; min-width: auto;
  }
  .vista-nav ul .sub-menu li a {
    font-size: 17px; padding: 8px 0; color: var(--gray);
  }
}

/* ========== BODY OFFSET FOR FIXED HEADER ========== */
body:not(.elementor-template-canvas) {
  padding-top: 80px;
}
@media (max-width: 768px) {
  body:not(.elementor-template-canvas) {
    padding-top: 70px;
  }
}

/* ========== ELEMENTOR CANVAS — NO HEADER ========== */
body.elementor-template-canvas .vista-header { display: none; }

/* ========== GRAIN OVERLAY ========== */
body::after {
  content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 99999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.03;
}
