/* 
 * OptiRise Digital - Main Stylesheet
 * Professional Dark Theme for Marketing Agency
 */

/* 1. Design Tokens - CSS Custom Properties */
@import url('./tokens.css');

/* 2. Base Styles & CSS Reset */
@import url('./base.css');

/* 3. Component Styles - Reusable UI Components */
@import url('./components/button.css');
@import url('./components/hero.css');
@import url('./components/features.css');
@import url('./components/testimonial.css');
@import url('./components/cta.css');
@import url('./components/contact-form.css');
@import url('./components/section-title.css');
@import url('./components/card.css');
@import url('./components/client-logos.css');
@import url('./components/process-timeline.css');
@import url('./components/newsletter.css');
@import url('./components/stats.css');
@import url('./components/pricing-table.css');
@import url('./components/social-share.css');
@import url('./components/theme-settings.css');
@import url('./components/phone-mockup.css');
@import url('./components/image-grid.css');
@import url('./components/lightbox.css');
@import url('./components/blog-card.css');
@import url('./components/author-bio.css');

/* 4. Section Styles - Page Section Layouts */
@import url('./sections/hero.css');
@import url('./sections/services.css');
@import url('./sections/metrics.css');
@import url('./sections/testimonials.css');
@import url('./sections/portfolio.css');
@import url('./sections/pricing.css');
@import url('./sections/cta-band.css');
@import url('./sections/homepage.css');
@import url('./sections/story.css');
@import url('./sections/blog.css');
@import url('./sections/single-post.css');

/* 5. Layout & Utility Classes */

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-alpha);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 767px) {
  .site-header {
    position: relative;
    z-index: 1002;
  }
}

.site-header--scrolled {
  background: rgba(var(--color-bg-deep-rgb), 0.98);
  box-shadow: var(--shadow-md);
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  max-width: var(--container-full);
  margin: 0 auto;
  position: relative;
}

.site-logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  text-decoration: none;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Site logo is already a link, so it needs the fix */
.site-logo:link,
.site-logo:visited {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-logo:hover,
.site-logo:active {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Custom Logo Styling */
.custom-logo-link {
  display: inline-block;
  text-decoration: none;
  transition: var(--transition-fast);
}

.custom-logo {
  height: auto;
  max-height: 50px;
  width: auto;
  max-width: 200px;
  display: block;
  transition: var(--transition-fast);
}

.custom-logo-link:hover .custom-logo {
  opacity: 0.8;
  transform: scale(1.02);
}

/* Responsive logo adjustments */
@media (max-width: 768px) {
  .custom-logo {
    max-height: 40px;
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .custom-logo {
    max-height: 35px;
    max-width: 120px;
  }
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
  position: relative;
}

.main-nav a:hover,
.main-nav a.current {
  color: var(--color-accent);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: var(--transition-fast);
}

.main-nav a:hover::after,
.main-nav a.current::after {
  width: 100%;
}

/* Footer */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-4xl) 0 var(--space-2xl);
  margin-top: var(--space-5xl);
}

.footer__container {
  max-width: var(--container-full);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer__section h3 {
  color: var(--color-text);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-lg);
}

.footer__section p,
.footer__section li {
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
}

.footer__section ul {
  list-style: none;
  padding: 0;
}

.footer__section a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
}

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

.footer__bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-dim);
  font-size: var(--font-size-sm);
}

/* Mobile Navigation */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: var(--space-xs);
  position: relative;
  width: 48px;
  height: 48px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  z-index: 1001;
}

.mobile-menu-toggle:hover {
  background: var(--color-surface);
}

.mobile-menu-toggle:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.mobile-menu-toggle__line {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-text);
  transition: all var(--transition-base);
  transform-origin: center;
  border-radius: 1px;
}

.mobile-menu-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
  background: var(--color-accent);
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__line:nth-child(2) {
  opacity: 0;
  transform: scale(0) rotate(180deg);
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle__line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
  background: var(--color-accent);
}

@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .site-header {
    position: relative;
  }
  
  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-surface) 100%);
    z-index: 1000;
    transform: translateX(-100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    padding-top: 80px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  
  .main-nav.is-open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
  }
  
  .main-nav__list {
    flex-direction: column;
    padding: var(--space-xl) var(--space-lg);
    gap: var(--space-md);
    height: 100%;
    justify-content: flex-start;
    list-style: none;
    margin: 0;
  }
  
  .main-nav__list li {
    width: 100%;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  
  .main-nav.is-open .main-nav__list li {
    opacity: 1;
    transform: translateX(0);
  }
  
  .main-nav.is-open .main-nav__list li:nth-child(1) { transition-delay: 0.1s; }
  .main-nav.is-open .main-nav__list li:nth-child(2) { transition-delay: 0.15s; }
  .main-nav.is-open .main-nav__list li:nth-child(3) { transition-delay: 0.2s; }
  .main-nav.is-open .main-nav__list li:nth-child(4) { transition-delay: 0.25s; }
  .main-nav.is-open .main-nav__list li:nth-child(5) { transition-delay: 0.3s; }
  .main-nav.is-open .main-nav__list li:nth-child(6) { transition-delay: 0.35s; }
  
  /* Enhanced opening animation */
  .main-nav.is-opening {
    animation: slideInMenu 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  }
  
  /* Enhanced closing animation */
  .main-nav.is-closing {
    animation: slideOutMenu 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
  }
  
  .main-nav.is-closing .main-nav__list li {
    animation: slideOutMenuItems 0.2s ease-in forwards;
  }
  
  .main-nav__list a {
    display: block;
    padding: var(--space-lg) var(--space-md);
    font-size: 1.375rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-xs);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .main-nav__list a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
  }
  
  .main-nav__list a:hover::before,
  .main-nav__list a:focus::before {
    left: 100%;
  }
  
  .main-nav__list a:hover,
  .main-nav__list a:focus {
    color: var(--color-accent);
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(8px) scale(1.02);
    border-color: var(--color-accent);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--color-accent);
  }
  
  .main-nav__list a:active {
    transform: translateX(4px) scale(0.98);
  }
  
  /* Ripple effect for menu links */
  .menu-link-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    transform: scale(0);
    animation: menuRipple 0.6s ease-out;
  }
  
  @keyframes menuRipple {
    to {
      transform: scale(2);
      opacity: 0;
    }
  }
  
  /* Mobile menu backdrop */
  .main-nav.is-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: -1;
    opacity: 0;
    animation: fadeInBackdrop 0.4s ease-out forwards;
  }
  
  /* Close button in mobile menu */
  .main-nav .mobile-menu-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text);
    font-size: 24px;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: scale(0.8) rotate(90deg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  
  .main-nav.is-open .mobile-menu-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 0.2s;
  }
  
  .main-nav.is-open .mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-accent);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  }
  
  /* Hide desktop menu on mobile */
  .header__container .main-nav:not(.is-open) {
    display: none;
  }
  
  .header__container .main-nav.is-open {
    display: block;
  }
  
  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

/* Mobile menu animations */
@keyframes fadeInBackdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInMenu {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes menuItemSlideIn {\n  from {\n    opacity: 0;\n    transform: translateX(-30px);\n  }\n  to {\n    opacity: 1;\n    transform: translateX(0);\n  }\n}\n\n@keyframes slideOutMenu {\n  from {\n    transform: translateX(0);\n  }\n  to {\n    transform: translateX(-100%);\n  }\n}\n\n@keyframes slideOutMenuItems {\n  from {\n    opacity: 1;\n    transform: translateX(0);\n  }\n  to {\n    opacity: 0;\n    transform: translateX(-20px);\n  }\n}

/* Add subtle menu decoration */
@media (max-width: 767px) {
  .main-nav.is-open::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-secondary, #a8d0e6) 100%);
    opacity: 0.8;
  }
  
  /* Add menu header */
  .main-nav.is-open .main-nav__list::before {
    content: 'Navigation';
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-lg);
    padding-left: var(--space-md);
    opacity: 0;
    animation: menuItemSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
    position: relative;
  }
  
  .main-nav.is-open .main-nav__list::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: var(--space-md);
    width: 30px;
    height: 2px;
    background: var(--color-accent);
    opacity: 0;
    animation: menuItemSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
  }
  
  /* Add subtle scrollbar styling for long menus */
  .main-nav::-webkit-scrollbar {
    width: 4px;
  }
  
  .main-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .main-nav::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 2px;
  }
  
  .main-nav::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
    opacity: 0.8;
  }
}

/* Medium screens and up - hide mobile toggle */
@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none !important;
  }
  
  .main-nav {
    position: static !important;
    transform: none !important;
    height: auto !important;
    padding-top: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }
  
  .main-nav__list {
    flex-direction: row !important;
    padding: 0 !important;
    gap: var(--space-lg) !important;
    height: auto !important;
    justify-content: flex-end !important;
  }
  
  .main-nav__list a {
    padding: var(--space-sm) 0 !important;
    font-size: var(--font-size-base) !important;
    border-bottom: none !important;
  }
  
  .mobile-menu-close {
    display: none !important;
  }
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-semibold);
  z-index: 10000;
}

.skip-link:focus {
  top: 6px;
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .btn,
  [data-animate] {
    display: none !important;
  }
  
  body {
    background: var(--color-white) !important;
    color: var(--color-black) !important;
  }
}

/* 6. Page Templates - Default page styles for content pages */
.page-wrapper {
  max-width: var(--container-6xl);
  margin: 0 auto;
  padding: var(--space-5xl) var(--space-lg);
}

/* Archive Page Styles */
.archive-page {
  padding: var(--space-5xl) 0;
  min-height: 70vh;
}

.archive-header {
  text-align: center;
  margin-bottom: var(--space-4xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-border);
}

.archive-title {
  font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-5xl));
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  line-height: var(--line-height-tight);
}

.archive-description {
  color: var(--color-text-dim);
  font-size: var(--font-size-lg);
  max-width: 600px;
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.archive-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  transition: var(--transition-base);
}

.archive-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

.archive-item__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-md);
  line-height: var(--line-height-tight);
}

.archive-item__title a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.archive-item__excerpt {
  color: var(--color-text-dim);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
}

.archive-item__meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.archive-pagination {
  display: flex;
  justify-content: center;
  margin-top: var(--space-3xl);
}

.archive-empty {
  text-align: center;
  padding: var(--space-5xl) 0;
}

.archive-empty h2 {
  font-size: var(--font-size-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-lg);
}

.archive-empty p {
  color: var(--color-text-dim);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .archive-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .archive-item {
    padding: var(--space-lg);
  }
}

.page-content {
  max-width: 65ch;
  margin: 0 auto;
}

.page-title {
  font-size: clamp(var(--font-size-3xl), 6vw, var(--font-size-5xl));
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-xl);
  color: var(--color-text);
}

.page-content h2 {
  font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-3xl));
  font-weight: var(--font-weight-semibold);
  margin: var(--space-2xl) 0 var(--space-lg);
  color: var(--color-text);
}

.page-content h3 {
  font-size: clamp(var(--font-size-xl), 3vw, var(--font-size-2xl));
  font-weight: var(--font-weight-semibold);
  margin: var(--space-xl) 0 var(--space-md);
  color: var(--color-text);
}

.page-content p {
  margin-bottom: var(--space-md);
  color: var(--color-text-dim);
  line-height: var(--line-height-relaxed);
}

.page-content ul,
.page-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.page-content li {
  margin-bottom: var(--space-sm);
  color: var(--color-text-dim);
  line-height: var(--line-height-relaxed);
}

.page-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

.page-content code {
  background: var(--color-surface);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  color: var(--color-accent);
}

.page-content pre {
  background: var(--color-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-lg) 0;
}

.page-content pre code {
  background: none;
  padding: 0;
  color: var(--color-text);
}

/* 7. WordPress Content Styles - Override Default Styling */
.wp-block-image {
  margin: var(--space-xl) 0;
  background: none !important;
}

.wp-block-image img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  background: none !important;
}

.wp-block-quote {
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  background: none !important;
}

.wp-block-pullquote {
  text-align: center;
  border-top: 4px solid var(--color-accent);
  border-bottom: 4px solid var(--color-accent);
  padding: var(--space-xl) 0;
  margin: var(--space-2xl) 0;
  background: none !important;
}

.wp-block-button .wp-block-button__link {
  background: var(--color-accent) !important;
  color: var(--color-on-accent) !important;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: var(--transition-base);
}

.wp-block-button .wp-block-button__link:hover {
  background: var(--color-accent-alt) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Global WordPress Style Override */
.entry-content *,
.portfolio-description__content *,
.wp-block-* {
  background-color: transparent !important;
}

/* Prevent WordPress color classes from applying */
.has-background,
.has-text-color,
.has-primary-background-color,
.has-secondary-background-color,
.has-tertiary-background-color {
  background-color: transparent !important;
}

/* Override any WordPress theme color utility classes */
[class*="has-"][class*="background-color"] {
  background-color: transparent !important;
}

[class*="has-"][class*="color"] {
  color: var(--color-text-dim) !important;
}
