/* Growthfully Advanced Styling
   Clean, professional interactions following brand guidelines */

/* Brand-Compliant Hover Effects */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: translateY(-2px);
}

/* Simplified Button Effects - Brand Compliant */

/* Essential Card Effects - Brand Compliant */

/* Essential Loading States - Minimal & Clean */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--green-mist);
  border-top: 2px solid var(--chelsea-cucumber);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Simple Feedback Animations */
.micro-shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Removed excessive attention-seeking animations */

/* Essential Form States - Clean & Simple */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  color: var(--pure-white);
}

/* Form validation states */
.form-error-state {
  border-color: var(--red-damask) !important;
}

.form-success-state {
  border-color: var(--chelsea-cucumber) !important;
}

/* Removed excessive click effects */

/* Essential Transitions - Brand Compliant */
.smooth-all {
  transition: all 0.3s ease;
}

/* ===================================
   RESPONSIVE IMAGE HANDLING
   =================================== */

/* Base responsive image styles */
.img-responsive {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Aspect ratio containers */
.aspect-ratio {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.aspect-ratio::before {
  content: '';
  display: block;
  padding-top: var(--aspect-ratio, 56.25%); /* 16:9 default */
}

.aspect-ratio img,
.aspect-ratio video,
.aspect-ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Common aspect ratios */
.aspect-16-9 { --aspect-ratio: 56.25%; }
.aspect-4-3 { --aspect-ratio: 75%; }
.aspect-3-2 { --aspect-ratio: 66.67%; }
.aspect-1-1 { --aspect-ratio: 100%; }

/* Object fit utilities */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-fill { object-fit: fill; }
.object-scale-down { object-fit: scale-down; }

/* Object position utilities */
.object-center { object-position: center; }
.object-top { object-position: top; }
.object-bottom { object-position: bottom; }
.object-left { object-position: left; }
.object-right { object-position: right; }

/* Lazy loading placeholder */
.img-lazy {
  background: var(--light-sage);
  transition: opacity 0.3s ease;
}

.img-lazy[data-loaded="false"] {
  opacity: 0.3;
}

.img-lazy[data-loaded="true"] {
  opacity: 1;
}

/* Loading skeleton for images */
.img-skeleton {
  background: linear-gradient(90deg, var(--light-sage) 25%, var(--green-mist) 50%, var(--light-sage) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  min-height: 200px;
}

/* Hero image enhancements */
.hero-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: center;
}

@media (min-width: 768px) {
  .hero-image {
    height: 500px;
  }
}

@media (min-width: 1200px) {
  .hero-image {
    height: 600px;
  }
}

/* Service detail images */
.service-detail-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--border-radius);
  transition: transform var(--transition-normal);
}

.service-detail-image:hover {
  transform: scale(1.05);
}

/* Kate's photo styling */
.kate-photo {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-normal);
}

.kate-photo:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Logo responsive handling */
.logo {
  height: auto;
  max-height: 80px;
  width: auto;
  transition: transform var(--transition-normal);
}

.logo:hover {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .logo {
    max-height: 60px;
  }
}

/* WebP support with fallback */
.webp .img-webp {
  background-image: var(--webp-url);
}

.no-webp .img-webp {
  background-image: var(--fallback-url);
}

/* High DPI / Retina support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .img-hidpi {
    background-image: var(--hidpi-url);
  }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
  /* Reset and base styles */
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  html {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  body {
    margin: 0;
    padding: 0;
    font-family: "Times New Roman", serif;
    color: black;
    background: white;
  }
  
  /* Hide non-essential elements */
  .nav-toggle,
  .skip-link,
  .btn,
  button,
  .newsletter,
  .footer,
  .nav-menu,
  .loading-spinner,
  .loading-dots,
  .img-print-hide {
    display: none !important;
  }
  
  /* Header adjustments */
  .header {
    position: static !important;
    padding: 0 !important;
    margin-bottom: 20pt;
    border-bottom: 1pt solid black;
  }
  
  .nav-brand {
    display: block !important;
  }
  
  .logo {
    max-height: 40pt !important;
    max-width: 200pt !important;
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 18pt;
    margin-bottom: 12pt;
    page-break-after: avoid;
  }
  
  h2 {
    font-size: 16pt;
    margin-bottom: 10pt;
    page-break-after: avoid;
  }
  
  h3 {
    font-size: 14pt;
    margin-bottom: 8pt;
    page-break-after: avoid;
  }
  
  h4, h5, h6 {
    font-size: 12pt;
    margin-bottom: 6pt;
    page-break-after: avoid;
  }
  
  p {
    margin-bottom: 8pt;
    orphans: 3;
    widows: 3;
  }
  
  /* Link handling */
  a {
    color: black !important;
    text-decoration: underline;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }
  
  a[href^="#"]:after,
  a[href^="mailto"]:after,
  a[href^="tel"]:after {
    content: "";
  }
  
  /* List styles */
  ul, ol {
    margin-bottom: 12pt;
  }
  
  li {
    margin-bottom: 4pt;
  }
  
  /* Table styles */
  table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 12pt;
  }
  
  th, td {
    border: 1pt solid black;
    padding: 6pt;
    text-align: left;
  }
  
  th {
    background: #f0f0f0 !important;
    font-weight: bold;
  }
  
  /* Page layout */
  .container {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .section {
    margin-bottom: 20pt;
    page-break-inside: avoid;
  }
  
  /* Hero section */
  .hero {
    margin-bottom: 20pt;
    padding: 0 !important;
    background: none !important;
  }
  
  .hero-title {
    font-size: 20pt;
    margin-bottom: 12pt;
  }
  
  .hero-subtitle {
    font-size: 14pt;
    margin-bottom: 8pt;
  }
  
  /* Service cards */
  .service-cards,
  .qualifications-grid {
    display: block !important;
  }
  
  .service-card,
  .qualification-card {
    display: block !important;
    margin-bottom: 16pt;
    padding: 12pt;
    border: 1pt solid black;
    page-break-inside: avoid;
  }
  
  .service-card h3,
  .qualification-card h3 {
    margin-top: 0;
  }
  
  /* Images */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
    margin-bottom: 8pt;
  }
  
  .kate-photo {
    max-width: 200pt !important;
    float: right;
    margin: 0 0 12pt 12pt;
  }
  
  /* Contact information */
  .contact-details {
    margin-bottom: 16pt;
  }
  
  .contact-item {
    margin-bottom: 8pt;
  }
  
  /* Form elements (simplified for print) */
  .contact-form {
    display: none !important;
  }
  
  .contact-form:before {
    content: "For inquiries, please contact us at hello@growthfully.co.za or visit our website.";
    display: block !important;
    font-style: italic;
    margin-bottom: 12pt;
  }
  
  /* Testimonials */
  .testimonial {
    border-left: 3pt solid black;
    padding-left: 12pt;
    margin: 16pt 0;
    font-style: italic;
  }
  
  .testimonial-author {
    font-weight: bold;
    margin-top: 8pt;
  }
  
  /* Quotes */
  blockquote {
    margin: 16pt 0;
    padding-left: 12pt;
    border-left: 2pt solid black;
    font-style: italic;
  }
  
  /* Page breaks */
  .page-break-before {
    page-break-before: always;
  }
  
  .page-break-after {
    page-break-after: always;
  }
  
  .page-break-inside-avoid {
    page-break-inside: avoid;
  }
  
  /* Print-specific content */
  .print-only {
    display: block !important;
  }
  
  .print-hide {
    display: none !important;
  }
  
  /* Footer for print */
  @page {
    margin: 2cm;
    @bottom-center {
      content: "Growthfully - Where people thrive, business grows";
      font-size: 10pt;
      color: #666;
    }
    
    @bottom-right {
      content: "Page " counter(page) " of " counter(pages);
      font-size: 10pt;
      color: #666;
    }
  }
  
  /* Color adjustments for print */
  .hero,
  .section-hero {
    background: white !important;
    color: black !important;
  }
  
  /* Ensure readable contrast */
  .text-light {
    color: black !important;
  }
  
  /* Icons (convert to text) */
  .service-icon:before {
    content: "• ";
  }
  
  .qual-icon:before {
    content: "→ ";
  }
  
  /* Process steps */
  .process-step {
    margin-bottom: 12pt;
    page-break-inside: avoid;
  }
  
  .process-number {
    font-weight: bold;
    margin-right: 8pt;
  }
  
  /* Statistics */
  .stat-item {
    display: inline-block;
    margin-right: 20pt;
    margin-bottom: 8pt;
  }
  
  .stat-number {
    font-weight: bold;
    font-size: 14pt;
  }
  
  /* Print URL at bottom */
  body:after {
    content: "Visit us online at https://growthfully.co.za";
    display: block;
    text-align: center;
    margin-top: 20pt;
    font-size: 10pt;
    color: #666;
  }
}

/* Image gallery styles */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  aspect-ratio: 4/3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Thumbnail styles */
.thumbnail {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--border-radius);
  border: 2px solid var(--light-sage);
  transition: all var(--transition-normal);
}

.thumbnail:hover {
  border-color: var(--chelsea-cucumber);
  transform: scale(1.1);
}

/* Avatar styles */
.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--light-sage);
}

.avatar-lg {
  width: 120px;
  height: 120px;
}

.avatar-sm {
  width: 40px;
  height: 40px;
}

/* Performance optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.will-change-auto {
  will-change: auto;
}

/* ===================================
   SMOOTH SCROLLING - MINIMAL & CLEAN
   =================================== */

/* Brand-compliant smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Simple scroll offset for anchors */
.scroll-offset {
  scroll-margin-top: 80px;
}

/* ===================================
   FOCUS STATES - CLEAN & ACCESSIBLE  
   =================================== */

/* Clean focus styles */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--mallard);
  outline-offset: 2px;
  transition: all 0.3s ease;
}

/* Button focus states */
.btn:focus-visible {
  outline: 2px solid var(--mallard);
  outline-offset: 2px;
}

/* Form input focus - as per brand guide */
.form-input:focus,
.form-textarea:focus,
select:focus {
  border-color: var(--mallard);
}

/* Navigation focus */
.nav-link:focus-visible {
  outline: 2px solid var(--mallard);
  outline-offset: 2px;
}

/* Card focus states */
.service-card:focus-visible,
.qualification-card:focus-visible {
  outline: 2px solid var(--mallard);
  outline-offset: 2px;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--mallard);
  color: var(--pure-white);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10000;
  transition: top 0.3s ease;
  transform: translateY(-100%);
  opacity: 0;
}

.skip-link:focus {
  top: 6px;
  transform: translateY(0);
  opacity: 1;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Clean scrollbar - minimal styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: var(--mallard);
  border-radius: 3px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hover-bounce:hover,
  .hover-pulse:hover,
  .hover-tilt:hover,
  .hover-rotate:hover,
  .hover-flip:hover,
  .float,
  .typewriter {
    animation: none;
    transform: none;
  }
  
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    opacity: 1;
    transform: none;
  }
}