/* ==========================================================================
   Safe Home Constructions — static site stylesheet
   Rebuilt from the WordPress (Astra + Elementor) design.
   ========================================================================== */

/* ---------- Fonts (self-hosted woff2, latin subset) ---------- */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/barlow-600-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/open-sans-latin.woff2') format('woff2');
}

/* ---------- Design tokens (from the original Astra global colors) ---------- */
:root {
  --orange: #ff5e14;        /* global color 0 — decorative lines, frames, icons */
  --orange-btn: #cc4a0e;    /* darkened so white button text meets WCAG AA (4.6:1) */
  --orange-btn-hover: #a83c0a;
  --orange-text: #c44300;   /* darkened for links on the light background (4.75:1) */
  --dark: #1a1a1a;          /* global color 1/7 */
  --text: #5a5a5a;          /* global color 3 */
  --page-bg: #f4f8fd;       /* global color 4 */
  --white: #ffffff;
  --container: 1320px;      /* 1280px content + 2 × 20px gutters */
  --gutter: 20px;
  --font-body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--page-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-text); text-underline-offset: 2px; }
a:hover, a:focus { color: var(--dark); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--dark);
  text-transform: capitalize;
  margin: 0 0 20px;
}
h1 { font-size: 4.5rem; line-height: 1.4; }     /* 72px */
h2 { font-size: 2.5rem; line-height: 1.3; }     /* 40px */
h3 { font-size: 2rem; line-height: 1.3; }       /* 32px */
h4, .size-h4 { font-size: 1.5rem; line-height: 1.2; }    /* 24px */
h5, .size-h5 { font-size: 1.25rem; line-height: 1.2; }   /* 20px */

:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.site-header :focus-visible, .hero :focus-visible, .band :focus-visible, .site-footer :focus-visible { outline-color: #fff; }

.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;
}
.skip-link {
  position: absolute; left: 10px; top: -60px; z-index: 1000;
  background: var(--white); color: var(--dark);
  padding: 10px 16px; font-weight: 700; text-decoration: none; border-radius: 3px;
}
.skip-link:focus { top: 10px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* Short orange rule used under headings */
.rule { display: block; width: 64px; height: 4px; background: var(--orange); border: 0; margin: 0 0 24px; }
.rule--center { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
  text-transform: capitalize;
  color: var(--white);
  background: var(--orange-btn);
  padding: 15px 30px;
  box-shadow: 0 16px 32px -16px rgba(255, 94, 20, 0.64);
  transition: background-color .2s;
}
.btn:hover, .btn:focus { color: var(--white); background: var(--orange-btn-hover); }

/* ==========================================================================
   Header — transparent over the hero photo, like the original
   ========================================================================== */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 146px; gap: 20px; }
.site-logo img { width: 300px; height: auto; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; }
.menu a {
  display: block; padding: 10px 16px;
  font-size: 0.9375rem; color: var(--white); text-decoration: none;
}
.menu a:hover, .menu a:focus, .menu a[aria-current="page"] { color: var(--white); text-decoration: underline; text-underline-offset: 6px; }

@media (max-width: 921px) {
  .site-header .container { min-height: 110px; }
  .site-logo img { width: 220px; }
}
@media (max-width: 544px) {
  .site-header .container { min-height: 90px; flex-wrap: wrap; justify-content: center; padding-top: 12px; }
  .site-logo img { width: 180px; }
  .menu a { padding: 6px 14px; }
}

/* ==========================================================================
   Photo bands (hero, consultation band, gallery title).
   The photo is an absolutely-positioned layer behind the content, so the band
   grows with its text instead of clipping it.
   ========================================================================== */
.hero, .band { position: relative; isolation: isolate; color: var(--white); }
.band-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--dark); }
.band-media img { width: 100%; height: 100%; object-fit: cover; }
.band-media::after { content: ''; position: absolute; inset: 0; background: rgba(26, 26, 26, 0.5); }
.hero h1, .hero h2, .band h1, .band h2 { color: var(--white); }

.hero { padding: 260px 0 240px; }
.hero .band-media img { object-position: bottom center; }
/* Home hero on large screens: the photo stays fixed while the page scrolls,
   sized to the window, as on the original site. The same file is already
   loaded by the <img>, so this costs no extra download. */
@media (min-width: 1025px) {
  .hero--home .band-media { background: var(--dark) url('/images/homepage-top.webp') center bottom / cover no-repeat fixed; }
  .hero--home .band-media img { visibility: hidden; }
}
.hero h1 { margin: 0 40% 20px 0; }
.hero .hero-sub { font-family: var(--font-head); font-weight: 600; font-size: 2rem; line-height: 1.3; margin: 0 0 22px; }

.page-title { padding: 240px 0 160px; }
.page-title h1 { margin: 0; }
.page-title .band-media img { object-position: center 40%; }

/* Consultation band: photo stays still while the page scrolls (as the
   original did) on large screens; main.js attaches it when it nears view. */
.band--consult { padding: 104px 0 100px; text-align: center; }
.band--consult .band-media::after { background: rgba(26, 26, 26, 0.45); }
.band--consult .container { max-width: 840px; }
.band--consult p { margin: 0 72px; color: var(--page-bg); }
.band--consult .btn { margin-top: 40px; }
@media (min-width: 1025px) {
  .band--consult.is-fixed .band-media img { display: none; }
  .band--consult.is-fixed .band-media {
    background: var(--dark) url('/images/homepage-saw.webp') center top / cover no-repeat fixed;
  }
}

@media (max-width: 1024px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  .hero { padding: 160px 0 120px; }
  .hero h1 { margin-right: 0; }
  .page-title { padding: 160px 0 120px; }
  .band--consult p { margin: 0; }
}
@media (max-width: 767px) {
  html { font-size: 91.2%; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  h4, .size-h4 { font-size: 1.375rem; }
  .hero { padding: 160px 0 104px; text-align: center; }   /* centered on phones, as in the original */
  .hero h1 { font-size: 2.5rem; line-height: 1.3; margin-bottom: 20px; }
  .hero .hero-sub { font-size: 1.75rem; }
  .page-title { padding: 150px 0 80px; }
  .band--consult { padding: 80px 0; }
}

/* ==========================================================================
   Content sections
   ========================================================================== */
.section { padding: 104px 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split > * { min-width: 0; }

.lead h4 { margin-bottom: 16px; }
.lead .divider { border: 0; border-top: 1px solid var(--white); margin: 30px 0; }
.call-label { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 600; letter-spacing: 1px; color: var(--dark); margin-bottom: 12px; }
.call-label svg { width: 13px; height: 13px; fill: var(--dark); }
.phones { font-family: var(--font-head); font-weight: 600; font-size: 2rem; line-height: 1.3; color: var(--dark); margin: 0; }
.phones a { color: var(--text); text-decoration: none; }
.phones a:hover, .phones a:focus { color: var(--orange-text); text-decoration: underline; }

/* Photo with an offset orange frame behind it */
.framed { position: relative; margin: 0 44px 44px 0; }
.framed::before {
  content: ''; position: absolute; z-index: 0;
  top: 44px; left: 44px; right: -44px; bottom: -44px;
  border: 3px solid var(--orange);
}
.framed img { position: relative; z-index: 1; width: 100%; box-shadow: 64px 64px 160px -40px rgba(0, 0, 0, 0.24); }

.section--spec { padding: 160px 0 104px; }
.services { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 24px; }
.services li { display: flex; gap: 16px; align-items: flex-start; }
.services svg { width: 32px; height: 32px; flex-shrink: 0; fill: var(--orange); }
.services h3 { font-size: 1.25rem; line-height: 1.2; margin: 2px 0 8px; }
.services p { font-size: 0.9375rem; }

/* Gallery page */
.section--gallery { padding: 104px 0 60px; }
.section--gallery h2 { margin-bottom: 20px; }
.section--gallery h3 { font-size: 2rem; margin: 40px 0 30px; }
.section--gallery h3:first-of-type { margin-top: 0; }
.gallery, .gallery ul { list-style: none; margin: 0; padding: 0; }
.gallery { display: flex; gap: 20px; align-items: flex-start; }
.gallery-col { flex: 1 1 0; min-width: 0; }
.gallery-col li { margin-bottom: 20px; }
.gallery a { display: block; }
.gallery a:hover img, .gallery a:focus img { opacity: .88; }
.gallery img { width: 100%; }

@media (max-width: 1024px) {
  .section { padding: 80px 0; }
  .section--spec { padding: 104px 0 80px; }
  .split { gap: 40px; }
}
@media (max-width: 767px) {
  .section, .section--spec { padding: 64px 0; }
  .split { grid-template-columns: 1fr; gap: 50px; }
  .split .order-first-mobile { order: -1; }
  .framed { margin: 0 24px 24px 0; }
  .framed::before { top: 24px; left: 24px; right: -24px; bottom: -24px; }
  .services { grid-template-columns: 1fr; }
  .phones { font-size: 1.6rem; }
  .section--gallery { padding: 64px 0 40px; }
  /* Phones: let the photos flow into two balanced columns */
  .gallery { display: block; column-count: 2; column-gap: 12px; }
  .gallery-col, .gallery-col ul { display: contents; }
  .gallery-col li { break-inside: avoid; margin-bottom: 12px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--dark); color: #e6e6e6; font-size: 0.875rem; }
.site-footer .container { min-height: 80px; display: flex; align-items: center; }
.site-footer p { margin: 0; }
@media (max-width: 767px) {
  .site-footer .container { justify-content: center; text-align: center; }
}

/* ==========================================================================
   Lightbox (progressive enhancement for gallery links)
   ========================================================================== */
.lightbox { border: 0; padding: 0; margin: auto; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: transparent; }
.lightbox::backdrop { background: rgba(0,0,0,.92); }
.lightbox-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 50px 60px; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(0,0,0,.5); color: #fff; border: 0; width: 48px; height: 48px; font-size: 1.75rem; line-height: 1; cursor: pointer; border-radius: 50%; }
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(0,0,0,.85); }
.lightbox .lb-close { top: 10px; right: 10px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: .875rem; }
@media (max-width: 600px) { .lightbox-inner { padding: 60px 8px; } }

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

/* ---------- 404 ---------- */
.notfound { text-align: center; }
.notfound ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-top: 20px; }
