/*
Theme Name: GRP Roofing Lincs
Description: One-page theme for GRP Roofing Lincs. Edit phone, enquiry email and opening hours under Appearance > Customize > Business details.
Version: 1.0.0
Requires at least: 5.9
Requires PHP: 7.4
License: Proprietary
Text Domain: grp-roofing-lincs
*/

:root {
  --navy: #08306b;
  --ink: #061a3a;
  --red: #e30613;
  --red-dark: #b9050f;
  --slate: #58595b;
  --paper: #f2f5f9;
  --line: #d5dde9;
  --text: #1c2534;
  --soft: #cfdaf0;
  --f-head: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --f-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --r: 4px;
  --header-h: 80px;
}

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

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

body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--f-body);
  color: var(--text);
  background: #fff;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}

p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: #fff; }

section[id], [id="contact"] { scroll-margin-top: calc(var(--header-h) + 8px); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: #fff; color: var(--ink); padding: 10px 16px; border-radius: var(--r); font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border: 2px solid transparent; border-radius: var(--r);
  font: 600 1.0625rem/1 var(--f-body);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-dark); }
.btn--line { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn--line:hover { background: #fff; border-color: #fff; color: var(--navy); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.site-header__in {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: var(--header-h);
}
.brand { display: block; line-height: 0; }
.brand img { height: 54px; width: auto; }
.site-header__in .btn { min-height: 46px; padding: 0 20px; }

@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .brand img { height: 44px; }
  .site-header__in .btn { min-height: 42px; padding: 0 16px; font-size: .95rem; }
}
@media (max-width: 360px) {
  .site-header__in .btn { padding: 0 12px; font-size: .88rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: min(720px, calc(100svh - var(--header-h)));
  background: var(--navy); color: #fff;
}
.hero__copy {
  align-self: center;
  padding-block: clamp(48px, 7vw, 96px) clamp(110px, 12vw, 160px);
  padding-left: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  padding-right: clamp(24px, 4vw, 64px);
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.9rem, 5vw, 4.9rem);
  line-height: .95;
  overflow-wrap: break-word;
}
.hero__lead { max-width: 34rem; margin: 24px 0 34px; font-size: 1.25rem; color: var(--soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__media { position: relative; min-height: 340px; }
.hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.roofline {
  position: absolute; left: 0; right: 0; bottom: -1px;
  width: 100%; height: clamp(36px, 6vw, 84px);
  pointer-events: none;
}
.roofline--fill { z-index: 1; }
.roofline--lines { z-index: 2; animation: unroll 1.7s .25s cubic-bezier(.65, 0, .25, 1) both; }
.roofline path { vector-effect: non-scaling-stroke; fill: none; stroke-linejoin: miter; }
.roofline__red { stroke: var(--red); stroke-width: 5; }
.roofline__grey { stroke: var(--slate); stroke-width: 4; }
.roofline--fill path { fill: #fff; stroke: none; }

@keyframes unroll {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .roofline--lines { animation: none; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero__copy { padding: 44px var(--gutter) 40px; }
  .hero__media { min-height: 0; aspect-ratio: 4 / 3; }
}

/* ---------- Trust strip ---------- */
.trust { padding: 12px 0 clamp(48px, 6vw, 72px); }
.trust__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px;
}
.trust__list li { padding-left: 16px; border-left: 4px solid var(--red); }
.trust__list strong { display: block; font: 700 1.6rem/1.1 var(--f-head); color: var(--ink); }
.trust__list span { display: block; margin-top: 4px; font-size: .975rem; line-height: 1.4; color: var(--slate); }
@media (max-width: 900px) { .trust__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .trust__list { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section--paper { background: var(--paper); }
.section--navy { background: var(--navy); color: #fff; }
.section--navy h2 { color: #fff; }

.section__head { max-width: 44rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section__head h2 { font-size: clamp(2.5rem, 5vw, 3.9rem); }
.section__head p { margin: 16px 0 0; font-size: 1.15rem; color: var(--slate); }
.section--navy .section__head p { color: var(--soft); }

/* Services */
.services {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 88px); align-items: start;
}
.services__list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.services__list li { padding: 24px 0; border-bottom: 1px solid var(--line); }
.services__list h3 { margin-bottom: 8px; font-size: 1.85rem; }
.services__list p { max-width: 46ch; margin: 0; color: var(--slate); }
.services__figure { position: sticky; top: calc(var(--header-h) + 28px); margin: 0; }
.services__figure img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 20% 85%; border-radius: var(--r); }
.services__figure figcaption { margin-top: 10px; font-size: .9rem; line-height: 1.4; color: var(--slate); }
@media (max-width: 860px) {
  .services { grid-template-columns: minmax(0, 1fr); }
  .services__figure { position: static; }
  .services__figure img { aspect-ratio: 4 / 3; }
}

/* Why GRP */
.why {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px); align-items: center;
}
.why__media { margin: 0; }
.why__media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); }
.why__points {
  list-style: none; margin: 36px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px;
}
.why__points li { padding-top: 16px; border-top: 3px solid var(--red); }
.why__points h3 { margin-bottom: 8px; font-size: 1.8rem; color: #fff; }
.why__points p { margin: 0; color: var(--soft); }
@media (max-width: 860px) {
  .why { grid-template-columns: minmax(0, 1fr); }
  .why__media img { aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) { .why__points { grid-template-columns: minmax(0, 1fr); } }

/* Gallery */
.gallery { column-count: 3; column-gap: 16px; }
.shot {
  display: block; position: relative; overflow: hidden;
  margin: 0 0 16px; break-inside: avoid;
  border-radius: var(--r); background: var(--line); cursor: zoom-in;
}
.shot img { width: 100%; height: auto; }
.gallery__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 24px; }
.gallery__cta p { margin: 0; font-size: 1.15rem; color: var(--slate); }
@media (max-width: 900px) { .gallery { column-count: 2; } }
@media (max-width: 460px) { .gallery { column-gap: 10px; } .shot { margin-bottom: 10px; } }

/* Process */
.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
}
.steps li { position: relative; padding-top: 60px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--red); color: #fff;
  font: 700 1.6rem/42px var(--f-head); text-align: center;
}
.steps li::after {
  content: ""; position: absolute; top: 20px; left: 54px; right: -20px; height: 2px;
  background: rgba(8, 48, 107, .25);
}
.steps li:last-child::after { display: none; }
.steps h3 { margin-bottom: 8px; font-size: 1.8rem; }
.steps p { margin: 0; color: var(--slate); }
@media (max-width: 860px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .steps li { padding: 4px 0 0 64px; }
  .steps li::after { top: 48px; bottom: -24px; left: 20px; right: auto; width: 2px; height: auto; }
}

/* Contact */
.contact {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px); align-items: start;
}
.contact__info {
  padding: clamp(28px, 4vw, 48px);
  background: var(--navy); color: #fff; border-radius: var(--r);
}
.contact__info h2 { color: #fff; font-size: clamp(2.5rem, 4.6vw, 3.6rem); }
.contact__info > p { margin: 16px 0 0; color: var(--soft); }
.contact__phone {
  display: block; margin: 28px 0 6px;
  font: 700 clamp(2.3rem, 4vw, 3.1rem)/1 var(--f-head); text-decoration: none;
}
.contact__phone:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.contact__meta { margin: 0; color: var(--soft); }
.contact__meta a { color: #fff; }

.social-link {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; text-decoration: none; color: #fff;
}
.social-link svg { width: 21px; height: 21px; flex: none; }
.social-link:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.contact__info .social-link { margin: 18px 0 0; }
.site-footer__links .social-link { margin-top: 2px; }
.contact__info h3 { margin: 36px 0 12px; font-size: 1.6rem; color: #fff; }

.form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
  padding: clamp(24px, 4vw, 44px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .975rem; }
.field label small { font-weight: 400; color: var(--slate); font-size: .9rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: inherit; color: var(--text); background: #fff;
  border: 1.5px solid #9fadc3; border-radius: var(--r);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--navy); }
.form__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; grid-column: 1 / -1; }
.form__submit small { color: var(--slate); font-size: .9rem; max-width: 30ch; line-height: 1.4; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  grid-column: 1 / -1; padding: 14px 16px; border-radius: var(--r);
  font-weight: 500; border-left: 4px solid;
}
.notice--ok { background: #e6f4ea; color: #14532d; border-color: #1e8e3e; }
.notice--err { background: #fdecea; color: #7a1410; border-color: var(--red); }

@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .form { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.site-footer { padding: clamp(40px, 6vw, 64px) 0 28px; background: var(--ink); color: var(--soft); }
.site-footer__grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
.site-footer .brand { display: inline-block; justify-self: start; padding: 10px 14px; background: #fff; border-radius: var(--r); }
.site-footer .brand img { height: 46px; }
.site-footer p { margin: 0; max-width: 34ch; }
.site-footer__links { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.site-footer__links a { color: #fff; text-decoration: none; }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer .site-footer__legal { max-width: none; margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .9rem; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Mobile call bar ---------- */
.callbar { display: none; }
@media (max-width: 700px) {
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .callbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: 1fr 1fr;
    padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--ink);
    box-shadow: 0 -2px 14px rgba(0, 0, 0, .2);
  }
  .callbar a {
    display: flex; align-items: center; justify-content: center; min-height: 56px;
    color: #fff; font-weight: 700; text-decoration: none;
  }
  .callbar a:first-child { background: var(--red); }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 64px 16px 76px; background: rgba(6, 26, 58, .97);
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 148px); object-fit: contain; border-radius: var(--r); }
.lightbox__btn {
  position: absolute; min-height: 44px; padding: 0 18px;
  background: #fff; color: var(--ink);
  border: 0; border-radius: var(--r); font: 600 1rem/1 var(--f-body); cursor: pointer;
}
.lightbox__btn:hover { background: var(--paper); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev, .lightbox__next { bottom: 14px; }
.lightbox__prev { left: 12px; }
.lightbox__next { right: 12px; }

/* ---------- Simple pages (non one-page templates) ---------- */
.prose { max-width: 46rem; padding-block: clamp(48px, 8vw, 96px); }
.prose h1 { margin-bottom: 24px; font-size: clamp(2.4rem, 5vw, 3.6rem); }
.prose h2 { margin: 1.6em 0 .5em; font-size: 2rem; }
