/* ==========================================================================
   Creative Arts — responsive layer
   Breakpoints: 1440 / 1200 / 992 / 768 / 575 / 375
   Grids collapse 4 -> 2 -> 1.
   ========================================================================== */

/* Shared guards ---------------------------------------------------------- */

/*
 * Grid and flex children default to min-width: auto, which refuses to shrink
 * below their own content. A single wide card or input then pushes the whole
 * page past the viewport, which body { overflow-x: hidden } silently clips
 * rather than fixes. Letting them shrink is what makes the columns fluid.
 */
.grid > *,
.split > *,
.hero__inner > *,
.customers__intro > *,
.customers__brands > *,
.gallery-grid > *,
.footer__grid > * {
  min-width: 0;
}

/* Form controls carry an intrinsic default width for roughly 20 characters. */
.field input,
.field textarea,
.field select {
  min-width: 0;
}

/*
 * Long unbroken strings — email addresses, URLs, case codes — would otherwise
 * set their container's minimum width and widen the page on small screens.
 */
.info-card a,
.footer__contact a,
.breadcrumb,
.post__body a {
  overflow-wrap: anywhere;
}

/* Large desktop ---------------------------------------------------------- */

@media (max-width: 1440px) {
  :root {
    --section-y: 88px;
  }
}

/* Small desktop / large tablet ------------------------------------------- */

@media (max-width: 1200px) {
  :root {
    --section-y: 80px;
  }

  h1 { font-size: 40px; }
  h2 { font-size: 32px; }

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

  .split,
  .hero__inner {
    gap: 44px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

}

/* Tablet — parallax off below 992px per spec ----------------------------- */

@media (max-width: 992px) {
  :root {
    --section-y: 68px;
  }

  h1 { font-size: 36px; }
  h2 { font-size: 29px; }

  /* Fixed backgrounds are unreliable and jittery on touch devices. */
  .band,
  .page-banner {
    background-attachment: scroll;
  }

  /*
   * The desktop band scrim thins toward the right because the copy is capped
   * at 660px there. Here .band__inner spans the full width, so the copy would
   * run over the thin edge — go back to an even wash.
   */
  .band {
    background-image: linear-gradient(rgba(8, 32, 48, .84), rgba(8, 32, 48, .84)),
                      var(--band-image, url('../images/banner-quality.svg'));
  }

  .band {
    padding-block: 90px;
  }

  .page-banner {
    padding-block: 96px;
    border-radius: 0 0 28px 28px;
  }

  /* Three columns leave too little room for a card at this width. */
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .topbar__inner {
    grid-template-columns: auto 1fr;
    gap: 20px;
  }

  /* The topbar CTA is duplicated by the mobile nav panel. */
  .topbar__cta {
    display: none;
  }

  .header-info__inner {
    justify-content: center;
    text-align: center;
  }

  .nav__toggle {
    display: grid;
  }

  .nav__inner {
    flex-wrap: wrap;
  }

  .nav__panel {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
  }

  .nav__panel.is-open {
    display: flex;
    animation: slideDown .35s cubic-bezier(.4, 0, .2, 1);
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .nav__links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__link {
    padding: 12px 4px;
    border-bottom: 1px dashed var(--border);
  }

  .nav__link::after {
    display: none;
  }

  .nav__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 4px 6px;
  }

  .hero {
    padding-block: 60px 70px;
  }

  .hero--carousel {
    padding-block: 0;
  }

  .hero-carousel__slide {
    padding-block: 56px 84px;
  }

  /* Arrows would sit over the artwork at this width — dots and swipe remain. */
  .hero-carousel__arrow {
    display: none;
  }

  .hero__inner,
  .split {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Photo above copy reads better than copy above photo on the hero. */
  .hero__media {
    order: -1;
  }

  /* Copy above media once the two halves stop fitting side by side. */
  .customers__intro {
    grid-template-columns: 1fr;
    gap: 36px;
  }

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

  .deco-circle {
    width: 96px;
    height: 96px;
    left: -20px;
    bottom: -20px;
  }

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

  .footer__grid > *:last-child {
    grid-column: span 2;
  }

  .map iframe {
    height: 380px;
  }
}

/* Mobile ----------------------------------------------------------------- */

@media (max-width: 768px) {
  /* Narrower logo slots keep several brands in view on a phone-width strip. */
  .partner {
    width: 140px;
    padding: 12px;
  }

  .partner {
    margin-right: 16px;
  }

  :root {
    --section-y: 56px;
    --radius-lg: 18px;
  }

  h1 { font-size: 31px; }
  h2 { font-size: 25px; }
  h3 { font-size: 20px; }

  body {
    font-size: 14.5px;
  }

  .container {
    padding-inline: 18px;
  }

  .grid {
    gap: 20px;
  }

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

  .photo-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
    margin-bottom: 40px;
  }

  .gallery-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-search {
    max-width: none;
  }

  .lightbox__nav--prev,
  .lightbox__nav--next {
    top: auto;
    bottom: -60px;
    transform: none;
  }

  .lightbox__nav--prev {
    left: 0;
  }

  .lightbox__nav--next {
    right: 0;
  }

  /* Container padding is only 18px here, so the old offset hung off-screen. */
  .deco-circle {
    left: -10px;
    bottom: -10px;
  }

  .section__head {
    margin-bottom: 36px;
  }

  .customers__stat {
    padding: 26px 22px;
  }

  .customers__stat-figure {
    font-size: 44px;
  }

  .customers__cities-panel {
    padding: 20px 22px;
  }

  .customers__note {
    font-size: 16.5px;
  }

  .brand-card {
    min-height: 0;
    padding: 16px 16px;
  }

  .topbar__inner {
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: center;
  }

  .header-info__inner {
    flex-direction: column;
    gap: 6px;
  }

  .logo {
    justify-content: center;
  }

  .logo img {
    height: 38px;
  }

  .search {
    max-width: none;
  }

  .band {
    padding-block: 70px;
  }

  .page-banner {
    padding-block: 74px;
    border-radius: 0 0 20px 20px;
  }

  .cta {
    padding-block: 64px;
  }

  .stat {
    padding: 28px 18px;
  }

  .stat__value {
    font-size: 36px;
  }

  .form {
    padding: 26px 20px;
  }

  .panel {
    padding: 26px 22px;
  }

  .value-card {
    flex-direction: column;
    gap: 16px;
    padding: 26px 22px;
  }

  .solution-card {
    min-height: 300px;
  }

  /* Hover reveal is meaningless on touch — always show the copy. */
  .solution-card p {
    max-height: 200px;
    opacity: 1;
  }

  .footer {
    padding-top: 56px;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-bottom: 40px;
  }

  .footer__bottom {
    justify-content: center;
    text-align: center;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  .float-actions {
    right: 16px;
    bottom: 70px;
    gap: 10px;
  }

  .float-actions__btn {
    width: 44px;
    height: 44px;
  }

  .float-actions__btn svg {
    width: 20px;
    height: 20px;
  }

  /* No hover on touch, so the slide-out labels only get in the way. */
  .float-actions__btn::after {
    display: none;
  }

  .map iframe {
    height: 320px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    transform: none;
    justify-content: center;
  }

  @keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* Small mobile ----------------------------------------------------------- */

@media (max-width: 575px) {
  .partner {
    width: 118px;
  }

  /* A wide fade would swallow most of a narrow strip. */
  .partners-marquee {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 32px,
                        #000 calc(100% - 32px), transparent);
            mask-image: linear-gradient(to right, transparent, #000 32px,
                        #000 calc(100% - 32px), transparent);
  }

  .btn {
    padding: 11px 24px;
    font-size: 14.5px;
  }

  .hero__play {
    width: 66px;
    height: 66px;
  }

  .hero__play svg {
    width: 22px;
    height: 22px;
  }

  .pagination a,
  .pagination span {
    min-width: 38px;
    height: 38px;
    font-size: 13.5px;
  }

  .recent img {
    width: 62px;
    height: 54px;
  }

  /* Two columns are ~210px here, so the longer client names need the room. */
  .customers__brands {
    gap: 12px;
  }

  .brand-card__name {
    font-size: 15px;
  }

  .brand-card__sub {
    font-size: 12.5px;
  }
}

@media (max-width: 375px) {
  h1 { font-size: 27px; }
  h2 { font-size: 22px; }

  .container {
    padding-inline: 14px;
  }

  .stat__value {
    font-size: 32px;
  }

  /* Two columns leave no room for the longer brand names at this width. */
  .customers__brands {
    grid-template-columns: 1fr;
  }

  .icon-card,
  .product-card {
    padding: 24px 18px;
  }

  .share {
    flex-wrap: wrap;
  }
}
