/* Mobile Text and Font Sizing Fixes */

/* Base text sizing for mobile */
@media screen and (max-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.5;
  }

  h1 {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 15px;
  }

  h2 {
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 10px;
  }

  h4 {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 8px;
  }

  p {
    margin-bottom: 15px;
  }

  /* Fix long text overflow */
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  a,
  span,
  div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    -ms-word-break: break-all;
    word-break: break-word;
    -ms-hyphens: auto;
    -moz-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}

/* Smaller devices need even smaller fonts */
@media screen and (max-width: 480px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 22px;
  }

  h3 {
    font-size: 18px;
  }

  h4 {
    font-size: 16px;
  }

  /* Fix line heights */
  .hero-content h1,
  .section-title {
    line-height: 1.2;
  }

  /* Fix animated job title on small screens */
  .animated-title {
    font-size: 16px !important;
  }
}

/* Fix code blocks and pre elements */
@media screen and (max-width: 768px) {
  pre,
  code {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

/* Fix links and buttons */
@media screen and (max-width: 768px) {
  a,
  button,
  .btn {
    display: inline-block;
    padding: 8px 15px;
  }

  /* Fix button text wrapping */
  .primary-btn,
  .secondary-btn,
  button,
  .btn {
    white-space: normal;
    height: auto;
    min-height: 44px;
  }

  /* Ensure navigation text is readable */
  .nav-links a {
    font-size: 16px;
    padding: 12px 15px;
  }
}

/* Utility classes for text control */
@media screen and (max-width: 768px) {
  .text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .mobile-center-text {
    text-align: center !important;
  }

  .mobile-left-text {
    text-align: left !important;
  }
}

/* Fix for long URLs or text in contact section */
@media screen and (max-width: 768px) {
  .contact-info a,
  .info-item a,
  .contact-info p,
  .info-item p {
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
  }
}
