/*
Theme Name: Mortgage Oakville
Theme URI: https://mortgageoakville.com
Author: Mortgage Oakville Team
Author URI: https://mortgageoakville.com
Description: A professional mortgage broker theme for Oakville, Ontario. Features modern design, responsive layouts, and Elementor compatibility.
Version: 1.0.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mortgage-oakville
Tags: mortgage, real-estate, business, elementor, responsive, custom-colors, custom-menu

Mortgage Oakville WordPress Theme
Designed for easy migration from React/Vite to WordPress/Elementor
*/

/* ==========================================================================
   CSS Variables - Design Tokens
   ========================================================================== */

:root {
  /* Primary Colors */
  --primary: 215 50% 23%;
  --primary-foreground: 0 0% 100%;
  
  /* Accent/Gold Colors */
  --accent: 45 93% 47%;
  --accent-foreground: 215 50% 23%;
  
  /* Background Colors */
  --background: 0 0% 100%;
  --foreground: 222 47% 11%;
  
  /* Secondary Colors */
  --secondary: 210 40% 96%;
  --secondary-foreground: 222 47% 11%;
  
  /* Muted Colors */
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  
  /* Card Colors */
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  
  /* Border & Input */
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 215 50% 23%;
  
  /* Destructive */
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  
  /* Border Radius */
  --radius: 0.5rem;
  
  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* ========== CUSTOMIZABLE HEADER/HERO VARIABLES ========== */
  /* These can be overridden via WordPress Customizer inline styles */
  
  /* Header */
  --header-height: 4rem;
  --header-top-bar-height: 2.5rem;
  --header-bg: hsl(var(--background) / 0.95);
  --header-border-color: hsl(var(--border));

  /* Hero Section */
  --hero-padding-y: 5rem;
  --hero-padding-y-md: 7rem;
  --hero-padding-y-lg: 8rem;
  --hero-bg: linear-gradient(135deg, hsl(var(--primary)), hsl(215 50% 18%));
  --hero-overlay-opacity: 0.7;
  --hero-text-color: hsl(var(--primary-foreground));
  --hero-title-size: 2.5rem;
  --hero-title-size-md: 3.5rem;
  --hero-title-size-lg: 4rem;
  --hero-subtitle-size: 1.125rem;
  --hero-max-width: 800px;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: hsl(var(--primary));
  margin: 0 0 1rem 0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

@media (min-width: 768px) {
  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.75rem; }
}

p {
  margin: 0 0 1rem 0;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: hsl(var(--accent));
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container-custom {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container-custom {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-custom {
    padding: 0 2rem;
  }
}

.section-padding {
  padding: 4rem 0;
}

@media (min-width: 768px) {
  .section-padding {
    padding: 5rem 0;
  }
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background-color: hsl(215 50% 18%);
}

.btn-gold {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-weight: 700;
}

.btn-gold:hover {
  background-color: hsl(45 93% 42%);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid hsl(var(--primary));
  color: hsl(var(--primary));
}

.btn-outline:hover {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--header-bg, hsl(var(--background) / 0.95));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--header-border-color, hsl(var(--border)));
}

/* WordPress admin bar offset */
.admin-bar .site-header {
  top: 32px;
}
@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

.header-top-bar {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  min-height: var(--header-top-bar-height, 2.5rem);
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.header-main {
  height: var(--header-height, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background-color: hsl(var(--accent) / 0.1);
  color: hsl(var(--primary));
}

.nav-dropdown {
  position: relative;
}

/*
  WordPress nav walker outputs dropdown lists as <ul class="nav-dropdown-content">.
  Ensure the dropdown has an opaque background and high z-index so page content
  never shows through (fixes "content covered" look).
*/
.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1200;
}

.nav-dropdown:hover > .nav-dropdown-content,
.nav-dropdown:focus-within > .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* WordPress Menu Styles */
/* Desktop horizontal nav: force flex layout, no bullets */
.desktop-nav .nav-menu {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.25rem;
}

.desktop-nav .nav-menu li {
  list-style: none !important;
  position: relative;
  display: block;
}

.desktop-nav .nav-menu > li {
  flex-shrink: 0;
}

/* Desktop nav menu links */
.desktop-nav .nav-menu > li > a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.desktop-nav .nav-menu > li > a:hover,
.desktop-nav .nav-menu > li.current-menu-item > a {
  background-color: hsl(var(--accent) / 0.1);
  color: hsl(var(--primary));
}

/* Desktop Dropdown Menus - hidden until hover */
.desktop-nav .nav-menu .sub-menu,
.desktop-nav .nav-menu .nav-dropdown-content {
  list-style: none !important;
  margin: 0;
  padding: 0.75rem;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid hsl(var(--border));
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1200;
}

.desktop-nav .nav-menu li:hover > .sub-menu,
.desktop-nav .nav-menu li:hover > .nav-dropdown-content,
.desktop-nav .nav-menu li:focus-within > .sub-menu,
.desktop-nav .nav-menu li:focus-within > .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.desktop-nav .nav-menu .sub-menu li,
.desktop-nav .nav-menu .nav-dropdown-content li {
  list-style: none !important;
  margin: 0;
}

.desktop-nav .nav-menu .sub-menu li a,
.desktop-nav .nav-menu .nav-dropdown-content li a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
  transition: background-color 0.2s ease;
  text-decoration: none;
}

.desktop-nav .nav-menu .sub-menu li a:hover,
.desktop-nav .nav-menu .nav-dropdown-content li a:hover {
  background-color: hsl(var(--accent) / 0.1);
  color: hsl(var(--primary));
}

/* Menu item with children indicator (desktop only) */
.desktop-nav .nav-menu > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.5rem;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
}

/* Mobile Navigation */
.header-main {
  position: relative;
}

.mobile-nav {
  /* Hidden by default (and force-hidden on desktop) */
  display: none !important;

  /* Render as a panel that pushes content down (not overlaying page content) */
  width: 100%;
  padding: 0.75rem 0 1rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
}

/* Only allow opening the accordion panel on mobile widths */
@media (max-width: 1023px) {
  .mobile-nav.is-open {
    display: block !important;
  }
}

/* Ensure header menus never show bullets */
.site-header .nav-menu,
.site-header .mobile-nav-menu,
.site-header .nav-menu ul,
.site-header .mobile-nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.mobile-nav-menu > li {
  border-bottom: 1px solid hsl(var(--border));
}

.mobile-nav-menu > li:last-child {
  border-bottom: none;
}

.mobile-nav-menu > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  font-size: 1rem;
  color: hsl(var(--foreground));
  text-decoration: none;
}

.mobile-nav-menu .sub-menu {
  margin: 0;
  padding: 0.25rem 0 0.75rem 1rem;
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: none;
  background: transparent;
  border: none;
  min-width: 0;
}

.mobile-nav-menu .sub-menu li a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none !important;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  color: hsl(var(--foreground));
}

/* Responsive */
@media (max-width: 1023px) {
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: flex !important;
  }

  .mobile-menu-toggle {
    display: flex !important;
  }
}

@media (min-width: 1024px) {
  .show-mobile {
    display: none !important;
  }

  /* Never show the mobile accordion/panel on desktop, even if it was toggled open */
  .mobile-nav,
  .mobile-nav.is-open {
    display: none !important;
  }

  /* Ensure desktop nav stays in the header */
  .desktop-nav {
    display: flex;
    align-items: center;
  }
}


/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  background: var(--hero-bg, linear-gradient(135deg, hsl(var(--primary)), hsl(215 50% 18%)));
  color: var(--hero-text-color, hsl(var(--primary-foreground)));
  padding: var(--hero-padding-y, 5rem) 0;
  position: relative;
}

@media (min-width: 768px) {
  .hero-section {
    padding: var(--hero-padding-y-md, 7rem) 0;
  }
}

@media (min-width: 1024px) {
  .hero-section {
    padding: var(--hero-padding-y-lg, 8rem) 0;
  }
}

.hero-content {
  max-width: var(--hero-max-width, 800px);
}

.hero-title {
  color: white;
  font-size: var(--hero-title-size, 2.5rem);
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: var(--hero-title-size-md, 3.5rem);
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: var(--hero-title-size-lg, 4rem);
  }
}

.hero-subtitle {
  font-size: var(--hero-subtitle-size, 1.125rem);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
}

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

.site-footer {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 4rem 0 2rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: hsl(var(--accent));
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.text-primary { color: hsl(var(--primary)); }
.text-accent { color: hsl(var(--accent)); }
.text-muted { color: hsl(var(--muted-foreground)); }

.bg-primary { background-color: hsl(var(--primary)); }
.bg-accent { background-color: hsl(var(--accent)); }
.bg-secondary { background-color: hsl(var(--secondary)); }

/* ==========================================================================
   Elementor Compatibility
   ========================================================================== */

.elementor-section {
  padding: 4rem 0;
}

.elementor-widget-text-editor h1,
.elementor-widget-text-editor h2,
.elementor-widget-text-editor h3 {
  font-family: var(--font-heading);
  color: hsl(var(--primary));
}

/* Service Cards for Elementor */
.mo-service-card {
  background: hsl(var(--card));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mo-service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.mo-service-card .icon-wrapper {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: hsl(var(--accent) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.mo-service-card .icon-wrapper svg {
  width: 2rem;
  height: 2rem;
  color: hsl(var(--accent));
}

/* CTA Section for Elementor */
.mo-cta-section {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(215 50% 18%));
  padding: 4rem 2rem;
  text-align: center;
  border-radius: var(--radius);
}

.mo-cta-section h2 {
  color: white;
}

.mo-cta-section p {
  color: rgba(255, 255, 255, 0.8);
}

/* Trust Badges for Elementor */
.mo-trust-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.mo-trust-badge .badge-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: hsl(var(--accent) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Testimonial Cards for Elementor */
.mo-testimonial {
  background: hsl(var(--card));
  border-radius: var(--radius);
  padding: 2rem;
}

.mo-testimonial .stars {
  color: hsl(var(--accent));
  margin-bottom: 1rem;
}

.mo-testimonial blockquote {
  font-style: italic;
  margin: 0 0 1rem 0;
  color: hsl(var(--foreground));
}

/* ==========================================================================
   Responsive Breakpoints Reference
   ========================================================================== */
/*
   sm: 640px
   md: 768px
   lg: 1024px
   xl: 1280px
   2xl: 1536px
*/
