/* Case Studies Mobile Responsive Styles */

/* Mobile optimizations for case studies listing page */
@media screen and (max-width: 767px) {
  /* Portfolio section adjustments */
  .portfolio.section-padding {
    padding: 40px 0 20px 0;
  }

  /* Filter buttons */
  .filtering .filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
  }

  .filtering .filter span {
    font-size: 13px;
    padding: 8px 16px;
    margin: 0;
    white-space: nowrap;
  }

  /* Gallery grid adjustments */
  .portfolio .gallery .row {
    margin: 0 -10px;
  }

  .portfolio .gallery .items {
    padding: 0 10px;
    margin-bottom: 20px;
  }

  /* Make all items full width on mobile */
  .portfolio .gallery .items.col-lg-4,
  .portfolio .gallery .items.col-md-6 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  /* Remove large margin classes on mobile */
  .portfolio .gallery .items.lg-mr {
    margin-right: 0 !important;
  }

  /* Image container */
  .portfolio .item-img {
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 8px;
  }

  .portfolio .item-img img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* Content below images */
  .portfolio .cont {
    padding: 0 5px 15px 5px;
  }

  .portfolio .cont h6 {
    font-size: 18px;
    margin-bottom: 8px;
    line-height: 1.4;
  }

  .portfolio .cont span {
    font-size: 13px;
    line-height: 1.6;
  }

  .portfolio .cont span a {
    display: inline;
    word-break: break-word;
  }
}

/* Case Study Detail Page Mobile Styles */
@media screen and (max-width: 767px) {
  /* Page header adjustments */
  .page-header .img-wrapper {
    min-height: 400px !important;
  }

  .page-header .img-wrapper .title {
    padding: 20px 15px;
  }

  .page-header .img-wrapper .title h4 {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
  }

  .page-header .img-wrapper .title h3.work-title {
    font-size: 28px;
    line-height: 1.3;
    margin-top: 15px;
  }

  .page-header .visit-proj-link {
    font-size: 14px;
    padding: 10px 20px;
    margin: 15px 0;
  }

  /* Intro section */
  .intro-section.work-intro-section {
    padding: 30px 0 0 0;
  }

  .intro-section .wide-img {
    width: 100%;
    height: auto;
    margin-bottom: 30px;
  }

  .intro-section .container {
    padding: 0 20px;
  }

  .intro-section .htit {
    margin-bottom: 15px;
  }

  .intro-section .htit h4 {
    font-size: 20px;
  }

  .intro-section .text p {
    font-size: 15px;
    line-height: 1.7;
  }

  .intro-section .execution-row {
    padding-top: 30px !important;
    margin-top: 30px;
  }

  /* Services section */
  .services.section-padding {
    padding: 40px 0;
  }

  .services .service-box {
    margin-bottom: 30px;
  }

  .services .service-box .item {
    padding: 20px;
  }

  .services .service-box .item .icon {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .services .service-box .item h6 {
    font-size: 18px;
    margin-bottom: 12px;
    line-height: 1.4;
  }

  .services .service-box .item p {
    font-size: 14px;
    line-height: 1.6;
  }

  /* Remove md-mb50 on last item for mobile */
  .services .service-box .item.md-mb50 {
    margin-bottom: 30px;
  }

  /* Outcomes section */
  .services .execution-row.mb-80 {
    margin-bottom: 40px !important;
  }

  /* Next Project button */
  .services .btn-curve {
    width: 100%;
    max-width: 280px;
    margin: 20px auto;
    display: block;
    text-align: center;
  }

  /* Testimonial block section */
  .block-sec .background {
    padding: 40px 0 !important;
  }

  .block-sec .container {
    padding: 0 20px;
  }

  .block-sec .row {
    flex-direction: column;
  }

  .block-sec .col-lg-6,
  .block-sec .col-lg-5 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    margin: 0;
    padding: 0 15px;
  }

  .block-sec .vid-area {
    margin-bottom: 40px;
  }

  .block-sec .vid-area .cont h3 {
    font-size: 22px;
    line-height: 1.4;
  }

  .block-sec .testim-box .head-box h6 {
    font-size: 14px;
  }

  .block-sec .testim-box .head-box h4 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .block-sec .testim-box .item p {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
  }

  .block-sec .testim-box .info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .block-sec .testim-box .info .img {
    margin-bottom: 15px;
  }

  .block-sec .testim-box .info .cont {
    padding-left: 0;
  }

  /* Slick slider dots */
  .block-sec .slick-dotted.slick-slider {
    margin-bottom: 20px;
  }

  .block-sec .slick-dots {
    bottom: -35px;
  }

  .block-sec .slick-dots li button:before {
    font-size: 10px;
  }
}

/* Small mobile devices (max-width: 480px) */
@media screen and (max-width: 480px) {
  .filtering .filter span {
    font-size: 12px;
    padding: 6px 12px;
  }

  .page-header .img-wrapper .title h3.work-title {
    font-size: 24px;
  }

  .intro-section .htit h4 {
    font-size: 18px;
  }

  .services .service-box .item h6 {
    font-size: 16px;
  }

  .block-sec .vid-area .cont h3 {
    font-size: 20px;
  }

  .block-sec .testim-box .head-box h4 {
    font-size: 20px;
  }
}

/* Tablet adjustments (768px - 991px) */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .portfolio .gallery .items.col-md-6 {
    width: 50%;
    max-width: 50%;
    flex: 0 0 50%;
  }

  .page-header .img-wrapper {
    min-height: 50vh !important;
  }

  .intro-section .container {
    padding: 0 30px;
  }

  .services .service-box {
    margin-bottom: 40px;
  }

  .block-sec .col-lg-6 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    margin-bottom: 30px;
  }

  .block-sec .col-lg-5 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }
}

/* Ensure container has proper padding on all mobile devices */
@media screen and (max-width: 991px) {
  .portfolio .container,
  .services .container,
  .intro-section .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Fix for offset columns on mobile */
@media screen and (max-width: 767px) {
  .col-lg-8.offset-lg-1,
  .col-md-8 {
    margin-left: 0 !important;
  }
}

/* Improve touch targets for mobile */
@media screen and (max-width: 767px) {
  .filtering .filter span {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .portfolio .item-img a {
    display: block;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  .btn-curve {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
