/* Global responsive fixes */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  width: 100%;
}

main {
  width: 100%;
  overflow-x: hidden;
}

.container {
  padding-left: clamp(1rem, 4vw, 1.5rem);
  padding-right: clamp(1rem, 4vw, 1.5rem);
}

.section-header {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding: 0 0.25rem;
}

/* Bootstrap row overflow fix */
.projects-section .row {
  margin-left: 0;
  margin-right: 0;
  --bs-gutter-x: 1.25rem;
}

/* Touch-friendly targets */
.btn-primary,
.btn-outline,
.form1 button,
.nav div.main_list ul li a,
.hero-socials a {
  min-height: 44px;
}

/* Prevent card overflow on small screens */
.project-card,
.experience-entry,
.education-entry,
.achv-card,
.skills-card {
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 576px) {
  .section-title::after {
    width: 50px;
    height: 3px;
  }

  .project-keywords-container {
    gap: 0.4rem;
  }

  .project-keyword {
    font-size: 0.7rem;
  }
}

@media (max-width: 768px) {
  .contact_content {
    gap: 1.5rem;
  }

  .achv-title {
    font-size: 1rem;
  }

  .experience-entry ul li,
  .achv-list li {
    font-size: 0.875rem;
  }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 1rem 0 2rem;
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .hero-content {
    order: 1;
    align-items: flex-start;
    text-align: left;
  }

  .hero-image-wrapper {
    order: 2;
    padding: 0.5rem;
  }

  .hero-image-ring {
    width: min(180px, 35vw);
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .container {
    max-width: 1280px;
  }
}
