/* ===== Responsive overrides for Miguel Garza Portfolio ===== */

/* --- Overflow guard (mobile/tablet only, to avoid breaking 100vh on desktop) --- */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
}

/* --- Fix hero whitespace gap on desktop only --- */
@media (min-width: 769px) {
  #about-me {
    min-height: auto !important;
    padding-bottom: 40px;
  }
}

/* --- Center the Tailwind .container (not centered by default) --- */
.container {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* --- Footer fixes (all sizes) --- */
footer {
  overflow: hidden;
}

.footer__social--list {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

footer img,
footer svg,
.footer__social--link img,
.footer__social--link svg,
.footer__row img,
.footer__row svg {
  max-width: 60px !important;
  max-height: 60px !important;
  width: auto !important;
  height: auto !important;
}

footer .h-20,
footer .w-20 {
  height: 60px !important;
  width: 60px !important;
}

footer .h-16,
footer .w-16 {
  height: 50px !important;
  width: 50px !important;
}

.footer__row {
  padding: 0 20px;
  overflow: hidden;
  word-break: break-word;
}

footer .text-6xl,
footer .text-5xl,
footer .text-4xl {
  font-size: 2rem !important;
  line-height: 1.3 !important;
  word-break: break-word;
}

/* --- Tablet (max 768px) --- */
@media (max-width: 768px) {
  /* Journey grid: collapse 7-column to stacked layout */
  .grid-cols-7 {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }

  .grid-cols-7 > * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .grid-cols-7 img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
  }

  .grid-cols-7 h1 {
    text-align: center;
    font-size: 2rem;
    padding: 10px 0;
  }

  /* col-start / col-end reset */
  .col-start-1, .col-start-2, .col-start-3, .col-start-4,
  .col-start-5, .col-start-7 {
    grid-column-start: auto !important;
  }

  .col-end-3, .col-end-4, .col-end-5, .col-end-7, .col-end-8 {
    grid-column-end: auto !important;
  }

  /* Project descriptions */
  .project__description {
    left: 20px !important;
    padding-right: 20px !important;
    max-width: 90%;
  }

  .project__description--title {
    font-size: 28px;
  }

  /* Footer icons smaller */
  footer img,
  footer svg,
  .footer__social--link img,
  .footer__social--link svg {
    max-width: 48px !important;
    max-height: 48px !important;
  }

  footer .h-20,
  footer .w-20 {
    height: 48px !important;
    width: 48px !important;
  }

  footer .h-16,
  footer .w-16 {
    height: 40px !important;
    width: 40px !important;
  }

  footer .text-6xl,
  footer .text-5xl {
    font-size: 1.75rem !important;
  }

  /* Section headings */
  .text-6xl {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
  }

  .text-5xl {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }

  .text-4xl {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
  }

  .Typewriter {
    font-size: 48px;
  }

  .i-title-item {
    font-size: 40px;
  }

  /* Row widths */
  .row, .row2 {
    padding: 0 16px;
  }
}

/* --- Mobile (max 480px) --- */
@media (max-width: 480px) {
  /* Hero adjustments */
  .Typewriter {
    font-size: 36px;
  }

  .im {
    font-size: 24px;
  }

  .i-title-item {
    font-size: 32px;
    height: 80px;
  }

  .i-title {
    height: 80px;
  }

  .i-title-wrapper {
    animation-name: move-mobile;
  }

  .about-me__info--para {
    font-size: 16px;
    line-height: 1.6;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Journey grid: single column, images full width */
  .grid-cols-7 {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: 12px !important;
  }

  .grid-cols-7 > * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .grid-cols-7 img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
  }

  .grid-cols-7 h1 {
    font-size: 1.5rem;
    text-align: center;
  }

  /* Tech stack */
  .language {
    width: 50% !important;
  }

  .language__name {
    font-size: 14px;
  }

  /* Project cards */
  .project {
    margin-bottom: 60px;
  }

  .project__description {
    left: 0 !important;
    padding: 0 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .project__description--title {
    font-size: 22px;
    text-align: center;
  }

  .project__description--sub-title {
    text-align: center;
    font-size: 14px;
  }

  .project__description--links {
    display: flex;
    justify-content: center;
  }

  .project__list {
    padding-top: 20px;
  }

  /* Footer */
  footer {
    padding: 20px 0;
  }

  .footer__social--list {
    gap: 16px;
    padding: 0 16px;
    max-width: 100%;
  }

  footer img,
  footer svg {
    max-width: 36px !important;
    max-height: 36px !important;
  }

  footer .h-20,
  footer .w-20 {
    height: 36px !important;
    width: 36px !important;
  }

  footer .h-16,
  footer .w-16 {
    height: 30px !important;
    width: 30px !important;
  }

  footer .text-6xl,
  footer .text-5xl,
  footer .text-4xl {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }

  /* Section titles */
  .section__title {
    font-size: 1.5rem;
    padding: 0 12px;
  }

  .text-6xl {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  .text-5xl {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }

  .text-4xl {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }

  .text-2xl {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
  }

  /* Navigation */
  nav {
    height: 60px;
    padding: 0 8px;
  }

  .personal__logo {
    font-size: 14px;
  }

  .nav__link--anchor-primary {
    padding: 6px 14px;
    font-size: 14px;
  }

  /* Container */
  .container {
    padding: 30px 0;
  }

  .row, .row2 {
    padding: 0 12px;
  }

  /* Prevent horizontal overflow on any large element */
  img, video, iframe {
    max-width: 100%;
  }
}

/* --- Small phones (max 360px) --- */
@media (max-width: 360px) {
  .Typewriter {
    font-size: 28px;
  }

  .i-title-item {
    font-size: 26px;
    height: 60px;
  }

  .i-title {
    height: 60px;
  }

  .i-title-wrapper {
    animation-name: move-small;
  }

  .im {
    font-size: 20px;
  }

  .about-me__info--para {
    font-size: 14px;
  }

  .language {
    width: 50% !important;
  }

  .language__img {
    max-width: 70px;
  }

  .project__description--title {
    font-size: 18px;
  }
}

/* Named keyframes for mobile title rotation (avoids overriding desktop @keyframes move) */
@keyframes move-mobile {
  25% { transform: translateY(-80px); }
  75% { transform: translateY(-160px); }
}

@keyframes move-small {
  25% { transform: translateY(-60px); }
  75% { transform: translateY(-120px); }
}
