/*
Theme Name: GHBC Consulting
Theme URI: https://ghbc.me
Author: GHBC Team
Author URI: https://ghbc.me
Description: Modern, professional WordPress theme for GHBC Consulting - Building bridges between Qatar and Africa
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
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: ghbc-theme
Tags: business, consulting, modern, responsive, accessibility-ready
*/

/* ========================================
   CSS Variables - Brand Identity
======================================== */
:root {
  /* Primary Colors - Qatar & Africa Bridge Theme */
  --color-primary: #07234a;        /* Deep Blue - Professional, Trust */
  --color-secondary: #030c1c;      /* Dark Navy - Premium, Sophistication */
  --color-accent: #10286E;         /* Royal Blue - Interactive elements */
  --color-dark: #1A1A1A;           /* Near Black - Text */
  --color-light: #F8F9FA;          /* Off White - Backgrounds */
  --color-white: #FFFFFF;

  /* Grays */
  --color-gray-100: #F7F7F7;
  --color-gray-200: #E5E5E5;
  --color-gray-300: #D4D4D4;
  --color-gray-600: #666666;
  --color-gray-700: #444444;

  /* Typography - Modern 2024 Fonts */
  --font-primary: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-heading: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  /* Font Sizes - Modern Scale */
  --fs-h1: clamp(3rem, 7vw, 5.5rem);
  --fs-h2: clamp(2.25rem, 5vw, 3.5rem);
  --fs-h3: clamp(1.75rem, 3.5vw, 2.5rem);
  --fs-h4: clamp(1.35rem, 2.5vw, 1.75rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;

  /* Spacing - Modern Scale */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  --spacing-2xl: 8rem;
  --spacing-3xl: 12rem;

  /* Layout */
  --container-max: 1200px;
  --container-wide: 1400px;
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 32px;

  /* Modern Shadows - Enhanced for Glass Effect */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.25), 0 12px 24px rgba(0, 0, 0, 0.2);
  --shadow-2xl: 0 32px 64px rgba(0, 0, 0, 0.3), 0 16px 32px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(255, 215, 0, 0.15), 0 0 40px rgba(255, 215, 0, 0.1);
  --shadow-glow-lg: 0 0 30px rgba(255, 215, 0, 0.25), 0 0 60px rgba(255, 215, 0, 0.15);

  /* Transitions */
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   Reset & Base Styles
======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--color-dark);
  background-color: #07234a;
  background: linear-gradient(-45deg,
    #030c1c 0%,
    #07234a 12%,
    #10286E 25%,
    #0a1f47 38%,
    #10286E 50%,
    #07234a 62%,
    #0d2557 75%,
    #07234a 88%,
    #030c1c 100%
  );
  background-size: 400% 400%;
  background-attachment: fixed;
  animation: gradientFlow 15s ease-in-out infinite;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1;
  font-kerning: normal;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  20% {
    background-position: 50% 20%;
  }
  40% {
    background-position: 100% 60%;
  }
  60% {
    background-position: 70% 80%;
  }
  80% {
    background-position: 30% 40%;
  }
  100% {
    background-position: 0% 50%;
  }
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(16, 40, 110, 0.7) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 70%, rgba(7, 35, 74, 0.6) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(16, 40, 110, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 20%, rgba(10, 31, 71, 0.4) 0%, transparent 35%);
  animation: floatOrbs 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -10;
}

@keyframes floatOrbs {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  20% {
    transform: translate(10%, -12%) rotate(8deg) scale(1.15);
    opacity: 0.9;
  }
  40% {
    transform: translate(-8%, 15%) rotate(-10deg) scale(1.08);
    opacity: 0.95;
  }
  60% {
    transform: translate(15%, 8%) rotate(12deg) scale(1.2);
    opacity: 0.85;
  }
  80% {
    transform: translate(-5%, -10%) rotate(-6deg) scale(1.05);
    opacity: 0.92;
  }
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 10% 80%, rgba(16, 40, 110, 0.5) 0%, transparent 40%),
    radial-gradient(ellipse at 90% 20%, rgba(7, 35, 74, 0.45) 0%, transparent 38%),
    radial-gradient(ellipse at 30% 50%, rgba(13, 37, 87, 0.35) 0%, transparent 45%),
    radial-gradient(ellipse at 70% 60%, rgba(10, 31, 71, 0.3) 0%, transparent 35%);
  animation: floatWaves 25s ease-in-out infinite reverse;
  pointer-events: none;
  z-index: -10;
}

@keyframes floatWaves {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 0.8;
  }
  25% {
    transform: translate(-12%, 10%) scale(1.2) rotate(-5deg);
    opacity: 1;
  }
  50% {
    transform: translate(10%, -8%) scale(1.1) rotate(8deg);
    opacity: 0.85;
  }
  75% {
    transform: translate(-8%, -12%) scale(1.15) rotate(-10deg);
    opacity: 0.9;
  }
}

/* ========================================
   Typography - Modern 2024
======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--spacing-md);
  color: #FFFFFF;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
}

h4 {
  font-size: var(--fs-h4);
  font-weight: 600;
}

p {
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

/* ========================================
   Layout Components
======================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
}

.container-wide {
  max-width: var(--container-wide);
}

.section {
  padding: var(--spacing-2xl) 0;
  position: relative;
  z-index: 1;
}

.section-alt {
  background: rgba(255, 255, 255, 0.03);
}

/* ========================================
   Buttons - Modern 2024
======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
  border-color: transparent;
  box-shadow:
    0 4px 16px rgba(255, 215, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-weight: 700;
  position: relative;
  overflow: hidden;
  isolation: isolate; /* <-- ADD THIS */
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1; /* <-- ADD THIS */
}

.btn-primary:hover {
  /* color: #FFFFFF !important;  <-- REMOVE THIS LINE */
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 8px 24px rgba(255, 215, 0, 0.6),
    0 0 30px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 215, 0, 0.5);
  color: var(--color-white);
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(255, 215, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  color: var(--color-white);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 215, 0, 0.6);
  color: #FFD700;
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(255, 215, 0, 0.2);
}

/* ========================================
   Cards - Modern 2024 with Enhanced Glassmorphism
======================================== */
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-xl);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: shimmer 3s linear infinite;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.1), rgba(255, 215, 0, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 215, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.card:hover::before {
  opacity: 1;
}

.card:hover::after {
  opacity: 1;
}

.card-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  font-size: 2rem;
  color: #000;
  box-shadow:
    0 8px 24px rgba(255, 215, 0, 0.4),
    0 0 20px rgba(255, 215, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
}

.card-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #FFA500, #FFD700);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow:
    0 12px 32px rgba(255, 215, 0, 0.5),
    0 0 30px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.card:hover .card-icon::before {
  opacity: 1;
}

.card-title {
  font-size: var(--fs-h4);
  margin-bottom: var(--spacing-md);
  font-weight: 600;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.card-text {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  font-size: 1rem;
}

/* ========================================
   Grid System
======================================== */
.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ========================================
   Utility Classes
======================================== */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }

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

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* ========================================
   Responsive Design
======================================== */

/* Tablet Portrait and Below (768px) */
@media (max-width: 768px) {
  :root {
    --spacing-xl: 4rem;
    --spacing-2xl: 5rem;
  }

  .section {
    padding: var(--spacing-xl) 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.1;
  }

  h2 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  h3 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .btn {
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
    width: 100%;
    max-width: 100%;
  }

  .card {
    padding: var(--spacing-md);
  }
}

/* Mobile Landscape and Below (640px) */
@media (max-width: 640px) {
  :root {
    --spacing-lg: 3rem;
    --spacing-xl: 3.5rem;
    --spacing-2xl: 4rem;
  }

  body {
    font-size: 0.9375rem;
  }

  .section {
    padding: var(--spacing-lg) 0;
  }

  .btn {
    padding: 0.75rem 1.5rem;
  }
}

/* Mobile Portrait (480px) */
@media (max-width: 480px) {
  :root {
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 3.5rem;
  }

  h1 {
    font-size: clamp(1.75rem, 10vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.5rem, 8vw, 2rem);
  }

  h3 {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
  }

  p {
    margin-bottom: var(--spacing-sm);
  }

  .card {
    padding: var(--spacing-sm) var(--spacing-md);
  }
}

/* Very Small Devices (360px) */
@media (max-width: 360px) {
  :root {
    --spacing-sm: 0.75rem;
    --spacing-md: 1.25rem;
    --spacing-lg: 2rem;
    --spacing-xl: 2.5rem;
  }

  body {
    font-size: 0.875rem;
  }

  .container {
    padding: 0 0.75rem;
  }
}

/* ========================================
   Global Responsive Enhancements
======================================== */

/* Prevent horizontal overflow on all devices */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Make all flex containers responsive */
@media (max-width: 768px) {
  .hero-actions,
  .cta-actions,
  .partnership-actions,
  .hero-cta-group {
    flex-wrap: wrap;
    width: 100%;
  }
}

/* Ensure videos and iframes are responsive */
iframe,
video,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* Responsive tables */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Prevent long URLs from breaking layout */
a {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* ========================================
   Accessibility Improvements for Mobile
======================================== */
@media (max-width: 768px) {
  /* Focus states for touch devices */
  button:focus,
  a:focus,
  input:focus,
  textarea:focus {
    outline: 2px solid rgba(255, 215, 0, 0.8);
    outline-offset: 2px;
  }

  /* Better tap highlight color */
  * {
    -webkit-tap-highlight-color: rgba(255, 215, 0, 0.2);
  }

  /* Prevent zoom on input focus for iOS */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* Prevents iOS zoom */
  }
}

/* ========================================
   iOS Safari Fixes
======================================== */
@supports (-webkit-touch-callout: none) {
  /* iOS-specific fixes */
  html {
    /* Fix viewport height for iOS Safari */
    height: -webkit-fill-available;
  }

  body {
    /* Fix background attachment for iOS - fixed doesn't work on iOS */
    background-attachment: scroll !important;
    /* Force hardware acceleration on iOS */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: transform;
    /* Ensure background covers full viewport */
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  /* Ensure animations work properly on iOS */
  body::before,
  body::after {
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    position: fixed;
  }

  /* Fix backdrop-filter on iOS */
  .site-header {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
  }

  .site-header.scrolled {
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
  }

  /* Prevent iOS from changing colors on menu toggle */
  body.menu-open {
    background-color: #07234a;
  }
}

/* ========================================
   Print Styles
======================================== */
@media print {
  /* Hide non-essential elements when printing */
  .site-header,
  .mobile-menu-toggle,
  .hero-scroll,
  .btn,
  .social-links,
  footer {
    display: none;
  }

  /* Optimize for print */
  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  /* Show link URLs after link text */
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* ========================================
   Scroll to Top Button
======================================== */
.scroll-to-top {
  position: fixed;
  left: 2rem;
  bottom: 2rem;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 4px 16px rgba(255, 215, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all var(--transition-base);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100px);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow:
    0 8px 24px rgba(255, 215, 0, 0.6),
    0 0 30px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.scroll-to-top:active {
  transform: translateY(-2px) scale(1.05);
}

.scroll-to-top svg {
  color: #000;
  transition: color var(--transition-base);
}

.scroll-to-top:hover svg {
  color: #FFFFFF;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .scroll-to-top {
    left: 1rem;
    bottom: 1rem;
    width: 48px;
    height: 48px;
  }

  .scroll-to-top svg {
    width: 20px;
    height: 20px;
  }
}
