/* ============================================================
   HARDY WORK CUSTOMS - Responsive Styles
   responsive.css | Media queries (mobile-first)
   ============================================================ */

/* ── Tablet (768px and up) ── */
@media (min-width: 768px) {
  :root {
    --nav-height: 80px;
  }

  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }

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

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

/* ── Desktop (1024px and up) ── */
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Large Desktop (1280px and up) ── */
@media (min-width: 1280px) {
  .container {
    padding-inline: var(--space-8);
  }
}

/* ── Mobile (below 768px) ── */
@media (max-width: 767px) {
  :root {
    --nav-height: 68px;
    --space-20: 3rem;
    --space-24: 3.5rem;
  }

  /* Typography scale down */
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  /* Navigation */
  .site-nav__links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: var(--white);
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .site-nav__links.open {
    display: flex;
  }

  .site-nav__links a {
    display: block;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--text-base);
    letter-spacing: 0.02em;
  }

  .site-nav__links a::after {
    display: none;
  }

  .site-nav__cta .btn {
    display: none;
  }

  .site-nav__phone {
    font-size: var(--text-xs);
  }

  .nav-toggle {
    display: flex;
  }

  /* Hero */
  .hero {
    padding-top: calc(var(--nav-height) + var(--space-12));
    padding-bottom: var(--space-16);
  }

  .hero__stats {
    flex-direction: column;
    gap: var(--space-6);
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Sections */
  .section {
    padding-block: var(--space-12);
  }

  /* Grids collapse to single column */
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .site-footer__tagline {
    max-width: none;
  }

  .site-footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .site-footer__legal {
    justify-content: center;
  }

  /* CTA banner */
  .cta-banner__actions {
    flex-direction: column;
    align-items: center;
  }

  .cta-banner__actions .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* Contact form */
  .contact-split {
    flex-direction: column;
  }

  /* Back to top */
  .back-to-top {
    bottom: var(--space-5);
    right: var(--space-5);
    width: 40px;
    height: 40px;
  }

  /* Process steps */
  .process-step {
    flex-direction: row;
  }

  /* Page hero */
  .page-hero {
    padding-top: calc(var(--nav-height) + var(--space-10));
    padding-bottom: var(--space-10);
  }

  /* Filter tabs scroll */
  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tab {
    flex-shrink: 0;
  }

  /* Hero stat section */
  .hero__stat {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
  }

  .hero__stat-number {
    font-size: var(--text-3xl);
  }
}

/* ── Services / About page inline grid collapse ── */
@media (max-width: 767px) {
  /* Two-column inline grids (services, about) */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1.5fr"],
  [style*="grid-template-columns: 1fr 1.5fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns:repeat(4, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }

  /* Contact split name row */
  [style*="grid-template-columns:1fr 1fr"] .form-group,
  [style*="grid-template-columns: 1fr 1fr"] .form-group {
    grid-column: span 1;
  }

  /* Featured project hero layout */
  [style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }

  /* Contact info dividers */
  [style*="width:1px; height:80px"] {
    display: none;
  }

  /* Sticky contact info - remove sticky on mobile */
  [style*="position:sticky"] {
    position: static !important;
  }
}

/* ── Small Mobile (below 480px) ── */
@media (max-width: 479px) {
  .container {
    padding-inline: var(--space-4);
  }

  .btn--lg {
    padding: 0.875rem 1.5rem;
    font-size: var(--text-sm);
  }

  .hero__tag {
    font-size: 0.65rem;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── High contrast ── */
@media (prefers-contrast: high) {
  :root {
    --border-color: var(--charcoal);
  }
}

/* ============================================================
   HOME PAGE - Responsive Adjustments
   ============================================================ */

/* Tablet (768–1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .value-props {
    grid-template-columns: repeat(3, 1fr);
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .svc-card {
    grid-template-columns: 1fr;
  }

  .svc-card__photo {
    order: 0;
    height: 220px;
  }

  .featured-project {
    grid-template-columns: 1fr;
  }

  .featured-project__image {
    aspect-ratio: 16/9;
  }

  .home-cta__inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .trust-bar__inner {
    gap: var(--space-6);
  }

  .trust-signal__divider {
    display: none;
  }

  .home-hero__stat-divider {
    display: none;
  }

  .home-hero__stats {
    gap: var(--space-8);
  }

  .home-hero__stat {
    padding-right: 0;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  /* Hero */
  .home-hero {
    padding-top: calc(var(--nav-height) + var(--space-10));
    padding-bottom: var(--space-12);
  }

  .home-hero__headline {
    font-size: var(--text-3xl);
    max-width: none;
  }

  .home-hero__mission {
    font-size: var(--text-lg);
  }

  .home-hero__body {
    font-size: var(--text-base);
  }

  .home-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-hero__actions .btn {
    text-align: center;
    justify-content: center;
  }

  .home-hero__stats {
    flex-direction: column;
    gap: var(--space-5);
    margin-top: var(--space-10);
    padding-top: var(--space-6);
  }

  .home-hero__stat {
    padding-right: 0;
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-3);
  }

  .home-hero__stat-num {
    font-size: var(--text-3xl);
  }

  .home-hero__stat-divider {
    display: none;
  }

  /* Area strip */
  .area-strip__inner {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  /* Value props */
  .value-props {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* Services grid */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .svc-card {
    grid-template-columns: 1fr;
  }

  .svc-card__photo {
    order: 0;
    height: 200px;
  }

  /* Featured project */
  .featured-project {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .featured-project__image {
    aspect-ratio: 16/9;
  }

  .featured-project__body {
    padding: var(--space-6);
    gap: var(--space-3);
  }

  .featured-project__title {
    font-size: var(--text-xl);
  }

  /* Portfolio preview header */
  .portfolio-preview__header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Testimonial */
  .home-testimonial__mark {
    font-size: 3.5rem;
  }

  .home-testimonial__quote {
    font-size: var(--text-lg);
  }

  /* CTA */
  .home-cta__inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .home-cta__sub {
    font-size: var(--text-base);
  }

  .home-cta__actions {
    flex-direction: column;
  }

  .home-cta__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Trust bar */
  .trust-bar__inner {
    flex-direction: column;
    gap: var(--space-6);
  }

  .trust-signal {
    min-width: unset;
  }

  .trust-signal__divider {
    display: none;
  }
}

/* Narrow mobile (< 480px) */
@media (max-width: 479px) {
  .svc-card__photo {
    height: 160px;
  }
}

/* ============================================================
   SERVICES PAGE - Responsive
   ============================================================ */

/* Tablet (768–1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .svc-section__layout {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .svc-section__photo {
    aspect-ratio: 16/9;
  }

  /* Flipped sections: restore natural order on tablet */
  .svc-section--flipped .svc-section__layout {
    direction: ltr;
  }

  .process-track {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .process-track__connector {
    display: none;
  }

  .svc-area-layout {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .svcs-cta__inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .svcs-cta__sub {
    max-width: none;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  /* Jump nav */
  .services-jumpnav {
    top: var(--nav-height);
  }

  /* Intro strip */
  .svcs-intro-strip__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .svcs-intro-strip__text {
    font-size: var(--text-base);
  }

  /* Service sections - single column */
  .svc-section {
    padding-block: var(--space-12);
  }

  .svc-section__layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .svc-section__photo {
    aspect-ratio: 16/9;
    order: -1; /* Always show image above content on mobile */
  }

  .svc-section--flipped .svc-section__photo {
    order: -1;
  }

  .svc-section__cols {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .svc-section__lead {
    font-size: var(--text-base);
  }

  /* Specialist strip */
  .svc-specialist-strip__inner {
    flex-direction: column;
    padding-block: var(--space-6);
  }

  .svc-specialist-divider {
    display: none;
  }

  .svc-specialist-item {
    min-width: unset;
    padding: var(--space-3) 0;
  }

  /* Process track - vertical stack */
  .process-track {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .process-track__step {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .process-track__connector {
    display: none;
  }

  .process-track__card {
    text-align: left;
    margin-top: 0;
    padding: 0;
    flex: 1;
  }

  .process-track__num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    font-size: var(--text-base);
    margin-top: 2px;
  }

  /* Service area */
  .svc-area-layout {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  /* Services CTA */
  .svcs-cta__inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .svcs-cta__sub {
    font-size: var(--text-base);
    max-width: none;
  }

  .svcs-cta__actions {
    flex-direction: column;
  }

  .svcs-cta__actions .btn {
    width: 100%;
    justify-content: center;
  }
}
