/*
 * Fine Line Framing — Main Stylesheet
 *
 * Dark theme with gold accent (#FFE500).  All design tokens are in the :root
 * custom properties below.  Breakpoints: 600px (mobile), 900px (tablet).
 *
 * Sections (in order):
 *   1. Custom properties & resets
 *   2. Layout (container, sections)
 *   3. Header & navigation (desktop)
 *   4. Hero, CTA, content, callout
 *   5. Forms (contact page)
 *   6. Carousel (3-up desktop, 2-up tablet, 1-up mobile)
 *   7. Lightbox overlay
 *   8. Gallery grid & photo detail
 *   9. Footer
 *  10. Flash messages
 *  11. Accessibility & utilities
 *  12. Anti-spam honeypot
 *  13. Responsive overrides (<=900px mobile/tablet)
 */


/* ==========================================================================
   1. Custom properties & resets
   ========================================================================== */

:root {
  --bg: #07110d;
  --panel: #0b1712;
  --text: #ffffff;
  --muted: #ffffff;
  --line: rgba(255,255,255,.12);
  --accent: #FFE500;
  --shadow: 0 16px 50px rgba(0,0,0,.40);
  --radius: 20px;
  --max: 1120px;
  --narrow: 720px;
  --speed: 160ms;
  --font-body: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box }
html, body { height: 100% }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  background: #000000;
  color: var(--text);
}

p {
  max-width: 65ch;
  margin: 0 0 1.4em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
}

h3, h4, h5, h6 {
  letter-spacing: -0.02em;
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.7;
  }
  p {
    max-width: none;
  }
}

a { color: inherit }

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size: .95em;
}

main { padding-bottom: 0 }


/* ==========================================================================
   2. Layout
   ========================================================================== */

.container { max-width: var(--max); margin: 0 auto; padding: 0 18px }
.narrow    { max-width: var(--narrow) }


/* ==========================================================================
   3. Header & navigation (desktop)
   ========================================================================== */

/* Sticky header with frosted-glass blur */
.siteheader {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(12,20,18,.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.siteheader__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

/* Brand logo link */
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--text);
  min-height: 64px;
}

.brand__logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 340px;
  object-fit: contain;
}

/* Desktop nav row */
.nav { display: flex; align-items: center; gap: 18px }

.nav__link {
  text-decoration: none;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 12px;
  transition: background var(--speed), color var(--speed);
}
.nav__link:hover    { background: rgba(255,255,255,.07); color: var(--text) }
.nav__link.is-active { background: rgba(255,255,255,.10); color: var(--text) }

/* Hamburger button — hidden on desktop, shown via media query */
.navtoggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.navtoggle__line {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  margin: 0;
  opacity: .9;
}

.navtoggle:active { transform: translateY(1px) }

.navtoggle[aria-expanded="true"] {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.28);
}


/* ==========================================================================
   4. Hero, CTA, content, callout
   ========================================================================== */

.hero { padding: 14px 0 6px }
.hero__inner { display: block }
.hero__copy { max-width: var(--max) }

.hero__headline {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.06;
  margin: 0 0 12px;
  color: var(--accent);
}

/* Secondary portion of the H1, split on an em/en-dash or hyphen+space */
.hero__headline-sub {
  display: block;
  font-size: clamp(16px, 1.9vw, 24px);
  font-weight: 400;
  line-height: 1.25;
  margin-top: 6px;
  opacity: .92;
}

.hero__sub {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 18px;
}

.hero__trustline {
  color: var(--muted);
  font-size: .95rem;
  opacity: .85;
}

.hero__cta { display: flex; gap: 12px; flex-wrap: wrap }

/* Primary button — gold-tinted glass */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 196, 0, .30);
  background: rgba(255, 196, 0, .08);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--speed), background var(--speed),
              border-color var(--speed);
}
.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 196, 0, .15);
  border-color: rgba(255, 196, 0, .45);
}
.btn--ghost { background: transparent }

/* CTA banner section */
.cta { padding: 4px 0 25px }

/* Services overview section (homepage) */
.services-overview { padding: 30px 0 10px; background: #000 }
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 20px 0;
}
.service-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}
.service-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--accent);
}
.service-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: .95rem;
}
.services-closing {
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: .95rem;
}

/* Section headings & leads */
.sectiontitle { margin: 0 0 8px; font-size: 1.3rem; color: var(--accent) }
.sectionlead  { margin: 0 0 18px; color: var(--muted); line-height: 1.6 }

/* Page header (about, contractors, contact, etc.) */
.pagehead    { padding: 36px 0 10px }
.pagehead h1 { margin: 0 0 8px; font-size: 2.2rem; color: var(--accent) }

/* Content sections & bullets */
.content { padding: 12px 0 50px; background: #000 }

.bullets    { margin: 0; padding: 0 0 0 18px; color: var(--text); line-height: 1.75 }
.bullets li { margin: 10px 0 }

/* Trust-line bullet list under the hero headline */
.trust    { margin: 0; padding: 0 0 0 18px; color: var(--text); line-height: 1.75 }
.trust li { margin: 6px 0 }

/* CTA callout card */
.callout        { margin-top: 22px; padding: 18px; border-radius: 22px;
                  border: 1px solid var(--line); background: rgba(255,255,255,.06) }
.callout__title { font-weight: 700; margin-bottom: 6px; color: var(--accent) }
.callout__body  { color: var(--muted); margin-bottom: 12px }


/* ==========================================================================
   5. Forms (contact page)
   ========================================================================== */

.form {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
}

.field { margin: 0 0 14px }

label {
  display: block;
  font-size: .92rem;
  margin: 0 0 7px;
  color: var(--muted);
}

input, textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.20);
  background: rgba(0,0,0,.25);
  color: var(--text);
  padding: 12px;
  outline: none;
}

input:focus, textarea:focus {
  border-color: rgba(255,255,255,.45);
  outline: 2px solid rgba(255,255,255,.20);
  outline-offset: 1px;
}

input[type="file"] {
  padding: 10px 12px;
  cursor: pointer;
}

/* Validation error text below a field */
.err       { margin-top: 6px; color: #ffb4b4; font-size: .92rem }
.err:empty { display: none }

/* Hint text below the attachment field */
.field-hint { margin: 6px 0 0; font-size: .85rem; color: var(--muted); opacity: .8 }


/* ==========================================================================
   6. Carousel (3-up desktop, 2-up tablet, 1-up mobile)
   ========================================================================== */

.gallery { padding: 4px 0 12px }

.carousel { --gap: 16px; position: relative }

.carousel__viewport {
  overflow: hidden;
  width: 100%;
  padding: 0 54px; /* room for overlay arrows */
}

.carousel__track {
  display: flex;
  gap: var(--gap);
  list-style: none;
  padding: 0;
  margin: 0;
  transition: transform 250ms ease;
  will-change: transform;
}

/* Desktop: 3 slides visible */
.carousel__slide { flex: 0 0 calc((100% - (2 * var(--gap))) / 3) }

.carousel__slide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.carousel__caption {
  text-align: center;
  padding: 6px 0;
  font-size: .9rem;
  color: var(--muted);
  opacity: .85;
}

/* Carousel prev/next buttons */
.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.carousel__btn--prev { left: 8px }
.carousel__btn--next { right: 8px }
.carousel__btn:disabled { opacity: .35; cursor: not-allowed }

/* Thumbnail button inside carousel slides — opens lightbox */
.lb__thumb {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
}


/* ==========================================================================
   7. Lightbox overlay
   ========================================================================== */

.lightbox[hidden] { display: none }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
}

.lightbox__panel {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox__img {
  max-width: min(1200px, 96vw);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 18px 60px rgba(0,0,0,.6);
  background: rgba(0,0,0,.2);
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* Vertical prev/next buttons (centered horizontally) */
.lightbox__nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 3;
}

.lightbox__nav--prev { top: 18px }
.lightbox__nav--next { bottom: 18px }

/* Show vertical nav only on small screens */
@media (min-width: 801px) {
  .lightbox__nav { display: none }
}


/* ==========================================================================
   8. Gallery grid & photo detail
   ========================================================================== */

.page-head h1 { margin: 0 0 6px }
.page-head p   { margin: 0 0 22px; opacity: .85 }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.gallery-card {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.gallery-link { display: block }

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-cap     { padding: 12px 12px 14px }
.gallery-caption { opacity: .85 }

/* Single photo detail page */
.photo-wrap {
  max-width: min(1100px, 100%);
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  box-shadow: 0 12px 34px rgba(0,0,0,0.35);
}
.photo-wrap img { width: 100%; height: auto; display: block }


/* ==========================================================================
   9. Footer
   ========================================================================== */

.footer {
  border-top: 1px solid rgba(255,255,255,.15);
  background: #000;
  padding: 3px 0 5px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.footer__contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 600;
}

.footer__contact a       { color: var(--accent); text-decoration: none }
.footer__contact a:hover { text-decoration: underline }

.footer__item   { color: #fff; margin: 2px 0; font-size: .9rem; font-weight: 500 }
.footer__item a { color: #fff }


/* ==========================================================================
   10. Flash messages
   ========================================================================== */

.flash {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 12px 14px;
  margin: 10px 0;
}
.flash--success { border-color: rgba(100,220,100,.50); background: rgba(100,220,100,.10) }
.flash--error   { border-color: rgba(255,120,120,.50); background: rgba(255,120,120,.10) }


/* ==========================================================================
   11. Accessibility & utilities
   ========================================================================== */

.skiplink {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  z-index: 1000;
}
.skiplink:focus { left: 12px; top: 12px }

.muted { color: rgba(255,255,255,.75) }


/* ==========================================================================
   12. Anti-spam honeypot
   ========================================================================== */

/* Positioned off-screen so bots see it but humans don't */
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* ==========================================================================
   13. Responsive overrides (<=900px mobile/tablet)
   ========================================================================== */

@media (max-width: 900px) {
  /* -- Navigation: hamburger + dropdown -- */
  .navtoggle { display: inline-flex }

  .nav {
    position: absolute;
    right: 18px;
    top: 64px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    min-width: min(240px, calc(100vw - 24px));
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(12,20,18,.92);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open,
  .nav.nav--open { display: flex }

  /* -- Brand logo slightly smaller on mobile -- */
  .brand__logo {
    height: 42px;
    max-width: 220px;
  }

  /* -- Footer: gold gradient background on mobile -- */
  .footer {
    background: linear-gradient(135deg, #8B6914, #C5A028, #D4AF37, #C5A028, #8B6914);
  }
  .footer__contact   { color: #fff }
  .footer__contact a { color: #fff }
  .footer__inner     { align-items: flex-start; text-align: left }

  /* -- Hero CTAs stack vertically -- */
  .hero__cta { flex-direction: column }

  /* -- Services grid: single column on mobile -- */
  .services-grid { grid-template-columns: 1fr }

  /* -- Carousel: 2 slides visible on tablet -- */
  .carousel__slide { flex-basis: calc((100% - var(--gap)) / 2) }
}

/* MOBILE (<=600px): single image with up/down buttons */
@media (max-width: 600px) {
  .carousel {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .carousel__btn {
    position: static;
    transform: none;
    width: 100%;
    height: 44px;
    border-radius: 14px;
    margin: 0;
    font-size: 0; /* hide default caret text */
  }

  .carousel__btn::after {
    font-size: 18px;
    line-height: 44px;
    display: block;
    text-align: center;
  }
  .carousel__btn--prev::after { content: "\25B2" } /* ▲ */
  .carousel__btn--next::after { content: "\25BC" } /* ▼ */

  .carousel__viewport { padding: 0 }

  /* Vertical layout: show one slide at a time */
  .carousel__track {
    display: block;
    transform: none !important;
  }

  .carousel__slide            { display: none }
  .carousel__slide.is-active  { display: block }
  .carousel__slide img        { height: 260px }
}
