/* CZAR Engineering - static site stylesheet
   Mobile-first. At >= 960px the original 927x708 "diamond" frame is used and
   regions sit at the same coordinates as the legacy sliced layout. */

:root {
  --slate-900: #223944;
  --slate: #2b4c5f;
  --band: #294959;
  --bar: #e6e6e6;
  --tab: #c8c8c8;
  --title: #244768;
  --link: #30538c;
  --nav-link: #affcfb;
  --text: #464646;
  --heading: #284c5e;
  --pic-border: #a0adb4;
  --footer-text: #c3ced4;
  --white: #fff;
  --font-display: Ubuntu, "Segoe UI", "Trebuchet MS", Tahoma, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 14px/1.5 var(--font-body);
  color: var(--text);
  background: var(--slate-900);
}
img { display: block; max-width: 100%; height: auto; border: 0; }
a { color: var(--link); }
a[href^="tel:"] { white-space: nowrap; }
a:focus-visible, button:focus-visible { outline: 2px solid #f5a623; outline-offset: 2px; }
ul { margin: 0; padding: 0; }
p { margin: 0 0 10px; }
h1, h2 { margin: 0; font-weight: normal; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 8px; top: -100px; z-index: 10; padding: 8px 12px;
  background: var(--white); color: var(--slate-900); font-weight: bold; border-radius: 3px;
}
.skip:focus { top: 8px; }

/* ---------- rotating photo background (chosen by inline head script) ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background: var(--slate-900) center / cover no-repeat;
}
.bg { background-image: url("/assets/img/bg/1.jpg"); background-image: image-set(url("/assets/img/bg/1.webp") type("image/webp"), url("/assets/img/bg/1.jpg") type("image/jpeg")); }
html[data-bg="2"] .bg { background-image: url("/assets/img/bg/2.jpg"); background-image: image-set(url("/assets/img/bg/2.webp") type("image/webp"), url("/assets/img/bg/2.jpg") type("image/jpeg")); }
html[data-bg="3"] .bg { background-image: url("/assets/img/bg/3.jpg"); background-image: image-set(url("/assets/img/bg/3.webp") type("image/webp"), url("/assets/img/bg/3.jpg") type("image/jpeg")); }
html[data-bg="4"] .bg { background-image: url("/assets/img/bg/4.jpg"); background-image: image-set(url("/assets/img/bg/4.webp") type("image/webp"), url("/assets/img/bg/4.jpg") type("image/jpeg")); }
html[data-bg="5"] .bg { background-image: url("/assets/img/bg/5.jpg"); background-image: image-set(url("/assets/img/bg/5.webp") type("image/webp"), url("/assets/img/bg/5.jpg") type("image/jpeg")); }
html[data-bg="6"] .bg { background-image: url("/assets/img/bg/6.jpg"); background-image: image-set(url("/assets/img/bg/6.webp") type("image/webp"), url("/assets/img/bg/6.jpg") type("image/jpeg")); }
html[data-bg="7"] .bg { background-image: url("/assets/img/bg/7.jpg"); background-image: image-set(url("/assets/img/bg/7.webp") type("image/webp"), url("/assets/img/bg/7.jpg") type("image/jpeg")); }
html[data-bg="8"] .bg { background-image: url("/assets/img/bg/8.jpg"); background-image: image-set(url("/assets/img/bg/8.webp") type("image/webp"), url("/assets/img/bg/8.jpg") type("image/jpeg")); }
html[data-bg="9"] .bg { background-image: url("/assets/img/bg/9.jpg"); background-image: image-set(url("/assets/img/bg/9.webp") type("image/webp"), url("/assets/img/bg/9.jpg") type("image/jpeg")); }
html[data-bg="10"] .bg { background-image: url("/assets/img/bg/10.jpg"); background-image: image-set(url("/assets/img/bg/10.webp") type("image/webp"), url("/assets/img/bg/10.jpg") type("image/jpeg")); }
html[data-bg="11"] .bg { background-image: url("/assets/img/bg/11.jpg"); background-image: image-set(url("/assets/img/bg/11.webp") type("image/webp"), url("/assets/img/bg/11.jpg") type("image/jpeg")); }

/* ---------- mobile / tablet layout ---------- */
.site {
  position: relative;
  max-width: 760px;
  margin: 12px;
  background: var(--white);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
}
@media (min-width: 784px) { .site { margin: 24px auto; } }

.masthead { display: flex; flex-wrap: wrap; align-items: center; }
.brand { display: block; padding: 14px 16px; }
.brand-logo { width: 73px; height: 68px; }
.tagline {
  flex: 1 1 100%; order: 3; margin: 0; padding: 12px 16px;
  font: 14px/1.35 var(--font-display); color: #f0f1f2; background: var(--slate-900);
}
.tagline strong { font-weight: 600; }
.nav { flex: 1 1 100%; order: 4; background: var(--slate); }
.nav ul { display: flex; flex-wrap: wrap; list-style: none; gap: 0 22px; padding: 8px 16px; }
.nav a {
  display: inline-block; padding: 6px 0; font: 600 16px/1.2 var(--font-display);
  color: var(--nav-link); text-underline-offset: 3px;
}
.nav a[aria-current="page"] { color: var(--white); text-decoration: none; }

.titlebar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  padding: 14px 16px; background: var(--bar);
}
.page-title { font: 300 30px/1.1 var(--font-display); color: var(--title); margin: 0; }
.subnav ul { display: flex; flex-wrap: wrap; list-style: none; gap: 4px 6px; }
.subnav a {
  display: inline-block; padding: 6px 12px; font: 14px/1.2 var(--font-body);
  color: var(--link); text-underline-offset: 2px;
}
.subnav a.is-current, .subnav a[aria-current="page"] {
  color: #000; font-weight: bold; text-decoration: none; background: var(--tab);
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%);
  padding-left: 22px; padding-right: 16px;
}

.main { padding: 20px 16px; font-size: 14px; }
.main ul { padding-left: 20px; }
.main li { margin-bottom: 4px; }
.lead-heading, .main h2 {
  display: block; margin: 4px 0 8px; font: bold 15px/1.3 Verdana, Tahoma, var(--font-body);
  color: var(--heading);
}
.cols { display: grid; gap: 18px; }
.list-dash { list-style: none; padding-left: 0 !important; }
.list-dash li { position: relative; padding-left: 20px; margin-bottom: 7px; }
.list-dash li::before { content: "\2014"; position: absolute; left: 0; }
.bordered { border: 4px solid var(--pic-border); }
.home-pics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.home-pics img { width: 100%; }

/* company panels */
.panel { display: none; }
.panel.is-active { display: block; }
html:not(.js) .panels:not(:has(.panel:target)) #overview { display: block; }
html:not(.js) .panel:target { display: block; }
.js .panel { transition: opacity .2s ease; }
.js .panel.is-entering { opacity: 0; }

/* category tiles */
.tiles { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 0 !important; }
.tiles a { display: block; text-align: center; text-decoration: none; color: #000; }
.tiles img { margin: 0 auto; width: 181px; }
.tiles span { display: block; margin-top: 8px; font: 500 17px/1.2 var(--font-display); }
.tiles a:hover span, .tiles a:focus-visible span { text-decoration: underline; }

/* project list */
.plist { position: relative; }
.plist-page { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; padding: 0 !important; margin-bottom: 18px; }
.card a { display: block; color: #000; text-decoration: none; }
.card img { width: 100%; aspect-ratio: 206 / 155; object-fit: cover; }
.card span { display: block; padding: 8px 6px 0; font: 17px/1.15 var(--font-display); }
.card a:hover span, .card a:focus-visible span { text-decoration: underline; }
.pager, .arrow { display: none; }

/* individual project */
.project-name { font: 300 26px/1.2 var(--font-display); color: #111; margin-bottom: 12px; }
.gallery { position: relative; }
.shots { position: relative; aspect-ratio: 393 / 294; background: #eee; }
.shot { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot.is-active { opacity: 1; visibility: visible; transition: opacity .2s ease; }
html:not(.js) .shot:first-child { opacity: 1; visibility: visible; }
.thumbs { list-style: none; display: flex; gap: 10px; padding: 10px 0 0 !important; }
.thumbs a { display: block; border: 2px solid transparent; }
.thumbs a.is-active { border-color: var(--slate-900); }
.thumbs img { width: 76px; height: 88px; }
.desc { margin-top: 14px; font-size: 14px; }
.desc ul { margin-top: 6px; }
.project-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.project-links a { font: bold 13px/1.3 var(--font-body); color: var(--heading); }

.nf-title { font: 300 26px/1.2 var(--font-display); color: #111; margin-bottom: 12px; }
.contact-card { margin-top: 14px; }
.contact-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.contact-card dt { font-weight: bold; color: var(--heading); }
.contact-card dd { margin: 0; }

.footer {
  display: grid; gap: 10px; padding: 16px; background: var(--slate-900);
  font: 13px/1.6 var(--font-body); color: var(--footer-text);
}
.footer address { font-style: normal; }
.footer a { color: var(--footer-text); text-decoration: none; }
.footer a:hover, .footer a:focus-visible { color: var(--white); text-decoration: underline; }
.footer p { margin: 0; }

/* ---------- desktop: legacy 927x708 frame ---------- */
@media (min-width: 960px) {
  body { display: grid; place-items: center; padding: 16px 0; }
  .site {
    width: 927px; height: 708px; max-width: none; margin: 0;
    background: url("/assets/img/frame.png") 0 0 / 927px 708px no-repeat;
    background-image: image-set(url("/assets/img/frame.webp") type("image/webp"), url("/assets/img/frame.png") type("image/png"));
    box-shadow: none;
  }
  .masthead { display: block; }
  .brand { position: absolute; left: 58px; top: 0; width: 140px; height: 132px; padding: 0; }
  .brand-logo { display: none; }
  .tagline { position: absolute; left: 223px; top: 93px; padding: 0; background: none; font-size: 13.5px; white-space: nowrap; }
  .nav { position: absolute; left: 73px; top: 147px; width: 741px; height: 34px; background: none; }
  .nav ul { padding: 0 0 0 7px; gap: 0; height: 34px; align-items: center; }
  .nav li { margin-right: 27px; }
  .nav a { padding: 4px 0; font-size: 16.5px; }

  .titlebar { position: absolute; left: 73px; top: 181px; width: 741px; height: 77px; padding: 0; background: none; display: block; }
  .page-title { position: absolute; left: 3px; top: 22px; font-size: 34px; }
  .subnav { position: absolute; right: 0; top: 0; height: 77px; }
  .subnav ul { height: 77px; align-items: center; flex-wrap: nowrap; gap: 0; padding-right: 38px; }
  .subnav a { padding: 9px 13px; font-size: 14px; }
  .subnav a.is-current, .subnav a[aria-current="page"] { padding: 9px 20px 9px 26px; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 100%, 16px 100%); }

  .main { position: absolute; left: 73px; top: 258px; width: 741px; height: 385px; padding: 20px 5px; font-size: 13px; overflow: auto; }
  .main ul { padding-left: 20px; }
  .main li { margin-bottom: 2px; }
  .main > p, .panel > p { margin-right: 20px; }
  .cols { grid-template-columns: var(--cols, 1fr 1fr); gap: 10px; padding-right: 10px; }
  .home .cols { --cols: 65fr 35fr; }
  .home-pics { display: block; }
  .home-pics img { width: 233px; margin-bottom: 7px; }
  .services .cols { --cols: 47fr 53fr; }
  .history .cols { --cols: 40fr 60fr; }

  .footer { position: absolute; left: 0; top: 643px; width: 927px; height: 65px; padding: 0; background: none; display: block; font-size: 11.5px; line-height: 17px; }
  .footer > * { position: absolute; top: 14px; }
  .footer .f-addr { left: 127px; }
  .footer .f-phone { left: 344px; }
  .footer .f-mail { left: 497px; }

  /* project categories index */
  .tiles { grid-template-columns: repeat(4, 180px); gap: 0; margin-top: 40px; justify-content: start; }

  /* project list: 3 cards per page, cross-faded */
  .main.is-list { padding: 0; overflow: hidden; }
  .plist { position: absolute; left: 0; top: 60px; width: 740px; height: 320px; }
  .plist-page { position: absolute; left: 36px; top: 0; width: 668px; display: grid; grid-template-columns: repeat(3, 206px); gap: 25px; margin: 0; }
  .card span { padding: 9px 6px 0; font-size: 16px; line-height: 18px; }
  .js .plist-page { opacity: 0; visibility: hidden; transition: opacity .15s linear, visibility 0s linear .15s; }
  .js .plist-page.is-active { opacity: 1; visibility: visible; transition: opacity .15s linear; }
  html:not(.js) .main.is-list { overflow: auto; }
  html:not(.js) .plist { position: static; padding: 30px 36px; height: auto; }
  html:not(.js) .plist-page { position: static; margin-bottom: 25px; }
  .js .pager { display: flex; align-items: center; gap: 6px; position: absolute; left: 566px; top: 281px; }
  .pager span { font: bold 14px var(--font-body); color: var(--heading); margin-right: 4px; }
  .pager button { min-width: 20px; padding: 0 3px; font: bold 14px/18px var(--font-body); color: #000; border: 2px solid transparent; }
  .pager button[aria-current="true"] { background: #30538c; border-color: #30538c; color: var(--white); }
  .js .arrow { display: grid; place-items: center; position: absolute; top: 0; width: 36px; height: 155px; color: var(--slate-900); }
  .arrow[hidden] { display: none !important; }
  .arrow.prev { left: 0; }
  .arrow.next { left: 704px; }
  .arrow svg { width: 12px; height: 22px; fill: currentColor; }

  /* individual project, legacy coordinates */
  .main.is-project { padding: 0; overflow: hidden; }
  .project { position: relative; width: 741px; height: 385px; }
  .project-name { position: absolute; left: 0; top: 0; width: 741px; height: 55px; margin: 0; padding: 12px 0 0 6px; font-size: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gallery { position: static; }
  .shots { position: absolute; left: 95px; top: 55px; width: 393px; height: 294px; }
  .thumbs { position: absolute; left: 0; top: 55px; flex-direction: column; gap: 9px; padding: 0 !important; }
  .thumbs a { border-width: 2px; }
  .desc { position: absolute; left: 504px; top: 55px; width: 237px; height: 294px; margin: 0; padding-right: 2px; font-size: 11px; line-height: 1.17; overflow: auto; }
  .desc p { margin-bottom: 4px; }
  .desc ul { padding-left: 18px; margin-top: 3px; }
  .desc li { margin-bottom: 0; }
  .project-links { position: absolute; left: 95px; top: 349px; width: 646px; margin: 0; padding-top: 9px; display: block; }
  .project-links .back { position: absolute; left: 0; }
  .project-links .next { position: absolute; left: 409px; }
  .project-links a { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .bg, .nav, .subnav, .skip, .thumbs, .pager, .arrow { display: none !important; }
  body { background: #fff; display: block; }
  .site { width: auto !important; height: auto !important; background: none !important; box-shadow: none; margin: 0; }
  .site > *, .main, .footer > * { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; }
  .footer { color: #000; background: none; }
  .footer a { color: #000; }
  .shot { position: static; opacity: 1; visibility: visible; }
}
