/*
 * Short desktop viewport adaptations (e.g. 1440x900, 1366x768, 1920x900).
 * Targets desktop navigation (>= 1025px) with limited vertical space (<= 900px).
 * Loaded after per-template CSS so these overrides win in the cascade.
 */

@media (min-width: 1025px) and (max-height: 900px) {
  /* ----- Global section rhythm ----- */
  .page-root > section,
  .page-root > .section {
    scroll-margin-top: 72px;
  }

  /* ----- Home hero ----- */
  /* Restore the 1920/798 banner ratio so background-size: cover keeps the
     full poster visible; the previous 52vh cap cropped ~130px of the lower
     circuit decoration under 1440x900 (and shorter desktop viewports). */
  .page-root .hero-section .hero-media {
    aspect-ratio: 1920 / 798;
    max-height: none;
    height: auto;
  }

  /* ----- Product detail hero ----- */
  .product-page .product-hero__content {
    min-height: clamp(300px, 38vh, 380px);
    padding-top: 0;
  }

  .product-page .product-hero__watermark {
    top: clamp(48px, 8vh, 72px);
    font-size: clamp(64px, 6vw, 96px);
  }

  .product-page .product-hero h1 {
    font-size: clamp(32px, 2.8vw, 40px);
    line-height: 1.2;
  }

  .product-page .product-hero__copy {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.55;
  }

  .product-page .applications-hero {
    margin-top: 0;
    padding-block: clamp(40px, 6vh, 56px) clamp(72px, 10vh, 96px);
  }

  .product-page .application-tabs {
    margin-top: -40px;
  }

  .product-page .product-capabilities__content {
    padding-block: clamp(36px, 5vh, 48px);
  }

  .product-page .product-capabilities__eyebrow {
    margin-bottom: 12px;
  }

  .product-page .product-action--solid {
    margin-top: 18px;
  }

  .product-page .product-dfm {
    padding: clamp(64px, 10vh, 96px) 0;
  }

  /* ----- Product center ----- */
  .page-product-center .products-hero {
    min-height: clamp(360px, 48vh, 440px);
  }

  .page-product-center .products-hero__content {
    padding-block: clamp(56px, 8vh, 88px);
  }

  .page-product-center .products-shell {
    width: calc(100% - 108px);
    margin-left: 24px;
    margin-right: auto;
  }

  .page-product-center .product-filter {
    padding-block: 36px 12px;
  }

  .page-product-center .products-catalog {
    padding-top: 16px;
    padding-bottom: clamp(64px, 10vh, 96px);
  }

  /* The catalog grid is taller than the viewport, so the shared 12% observer
     threshold can leave the first row transparent until after scrolling. */
  .page-motion-ready .page-product-center .products-catalog-grid .products-catalog-card {
    opacity: 1;
    transform: none;
    will-change: auto;
  }

  /* ----- SMT / assembly pages ----- */
  .smt-page .hero-overlay {
    padding: clamp(40px, 5.5vh, 64px) 0 clamp(48px, 6vh, 72px);
  }

  .smt-page .hero-copy h1 {
    font-size: clamp(32px, 2.8vw, 40px);
    line-height: 1.2;
    margin-bottom: 12px;
  }

  .smt-page .hero-copy p,
  .smt-page .hero-copy .smt-richtext {
    font-size: 15px;
    line-height: 1.55;
  }

  .smt-page .side-anchor {
    max-width: 360px;
  }

  .smt-page .side-anchor h3 {
    font-size: 24px;
    line-height: 28px;
    padding: 18px 10px 14px 40px;
    margin-bottom: 8px;
  }

  .smt-page .side-anchor a {
    padding: 5px 12px 5px 24px;
    font-size: 14px;
    line-height: 22px;
  }

  /* ----- PCB support pages ----- */
  .pcb-support-page .workflow-card__number {
    margin-bottom: 24px;
    font-size: 32px;
    line-height: 1;
  }

  /* ----- About page ----- */
  /* Must stay scoped to .page-about. Application inner pages also use
     .page-root .hero as a full-bleed banner; the About padding/gradient
     would otherwise open a 48-72px blank strip above that image at
     1440x900 (and other short desktop viewports). */
  .page-about .hero {
    padding: clamp(48px, 7vh, 72px) 0 clamp(40px, 6vh, 64px);
    background: linear-gradient(#f9fbfa 0 clamp(320px, 42vh, 400px), #fff clamp(320px, 42vh, 400px) 100%);
  }

  .page-about .hero-head {
    gap: clamp(2rem, 5vw, 4rem);
    margin-bottom: clamp(1rem, 2vh, 1.5rem);
  }

  /* .page-about .hero-title p,
  .page-about .hero-title strong {
    font-size: clamp(32px, 2.8vw, 40px);
    line-height: 1.2;
  } */

  .page-root .philosophy-expander .philosophy-item {
    min-height: clamp(320px, 42vh, 400px);
  }

  /* ----- Structured CPT (blog / video / application archives) ----- */
  .structured-cpt__hero {
    padding: clamp(64px, 9vh, 88px) 0 clamp(48px, 6vh, 64px);
  }

  .structured-cpt__detail {
    padding: clamp(56px, 8vh, 80px) 0;
  }

  .structured-cpt__list {
    padding-bottom: clamp(64px, 10vh, 96px);
  }

  /* ----- Blog / news detail ----- */
  .news-detail-page .news-detail-shell {
    width: calc(100% - 124px);
    margin-left: 40px;
    margin-right: auto;
    padding: clamp(40px, 6vh, 56px) 0 clamp(48px, 7vh, 64px);
  }

  /* ----- Contact / FAQ hero bands ----- */
  .contact-page .contact-hero__image {
    max-height: min(46vh, 420px);
    width: 100%;
    object-fit: cover;
  }

  .contact-page .contact-hero__content {
    padding: clamp(32px, 5vh, 56px) 2rem;
  }

  /* ----- PCB variant hero ----- */
  .pcb-variant-page .pcb-variant-hero {
    min-height: clamp(360px, 46vh, 440px);
  }

  /* ----- Floating social: avoid covering hero CTA on short screens ----- */
  .floating-social {
    top: auto;
    right: 8px;
    bottom: 20px;
    transform: none;
  }

  .floating-social__link {
    width: 40px;
    height: 40px;
  }

  /* ----- Application / Industries: equal image-text gutter ----- */
  /* Base page-application.css uses asymmetric padding-left (74px) and img
     margin-left (10px) on alternating rows, so reverse cards end up with
     300px+ dead space between short copy and the image at 1440 width. */
  .application-page .application-list {
    padding-inline: 0;
  }

  .application-page .application-item {
    --app-item-gutter: clamp(48px, 4vw, 67px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--app-item-gutter);
    max-width: 100%;
  }

  .application-page .application-item__media {
    width: fit-content;
    max-width: 100%;
  }

  .application-page .application-item:not(.application-item--reverse) .application-item__media {
    justify-self: end;
  }

  .application-page .application-item--reverse .application-item__media {
    justify-self: start;
  }

  .application-page .application-item__content {
    width: fit-content;
    max-width: 100%;
  }

  .application-page .application-item:not(.application-item--reverse) .application-item__content {
    justify-self: start;
    padding-left: 0;
  }

  .application-page .application-item--reverse .application-item__content {
    justify-self: end;
  }

  .application-page .application-item__media img {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
}

/*
 * 1440-width desktop: keep SMT body content clear of the fixed side anchor.
 * Applies at full height too; short-height anchor width is tightened above.
 */
@media (min-width: 1181px) and (max-width: 1440px) {
  .smt-page {
    --smt-anchor-offset: 470px;
  }

  .smt-page .smt-section .content-shell,
  .smt-page .related-band .content-shell {
    margin-left: var(--smt-anchor-offset);
    margin-right: auto;
    max-width: calc(100% - var(--smt-anchor-offset) - 72px);
    box-sizing: border-box;
  }

  .smt-page .advantages-section .advantage-grid {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    box-sizing: border-box;
  }

  .smt-page .capability-cta .section-overlay {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 1181px) and (max-width: 1440px) and (max-height: 900px) {
  .smt-page {
    --smt-anchor-offset: 380px;
  }
}

/* Factory Tour Dimension 3: preserve the design's text-led 66/34 split. */
@media (min-width: 1281px) and (max-width: 1440px) and (max-height: 900px) {
  .mc-page .mc-clean {
    grid-template-columns: minmax(0, 66%) minmax(0, 34%);
  }

  .mc-page .mc-clean-copy {
    width: auto;
    max-width: none;
    justify-self: stretch;
    padding: 72px 64px 68px var(--mc-viewport-gutter);
  }
}
