/* ==========================================================================
   HDtranS – responsive.css
   Breakpoints: 1024px (tablet), 768px (mobile), 480px (small)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tablet ≤ 1024px
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --h1: 52px;
    --h2: 40px;
    --h3: 32px;
    --space-2xl: 88px;
    --space-xl: 64px;
  }

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

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

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

  .alternating-row__inner {
    padding: 48px;
  }
}

/* --------------------------------------------------------------------------
   Header → hamburger at ≤ 1200px (so the inline 2-row header only shows when
   there is guaranteed room and never wraps / collapses)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  /* Compact header on mobile/tablet (shorter bar + smaller logo). */
  :root { --header-height: 62px; }
  .nav__logo img,
  .custom-logo { height: 40px; }

  /* Full-screen slide-in panel with the logo on top, then the menu. */
  .nav__right {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    background: var(--snow);
    padding: 18px 24px 40px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 105;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  body.nav-open .nav__right {
    transform: translateX(0);
  }

  /* Company logo where the addresses used to be – same size as the header. */
  .nav__panel-logo {
    display: block;
    margin-bottom: 14px;
  }
  .nav__panel-logo img,
  .nav__panel-logo .custom-logo {
    height: 40px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
  }

  /* Addresses are desktop-only – not shown inside the hamburger panel */
  .nav__addresses {
    display: none;
  }

  .nav__primary {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav__menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav__menu .menu-item > a {
    display: block;
    padding: 16px 2px;
    font-size: 17px;
    border-bottom: 1px solid var(--alabaster-grey);
  }
  .nav__menu .menu-item > a::after { display: none; }
  .nav__menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0 0 0 14px;
  }
  .nav__contact {
    margin-left: 0;
    margin-top: 20px;
    justify-content: center;
    padding: 14px 20px;
  }

  /* Hamburger stays above the full-screen panel and turns into the close (X). */
  .nav__toggle { display: flex; }
  body.nav-open .nav__toggle {
    position: fixed;
    top: 9px;
    right: 16px;
    z-index: 115;
  }
}

/* --------------------------------------------------------------------------
   Mobile ≤ 768px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --h1: 36px;
    --h2: 28px;
    --h3: 24px;
    --h4: 20px;
    --space-2xl: 64px;
    --space-xl: 48px;
  }

  .container { padding-inline: 20px; }

  /* Single-column grids */
  .services-grid,
  .news-grid,
  .features-grid,
  .stats__grid,
  .contact-cards,
  .contact-tiles {
    grid-template-columns: 1fr;
  }

  /* Hero */
  .hero-slider,
  .hero-slider__track {
    min-height: 58vh;
  }
  .hero-slide__overlay {
    background: rgba(0, 0, 0, 0.55); /* slightly stronger dim on mobile */
  }
  .hero-slide__inner { padding-block: 48px; }
  .hero-slide__title { font-size: 42px; line-height: 1.1; }
  .hero-slide__subtitle { font-size: 16px; }
  .hero-slider__arrow { display: none; }

  /* Page head (inner pages) */
  .page-head__top {
    padding-block: 44px 28px;
  }
  .page-head__cols {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .page-head__text { font-size: 16px; }
  .page-head__media { height: 200px; }

  /* Page / post heroes */
  .post-hero__inner { padding-block: 72px; }
  .landing-hero__inner { padding-block: 84px; }
  .landing-hero__text { font-size: 16px; }

  /* Intro block stacks */
  .intro-block {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .intro-block__text { padding-top: 0; }

  .service-split {
    grid-template-columns: 1fr;
    row-gap: 0;
  }
  .service-split__eyebrow,
  .service-split__title,
  .service-split__text {
    grid-column: 1;
    grid-row: auto;
  }
  .service-split__text {
    margin-top: 16px;
  }

  /* Experience stacks, image first */
  .experience {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .experience__media { order: 1; }
  .experience__content { order: 2; }

  /* Alternating rows: single column, image always on top */
  .alternating-row {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .alternating-row__image {
    order: 1 !important;
    min-height: 240px;
  }
  .alternating-row__content {
    order: 2 !important;
  }
  .alternating-row__inner {
    padding: 36px 24px;
    max-width: 100%;
    margin: 0 !important;
  }
  /* Boxed tiles: text aligns to the image (no side inset) when stacked. */
  .alternating--boxed .alternating-row__inner,
  .alternating--boxed .alternating-row:nth-child(even) .alternating-row__inner {
    padding: 20px 0 8px;
  }

  /* Forms single column */
  .offer-form,
  .footer-form-row {
    grid-template-columns: 1fr;
  }

  /* Doświadczenie / Dlaczego / Kontakt sections stack */
  .experience-head {
    grid-template-columns: 1fr;
    row-gap: 12px;
    margin-bottom: 32px;
  }
  .experience-head__eyebrow,
  .experience-head__title,
  .experience-head__right {
    grid-column: 1;
    grid-row: auto;
  }
  .exp-tile {
    width: 280px;
    height: 220px;
  }
  .why {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .why__media { order: -1; }
  .contact-band__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Footer – stack the two columns, hide the vertical divider */
  .footer-main {
    padding-block: 48px;
  }
  .footer-main__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .footer-main__divider {
    display: none;
  }
  /* Even spacing for the stacked footer link groups. */
  .footer-links {
    gap: 28px;
  }
  .footer-menu {
    gap: 12px;
  }
  .footer-main__col--right {
    padding-left: 0;
  }
  .footer-branches {
    grid-template-columns: 1fr;
  }
  .footer-bottom__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  /* CTA */
  .cta-banner { padding: 72px 0; }
  .cta-banner__text { font-size: 16px; }

  .section { padding-block: var(--space-2xl); }
  .front-page .section { padding-block: 32px; }
}

/* --------------------------------------------------------------------------
   Small phones ≤ 480px
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  :root {
    --h1: 30px;
    --h2: 25px;
  }

  .container { padding-inline: 16px; }

  .btn,
  .btn-primary,
  .btn-outline,
  .btn-dark {
    width: 100%;
  }

  /* Two-box CTA keeps its natural width (only form submit buttons stretch). */
  .btn-cta { width: auto; max-width: 100%; }

  .stat__num { font-size: 38px; }
  .alternating-row__inner { padding: 28px 18px; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-slide { transition: opacity 0.001ms; }
}
