/**
 * TechnAre — Responsive UI refinements
 * Loaded after premium-ui.css. Preserves brand colors, theme, and layout identity.
 */

:root {
  --site-header-height: 72px;
  --container-gutter: clamp(1rem, 4vw, 1.5rem);
  --section-space-y: clamp(3rem, 6vw, 6.25rem);
}

html {
  scroll-padding-top: calc(var(--site-header-height) + 12px);
}

/* --------------------------------------------------------------------------
   Global layout & overflow
   -------------------------------------------------------------------------- */
body {
  overflow-x: clip;
}

main.main {
  overflow-x: clip;
}

.container,
.container-fluid,
.container-xl {
  padding-left: max(var(--container-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--container-gutter), env(safe-area-inset-right, 0px));
}

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

pre,
code {
  max-width: 100%;
  overflow-x: auto;
}

/* --------------------------------------------------------------------------
   Typography scaling (fluid, same visual hierarchy)
   -------------------------------------------------------------------------- */
.hero h1 {
  font-size: clamp(1.65rem, 4.5vw, 3rem);
  line-height: 1.12;
}

.section-title p {
  font-size: clamp(1.35rem, 3.2vw, 2.25rem);
}

.page-title {
  padding: clamp(2.25rem, 5vw, 3.75rem) 0;
}

.page-title h1 {
  font-size: clamp(1.45rem, 4vw, 2.125rem);
  line-height: 1.2;
  word-wrap: break-word;
}

.page-title .lead,
.portfolio-category-hero .lead {
  font-size: clamp(0.9375rem, 2.2vw, 1.125rem);
  line-height: 1.65;
}

.portfolio-category-hero .hero-icon {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.portfolio-category-hero h1 {
  font-size: clamp(1.45rem, 4vw, 2.25rem);
}

/* --------------------------------------------------------------------------
   Touch targets & interactive polish
   -------------------------------------------------------------------------- */
.btn,
.btn-get-started,
.btn-getstarted,
.header .btn-getstarted,
.php-email-form button[type="submit"],
.chatbot-send-btn,
#chatbot-send-btn,
.portfolio-hub-filters a {
  min-height: 44px;
}

.navmenu a {
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .portfolio-category-card,
  .portfolio-project-card,
  .services .service-item,
  .stats .stats-item {
    will-change: transform;
  }
}

@media (hover: none) {
  .portfolio-category-card:hover,
  .portfolio-project-card:hover,
  .services .service-item:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Header & navigation
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
  .header .btn-getstarted {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
  }

  .navmenu .dropdown ul.dropdown-active {
    max-height: min(50vh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 400px) {
  .header .btn-getstarted {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* --------------------------------------------------------------------------
   Hero & home sections
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .hero .hero-img {
    max-width: min(100%, 420px);
    margin-left: auto;
    margin-right: auto;
  }

  .hero-tech-badges {
    gap: 0.5rem;
  }

  .hero-tech-badge {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
  }
}

@media (max-width: 575.98px) {
  .stats .stats-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
  }

  .alt-features .icon-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .alt-features .icon-box i {
    margin-right: 0;
    margin-bottom: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   Services, features, cards
   -------------------------------------------------------------------------- */
.services .row > [class*="col-"] {
  display: flex;
}

.services .service-item {
  width: 100%;
  height: 100%;
}

.features .feature-box,
.values .icon-box {
  height: 100%;
}

/* --------------------------------------------------------------------------
   Portfolio hub & listings
   -------------------------------------------------------------------------- */
.portfolio-breadcrumb-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
}

.portfolio-breadcrumb-nav span:last-child {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
  .portfolio-hub-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
    padding-bottom: 0.35rem;
    margin-bottom: 1.5rem;
  }

  .portfolio-hub-filters::-webkit-scrollbar {
    display: none;
  }

  .portfolio-hub-filters a {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  .portfolio-category-card {
    padding: 1.35rem 1.15rem;
  }

  .portfolio-category-services {
    padding: 1.25rem 1rem;
  }

  .portfolio-service-grid,
  .portfolio-tool-grid {
    gap: 0.4rem;
  }
}

/* Portfolio detail */
.portfolio-detail-hero-overlay h1 {
  font-size: clamp(1.2rem, 3.8vw, 2rem);
}

.portfolio-detail-hero-overlay p {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

.portfolio-detail-cta-inner {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

@media (max-width: 575.98px) {
  .portfolio-detail-cta-inner .btn-get-started,
  .portfolio-detail-cta-inner .btn {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-right: 0 !important;
    margin-bottom: 0.5rem;
  }

  .portfolio-detail-sidebar {
    padding: 1.25rem;
  }

  .portfolio-gallery-item img {
    border-radius: 12px;
  }
}

.portfolio-color-swatches,
.portfolio-color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Forms & contact
   -------------------------------------------------------------------------- */
.php-email-form input,
.php-email-form textarea,
.php-email-form select,
.contact .php-email-form input,
.contact .php-email-form textarea {
  border-radius: 10px;
}

@media (max-width: 575.98px) {
  .php-email-form input,
  .php-email-form textarea,
  .contact .php-email-form input,
  .contact .php-email-form textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .contact .php-email-form textarea {
    min-height: 120px;
  }

  .contact .php-email-form button[type="submit"],
  .php-email-form button[type="submit"] {
    width: 100%;
    justify-content: center;
  }

  .contact .info-item {
    text-align: center;
    flex-direction: column;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Blog
   -------------------------------------------------------------------------- */
.blog .post-entry,
.blog-details .article {
  overflow-wrap: anywhere;
}

.blog .post-entry .post-img img,
.blog-details .article img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

@media (max-width: 767px) {
  .blog .sidebar {
    margin-top: 2rem;
  }

  .blog-pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .footer .footer-top .row > [class*="col-"] {
    margin-bottom: 1.5rem;
  }

  .footer .footer-newsletter .newsletter-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .footer .footer-newsletter .newsletter-form input[type="email"] {
    width: 100%;
    min-height: 48px;
  }

  .footer .footer-newsletter .newsletter-form input[type="submit"] {
    width: 100%;
    min-height: 48px;
  }
}

/* --------------------------------------------------------------------------
   FAQ, testimonials, clients
   -------------------------------------------------------------------------- */
.faq .faq-question-btn {
  min-height: 48px;
  align-items: center;
}

.testimonials .swiper,
.clients .swiper {
  padding-bottom: 2.5rem;
}

.testimonials .testimonial-item {
  height: auto;
}

/* --------------------------------------------------------------------------
   Scroll top + chatbot spacing
   -------------------------------------------------------------------------- */
.scroll-top {
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 576px) {
  .scroll-top {
    right: max(5.5rem, calc(56px + env(safe-area-inset-right, 0px)));
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  }
}

/* --------------------------------------------------------------------------
   Large screens — comfortable reading width
   -------------------------------------------------------------------------- */
@media (min-width: 1400px) {
  .hero p {
    max-width: 560px;
  }

  .section-title p {
    max-width: 760px;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .portfolio-category-card,
  .portfolio-project-card,
  .services .service-item,
  .hero .btn-get-started {
    transition-duration: 0.001ms !important;
  }
}
