/*
 * MAGZ MARKETING - Responsive Utilities
 * This file contains responsive utilities to complement Bootstrap's framework
 * and ensure consistent responsive behavior across all sections
 */

/* Custom Responsive Breakpoints - Matching Bootstrap's breakpoints */
:root {
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;
}

/* 
 * Responsive Typography
 * Uses clamp() for fluid typography that scales smoothly between breakpoints.
 * Includes overrides moved from style.css
 */
.responsive-text-xl {
  font-size: clamp(2rem, 5vw, 4rem);
}

.responsive-text-lg {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.responsive-text-md {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.responsive-text-sm {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.responsive-text-xs {
  font-size: clamp(0.8rem, 1vw, 1rem);
}

/* General Title Adjustments */
@media (max-width: 992px) {
    .footer-title { /* Moved from style.css */
        font-size: clamp(1.5rem, 3.5vw, 3rem);
    }
}
@media (max-width: 576px) {
    .section-title { /* Moved from style.css */
        font-size: clamp(1.8rem, 4vw, 3rem);
    }
}

/* Gradient Text Adjustments */
@media (max-width: 768px) {
    .gradient-text { /* Moved from style.css */
        font-size: clamp(1.5rem, 8vw, 2.5rem);
        letter-spacing: 0.02em;
    }
}
@media (max-width: 576px) {
    .gradient-text { /* Moved from style.css */
        font-size: clamp(1.2rem, 7vw, 2rem);
        letter-spacing: 0.01em;
    }
}
@media (max-width: 375px) {
    .gradient-text { /* Moved from style.css */
        font-size: clamp(1rem, 6vw, 1.5rem);
    }
}


/* 
 * Responsive Spacing
 * Consistent spacing that adapts to screen size.
 */
.responsive-margin {
  margin: clamp(1rem, 3vw, 3rem);
}

.responsive-padding {
  padding: clamp(1rem, 3vw, 3rem);
}

/* Hero Section Responsive Adjustments */
@media (max-width: 992px) {
    .hero-inner { /* Moved from style.css */
        padding: 0 5%;
    }
    .title-line.first { /* Moved from style.css */
        font-size: clamp(2rem, 3.5vw, 4.5rem) !important;
    }
    .title-line.second { /* Moved from style.css */
        font-size: clamp(4rem, 8vw, 9rem) !important;
    }
}
@media (max-width: 768px) {
    .hero-subtitle { /* Moved from style.css */
        font-size: 1rem;
        max-width: 90%;
    }
    .title-line.first,
    .title-line.second {
        overflow-wrap: normal; /* Prevent mid-word breaks */
        word-break: normal;   /* Ensure standard word breaking */
    }
}
@media (max-width: 576px) {
    .hero-inner { /* Moved from style.css */
        padding: 0 1rem;
    }
    .title-line.first { /* Moved from style.css */
        font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
        overflow-wrap: normal; /* Prevent mid-word breaks */
        word-break: normal;   /* Ensure standard word breaking */
    }
    .title-line.second { /* Moved from style.css */
        font-size: clamp(2.8rem, 7vw, 4.5rem) !important;
        overflow-wrap: normal; /* Prevent mid-word breaks */
        word-break: normal;   /* Ensure standard word breaking */
    }
    .hero-subtitle { /* Moved from style.css */
        font-size: 0.9rem;
        line-height: 1.4;
        margin-top: 1rem;
        max-width: 100%;
    }
}
@media (max-width: 480px) {
    .hero-inner { /* Moved from style.css */
        padding: 0 1rem;
    }
    .title-line.first { /* Moved from style.css */
        font-size: 1.5rem !important;
        overflow-wrap: normal; /* Prevent mid-word breaks */
        word-break: normal;   /* Ensure standard word breaking */
    }
    .title-line.second { /* Moved from style.css */
        font-size: 2.8rem !important;
        overflow-wrap: normal; /* Prevent mid-word breaks */
        word-break: normal;   /* Ensure standard word breaking */
    }
}


/* 
 * Responsive Height Utilities
 * For sections that need to adapt their height based on screen size.
 */
.min-vh-50 {
  min-height: 50vh;
}

.min-vh-75 {
  min-height: 75vh;
}

/* 
 * Responsive Image Containers
 * Ensures images maintain aspect ratio and fit their containers.
 */
.img-container {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
}

.img-container.ratio-16-9 {
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.img-container.ratio-4-3 {
  padding-bottom: 75%; /* 4:3 Aspect Ratio */
}

.img-container.ratio-1-1 {
  padding-bottom: 100%; /* 1:1 Aspect Ratio (Square) */
}

.img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 
 * Responsive Navbar Adjustments
 * Ensures the navbar works well with Bootstrap's responsive navbar.
 * NOTE: Most navbar styles are in navbar-responsive.css
 */
@media (max-width: 991.98px) {
  /* Leave navbar styling to navbar-responsive.css to avoid conflicts */
  /* Ensure nav items are technically visible for JS interaction even if styled hidden */
  .navbar-nav .nav-item, 
  .navbar-nav .nav-link {
    visibility: visible !important; 
    display: block !important; /* Or flex depending on final mobile layout */
  }
}

/* 
 * Responsive Service Items
 * Adjusts service items for better mobile display.
 * Includes overrides moved from style.css
 */
@media (max-width: 1200px) {
    .service-item-header h3 { /* Moved from style.css */
        font-size: clamp(1rem, 2.5vw, 1.4rem);
    }
}
@media (max-width: 992px) {
    .service-item-content { /* Moved from style.css */
        margin-left: 3.5rem;
    }
}
@media (max-width: 767.98px) {
  .service-item-header h3 { /* Combined from existing rule */
    font-size: 1rem;
  }
  .service-item { /* Combined from existing rule */
    padding: 1.25rem;
  }
  .service-item-content { /* Combined from existing rule */
    margin-left: 2rem;
  }
  .service-item-header { /* Moved from style.css */
      gap: 1.5rem;
  }
}
@media (max-width: 576px) {
    .service-item-header h3 { /* Moved from style.css */
        font-size: clamp(0.9rem, 2vw, 1.2rem);
        white-space: normal;
    }
    .service-item-content { /* Moved from style.css */
        margin-left: 2rem;
    }
    /* Additional small screen adjustments for service items */
    .service-item-content li {
        font-size: 0.9rem; /* Slightly smaller text */
        padding-left: 1.2em;
    }
    .service-item-content li::before {
        font-size: 1.1rem;
        top: 0.1em;
    }
}
@media (max-width: 480px) {
    .service-item { /* Moved from style.css */
        padding: 1.5rem;
    }
    .service-item-header { /* Moved from style.css */
        gap: 1rem;
    }
    .service-item-content { /* Moved from style.css */
        margin-left: 1.5rem;
    }
    .number { /* Moved from style.css */
        min-width: 1.5rem;
    }
}
@media (max-width: 375px) {
    .service-item-header h3 { /* Moved from style.css */
        font-size: 0.9rem;
    }
}
/* High-resolution devices with small viewports */
@media (min-width: 390px) and (max-width: 767px) and (min-resolution: 2dppx) {
    .service-item-header h3 { /* Moved from style.css */
        font-size: 1rem;
        white-space: normal;
    }
    .service-item-content { /* Moved from style.css */
        margin-left: 2rem;
    }
    .service-item { /* Moved from style.css */
        padding: 1.5rem;
    }
}


/* 
 * Responsive Footer
 * Ensures footer elements stack properly on mobile.
 * Includes overrides moved from style.css
 */
@media (max-width: 767.98px) {
  .footer-bottom { /* Combined from existing rule */
    text-align: center;
    flex-direction: column; /* Moved from style.css */
    gap: 1.5rem; /* Moved from style.css */
  }
  .social-links { /* Combined from existing rule */
    justify-content: center;
    gap: 1rem;
  }
}

/* 
 * Bootstrap Grid Enhancements
 * Additional utilities to complement Bootstrap's grid.
 */
.row.row-eq-height {
  display: flex;
  flex-wrap: wrap;
}

.row.row-eq-height > [class*='col-'] {
  display: flex;
  flex-direction: column;
}

/* 
 * Responsive Video Container
 * Ensures videos maintain aspect ratio.
 */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 
 * Responsive Background Images
 * Ensures background images scale properly.
 */
.bg-responsive {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* 
 * Responsive Visibility Helpers
 * Complement Bootstrap's display utilities.
 */
@media (max-width: 575.98px) {
  .d-xs-none {
    display: none !important;
  }
  
  .d-xs-block {
    display: block !important;
  }
  
  .text-xs-center {
    text-align: center !important;
  }
}

/* Hero adjustment for portrait */
@media (orientation: portrait) and (max-width: 767.98px) {
    .hero-inner {
        transform: translateY(10%); /* Reduce the downward push on tall screens */
    }
}

/* 
 * Orientation-specific styles
 * Handle different screen orientations (portrait vs landscape).
 */
@media (orientation: portrait) {
  /* Portrait mode (height > width) - mobile optimization */
  .brands-content h2 {
    font-size: clamp(1.8rem, 7vw, 3.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .brands-content h2 span.d-inline-block {
    margin: 0 0 0.1em;
  }
  
  .partnerships-image-container { /* Consider if this class is still used */
    padding: 0 5%;
  }
}

@media (orientation: landscape) {
  /* Landscape mode (width > height) - desktop optimization */
  .brands-content h2 {
    display: inline-block;
  }
  
  .brands-content h2 span.d-inline-block {
    margin: 0 0.1em;
  }
}

/* 
 * Responsive Order Helpers
 * For changing element order on different screen sizes.
 */
@media (max-width: 767.98px) {
  .order-first-sm {
    order: -1 !important;
  }
  
  .order-last-sm {
    order: 999 !important;
  }
}

/* 
 * Responsive Animations
 * Disable animations on small screens for performance.
 */
@media (max-width: 575.98px) {
  .disable-animation-xs {
    animation: none !important;
    transition: none !important;
  }
}

/* Careers Page Partnership Expertise Text Clipping Fix */
@media (max-width: 768px) {
  .careers-info .partnership-expertise .tab-pane {
    height: auto;
    overflow-y: visible; /* Ensure vertical content is not clipped */
  }
  .careers-info .partnership-expertise .tab-pane .row > div { /* Text column */
    height: auto;
    min-height: initial; /* Override any inherited min-height */
  }
}

/* 
 * Print Styles
 * Optimize for printing.
 */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-full-width {
    width: 100% !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  a {
    text-decoration: underline !important;
    color: black !important;
  }
}
