/* True Carpentry & Joinery - shared stylesheet
   Colours and fonts carried over from the original Site.css */

:root {
  --bg: #060708;
  --gold: #a48f6f;
  --text: #ffffff;
  --muted: #696969;
  --rule: #2a2822;
  --panel: #0e0f11;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }

a { color: var(--text); }
a:hover { text-decoration: none; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: #000; padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.page { max-width: 1000px; margin: 0 auto; }

/* ---------- Header ---------- */

.header { border-bottom: 1px solid var(--rule); }

.header .banner { display: block; overflow: hidden; }
.header .banner img { display: block; width: 100%; }

/* Phone numbers are part of the banner artwork on wide screens.
   On narrow screens the banner is cropped to the logo and this strip takes over. */
.contact-strip {
  display: none;
  text-align: center;
  padding: 6px 12px 12px;
  line-height: 1.5;
}
.contact-strip .name { color: var(--gold); font-size: 17px; display: block; }
.contact-strip a {
  display: inline-block;
  font-weight: bold;
  font-size: 17px;
  text-decoration: none;
  padding: 6px 10px;
  white-space: nowrap;
}

/* ---------- Navigation ---------- */

.nav-toggle {
  display: none;
  width: 100%;
  background: var(--panel);
  color: var(--gold);
  border: 0;
  border-top: 1px solid var(--rule);
  font: inherit;
  font-size: 17px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
}
.nav-toggle .bars {
  display: inline-block; width: 20px; height: 14px; margin-right: 10px;
  vertical-align: -1px;
  border-top: 2px solid currentColor; border-bottom: 2px solid currentColor;
  position: relative;
}
.nav-toggle .bars::after {
  content: ""; position: absolute; left: 0; right: 0; top: 4px;
  border-top: 2px solid currentColor;
}

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block;
  color: var(--gold);
  text-decoration: none;
  font-size: 17px;
  line-height: 26px;
  padding: 6px 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
}

/* menu is a horizontal bar under the banner, spanning the full width */
.site-nav { grid-column: 1 / -1; padding: 0 16px; border-bottom: 1px solid var(--rule); }
.site-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 28px; }
.site-nav a { padding: 10px 0; }
.content { padding: 0 16px 24px; min-width: 0; }
.services { padding: 0 0 24px 15px; border-left: 1px solid var(--rule); }

h1, h2 {
  color: var(--gold);
  font-size: 20px;
  font-weight: normal;
  margin: 18px 0 0;
  padding-bottom: 6px;
  border-bottom: 2px dashed var(--rule);
}

p { margin: 10px 0; }

.intro::after { content: ""; display: block; clear: both; }
.portrait { float: left; margin: 14px 20px 6px 0; }
.portrait img { display: block; width: 150px; }

.tel { white-space: nowrap; font-weight: bold; }

/* ---------- Gallery ---------- */

.gallery {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.gallery li { border: 1px solid #fff; background: #000; flex: 1 0 auto; }
.gallery::after { content: ""; flex: 12 0 0; } /* keeps the last row from stretching */
.gallery a { display: block; }
.gallery img { display: block; height: 150px; width: 100%; max-width: none; object-fit: cover; }

/* ---------- Services ---------- */

.service-list { list-style: none; margin: 10px 0 0; padding: 0 10px; }
.service-list li { margin: 0; padding: 2px 0; }

/* ---------- Footer ---------- */

.footer { text-align: center; border-top: 1px solid var(--rule); }
.footer img { display: block; width: 100%; }

/* ---------- Photo viewer ---------- */

.lightbox {
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  padding: 0;
  max-width: 96vw;
  max-height: 96vh;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.lightbox img {
  display: block;
  max-width: 96vw;
  max-height: calc(96vh - 52px);
  width: auto; height: auto;
  margin: 0 auto;
}
.lightbox .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 6px; height: 52px;
}
.lightbox button {
  background: var(--panel); color: #fff; border: 1px solid #555;
  font: inherit; min-width: 44px; min-height: 40px; padding: 0 14px; cursor: pointer;
}
.lightbox button:hover { border-color: var(--gold); color: var(--gold); }
.lightbox .count { color: var(--gold); }

/* ---------- Tablet: services drop below ---------- */

@media (max-width: 899px) {
  .layout { display: block; }

  .services { border-left: 0; padding: 0 16px 24px; }
  .service-list { columns: 3; column-gap: 24px; padding: 0; }
  .service-list li { break-inside: avoid; }
}

/* ---------- Phone: cropped banner, tap-to-call strip, collapsed menu ---------- */

@media (max-width: 639px) {
  body { font-size: 16px; }

  /* show only the logo part of the 1000px banner */
  .header .banner img { width: 190%; max-width: none; margin-left: -28%; }
  .contact-strip { display: block; }

  .js .nav-toggle { display: block; }
  .site-nav { padding: 0; border-bottom: 0; }
  .site-nav ul { display: block; }
  .site-nav a { padding: 12px 16px; border-top: 1px solid var(--rule); }
  .js .site-nav:not(.open) { display: none; }

  .service-list { columns: 2; }

  .gallery { gap: 3px; }
  .gallery img { height: 104px; }
}

@media (max-width: 400px) {
  .portrait { float: none; margin: 14px auto 0; width: 150px; }
  .service-list { columns: 1; }
}
