/* Mobile Spacing Fixes for Blog Posts and Projects */

/* Fix excessive spacing between projects on mobile */
@media (max-width: 767.98px) {
  .project {
    margin-bottom: 35px !important; /* Minimum 35px spacing between projects */
  }

  .project .img {
    height: 250px !important; /* Same as blog images for horizontal crop */
    background-size: cover !important;
    background-position: center !important;
  }

  .project .img .text {
    margin-top: -2vw !important;
  }

  .project .img .text h2 {
    font-size: 6vw !important;
    margin: -20px !important;
  }
}

/* Fix blog entry spacing on mobile */
@media (max-width: 767.98px) {
  .blog-entry {
    margin-bottom: 2em !important; /* Reduced from 4em */
  }

  .blog-entry .img {
    height: 250px !important;
  }

  .blog-entry .text h3 {
    font-size: 24px !important;
  }
}

/* Fix full-height elements on mobile */
@media (max-width: 767.98px) {
  .js-fullheight {
    height: auto !important;
    min-height: auto !important; /* Changed from 100vh to auto */
  }

  /* Override js-fullheight for project images - use horizontal crop like blog */
  .project .img.js-fullheight {
    height: 250px !important; /* Same as blog images */
    min-height: 250px !important;
    max-height: 250px !important;
    background-size: cover !important;
    background-position: center center !important;
  }

  /* Ensure navigation sidebar is scrollable if content exceeds viewport */
  #colorlib-aside {
    height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  /* Ensure all navigation menu items are visible on mobile */
  #colorlib-aside #colorlib-main-menu ul {
    display: block !important;
    visibility: visible !important;
  }

  #colorlib-aside #colorlib-main-menu ul li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Ensure social links (Facebook, Instagram) are visible on mobile */
  #colorlib-aside #colorlib-main-menu p.social {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: 20px !important;
  }

  #colorlib-aside #colorlib-main-menu p.social span {
    display: block !important;
    visibility: visible !important;
    margin-bottom: 10px !important;
  }

  #colorlib-aside #colorlib-main-menu p.social span a {
    display: inline-block !important;
    visibility: visible !important;
    color: #000000 !important;
    font-size: 14px !important;
  }

  /* Ensure language switcher is visible on mobile */
  #colorlib-aside #colorlib-main-menu p.social:last-of-type {
    display: block !important;
    visibility: visible !important;
  }

  /* Ensure footer logo is visible on mobile */
  #colorlib-aside .colorlib-footer {
    position: absolute;
    display: block !important;
    visibility: visible !important;
    margin-top: 30px !important;
    margin-bottom: 30px !important;
    padding-bottom: 30px !important;
  }
}

/* Horizontal/landscape crop for project images on mobile */
@media (max-width: 767.98px) {
  /* Use same height as blog images for consistent horizontal crop */
  .project .img {
    height: 250px !important; /* Same as blog images */
    width: 100% !important;
    background-size: cover !important;
    background-position: center center !important;
    object-fit: cover !important;
  }

  /* Override js-fullheight class for project images */
  .project .img.js-fullheight {
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
  }

  /* Adjust text overlay for horizontal images */
  .project .img .text {
    margin-top: -1vw !important;
  }

  .project .img .text h2 {
    font-size: 5vw !important;
    margin: -10px !important;
  }

  /* Ensure minimum spacing between projects */
  .project {
    margin-bottom: 35px !important;
  }
}
