/*
 * tekscode.com, rebuilt.
 *
 * The palette and the image-based navigation are the original's, lifted from
 * the 2005 stylesheet: #346 ground, #10173d panel over the m_sub.gif texture,
 * #FAE17F headings, #ffcc66 links. What has changed is underneath -- the
 * table layout is a grid, and the nav rollovers are CSS rather than the
 * preloadImages()/changeImages() pair in rollover.js, which is gone.
 */

:root {
  --ink: #bde;
  --ground: #334466;
  --panel: #10173d;
  --rule: #aaccdd;
  --heading: #fae17f;
  --link: #ffcc66;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.5rem;
  background: var(--ground);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 100%;
  line-height: 1.5;
  display: grid;
  grid-template-columns: 127px minmax(0, 46rem);
  grid-template-areas: "nav main" ".  footer";
  gap: 1.5rem;
  justify-content: center;
}

/* ------------------------------------------------------------------- nav */

header {
  grid-area: nav;
  text-align: right;
}

header nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The nav was eight gif pairs swapped by javascript on mouseover. The images
   are kept; the swap is a background-position-free two-image hover instead. */
header nav a {
  display: block;
  width: 127px;
  height: 31px;
  margin-bottom: 1px;
  /* Image replacement, with two traps worth naming. text-align has to be
     reset, because the header is right-aligned and a right-aligned line box
     absorbs a negative text-indent entirely -- the label lands back on top of
     the image. And nowrap is needed because text-indent only moves the first
     line, so "Request Quote" would otherwise wrap and paint its second line.
     The text stays in the accessibility tree, which is the point. */
  text-align: left;
  text-indent: -9999px;
  white-space: nowrap;
  overflow: hidden;
  background-repeat: no-repeat;
}

/* --------------------------------------------------------------- content */

main {
  grid-area: main;
  border: 1px solid var(--rule);
  background-color: var(--panel);
  background-image: url(images/m_sub.gif);
  padding: 1.5rem;
}

/* The original had one heading level: every subject on a page was an h1,
   gold, with a hairline rule under it. Kept as it was. */
/* The page gets one h1 naming it, for the document outline and for anyone
   arriving by screen reader. It is not painted: the original had no page
   heading and this does not add one. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

main h2 {
  margin: 0 0 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--ground);
  color: var(--heading);
  font-size: 1rem;
}

main > div { margin-bottom: 2.5rem; }
main > div:last-child { margin-bottom: 0; }

main p {
  margin: 0 0 0 2rem;
  font-size: 0.875rem;
}

a { color: var(--link); font-weight: bold; }
a:hover { color: #fff; }

.portfolio { clear: both; }

.portfolio img {
  float: right;
  max-width: 45%;
  height: auto;
  margin: 0 0 1rem 1rem;
  border: 1px solid var(--rule);
}

.portfolio p { margin-left: 0; }

/* ---------------------------------------------------------------- footer */

footer {
  grid-area: footer;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: bold;
}

/* The original had no small-screen layout at all; this is the one addition. */
@media (max-width: 40rem) {
  body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "nav" "main" "footer";
  }

  header { text-align: left; }
  header nav ul { display: flex; flex-wrap: wrap; gap: 1px; }
  main p { margin-left: 0; }
  .portfolio img { float: none; max-width: 100%; margin-left: 0; }
}

/* One rule per nav item, keyed on the gif name common.php used.
   The current page shows its rollover image, which the original
   never did -- it had no way of knowing where you were. */
.w_home a { background-image: url(images/w_home.gif); }
.w_home.current a,
.w_home a:hover,
.w_home a:focus-visible { background-image: url(images/w_home_over.gif); }
.w_process a { background-image: url(images/w_process.gif); }
.w_process.current a,
.w_process a:hover,
.w_process a:focus-visible { background-image: url(images/w_process_over.gif); }
.w_services a { background-image: url(images/w_services.gif); }
.w_services.current a,
.w_services a:hover,
.w_services a:focus-visible { background-image: url(images/w_services_over.gif); }
.w_portfolio a { background-image: url(images/w_portfolio.gif); }
.w_portfolio.current a,
.w_portfolio a:hover,
.w_portfolio a:focus-visible { background-image: url(images/w_portfolio_over.gif); }
.w_quote a { background-image: url(images/w_quote.gif); }
.w_quote.current a,
.w_quote a:hover,
.w_quote a:focus-visible { background-image: url(images/w_quote_over.gif); }
.w_support a { background-image: url(images/w_support.gif); }
.w_support.current a,
.w_support a:hover,
.w_support a:focus-visible { background-image: url(images/w_support_over.gif); }
.w_about a { background-image: url(images/w_about.gif); }
.w_about.current a,
.w_about a:hover,
.w_about a:focus-visible { background-image: url(images/w_about_over.gif); }
.w_contact a { background-image: url(images/w_contact.gif); }
.w_contact.current a,
.w_contact a:hover,
.w_contact a:focus-visible { background-image: url(images/w_contact_over.gif); }
