/* ==========================================================================
   Thal Nexus Technologies — Modern Responsive Media Queries
   ========================================================================== */

/* Desktops & Large Tablets (<= 1180px) */
@media (max-width: 1180px) {
  .tn-nav {
    display: none;
  }

  .tn-burger {
    display: grid;
  }

  .tn-hero__split {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    text-align: center;
  }

  .tn-hero__lead,
  .tn-hero__badge {
    margin-inline: auto;
  }

  .tn-hero__cta,
  .tn-hero__trust {
    justify-content: center;
  }

  .tn-hero__visual {
    max-width: 580px;
    margin-inline: auto;
  }

  .tn-services-grid,
  .tn-projects-grid,
  .tn-blog-grid,
  .tn-testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tn-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tn-process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tn-team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tn-split-why {
    grid-template-columns: 1fr;
  }

  .tn-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium Tablets & Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .tn-layout-blog {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .tn-sidebar {
    position: static;
    margin-top: 2rem;
  }

  .tn-blog-grid--archive {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets (<= 880px) */
@media (max-width: 880px) {
  .tn-section {
    padding: clamp(3.5rem, 6vw, 5rem) 0;
  }

  .tn-services-grid,
  .tn-projects-grid,
  .tn-blog-grid,
  .tn-blog-grid--archive,
  .tn-testimonials-grid,
  .tn-tech-grid,
  .tn-faq-layout,
  .tn-contact-grid {
    grid-template-columns: 1fr;
  }

  .tn-faq-layout__sidebar {
    position: static;
    margin-top: 1.5rem;
  }

  .tn-careers-benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tn-career-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .tn-career-open-box__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .tn-float-badge--bottom-left {
    left: -10px;
  }

  .tn-float-badge--top {
    right: -10px;
  }

  .tn-split-why {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .tn-why__visual,
  .tn-why__content {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .tn-terminal-mockup {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .tn-terminal__code {
    font-size: 0.78rem !important;
    padding: 1.1rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .tn-hide-sm,
  .hide-sm {
    display: none !important;
  }

  .tn-header__top-inner {
    justify-content: center;
    text-align: center;
  }
}

/* Mobile Devices (<= 640px) */
@media (max-width: 640px) {
  .tn-header__top {
    display: none;
  }

  .tn-header__bar {
    min-height: 64px;
    gap: 0.75rem;
  }

  .tn-logo__img {
    height: 34px;
    max-width: 170px;
  }

  /* On small mobile, clean header with just Logo + Burger button */
  .tn-header__actions .tn-btn {
    display: none;
  }

  .tn-careers-benefits-grid,
  .tn-stats-grid,
  .tn-process-grid,
  .tn-team-grid,
  .tn-footer__grid,
  .tn-form-grid,
  .tn-post-nav {
    grid-template-columns: 1fr;
  }

  .tn-post-nav__link--next {
    text-align: left;
  }

  .tn-field--full {
    grid-column: span 1;
  }

  /* Buttons Responsive Fix: prevent horizontal protrusion */
  .tn-btn {
    white-space: normal !important;
    text-align: center !important;
    word-break: break-word !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tn-btn--lg {
    min-height: 48px !important;
    padding: 0.85rem 1.25rem !important;
    font-size: 0.94rem !important;
  }

  .tn-center-btn,
  .tn-btn-center,
  .tn-section-cta,
  .tn-section-foot {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 0.5rem !important;
    box-sizing: border-box !important;
  }

  .tn-center-btn .tn-btn,
  .tn-btn-center .tn-btn,
  .tn-section-cta .tn-btn,
  .tn-section-foot .tn-btn {
    width: 100% !important;
    max-width: 360px !important;
    display: inline-flex !important;
    justify-content: center !important;
    margin-inline: auto !important;
  }

  .tn-btn-group {
    flex-direction: column;
    width: 100%;
  }

  .tn-btn-group .tn-btn {
    width: 100%;
  }

  /* Code Terminal Mockup Mobile Fit */
  .tn-terminal-mockup {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .tn-terminal__header {
    padding: 0.75rem 1rem !important;
    gap: 0.4rem !important;
  }

  .tn-terminal__title {
    max-width: 135px !important;
    font-size: 0.72rem !important;
  }

  .tn-terminal__lang {
    font-size: 0.68rem !important;
    padding: 0.2rem 0.45rem !important;
  }

  .tn-terminal__code {
    padding: 1rem 0.85rem !important;
    font-size: 0.72rem !important;
    line-height: 1.6 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .tn-terminal__footer {
    padding: 0.65rem 1rem !important;
  }

  .tn-terminal__status-pill {
    font-size: 0.72rem !important;
  }

  /* The Thal Nexus Advantage Reason Items Mobile Fit */
  .tn-reasons-list {
    gap: 1rem !important;
    margin-top: 1.5rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .tn-reason-item {
    padding: 1.15rem 1rem !important;
    gap: 0.85rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tn-reason-item__icon {
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0 !important;
  }

  .tn-reason-item__body h3 {
    font-size: 1.02rem !important;
  }

  .tn-reason-item__body p {
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
  }

  .tn-section--marquee {
    margin: 2rem 0 !important;
    padding: 2.5rem 0 !important;
  }

  .tn-float-badge {
    position: static;
    margin-top: 0.85rem;
  }

  .tn-hero__visual-wrap {
    padding: 0.45rem;
  }

  .tn-form-panel {
    padding: 1.5rem 1.15rem;
  }

  .tn-service-card,
  .tn-project-card__body,
  .tn-stat-card,
  .tn-testimonial-card,
  .tn-team-card {
    padding: 1.35rem 1.15rem;
  }

  .tn-testimonial-card__header {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .tn-faq__q {
    padding: 1.15rem 1.25rem;
    font-size: 1rem;
  }

  .tn-faq__item.is-open .tn-faq__a {
    padding: 0 1.25rem 1.15rem;
  }

  .tn-footer__bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .tn-author-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .tn-cta-box {
    padding: 2.2rem 1.25rem;
  }

  .tn-cta-box__actions {
    flex-direction: column;
    width: 100%;
  }

  .tn-cta-box__actions .tn-btn {
    width: 100%;
  }

  .tn-cta-perk {
    font-size: 0.84rem;
  }

  .tn-career-card {
    padding: 1.6rem 1.25rem;
  }

  .tn-legal-card {
    padding: 1.6rem 1.25rem;
  }

  .tn-legal-section h2 {
    font-size: 1.25rem;
  }
}

/* Ultra Small Screens (<= 380px) */
@media (max-width: 380px) {
  .tn-container {
    width: calc(100% - 1.5rem);
  }

  .tn-logo__img {
    height: 28px;
    max-width: 140px;
  }

  .tn-hero__title {
    font-size: 1.95rem;
  }
}
