/*
Theme Name: Nkosi Thatchers
Theme URI: https://www.nkosi-thatchers.co.za
Description: Single-page brochure theme for Nkosi Thatchers — thatch roofing across Gauteng, South Africa.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nkosi-thatchers
*/

/* ===================================================================
   Nkosi Thatchers — styles.css
   Mobile-first. Palette drawn from thatch: paper, charcoal, brown, ochre.
   =================================================================== */

@font-face {
  font-family: "Bitter";
  src: url("assets/fonts/bitter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper:   #F7F3EC;
  --char:    #2A2724;
  --brown:   #5A3E28;
  --brown-d: #43301F;
  --ochre:   #C6871E;
  --straw:   #EAD9BC;
  --line:    #E0D5C0;

  --wrap: 1120px;
  --gap: clamp(1rem, 4vw, 2rem);
  --radius: 10px;
  --shadow: 0 6px 22px rgba(42, 39, 36, .12);

  --head: "Bitter", Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- reset-ish ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--char);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.12; color: var(--brown); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6.5vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
h3 { font-size: 1.2rem; color: var(--char); }
p { margin: 0 0 1rem; }
a { color: var(--brown); text-decoration-color: var(--ochre); text-underline-offset: 3px; }
a:hover { color: var(--brown-d); }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gap); }

/* ---------- accessibility helpers ---------- */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--brown); color: var(--paper); padding: .6rem 1rem;
  border-radius: 6px; transition: top .15s;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1rem;
  font: inherit; font-weight: 600; text-decoration: none;
  border: 2px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: background-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 52px; padding: .8rem 1.5rem; font-size: 1.05rem; }

.btn-call { background: var(--brown); color: var(--paper); }
.btn-call:hover { background: var(--brown-d); color: var(--paper); }
.btn-wa { background: var(--ochre); color: var(--char); }
.btn-wa:hover { background: #b3781a; color: var(--char); }
.btn-quote { background: var(--ochre); color: var(--char); }
.btn-quote:hover { background: #b3781a; color: var(--char); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 243, 236, .96);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; margin-right: auto; }
.brand-mark { flex: none; }
.brand-name { font-family: var(--head); font-weight: 700; font-size: 1.15rem; color: var(--brown); }

.site-nav { display: none; }
.header-cta { display: none; }

/* mobile menu toggle (checkbox hack — works without JS) */
.nav-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: .4rem .7rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-weight: 600; color: var(--char);
}
.nav-btn-bars, .nav-btn-bars::before, .nav-btn-bars::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--char); position: relative;
}
.nav-btn-bars::before { position: absolute; top: -6px; }
.nav-btn-bars::after  { position: absolute; top: 6px; }
.nav-toggle:focus-visible + .nav-btn { outline: 3px solid var(--ochre); outline-offset: 2px; }

.nav-toggle:checked ~ .site-nav {
  display: flex; flex-direction: column;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: .5rem var(--gap) 1rem; gap: .25rem; box-shadow: var(--shadow);
}
.site-nav a { padding: .8rem .4rem; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.site-nav a:last-child { border-bottom: 0; }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--char); }
.hero-media img { width: 100%; height: 46vh; min-height: 260px; max-height: 560px; object-fit: cover; }
.hero-body {
  background: var(--brown);
  color: var(--paper);
  padding: clamp(1.5rem, 6vw, 3rem) 0;
}
.hero-body h1 { color: var(--paper); }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--ochre); margin-bottom: .6rem; }
.hero-sub { font-size: clamp(1.05rem, 2.6vw, 1.25rem); max-width: 46ch; color: #F0E7D8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.hero-actions .btn-call { background: var(--paper); color: var(--brown); }
.hero-actions .btn-call:hover { background: #fff; }

/* ---------- sections ---------- */
.section { padding: clamp(2.5rem, 8vw, 5rem) 0; }
.section-alt { background: var(--straw); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--ochre); margin-bottom: .4rem; }
.section-lead { max-width: 60ch; font-size: 1.1rem; margin-bottom: 2rem; }

/* ---------- generic grid ---------- */
.grid { display: grid; gap: 1rem; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem;
}
.section-alt .card { background: #fff; }
.services-grid .card { border-top: 4px solid var(--ochre); }
.services-grid p { margin: 0; color: #4a453f; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.gallery-item {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); aspect-ratio: 4 / 3; background: var(--straw);
}
.gallery-item picture { display: block; width: 100%; height: 100%; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.04); }
.badge {
  position: absolute; top: .5rem; left: .5rem; z-index: 2;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .25rem .55rem; border-radius: 999px;
}
.badge-after  { background: var(--brown); color: var(--paper); }
.badge-before { background: var(--paper); color: var(--brown); border: 1px solid var(--brown); }

/* ---------- team feature (prominent) ---------- */
.team-feature { margin: 0 0 2.5rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.team-feature .team-item { aspect-ratio: 3 / 2; border-radius: 0; }
.team-feature .team-item img { object-position: center 55%; }
.team-feature figcaption { padding: .85rem 1.15rem; font-family: var(--head); font-weight: 700; color: var(--brown); }

/* ---------- gallery sub-headings + before/after pairs ---------- */
.gallery-subhead { font-family: var(--head); color: var(--brown); font-size: 1.4rem; margin: 2.4rem 0 .3rem; }
.ba-lead { color: #4a453f; margin: 0 0 1.2rem; }
.ba-grid { display: grid; gap: 1.4rem; margin-bottom: 1rem; }
.ba-pair { display: grid; gap: .6rem; }
.ba-pair .gallery-item { aspect-ratio: 4 / 3; }
@media (min-width: 700px) { .ba-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- areas ---------- */
.areas-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem 1rem; margin-bottom: 1.5rem; }
.areas-list li { padding: .55rem .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.section-alt .areas-list li { background: #fff; }
.areas-note { color: #4a453f; }

/* ---------- process / why ---------- */
.steps { display: grid; gap: 1rem; margin-bottom: 2.5rem; }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.3rem 3.6rem; }
.step-num {
  position: absolute; left: 1rem; top: 1.2rem;
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--ochre); color: var(--char); font-family: var(--head); font-weight: 700;
  border-radius: 50%;
}
.step h3 { margin-bottom: .2rem; }
.step p { margin: 0; color: #4a453f; }
.why-grid { grid-template-columns: 1fr; }
.why-card { text-align: center; }
.why-stat { display: block; font-family: var(--head); font-size: 1.15rem; color: var(--brown); margin-bottom: .3rem; }

/* ---------- contact ---------- */
.contact-list { margin: 1.2rem 0 0; display: grid; gap: .6rem; }
.contact-list a, .contact-list li { font-size: 1.1rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; }
.ci { font-size: 1.2rem; }

.quote-form { margin-top: 2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--char);
  padding: .7rem .8rem; min-height: 46px;
  background: var(--paper); border: 1px solid #cbb998; border-radius: 8px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--ochre); outline-offset: 1px; border-color: var(--brown); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #a3311f; background: #fdf3f1; }
.error { display: block; color: #a3311f; font-size: .9rem; font-weight: 600; margin-top: .3rem; min-height: 1.1em; }
.form-note { color: #a3311f; font-weight: 600; }
.form-submit { width: 100%; margin-top: .5rem; }
.form-success { background: var(--straw); border: 1px solid var(--ochre); border-radius: 8px; padding: 1rem; margin-top: 1rem; font-weight: 600; }

/* honeypot — hidden from users, visible to bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
.site-footer { background: var(--char); color: #E9E2D6; padding: 2.5rem 0 6rem; }
.footer-inner { display: grid; gap: 1.2rem; }
.footer-brand { font-family: var(--head); font-weight: 700; font-size: 1.2rem; color: var(--paper); margin-bottom: .2rem; }
.site-footer a { color: var(--ochre); text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.footer-copy { font-size: .9rem; color: #b8ae9d; margin: 0; }

/* ---------- mobile sticky bar ---------- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; border-top: 1px solid rgba(0,0,0,.15);
  box-shadow: 0 -4px 16px rgba(0,0,0,.14);
}
.mobile-bar-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 56px; font-weight: 700; text-decoration: none; font-size: 1.05rem;
}
.mb-call { background: var(--brown); color: var(--paper); }
.mb-wa   { background: var(--ochre); color: var(--char); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: rgba(20, 17, 14, .93); padding: 1rem;
}
.lightbox[hidden] { display: none; }
.lb-img { max-width: 94vw; max-height: 86vh; width: auto; height: auto; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-btn {
  position: absolute; background: rgba(247,243,236,.92); color: var(--char);
  border: none; border-radius: 50%; cursor: pointer;
  width: 52px; height: 52px; font-size: 1.8rem; line-height: 1; display: grid; place-items: center;
}
.lb-btn:hover { background: #fff; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---------- scroll reveal (JS adds .reveal; .in when visible) ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =================================================================
   TABLET  ≥600px
   ================================================================= */
@media (min-width: 600px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .areas-list { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-copy { grid-column: 1 / -1; }
}

/* =================================================================
   DESKTOP  ≥900px — show inline nav + header CTAs, drop mobile bar
   ================================================================= */
@media (min-width: 900px) {
  .nav-btn, .nav-toggle { display: none; }
  .site-nav { display: flex; gap: 1.4rem; align-items: center; margin-right: 1.2rem; }
  .site-nav a { padding: .4rem 0; border: 0; text-decoration: none; font-weight: 600; }
  .site-nav a:hover { text-decoration: underline; text-decoration-color: var(--ochre); }
  .header-cta { display: flex; gap: .6rem; }

  .mobile-bar { display: none; }
  .site-footer { padding-bottom: 2.5rem; }

  .hero { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .hero-media img { height: 100%; min-height: 420px; max-height: none; }
  .hero-body { display: grid; align-items: center; }

  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .areas-list { grid-template-columns: repeat(4, 1fr); }

  .contact-wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start; }
  .quote-form { margin-top: 0; }
  .footer-inner { grid-template-columns: 2fr 1fr; align-items: start; }
}

/* =================================================================
   REDUCED MOTION
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
