/*
 * Precision Electronics — additions to the approved design's style.css (which stays as delivered, so it can be compared
 * with the design). Spec §5: the site's own pieces (forms' states, page sections) and the
 * phone/tablet fixes. Uses the design's tokens (:root in style.css).
 */

/* ------------------------------------------------------------------ shell */
.skip-link{position:absolute;left:12px;top:-60px;z-index:1000;padding:10px 16px;background:var(--brand);color:#fff;font-weight:600;transition:top .2s}
.skip-link:focus{top:12px}
.header .phone{text-decoration:none}
.m-nav .m-phone{display:block;text-decoration:none}
.fbrand .flogo{display:block;width:260px;height:61px;max-width:100%;background:#fff;-webkit-mask:url(/img/logo-white.png) no-repeat 0 0/contain;mask:url(/img/logo-white.png) no-repeat 0 0/contain}
.modal.doc .doc-pdf{position:absolute;left:24px;bottom:20px;background:#fff;padding:8px 14px}
main.page:focus{outline:none}

/* ------------------------------------------------------------------ forms */
.hp{position:absolute!important;left:-9999px;width:1px;height:1px;overflow:hidden}
.form-error{padding:12px 16px;border-left:4px solid #c62828;background:#fdecea;color:#7f1d1d;font-size:15px;line-height:22px}
.form-hint{margin-top:-6px;font-size:13px;line-height:20px;color:var(--muted)}
.field .err{font-size:13px;line-height:18px;color:#c62828}
.field.invalid input,.field.invalid textarea{border-color:#c62828}
form.sending [type=submit]{opacity:.6;pointer-events:none}

/* ------------------------------------------------------------------ links the design draws as text */
.ph-content .ph-link,.products .intro a{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px}
.ph-content .ph-link:hover,.products .intro a:hover{color:var(--accent)}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ------------------------------------------------------------------ page sections (tb_paragraph, core/Sections.php) */
.psec-stacked{padding:86px 0}
.psec-stacked.white{background:#fff}
.psec-stacked.pale{background:var(--pale)}
.psec-in{max-width:1100px}
.psec-photo{margin:28px 0}
.psec-photo img{display:block;width:100%;height:auto}
.psec .ticks{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:12px}
.psec .ticks li{position:relative;padding-left:30px;font-size:16px;line-height:28px;color:var(--text-2)}
.psec .ticks li::before{content:"";position:absolute;left:2px;top:9px;width:14px;height:8px;border-left:2px solid var(--brand);border-bottom:2px solid var(--brand);transform:rotate(-45deg)}
.psec .ticks b{color:var(--text);font-weight:600}
.psec-points-label{font-size:14px;letter-spacing:1.12px;text-transform:uppercase;color:var(--brand);font-weight:600}
.psec-outcome{padding-left:16px;border-left:3px solid var(--brand);font-weight:600;color:var(--text)}
@media (max-width:760px){.psec-stacked{padding:48px 0}}

/* ------------------------------------------------------------------ <picture> where the design has a bare <img> */
.imgbox > picture,.thumb > picture{display:block}
.imgbox > picture > img,.thumb > picture > img{display:block;width:100%;height:100%;object-fit:contain}
.split-photo picture,.about .photo picture{display:block;width:100%;height:100%}
.about .photo img{display:block;width:100%;height:100%;object-fit:cover}

/* ------------------------------------------------------------------ 404 (no design page: the FAQ page's language) */
.error-page{background:#fff;padding:90px 0 120px;text-align:center}
.error-code{font-size:140px;line-height:1;font-weight:200;letter-spacing:-4px;color:var(--pale);-webkit-text-stroke:1px var(--border)}
.error-page h1{margin:8px 0 18px;font-size:50px;line-height:65px;font-weight:300;letter-spacing:-.5px;color:var(--text)}
.error-text{max-width:620px;margin:0 auto;font-size:17px;line-height:28px;color:var(--text-2)}
.error-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:14px;margin-top:36px}
.error-links{list-style:none;margin:48px auto 0;padding:28px 0 0;border-top:1px solid var(--border);max-width:900px;display:flex;flex-wrap:wrap;justify-content:center;gap:14px 30px}
.error-links .link{color:var(--brand);font-size:16px}
@media (max-width:760px){
  .error-page{padding:48px 0 64px}
  .error-code{font-size:96px}
  .error-page h1{font-size:34px;line-height:42px}
  .error-actions .btn{width:100%;justify-content:center}
}
.btn-line{background:#fff;color:var(--brand);border:1px solid var(--brand);padding-inline:32px}
.btn-line:hover{background:var(--brand);color:#fff}

/* ------------------------------------------------------------------ phones and tablets (spec §5: no mobile design; the design's own
   breakpoints 1279 / 760 / 520 are kept, these refine them) */
@media (max-width:760px){
  /* product grids: a picture beside the text instead of a tall card, so seven products fit in a few screens */
  .products .grid .card,.catalog .grid .card{display:grid;grid-template-columns:118px minmax(0,1fr);grid-template-rows:auto 1fr;column-gap:16px;padding:14px;align-items:start}
  .products .grid .card .imgbox,.catalog .grid .card .imgbox{grid-row:1 / span 2;aspect-ratio:1/1;align-self:center}
  .products .grid .card .txt,.catalog .grid .card .txt{padding-top:0;gap:2px}
  .products .grid .card .name,.catalog .grid .card .name{font-size:22px;line-height:28px}
  .products .grid .card .series,.catalog .grid .card .series{line-height:20px}
  .products .grid .card .bottom,.catalog .grid .card .bottom{padding-top:10px;align-self:end}
  .products .grid .card .tag,.catalog .grid .card .tag{padding:3px 6px;font-size:12px;line-height:18px}
  .products .grid .card .sq,.catalog .grid .card .sq{display:none}
  .products .grid,.catalog .grid{gap:12px}
  .products .grid .viewall{min-height:0;padding:22px}
  /* the related products scroll sideways by touch: show that there is more */
  .related .carousel{scroll-padding-left:20px;padding-bottom:12px}
  /* guidance features: one per line */
  .cta .feats{flex-direction:column;align-items:flex-start;gap:14px}
  .cta .feats .v{display:none}
  .cta .feat p br{display:none}
  /* comfortable taps in the footer and the phone menu */
  .footer .fcol a{display:inline-block;padding:6px 0}
  .m-nav a{min-height:44px;display:flex;align-items:center}
  .m-nav .sub a{min-height:40px}
  /* popups use the whole phone screen */
  .scrim .modal.quote{max-height:100dvh;overflow-y:auto}
  .modal.doc img{max-height:80dvh;width:auto;max-width:100%}
  /* the spec table's label column a little wider for long labels */
  .spec-row span{min-width:0;overflow-wrap:anywhere}
}
@media (max-width:480px){
  .products .grid .card,.catalog .grid .card{grid-template-columns:96px minmax(0,1fr);column-gap:12px}
  .tags{flex-wrap:wrap;row-gap:4px}
}
@media (max-width:374px){
  /* the smallest phones (320 px): the header's three pieces must fit */
  .header .logo-link svg{width:116px;height:auto}
  .header .btn-bright{padding-inline:10px;font-size:13px}
  .story .yr{font-size:50px;line-height:58px}
}

/* the phone menu scrolls inside the screen (seven products made it taller than a phone) */
@media (max-width:1279px){.m-nav{max-height:calc(100dvh - 76px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}}
@media (min-width:761px) and (max-width:1279px){.m-nav{max-height:calc(100dvh - 120px)}}

/* ------------------------------------------------------------------ sticky header (2026-11-25, user): fixed at the top; once the page
   scrolls (js/site.js adds .is-scrolled) it shrinks and turns solid, and stays so while scrolled */
.header{position:fixed;transition:height .35s var(--ease),top .35s var(--ease),background-color .35s var(--ease),box-shadow .35s var(--ease)}
.header .logo-slot,.header .nav-item,.header .phone,.header .btn-md{transition:width .35s var(--ease),height .35s var(--ease),padding .35s var(--ease)}
.dropdown{top:calc(100% - 1px)}
html{scroll-padding-top:100px}
.header.is-scrolled{top:0;height:84px;background:linear-gradient(90deg, rgba(6,20,43,.97), rgba(10,34,80,.97));box-shadow:0 8px 24px rgba(6,20,43,.28)}
.header.is-scrolled .logo-slot{width:200px;height:47px}
.header.is-scrolled .nav-item{padding:18px 0 8px}
.header.is-scrolled .phone{padding-top:4px}
.header.is-scrolled .btn-md{height:52px}
@media (max-width:1365px){.header.is-scrolled .logo-slot{width:190px;height:44.6px}}
@media (max-width:760px){
  .header.is-scrolled{height:64px}
  .header.is-scrolled .logo-slot{width:140px;height:33px}
  .header.is-scrolled .btn-md{height:42px}
  .header.is-scrolled .m-nav{max-height:calc(100dvh - 64px)}
  html{scroll-padding-top:80px}
}
@media (max-width:520px){.header.is-scrolled .logo-slot{width:120px;height:28px}}
@media (prefers-reduced-motion:reduce){.header,.header *{transition:none!important}}

/* ------------------------------------------------------------------ Lighthouse (2026-11-25): accessibility without a visible change */
.fcol h2.fh{margin:0 0 3.6px;font-size:14px;line-height:20px;font-weight:700;letter-spacing:1.12px;color:var(--brand)}
.card .num{color:#66728a}   /* the design's --muted (#7a869c) is 3.6:1 on white; this reads the same and passes 4.5:1 */

/* The design's entrance fades start at opacity 0, and Chrome never counts an element that is invisible when first painted
   as the page's largest paint (Lighthouse then reports none: "NO_LCP"). The same fades from .01 look identical and let the
   page title count from the first frame. */
@keyframes pageInLcp{from{opacity:.01;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes fadeUpLcp{from{opacity:.01;transform:translateY(28px)}to{opacity:1;transform:none}}
.page{animation-name:pageInLcp}
.fu > *,.fu .s-head > *{animation-name:fadeUpLcp}
/* the page-header photo is placed by main.js (the design's crop); hidden until then, so placing it is no layout shift */
.js .page-hero[data-iw] .ph-photo:not(.is-fit){visibility:hidden}

/* ------------------------------------------------------------------ Request a Quote popup on phones (2026-11-25, user): compact */
@media (max-width:760px){
  .quote-form{padding:40px 18px 22px}
  .quote-form .label{font-size:12px;line-height:16px;gap:10px}
  .quote-form .label i{width:36px}
  .quote-form h2{margin-top:8px;font-size:28px;line-height:34px}
  .quote-form .lead{margin-top:8px;font-size:14px;line-height:21px}
  .quote-form .form{margin-top:18px;gap:10px}
  .quote-form .f-row{gap:10px}
  .quote-form .field{gap:6px}
  .quote-form .field input{height:48px;padding:10px 14px}
  .quote-form .field textarea{height:92px;padding:12px 14px}
  .quote-form .upload{gap:8px 12px}
  .quote-form .ubox{width:40px;height:40px}
  .quote-form .ulabel{font-size:13px;line-height:20px}
  .quote-form .choose{height:38px;padding:0 14px;font-size:15px}
  .quote-form .form-hint{margin-top:-2px;font-size:12px;line-height:17px}
  .quote-form [type=submit]{width:100%!important;height:52px;justify-content:center}
  .quote-form .sent{margin-top:18px}
  .modal.quote .x-btn{top:8px;right:8px}
  /* 16 px text in every form field: phones (iOS) zoom into anything smaller when it is tapped */
  .field input,.field textarea{font-size:16px}
}

/* ------------------------------------------------------------------ Related Products as a Swiper carousel (2026-11-25, user):
   the design's strip (six across on wide screens, cards 258 px at least, 9.9 px apart), dragged with the mouse or a finger,
   with arrows beside View All Products; Swiper hides the arrows when every card already fits */
.related-tools{display:flex;align-items:center;gap:22px}
.rel-nav{display:flex;gap:8px}
.rel-nav button{width:44px;height:44px;display:flex;align-items:center;justify-content:center;border:1.5px solid var(--text);background:#fff;transition:background-color .3s var(--ease),border-color .3s var(--ease)}
.rel-nav button:hover{background:var(--accent);border-color:var(--accent)}
.rel-nav button:hover path{stroke:#fff}
.rel-nav .rel-prev svg{transform:rotate(180deg)}
.rel-nav button.swiper-button-disabled{opacity:.35;pointer-events:none}
.rel-nav button.swiper-button-lock,.rel-nav:has(.swiper-button-lock){display:none}
.related-swiper{margin-top:30px;padding-bottom:4px}
.related-swiper .swiper-slide{width:calc((100% - 5 * 9.9px) / 6);min-width:258px;height:auto}
.related-swiper .swiper-slide .card{height:100%;min-width:0;flex:none;width:100%}
/* without JavaScript the row still scrolls sideways */
.related-swiper:not(.swiper-initialized) .swiper-wrapper{overflow-x:auto;gap:9.9px}
@media (max-width:760px){
  .related-head{flex-wrap:wrap;row-gap:12px}
  .related-tools{gap:14px}
  .rel-nav button{width:40px;height:40px}
  .related-swiper .swiper-slide{width:72%;min-width:0}
}

/* ------------------------------------------------------------------ the product gallery as a Swiper (2026-11-25, user): the
   design's box, picture sizes and thumbnails, the pictures side by side in a strip. The strip is laid out here as well as by
   Swiper's stylesheet, which loads after the first paint, so the first picture sits right from the start */
.pg-swiper,.lb-swiper{position:absolute;inset:0;overflow:hidden}
.pg-swiper .swiper-wrapper,.lb-swiper .swiper-wrapper{display:flex;height:100%}
.pg-swiper .swiper-slide,.lb-swiper .swiper-slide{flex:none;width:100%;height:100%;display:flex;align-items:center;justify-content:center}
/* the design blends the photos' white into the grey box (multiply); Swiper's slides are layers of their own, so each slide
   carries the box's grey for the photo to blend into */
.pg-swiper .swiper-slide{background:var(--subtle)}
.pg-main .pg-expand{z-index:2;display:block}
.pg-main .pg-expand svg{display:block;width:100%;height:100%}
.pg-main .pg-expand:focus-visible{outline:2px solid var(--brand);outline-offset:3px}
.pg-thumb{aspect-ratio:183/131;background:#fff;border:1px solid var(--border);overflow:hidden;transition:border-color .25s}
.pg-thumb img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .5s var(--ease)}
.pg-thumb:hover img{transform:scale(1.06)}
.pg-thumb.on{border:2px solid var(--brand)}
/* full screen: the design's stage holds the strip; the slides glide, so the pictures' own fade-in goes; each picture sits
   in Swiper's zoom box at its own size (so a zoomed picture pans over the picture, not over empty margins) */
.lb-swiper .swiper-zoom-container{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.lightbox .lb-swiper img{animation:none;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain}
.lb-swiper .swiper-slide-zoomed{cursor:move}
.lb-nav{z-index:2}
.lb-nav.swiper-button-disabled{opacity:.35;pointer-events:none}
@media (max-width:760px){
  .pg-main .pg-expand{right:12px;top:12px;width:40px;height:40px}
  .thumbs.pg-thumbs{gap:8px;margin-top:8px}
  /* phones swipe and pinch: the view takes nearly the whole width, the stage is taller, the arrows shrink to its edges */
  .lb-scrim{padding:max(8px, env(safe-area-inset-top, 0px)) 8px max(8px, env(safe-area-inset-bottom, 0px))}
  .lightbox{width:100%;max-width:100%;padding:20px 12px 22px}
  .lb-stage{margin-top:12px;aspect-ratio:4/3}
  .lb-nav{width:44px;height:44px}
  .lb-nav svg{width:44px;height:44px}
  .lb-nav.prev{left:-4px}.lb-nav.next{right:-4px}
  .lightbox .x-btn{top:12px;right:10px}
}
